@charset "UTF-8";
/* =================================================
 * 公共样式 - 所有页面共用
 * 包含：导航栏、卡片、夜间模式、响应式、滚动进度条等
 * ================================================= */

/* =================================================
 * 设计 Token（CSS 变量）- 统一圆角/阴影/间距/主色
 * 美感基础：所有组件应优先使用变量，保证视觉一致性
 * ================================================= */
:root {
    /* 主色系 */
    --color-primary: #1abc9c;
    --color-primary-dark: #16a085;
    --color-primary-light: rgba(26, 188, 156, 0.1);
    --color-primary-glow: rgba(26, 188, 156, 0.4);

    /* 文字色 */
    --color-text: #2c3e50;
    --color-text-secondary: #6b7280;
    --color-text-muted: #7f8c8d;

    /* 背景色 */
    --color-bg: #ffffff;
    --color-bg-alt: rgba(26, 188, 156, 0.06);

    /* 圆角阶梯 */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 50%;

    /* 阴影阶梯 */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.16);
    --shadow-primary: 0 8px 24px rgba(26, 188, 156, 0.25);

    /* 间距阶梯（8px 基准） */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 40px;

    /* 过渡 */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* 渐变 */
    --gradient-primary: linear-gradient(135deg, #1abc9c, #16a085);
    --gradient-bg: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);

    /* AARRR 模型色彩 */
    --color-aarrr-acquisition: #3498db;
    --color-aarrr-activation: #2ecc71;
    --color-aarrr-retention: #f39c12;
    --color-aarrr-revenue: #e74c3c;
    --color-aarrr-referral: #9b59b6;
}

/* 暗色模式 token 覆盖 */
body.dark-mode {
    --color-primary: #38bdf8;
    --color-primary-dark: #0ea5e9;
    --color-primary-light: rgba(56, 189, 248, 0.1);
    --color-primary-glow: rgba(56, 189, 248, 0.4);

    --color-text: #f3f4f6;
    --color-text-secondary: #9ca3af;
    --color-text-muted: #9ca3af;

    --color-bg: #1f2937;
    --color-bg-alt: rgba(56, 189, 248, 0.08);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.6);
    --shadow-primary: 0 8px 24px rgba(56, 189, 248, 0.25);

    --gradient-primary: linear-gradient(135deg, #38bdf8, #0ea5e9);
    --gradient-bg: linear-gradient(135deg, #1a2a3a 0%, #111827 100%);
}

/* 屏幕阅读器专用（视觉隐藏，SEO 友好） */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 跳到主内容（无障碍） */
.skip-to-content {
    position: absolute;
    top: -100px;
    left: 0;
    z-index: 10000;
    padding: 10px 20px;
    background: #1abc9c;
    color: #fff;
    font-size: 14px;
    text-decoration: none;
    border-radius: 0 0 8px 0;
    transition: top 0.2s ease;
}

.skip-to-content:focus {
    top: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 110px;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    background-attachment: fixed;
    background-size: cover;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-size: .9em;
    line-height: 1.6;
    transition: background 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* 焦点可见性（无障碍） */
:focus-visible {
    outline: 2px solid #1abc9c;
    outline-offset: 2px;
}

/* 选中文本样式 */
::selection {
    background: rgba(26, 188, 156, 0.3);
    color: inherit;
}

body .fa {
    margin-right: .3em;
}

/* =================================================
 * 顶部导航栏
 * ================================================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 4px 20px rgba(0, 0, 0, 0.06);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), height 0.3s ease, box-shadow 0.3s ease;
}

.navbar.scrolled {
    height: 52px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), 0 6px 24px rgba(0, 0, 0, 0.1);
}

/* 滚动方向感知：向下隐藏，向上显示 */
.navbar.hidden {
    transform: translateY(-100%);
}

.navbar-brand {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #2c3e50, #1abc9c);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.5px;
}

.navbar-brand i {
    color: #1abc9c;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 5px;
    align-items: center;
}

.navbar-menu li a {
    display: block;
    padding: 8px 16px;
    color: #555;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-base);
    white-space: nowrap;
    position: relative;
}

.navbar-menu li a:hover {
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
}

.navbar-menu li a.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 2px 8px var(--color-primary-glow);
}

.navbar-tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 夜间模式切换按钮 */
.theme-switch {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border-radius: var(--radius-full);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255,255,255,0.8);
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
    padding: 0;
    font: inherit;
}

.theme-switch:hover {
    transform: scale(1.1);
}

.theme-switch:focus-visible {
    outline: 2px solid #1abc9c;
    outline-offset: 2px;
}

.theme-switch i {
    font-size: 18px;
    color: #16a085;
}

/* 移动端汉堡菜单按钮 */
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    color: #2c3e50;
    cursor: pointer;
    padding: 5px 10px;
    transition: transform 0.2s ease;
}

.navbar-toggle:active {
    transform: scale(0.9);
}

/* =================================================
 * 滚动进度条
 * ================================================= */
.progress-container {
    width: 100%;
    height: 3px;
    background: transparent;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1001;
}

.progress-bar {
    height: 3px;
    background: linear-gradient(90deg, #1abc9c, #16a085, #1abc9c);
    background-size: 200% 100%;
    width: 0%;
    transition: width 0.1s ease;
    box-shadow: 0 0 8px rgba(26, 188, 156, 0.5);
}

/* =================================================
 * 鼠标跟随效果
 * ================================================= */
.cursor-follower {
    position: fixed;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(26, 188, 156, 0.1);
    pointer-events: none !important;
    z-index: 0;
    transform: translate(-50%, -50%);
    transition: transform 0.2s ease, width 0.3s ease, height 0.3s ease, opacity 0.3s ease;
    mix-blend-mode: multiply;
    will-change: left, top, transform;
    opacity: 0;
}

.cursor-follower.hover {
    width: 80px;
    height: 80px;
    background: rgba(26, 188, 156, 0.15);
}

body:hover .cursor-follower {
    opacity: 1;
}

/* =================================================
 * 容器布局
 * ================================================= */
.container {
    display: flex;
    gap: 20px;
    padding: 110px 20px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.container.single-column {
    flex-direction: column;
    max-width: 900px;
}

.side {
    flex: 0 0 320px;
    min-width: 0;
}

.main {
    flex: 1;
    min-width: 0;
}

/* 单页面内容容器 */
.page-content {
    max-width: 900px;
    margin: 110px auto 20px;
    padding: 0 20px;
}

/* =================================================
 * 工具类
 * ================================================= */
.icon-accent {
    margin-right: var(--space-sm);
    color: var(--color-primary);
}

.sub-list {
    margin-left: 30px;
}

/* =================================================
 * 卡片样式
 * ================================================= */
.card {
    background-color: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    border-left: 4px solid var(--color-primary);
    opacity: 0;
    transform: translateY(20px);
    position: relative;
}

.card.animate {
    opacity: 1;
    transform: translateY(0);
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

.card h2 {
    color: #333;
    font-size: 18px;
    margin-top: 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 16px;
}

.card h2 i {
    transition: transform 0.3s ease;
    margin-right: 8px;
}

.card:hover h2 i {
    transform: rotate(15deg);
    color: #1abc9c;
}

.card ul {
    padding-left: 20px;
    margin-bottom: 0;
}

.card li {
    margin-bottom: 12px;
    line-height: 1.6;
    transition: all 0.3s ease;
    padding: 5px 8px;
    border-radius: 4px;
    cursor: default;
}

.main .card li:hover {
    background-color: rgba(26, 188, 156, 0.1);
    transform: translateX(5px);
}

.card a {
    color: #1abc9c;
    text-decoration: none;
    transition: color 0.2s ease;
    position: relative;
}

.card a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: #16a085;
    transition: width 0.3s ease;
}

.card a:hover::after {
    width: 100%;
}

/* 头像区域 */
.me.card {
    text-align: center;
    padding: 30px 20px;
    border-left: none;
}

/* 头像图片居中（加载后 display:block 需要 margin 居中） */
.me.card .image-container img.avatar {
    display: block;
    margin: 0 auto;
}

/* 联系方式卡片：图标 + 内容横向布局 */
.contact-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(26, 188, 156, 0.06);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.contact-item:hover {
    background: rgba(26, 188, 156, 0.12);
    border-color: rgba(26, 188, 156, 0.3);
    transform: translateX(3px);
}

.contact-item:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.contact-item > i {
    font-size: 16px;
    color: #fff;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1abc9c, #16a085);
    border-radius: 50%;
    flex-shrink: 0;
}

.contact-detail {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.contact-label {
    font-size: 12px;
    color: #95a5a6;
    line-height: 1.2;
}

.contact-value {
    color: #2c3e50;
    font-size: 14px;
    font-weight: 500;
    word-break: break-all;
}

/* 二维码区域 */
.qrcode-box {
    text-align: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed #eee;
}

.qrcode-box .avatar,
.qrcode-box img {
    display: block;
    margin: 0 auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.qrcode-tip {
    margin-top: 8px;
    font-size: 12px;
    color: #95a5a6;
}

body.dark-mode .contact-item {
    background: rgba(56, 189, 248, 0.08);
}

body.dark-mode .contact-item:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.3);
}

body.dark-mode .contact-value {
    color: #f3f4f6;
}

body.dark-mode .qrcode-box {
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* 自媒体矩阵网格 */
.media-matrix {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
    margin-top: 15px;
}

.media-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 6px;
    background: rgba(26, 188, 156, 0.08);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    text-decoration: none;
    font-size: 12px;
    transition: all var(--transition-base);
    border: 1px solid transparent;
    min-height: 40px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

/* 列表项前置图标（about 页统一主题色） */
.contact.info-unit.card li > i.fa {
    margin-right: 8px;
    color: #1abc9c;
}

.media-link span {
    text-align: center;
    position: relative;
    z-index: 1;
}

.media-link::before {
    content: '';
    margin-right: 0;
    font-size: 0;
}

.media-link::after {
    content: '\f08e';
    font-family: FontAwesome;
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 9px;
    opacity: 0;
    transform: translate(4px, -4px);
    transition: all 0.3s ease;
    color: #16a085;
}

.media-link:hover {
    background: rgba(26, 188, 156, 0.15);
    border-color: #1abc9c;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(26, 188, 156, 0.2);
    color: #16a085;
}

.media-link:hover::after {
    opacity: 1;
    transform: translate(0, 0);
}

body.dark-mode .media-link {
    background: rgba(56, 189, 248, 0.1);
    color: #f3f4f6;
}

body.dark-mode .media-link:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    color: #38bdf8;
    box-shadow: 0 4px 10px rgba(56, 189, 248, 0.2);
}

body.dark-mode .media-link::after {
    color: #38bdf8;
}

.name {
    color: #2c3e50;
    margin: 15px 0 5px;
}

.info-job {
    color: #7f8c8d;
    font-weight: normal;
    margin: 0;
}

/* 基本信息/联系方式 列表 */
.side .info-unit ul li label {
    display: inline-block;
    width: 35%;
    font-weight: bold;
}

.side .info-unit ul li span {
    display: inline-block;
    vertical-align: top;
    width: 60%;
}

/* =================================================
 * 技能分类样式
 * ================================================= */
.skill-category {
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

/* hover展开仅限鼠标设备，触摸设备用.active class控制 */
@media (hover: hover) {
    .skill-category:hover {
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }

    .skill-category:hover .category-details {
        max-height: 2000px;
    }

    .skill-category:hover .category-icon {
        transform: rotate(45deg);
    }
}

.skill-category.active .category-header {
    background-color: rgba(26, 188, 156, 0.2);
}

.skill-category.active .category-header h3 {
    color: #16a085;
}

.skill-category.active .category-icon {
    transform: rotate(45deg);
}

.skill-category.active .category-details {
    max-height: 2000px;
}

.category-header {
    background-color: rgba(26, 188, 156, 0.1);
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.category-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
    transition: all 0.3s ease;
}

.category-header h3 i {
    margin-right: 8px;
    transition: transform 0.3s ease;
}

@media (hover: hover) {
    .skill-category:hover .category-header h3 i {
        transform: rotate(15deg);
    }
}

.category-icon {
    font-size: 18px;
    font-weight: bold;
    transition: transform 0.3s ease;
    color: #1abc9c;
}

.category-details {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
    background-color: #f9f9f9;
    position: relative;
    z-index: 2;
}

.category-details p {
    margin: 0;
    padding: 15px;
    line-height: 1.6;
    font-size: 14px;
    border-bottom: 1px solid #eee;
}

.category-details p:last-child {
    border-bottom: none;
}

/* =================================================
 * 干过哪些事 / 生活习惯 卡片
 * ================================================= */
.achievement-group-title {
    font-size: 15px;
    color: #2c3e50;
    margin: 22px 0 10px;
    padding: 8px 14px;
    border-left: 3px solid #1abc9c;
    background: linear-gradient(90deg, rgba(26, 188, 156, 0.08), transparent);
    border-radius: 0 6px 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.achievement-group-title:first-of-type {
    margin-top: 10px;
}

.achievement-group-title i {
    color: #1abc9c;
    font-size: 14px;
}

body.dark-mode .achievement-group-title {
    color: #f3f4f6;
    border-left-color: #38bdf8;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.1), transparent);
}

body.dark-mode .achievement-group-title i {
    color: #38bdf8;
}

.achievements-container,
.habits-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.achievement-card,
.habit-card {
    background-color: rgba(26, 188, 156, 0.05);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.achievement-card:hover,
.habit-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border-left-color: #1abc9c;
    background-color: rgba(26, 188, 156, 0.1);
}

.achievement-icon,
.habit-icon {
    font-size: 20px;
    color: #1abc9c;
    margin-right: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(26, 188, 156, 0.1);
    border-radius: 8px;
}

.achievement-content p,
.habit-content p {
    margin: 0;
    line-height: 1.6;
}

/* =================================================
 * 出版图书卡片样式
 * ================================================= */
.books-publisher,
.books-publisher-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 20px;
    padding: 8px 16px;
    background: rgba(26, 188, 156, 0.06);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.books-publisher i,
.books-publisher-group i {
    color: #1abc9c;
}

.books-publisher-group {
    margin-top: 28px;
    background: rgba(155, 89, 182, 0.06);
}

.books-publisher-group i {
    color: #9b59b6;
}

.books-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.book-card {
    display: flex;
    gap: 18px;
    padding: 24px;
    background: #fff;
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                border-color 0.3s ease,
                background 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
    z-index: 1;
    cursor: pointer;
}

.book-card > * {
    position: relative;
    z-index: 2;
}

.book-card.animate {
    opacity: 1;
    transform: translateY(0);
}

.book-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1abc9c, #16a085, #1abc9c);
    background-size: 200% 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.book-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(26, 188, 156, 0.08);
    border-color: rgba(26, 188, 156, 0.2);
}

.book-card:hover::before {
    opacity: 1;
    animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.book-cover {
    flex-shrink: 0;
    width: 180px;
    perspective: 800px;
}

.book-cover img {
    width: 180px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: block;
}

.book-card:hover .book-cover img {
    transform: rotateY(-8deg) rotateX(2deg) scale(1.05) translateZ(10px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2), -8px 8px 20px rgba(0, 0, 0, 0.1);
}

.book-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.book-title {
    font-size: 15px;
    font-weight: bold;
    color: #2c3e50;
    margin: 0;
    line-height: 1.5;
    transition: color 0.3s ease;
}

.book-card:hover .book-title {
    color: #16a085;
}

.book-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    font-size: 12px;
    color: #95a5a6;
    margin: 8px 0 10px;
}

.book-tag {
    display: inline-block;
    padding: 3px 12px;
    background: linear-gradient(135deg, #1abc9c, #16a085);
    color: #fff;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    align-self: flex-start;
}

.book-card:hover .book-tag {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(26, 188, 156, 0.3);
}

.book-tag-soft {
    background: linear-gradient(135deg, #e67e22, #d35400);
}

.book-card:hover .book-tag-soft {
    box-shadow: 0 2px 8px rgba(230, 126, 34, 0.3);
}

.book-tag-tw {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.book-card:hover .book-tag-tw {
    box-shadow: 0 2px 8px rgba(155, 89, 182, 0.3);
}

.book-publisher-meta {
    font-size: 12px;
    color: #7f8c8d;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.book-publisher-meta i {
    font-size: 11px;
    color: #bdc3c7;
}

.book-isbn {
    font-size: 12px;
    color: #7f8c8d;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.book-isbn i {
    font-size: 11px;
    opacity: 0.7;
}

.book-price {
    color: #e74c3c;
    font-weight: bold;
    font-size: 14px;
    transition: transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.book-price i {
    font-size: 12px;
}

.book-card:hover .book-price {
    transform: scale(1.05);
    transform-origin: left center;
}

.book-desc {
    font-size: 13px;
    color: #555;
    line-height: 1.7;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.book-link {
    margin-top: auto;
    font-size: 13px;
    color: #fff;
    background: linear-gradient(135deg, #1abc9c, #16a085);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 20px;
    align-self: flex-start;
    transition: gap 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(26, 188, 156, 0.25);
}

.book-link i {
    font-size: 11px;
    transition: transform 0.3s ease;
}

.book-card:hover .book-link {
    gap: 10px;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(26, 188, 156, 0.4);
}

.book-card:hover .book-link i {
    transform: translate(2px, -2px);
}

body.dark-mode .book-link {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    box-shadow: 0 2px 8px rgba(56, 189, 248, 0.25);
}

body.dark-mode .book-card:hover .book-link {
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.4);
}

body.dark-mode .books-publisher {
    background: rgba(56, 189, 248, 0.08);
    color: #94a3b8;
}

body.dark-mode .books-publisher-group {
    background: rgba(167, 139, 250, 0.08);
    color: #94a3b8;
}

body.dark-mode .books-publisher-group i {
    color: #a78bfa;
}

body.dark-mode .book-tag-tw {
    background: linear-gradient(135deg, #a78bfa, #8b5cf6);
}

body.dark-mode .book-publisher-meta {
    color: #9ca3af;
}

body.dark-mode .book-publisher-meta i {
    color: #7dd3fc;
}

body.dark-mode .book-card {
    background: rgba(31, 41, 55, 0.8);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

body.dark-mode .book-card:hover {
    background: rgba(31, 41, 55, 0.95);
    border-color: rgba(56, 189, 248, 0.25);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(56, 189, 248, 0.08);
}

body.dark-mode .book-card::before {
    background: linear-gradient(90deg, #38bdf8, #0ea5e9, #38bdf8);
    background-size: 200% 100%;
}

body.dark-mode .book-title {
    color: #f3f4f6;
}

body.dark-mode .book-card:hover .book-title {
    color: #38bdf8;
}

body.dark-mode .book-meta {
    color: #94a3b8;
}

body.dark-mode .book-isbn {
    color: #64748b;
}

body.dark-mode .book-desc {
    color: #cbd5e1;
}

body.dark-mode .book-link {
    color: #38bdf8;
}

body.dark-mode .book-link:hover {
    color: #7dd3fc;
}

body.dark-mode .book-tag {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
}

body.dark-mode .book-tag-soft {
    background: linear-gradient(135deg, #fb923c, #ea580c);
}

/* =================================================
 * 数据统计样式
 * ================================================= */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.stat-card {
    background-color: rgba(26, 188, 156, 0.05);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    background-color: rgba(26, 188, 156, 0.1);
}

.stat-icon {
    font-size: 24px;
    color: #1abc9c;
    margin-bottom: 10px;
}

.stat-content h3 {
    margin: 0 0 10px;
    font-size: 16px;
    color: #333;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #16a085;
    margin: 5px 0;
}

.stat-label {
    color: #7f8c8d;
    font-size: 14px;
}

.data-source {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed #eee;
    font-size: 14px;
    text-align: center;
}

/* =================================================
 * 页面入口卡片（主页导航用）
 * ================================================= */
.page-entry-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.page-entry-card {
    background-color: #fff;
    border-radius: 12px;
    padding: 30px 24px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border-left: 4px solid #1abc9c;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    position: relative;
    z-index: 1;
    cursor: pointer;
}

.page-entry-card > * {
    position: relative;
    z-index: 2;
}

.page-entry-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    color: inherit;
    border-left-color: #16a085;
}

.page-entry-card .entry-icon {
    font-size: 36px;
    color: #1abc9c;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 188, 156, 0.1);
    border-radius: 50%;
    margin-bottom: 5px;
}

.page-entry-card .entry-title {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
}

.page-entry-card .entry-desc {
    font-size: 14px;
    color: #7f8c8d;
    line-height: 1.6;
}

.page-entry-card .entry-link {
    color: #1abc9c;
    font-size: 14px;
    margin-top: 5px;
}

/* =================================================
 * 目录导航（侧边悬浮）
 * ================================================= */
.toc-container {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 15px 10px;
    z-index: 999;
    transition: all 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
}

.toc-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 10px;
    padding: 0 10px;
    color: #16a085;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-item {
    padding: 5px 10px;
    margin-bottom: 5px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.toc-item:hover,
.toc-item.active {
    background: #1abc9c;
    color: white;
}

.toc-item:focus-visible {
    outline: 2px solid #1abc9c;
    outline-offset: 2px;
}

/* =================================================
 * 页脚
 * ================================================= */
.footer {
    width: 100%;
    margin-top: 2rem;
    padding: 30px 20px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.footer-copyright {
    margin: 0;
}

.footer-nav {
    line-height: 1.8;
}

.footer-meta {
    margin: 0;
    font-size: 0.75rem;
    opacity: 0.8;
}

.footer-meta i {
    margin-right: 5px;
    color: var(--color-primary);
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

/* =================================================
 * 面包屑导航
 * ================================================= */
.breadcrumb {
    background: rgba(248, 250, 252, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 8px 30px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    z-index: 999;
    box-sizing: border-box;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), top 0.3s ease;
}

/* navbar 收缩时面包屑跟随上移（JS 同步 class） */
body.navbar-scrolled .breadcrumb {
    top: 52px;
}

/* navbar 隐藏时面包屑跟随到顶部 */
body.navbar-hidden .breadcrumb {
    top: 0;
}

/* 面包屑自己隐藏（向下滚动） */
.breadcrumb.breadcrumb-hidden {
    transform: translateY(-100%);
}

.breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    margin: 0;
    max-width: 1200px;
    margin: 0 auto;
    font-size: 13px;
}

.breadcrumb li {
    display: flex;
    align-items: center;
}

.breadcrumb li:not(:last-child)::after {
    content: '/';
    margin-left: 8px;
    color: #95a5a6;
}

.breadcrumb a {
    color: #1abc9c;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #16a085;
}

.breadcrumb i {
    margin-right: 4px;
}

/* 相关内容推荐 */
.related-content {
    padding: 40px 20px;
    max-width: 900px;
    margin: 20px auto 0;
}

.related-content-inner {
    max-width: 900px;
    margin: 0 auto;
}

.related-content h2 {
    color: #2c3e50;
    font-size: 22px;
    margin-bottom: 20px;
    text-align: center;
}

.related-content h2 i {
    color: #1abc9c;
    margin-right: 8px;
}

/* =================================================
 * 滚动条样式（webkit 内核）
 * Firefox 通过 html 上的 scrollbar-width / scrollbar-color 兼容
 * ================================================= */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #1abc9c;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #16a085;
}

/* 暗色模式滚动条 */
body.dark-mode {
    scrollbar-color: #38bdf8 #1f2937;
}

body.dark-mode ::-webkit-scrollbar-track {
    background: #1f2937;
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background: #38bdf8;
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: #0ea5e9;
}

/* =================================================
 * 夜间模式
 * ================================================= */
body.dark-mode {
    background: linear-gradient(135deg, #1a2a3a 0%, #111827 100%);
    color: #e5e7eb;
}

body.dark-mode .navbar {
    background: rgba(31, 41, 55, 0.95);
}

body.dark-mode .navbar-brand {
    color: #f3f4f6;
}

body.dark-mode .navbar-menu li a {
    color: #d1d5db;
}

body.dark-mode .navbar-menu li a:hover,
body.dark-mode .navbar-menu li a.active {
    background: #38bdf8;
}

/* 暗色模式：secondary 文本统一提亮（WCAG AA 4.5:1） */
body.dark-mode .contact-label,
body.dark-mode .stat-label,
body.dark-mode .book-publisher-meta,
body.dark-mode .reading-time,
body.dark-mode .qrcode-tip,
body.dark-mode .info-job {
    color: #9ca3af;
}

body.dark-mode .book-meta {
    color: #a8b3c5;
}

body.dark-mode .card {
    background-color: #1f2937;
    border-left-color: #38bdf8;
}

body.dark-mode .card h2 {
    color: #f3f4f6;
    border-bottom-color: #374151;
}

body.dark-mode .card a {
    color: #38bdf8;
}

body.dark-mode .card a::after {
    background-color: #0ea5e9;
}

body.dark-mode .main .card li:hover {
    background-color: rgba(56, 189, 248, 0.1);
}

body.dark-mode .category-header {
    background-color: rgba(56, 189, 248, 0.1);
}

body.dark-mode .category-header h3 {
    color: #e5e7eb;
}

body.dark-mode .category-icon {
    color: #38bdf8;
}

body.dark-mode .skill-category.active .category-header {
    background-color: rgba(56, 189, 248, 0.2);
}

body.dark-mode .skill-category.active .category-header h3 {
    color: #38bdf8;
}

body.dark-mode .category-details {
    background-color: #2d3748;
}

body.dark-mode .category-details p {
    border-bottom-color: #4a5568;
}

body.dark-mode .achievement-card,
body.dark-mode .habit-card,
body.dark-mode .stat-card {
    background-color: rgba(56, 189, 248, 0.05);
}

body.dark-mode .achievement-card:hover,
body.dark-mode .habit-card:hover,
body.dark-mode .stat-card:hover {
    background-color: rgba(56, 189, 248, 0.1);
}

body.dark-mode .achievement-icon,
body.dark-mode .habit-icon,
body.dark-mode .stat-icon {
    color: #38bdf8;
}

body.dark-mode .stat-content h3 {
    color: #f3f4f6;
}

body.dark-mode .stat-value {
    color: #38bdf8;
}

body.dark-mode .data-source {
    border-top-color: #374151;
}

body.dark-mode .toc-container {
    background: rgba(31, 41, 55, 0.9);
}

body.dark-mode .toc-title {
    color: #38bdf8;
}

body.dark-mode .theme-switch {
    background: #1f2937;
}

body.dark-mode .theme-switch i {
    color: #38bdf8;
}

body.dark-mode .navbar-toggle {
    color: #f3f4f6;
}

body.dark-mode .page-entry-card {
    background-color: #1f2937;
    border-left-color: #38bdf8;
}

body.dark-mode .page-entry-card .entry-title {
    color: #f3f4f6;
}

body.dark-mode .page-entry-card .entry-desc {
    color: #9ca3af;
}

body.dark-mode .page-entry-card .entry-icon {
    color: #38bdf8;
}

body.dark-mode .footer {
    color: #9ca3af;
    background: rgba(31, 41, 55, 0.5);
}

body.dark-mode .breadcrumb {
    background: rgba(31, 41, 55, 0.9);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .breadcrumb a {
    color: #38bdf8;
}

body.dark-mode .related-content h2 {
    color: #f3f4f6;
}

body.dark-mode a {
    color: #38bdf8;
}

body.dark-mode a::after {
    background-color: #0ea5e9;
}

body.dark-mode .navbar {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

/* =================================================
 * 响应式 - 平板
 * ================================================= */
@media (max-width: 1024px) {
    .toc-container {
        right: 10px;
        padding: 10px 5px;
    }

    .toc-item {
        font-size: 12px;
        padding: 3px 8px;
    }

    .container {
        padding: 75px 15px 15px;
    }
}

/* =================================================
 * PC端默认隐藏移动端TOC专属元素（双重保险）
 * ================================================= */
.toc-overlay,
.toc-fab,
.toc-panel-handle,
.toc-panel-header,
.toc-container .toc-item i.fa {
    display: none !important;
}

/* =================================================
 * 响应式 - 移动端
 * ================================================= */
@media (max-width: 768px) {
    /* 移动端 TOC 遮罩层 */
    .toc-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 998;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .toc-overlay.show {
        display: block;
        opacity: 1;
    }

    .navbar {
        padding: 0 15px;
    }

    .breadcrumb {
        padding: 8px 15px;
    }

    .breadcrumb ol {
        font-size: 12px;
    }

    .navbar-toggle {
        display: block;
    }

    .navbar-menu {
        position: fixed;
        top: 97px;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 10px 0;
        gap: 0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        transform: translateY(-150%);
        transition: transform 0.3s ease;
        max-height: calc(100vh - 97px);
        overflow-y: auto;
    }

    .navbar-menu.show {
        transform: translateY(0);
    }

    .navbar-menu li {
        width: 100%;
    }

    .navbar-menu li a {
        padding: 12px 20px;
        border-radius: 0;
    }

    body.dark-mode .navbar-menu {
        background: rgba(31, 41, 55, 0.98);
    }

    .container {
        flex-direction: column;
        padding: 110px 15px 80px;
    }

    .side {
        flex: none;
    }

    .page-content {
        padding: 0 15px 80px;
    }

    /* 移动端 TOC 浮动按钮 - 左下角 */
    .toc-container {
        position: fixed;
        left: 15px;
        bottom: 20px;
        top: auto;
        right: auto;
        transform: none;
        width: auto;
        max-width: none;
        max-height: none;
        padding: 0;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border: none;
        box-shadow: none;
        z-index: 999;
        transition: none;
    }

    .toc-container .toc-title {
        display: none;
    }

    /* 移动端 - 恢复移动端TOC元素显示 */
    .toc-overlay,
    .toc-fab,
    .toc-panel-handle,
    .toc-panel-header {
        display: block !important;
    }

    /* 收起状态：目录列表隐藏 */
    .toc-container:not(.mobile-open) .toc-list {
        display: none;
    }

    /* 浮动按钮 - 使用真实DOM元素 */
    .toc-fab {
        display: flex !important;
        align-items: center;
        gap: 8px;
        padding: 10px 16px;
        border-radius: 28px;
        background: var(--gradient-primary);
        color: #fff;
        font-size: 14px;
        font-weight: 600;
        box-shadow: 0 4px 16px var(--color-primary-glow);
        cursor: pointer;
        transition: all 0.25s ease;
        border: none;
        -webkit-tap-highlight-color: transparent;
    }

    .toc-fab i {
        font-size: 16px;
    }

    .toc-fab:active {
        transform: scale(0.95);
    }

    /* 展开状态：底部弹出面板 */
    .toc-container.mobile-open {
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        z-index: 1000;
    }

    .toc-container.mobile-open .toc-list {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: 50vh;
        overflow-y: auto;
        padding: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
        border-top: 1px solid rgba(26, 188, 156, 0.15);
        -webkit-overflow-scrolling: touch;
        transform: translateY(100%);
        animation: tocSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

    @keyframes tocSlideUp {
        to {
            transform: translateY(0);
        }
    }

    /* TOC 面板拖拽指示条 */
    .toc-panel-handle {
        width: 40px;
        height: 4px;
        background: rgba(0, 0, 0, 0.15);
        border-radius: 2px;
        margin: 10px auto 0;
        flex-shrink: 0;
    }

    /* TOC 面板头部 */
    .toc-panel-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 20px 12px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        position: sticky;
        top: 0;
        background: inherit;
        z-index: 1;
    }

    .toc-panel-title {
        font-size: 16px;
        font-weight: 600;
        color: var(--color-text);
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .toc-panel-title i {
        color: var(--color-primary);
    }

    .toc-close-btn {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        border: none;
        background: rgba(0, 0, 0, 0.05);
        color: var(--color-text-secondary);
        font-size: 18px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
        -webkit-tap-highlight-color: transparent;
        flex-shrink: 0;
    }

    .toc-close-btn:active {
        background: rgba(0, 0, 0, 0.1);
        transform: scale(0.9);
    }

    .toc-container.mobile-open .toc-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 14px 20px;
        margin: 0;
        border-radius: 0;
        font-size: 15px;
        white-space: normal;
        border-bottom: 1px solid rgba(0, 0, 0, 0.04);
        min-height: 52px;
    }

    .toc-container.mobile-open .toc-item:last-child {
        border-bottom: none;
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    }

    .toc-container.mobile-open .toc-item i.fa {
        display: inline-block !important;
        width: 20px;
        text-align: center;
        font-size: 14px;
        color: var(--color-primary);
        opacity: 0.7;
        flex-shrink: 0;
    }

    .toc-container.mobile-open .toc-item.active {
        background: var(--color-primary-light);
        color: var(--color-primary-dark);
        font-weight: 600;
    }

    .toc-container.mobile-open .toc-item.active i {
        opacity: 1;
    }

    body.dark-mode .toc-container.mobile-open .toc-list {
        background: rgba(31, 41, 55, 0.98);
        border-top-color: rgba(56, 189, 248, 0.15);
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
    }

    body.dark-mode .toc-panel-header {
        border-bottom-color: rgba(255, 255, 255, 0.08);
    }

    body.dark-mode .toc-panel-title {
        color: #f3f4f6;
    }

    body.dark-mode .toc-close-btn {
        background: rgba(255, 255, 255, 0.1);
        color: #9ca3af;
    }

    body.dark-mode .toc-close-btn:active {
        background: rgba(255, 255, 255, 0.15);
    }

    body.dark-mode .toc-panel-handle {
        background: rgba(255, 255, 255, 0.2);
    }

    body.dark-mode .toc-container.mobile-open .toc-item {
        border-bottom-color: rgba(255, 255, 255, 0.05);
    }

    body.dark-mode .toc-fab {
        box-shadow: 0 4px 16px var(--color-primary-glow);
    }

    body {
        padding-bottom: 0;
    }

    .page-entry-cards {
        grid-template-columns: 1fr;
    }

    .books-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .book-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 14px;
        padding: 20px;
    }

    .book-cover {
        width: 160px;
    }

    .book-cover img {
        width: 160px;
    }

    .book-card:hover .book-cover img {
        transform: rotateY(0) rotateX(0) scale(1.03);
    }

    .book-meta {
        align-items: center;
    }

    .book-desc {
        -webkit-line-clamp: 4;
        text-align: left;
    }

    .book-title {
        font-size: 15px;
        text-align: center;
    }

    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }

    aside {
        display: none;
    }
}

@media (max-width: 480px) {
    .stats-container {
        grid-template-columns: 1fr;
    }

    .achievements-container,
    .habits-container {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 16px;
    }
}

/* =================================================
 * 返回顶部按钮
 * ================================================= */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #1abc9c;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(26, 188, 156, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 998;
}

#backToTop.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#backToTop:hover {
    background: #16a085;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(26, 188, 156, 0.5);
}

#backToTop:active {
    transform: translateY(-1px) scale(0.92);
}

body.dark-mode #backToTop {
    background: #38bdf8;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.4);
}

body.dark-mode #backToTop:hover {
    background: #0ea5e9;
}

/* =================================================
 * 阅读时间徽章
 * ================================================= */
.reading-time {
    float: right;
    font-size: 11px;
    font-weight: 500;
    color: #95a5a6;
    padding: 3px 10px;
    background: rgba(26, 188, 156, 0.08);
    border-radius: 12px;
    margin-top: 2px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
    transition: all 0.3s ease;
}

.reading-time:hover {
    background: rgba(26, 188, 156, 0.15);
    color: #16a085;
}

.reading-time i {
    margin-right: 0;
    font-size: 10px;
}

body.dark-mode .reading-time {
    background: rgba(56, 189, 248, 0.1);
    color: #94a3b8;
}

body.dark-mode .reading-time:hover {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
}

/* =================================================
 * 复制成功提示
 * ================================================= */
.copy-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1abc9c;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10000;
    pointer-events: none;
}

.copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* =================================================
 * 卡片点击波纹效果
 * ================================================= */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

body.dark-mode .ripple {
    background: rgba(255, 255, 255, 0.1);
}

/* =================================================
 * 骨架屏（加载占位）
 * ================================================= */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

body.dark-mode .skeleton {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
}

/* =================================================
 * 侧边栏粘性定位
 * ================================================= */
@media (min-width: 769px) {
    .container .side {
        position: sticky;
        top: 120px;
        max-height: calc(100vh - 140px);
        overflow-y: auto;
        align-self: flex-start;
    }

    .container .side::-webkit-scrollbar {
        width: 4px;
    }

    .container .side::-webkit-scrollbar-thumb {
        background: rgba(26, 188, 156, 0.3);
        border-radius: 2px;
    }
}

/* =================================================
 * 粒子背景画布
 * ================================================= */
#particlesCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

/* =================================================
 * 移动端触摸优化
 * ================================================= */
@media (max-width: 768px) {
    #backToTop {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
    }

    /* TOC展开时隐藏返回顶部按钮，避免视觉冲突 */
    .toc-container.mobile-open ~ #backToTop {
        display: none !important;
    }

    /* 增大触摸目标 */
    .navbar-menu li a,
    .toc-item,
    .page-entry-card,
    .media-link,
    .toc-close-btn {
        min-height: 44px;
    }

    .reading-time {
        display: none;
    }

    /* 移动端最小字号14px，保证可读性 */
    .contact-label,
    .qrcode-tip,
    .media-link,
    .book-meta,
    .book-tag,
    .book-publisher-meta,
    .book-isbn,
    .breadcrumb ol {
        font-size: 14px;
    }

    .book-desc,
    .book-link,
    .toc-item {
        font-size: 14px;
    }

    /* 响应式锚点偏移 */
    html {
        scroll-padding-top: 90px;
    }
}

/* =================================================
 * 打印样式
 * ================================================= */
@media print {
    .navbar,
    .breadcrumb,
    .toc-container,
    #backToTop,
    .cursor-follower,
    .progress-container,
    #particlesCanvas,
    aside,
    .related-content,
    .navbar-tools,
    .footer-nav,
    .footer-meta {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
        font-size: 12pt;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        page-break-inside: avoid;
        opacity: 1 !important;
        transform: none !important;
    }

    a {
        color: black !important;
        text-decoration: underline;
    }

    a::after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #555;
    }

    a[href^="#"]::after,
    a[href^="javascript"]::after {
        content: "";
    }

    .container,
    .page-content {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .side {
        position: static !important;
        max-height: none !important;
    }
}

/* =================================================
 * 渐进式加载 & 增强动画
 * ================================================= */

/* 图片渐进式加载（模糊→清晰） */
img {
    transition: filter 0.4s ease, opacity 0.4s ease;
}

img[data-loading="true"] {
    filter: blur(8px);
    opacity: 0.6;
}

img[data-loaded="true"] {
    filter: blur(0);
    opacity: 1;
}

/* 卡片入场动画增强 - 交错延迟 */
.card {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.3s ease,
                border-color 0.3s ease;
    will-change: opacity, transform;
}

.card.animate {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* 卡片悬停时的光效扫过 */
.card {
    position: relative;
    overflow: hidden;
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    transition: left 0.6s ease;
    pointer-events: none;
    z-index: 0;
}

.card:hover::after {
    left: 120%;
}

/* 卡片内容层级 */
.card > *:not(.ripple) {
    position: relative;
    z-index: 1;
}

/* 页面入口卡片入场动画 */
.page-entry-card {
    opacity: 0;
    transform: translateY(25px) scale(0.95);
    transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.3s ease;
    will-change: opacity, transform;
}

.page-entry-card.animate {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* 页面入口卡片图标弹跳效果 */
.page-entry-card:hover .entry-icon {
    animation: iconBounce 0.5s ease;
}

@keyframes iconBounce {
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.2) rotate(-8deg); }
    60% { transform: scale(0.95) rotate(4deg); }
}

/* 成就卡片入场动画 */
.achievement-card,
.habit-card {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.5s ease, transform 0.5s ease, background-color 0.3s ease;
    will-change: opacity, transform;
}

.achievement-card.animate,
.habit-card.animate {
    opacity: 1;
    transform: translateX(0);
}

/* 统计卡片入场动画 */
.stat-card {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    transition: opacity 0.5s ease, transform 0.5s ease;
    will-change: opacity, transform;
}

.stat-card.animate {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* 统计数字弹性放大 */
.stat-value {
    transition: transform 0.3s ease, color 0.3s ease;
}

.stat-card:hover .stat-value {
    transform: scale(1.15);
}

/* 相关内容推荐区域入场 */
.related-content {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.related-content.animate {
    opacity: 1;
    transform: translateY(0);
}

/* 导航栏滚动时的阴影增强 */
.navbar.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    height: 55px;
}

.navbar.scrolled .navbar-brand {
    font-size: 16px;
}

/* 导航链接下划线动画 */
.navbar-menu li a {
    position: relative;
    overflow: hidden;
}

.navbar-menu li a::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.3s ease, left 0.3s ease;
    border-radius: 1px;
}

.navbar-menu li a:hover::after,
.navbar-menu li a.active::after {
    width: 60%;
    left: 20%;
}

/* 滚动进度条渐变增强 */
.progress-bar {
    background: linear-gradient(90deg, #1abc9c, #16a085, #1abc9c);
    background-size: 200% 100%;
    animation: progressShimmer 3s linear infinite;
    box-shadow: 0 0 8px rgba(26, 188, 156, 0.5);
}

@keyframes progressShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 返回顶部按钮脉冲效果 - 仅hover时触发，节省GPU */
#backToTop.show:hover {
    animation: backToTopPulse 2s ease-in-out infinite;
}

@keyframes backToTopPulse {
    0%, 100% { box-shadow: 0 4px 12px rgba(26, 188, 156, 0.4); }
    50% { box-shadow: 0 4px 20px rgba(26, 188, 156, 0.6); }
}

/* 自媒体矩阵链接微动画 */
.media-link {
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                background 0.3s ease,
                box-shadow 0.3s ease;
}

.media-link:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 4px 12px rgba(26, 188, 156, 0.2);
}

/* 标题文字渐入效果 */
.card h2 {
    overflow: hidden;
}

.card h2 i {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s ease;
}

.card.animate h2 i {
    animation: iconPopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

@keyframes iconPopIn {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* 列表项交错入场 */
.card.animate li {
    animation: listItemSlide 0.4s ease both;
}

.card.animate li:nth-child(1) { animation-delay: 0.05s; }
.card.animate li:nth-child(2) { animation-delay: 0.1s; }
.card.animate li:nth-child(3) { animation-delay: 0.15s; }
.card.animate li:nth-child(4) { animation-delay: 0.2s; }
.card.animate li:nth-child(5) { animation-delay: 0.25s; }
.card.animate li:nth-child(6) { animation-delay: 0.3s; }
.card.animate li:nth-child(7) { animation-delay: 0.35s; }
.card.animate li:nth-child(8) { animation-delay: 0.4s; }
.card.animate li:nth-child(9) { animation-delay: 0.45s; }
.card.animate li:nth-child(10) { animation-delay: 0.5s; }

@keyframes listItemSlide {
    from {
        opacity: 0;
        transform: translateX(-15px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 面包屑导航淡入 */
.breadcrumb {
    animation: fadeInDown 0.5s ease both;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =================================================
 * 极致体验：字号调节按钮
 * ================================================= */
.font-size-toggle {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border-radius: var(--radius-full);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255,255,255,0.8);
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
    padding: 0;
    font: inherit;
    color: var(--color-primary-dark);
    font-weight: 700;
    font-size: 13px;
    position: relative;
}

.font-size-toggle:hover {
    transform: scale(1.1);
}

.font-size-toggle:active {
    transform: scale(0.92);
}

.font-size-toggle:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

body.dark-mode .font-size-toggle {
    background: linear-gradient(135deg, #374151, #1f2937);
    color: #38bdf8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255,255,255,0.05);
}

/* 字号调节弹出面板 */
.font-size-panel {
    position: absolute;
    top: 48px;
    right: 0;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    display: none;
    gap: 4px;
    z-index: 1001;
    border: 1px solid rgba(0,0,0,0.06);
}

.font-size-panel.show {
    display: flex;
}

.font-size-panel button {
    background: transparent;
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--color-text);
    transition: all var(--transition-fast);
    min-height: 36px;
    min-width: 44px;
    font-weight: 500;
}

.font-size-panel button:hover {
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
}

.font-size-panel button.active {
    background: var(--gradient-primary);
    color: #fff;
}

body.dark-mode .font-size-panel {
    background: #1f2937;
    border-color: rgba(255,255,255,0.08);
}

body.dark-mode .font-size-panel button {
    color: #f3f4f6;
}

body.dark-mode .font-size-panel button:hover {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
}

body.dark-mode .font-size-panel button.active {
    background: var(--gradient-primary);
}

/* =================================================
 * 极致体验：快捷键帮助面板
 * ================================================= */
.shortcut-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.shortcut-overlay.show {
    display: flex;
    opacity: 1;
}

.shortcut-modal {
    background: #fff;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 28px 32px;
    max-width: 480px;
    width: calc(100% - 40px);
    transform: scale(0.9);
    transition: transform var(--transition-base);
}

.shortcut-overlay.show .shortcut-modal {
    transform: scale(1);
}

.shortcut-modal h2 {
    margin: 0 0 6px;
    font-size: 20px;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.shortcut-modal h2 i {
    color: var(--color-primary);
}

.shortcut-modal .shortcut-desc {
    color: var(--color-text-muted);
    font-size: 13px;
    margin-bottom: 20px;
}

.shortcut-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.shortcut-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.shortcut-list li:last-child {
    border-bottom: none;
}

.shortcut-list .shortcut-label {
    color: var(--color-text);
}

.shortcut-list kbd {
    background: #f5f5f5;
    border: 1px solid #d1d5db;
    border-bottom-width: 2px;
    border-radius: var(--radius-sm);
    padding: 3px 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    color: var(--color-text);
    box-shadow: 0 1px 0 rgba(0,0,0,0.05);
    min-width: 28px;
    text-align: center;
}

.shortcut-close-hint {
    margin-top: 16px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 12px;
}

body.dark-mode .shortcut-modal {
    background: #1f2937;
}

body.dark-mode .shortcut-modal h2 {
    color: #f3f4f6;
}

body.dark-mode .shortcut-list li {
    border-color: rgba(255,255,255,0.08);
}

body.dark-mode .shortcut-list .shortcut-label {
    color: #f3f4f6;
}

body.dark-mode .shortcut-list kbd {
    background: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
}

/* =================================================
 * 极致体验：链接跳转加载条
 * ================================================= */
.nav-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--gradient-primary);
    width: 0;
    z-index: 10001;
    box-shadow: 0 0 8px var(--color-primary-glow);
    transition: width 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.nav-loading-bar.loading {
    opacity: 1;
    animation: navLoadingGrow 1.2s ease-in-out infinite;
}

@keyframes navLoadingGrow {
    0% { width: 0; }
    50% { width: 70%; }
    100% { width: 90%; }
}

/* =================================================
 * 极致体验：阅读模式
 * ================================================= */
body.reading-mode .cursor-follower,
body.reading-mode #particlesCanvas,
body.reading-mode .toc-container,
body.reading-mode aside,
body.reading-mode .breadcrumb {
    display: none !important;
}

body.reading-mode .container,
body.reading-mode .page-content {
    max-width: 760px;
}

body.reading-mode .card {
    box-shadow: var(--shadow-sm);
}

body.reading-mode .card:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
}

/* 减少动画偏好：隐藏新增交互的非必要动画 */
@media (prefers-reduced-motion: reduce) {
    .nav-loading-bar.loading {
        animation: none;
        width: 90%;
    }
    .shortcut-modal {
        transition: none;
    }
}


/* 页面整体淡入 */
body {
    animation: pageFadeIn 0.4s ease both;
}

@keyframes pageFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 夜间模式切换过渡 */
body,
.navbar,
.card,
.page-entry-card,
.toc-container,
.breadcrumb,
.footer {
    transition: background 0.4s ease, color 0.4s ease, background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

/* 性能优化：content-visibility 跳过屏幕外渲染 */
.card,
.page-entry-card,
.achievement-card,
.habit-card,
.stat-card {
    content-visibility: auto;
    contain-intrinsic-size: 200px;
}

/* 减少动画偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .card,
    .page-entry-card,
    .achievement-card,
    .habit-card,
    .stat-card {
        opacity: 1 !important;
        transform: none !important;
    }

    .cursor-follower,
    #particlesCanvas {
        display: none !important;
    }
}

/* TOC目录项激活动画 */
.toc-item {
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toc-item.active {
    transform: scale(1.05);
    font-weight: 600;
}

/* 书籍链接提示箭头动画 */
.book-link {
    transition: transform 0.3s ease;
}

.book-card:hover .book-link i {
    animation: arrowBounce 0.6s ease infinite;
}

@keyframes arrowBounce {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
}

/* =================================================
 * 高对比度模式
 * ================================================= */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #333;
    }

    body.dark-mode .card {
        border: 2px solid #fff;
    }
}

/* =================================================
 * 触摸设备：禁用 :hover 粘滞效果
 * 仅在支持 hover 的设备（鼠标）上保留 hover 交互
 * ================================================= */
@media (hover: none) {
    .card:hover,
    .page-entry-card:hover,
    .book-card:hover,
    .book-card:hover::before,
    .book-card:hover .book-cover img,
    .book-card:hover .book-title,
    .book-card:hover .book-tag,
    .book-card:hover .book-tag-soft,
    .book-card:hover .book-tag-tw,
    .book-card:hover .book-price,
    .book-card:hover .book-link,
    .book-card:hover .book-link i,
    .achievement-card:hover,
    .habit-card:hover,
    .stat-card:hover,
    .stat-card:hover .stat-value,
    .media-link:hover,
    .media-link:hover::after,
    .card:hover::after,
    .card:hover h2 i,
    .page-entry-card:hover .entry-icon,
    .toc-item:hover {
        transform: none !important;
        box-shadow: inherit !important;
    }
}
