/* ============================================================
   生理学学习网页 — 全局样式
   主色调：青蓝 teal (#0c4a6e → #0e7490)
   区别于解剖学的深紫蓝 (#1e3a8a → #312e81)
   ============================================================ */

/* ===== 基础重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主色：青蓝 teal —— 偏"流动/动态"感 */
    --primary:       #0e7490;
    --primary-light: #cffafe;
    --primary-dark:  #0c4a6e;
    /* 辅助色 */
    --accent:        #059669;
    --accent-light:  #d1fae5;
    --warning:       #d97706;
    --warning-light: #fef3c7;
    --danger:        #dc2626;
    --danger-light:  #fee2e2;
    --purple:        #7c3aed;
    --purple-light:  #ede9fe;
    --teal:          #0f766e;
    --teal-light:    #ccfbf1;
    --cyan:          #0891b2;
    --cyan-light:    #e0f2fe;
    /* 灰度 */
    --gray-50:  #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    /* 通用 */
    --radius:    12px;
    --shadow:    0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
                 "PingFang SC", "Hiragino Sans GB", sans-serif;
    line-height: 1.8;
    color: var(--gray-800);
    background: var(--gray-50);
}

/* ===================================================
   顶部导航
   =================================================== */
.top-nav {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}
.top-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}
.top-nav .logo {
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
}
.top-nav .logo:hover { opacity: 0.9; }
.top-nav .nav-links {
    display: flex;
    gap: 4px;
    list-style: none;
    flex-wrap: wrap;
}
.top-nav .nav-links a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.top-nav .nav-links a:hover,
.top-nav .nav-links a.active {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* ===================================================
   面包屑
   =================================================== */
.breadcrumb {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem 0;
    font-size: 0.85rem;
    color: var(--gray-500);
}
.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 6px; }

/* ===================================================
   页面标题区
   =================================================== */
.page-hero {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 2rem 1rem;
}
.page-hero h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}
.page-hero .subtitle {
    font-size: 1.1rem;
    color: var(--gray-500);
    max-width: 700px;
}
.page-hero .chapter-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 12px;
}

/* ===================================================
   主内容区布局
   =================================================== */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem 3rem;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 2rem;
    align-items: start;
}
.main-content.full-width {
    grid-template-columns: 1fr;
}
.content-body { min-width: 0; }
.content-body h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary);
    display: inline-block;
    scroll-margin-top: 72px;
}
.content-body h2:first-child { margin-top: 0; }
.content-body h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: 1.8rem 0 0.8rem;
}
.content-body h4 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--gray-700);
    margin: 1.2rem 0 0.5rem;
}
.content-body p {
    margin-bottom: 1rem;
    color: var(--gray-700);
}
.content-body ul,
.content-body ol {
    margin: 0.5rem 0 1rem 1.5rem;
    color: var(--gray-700);
}
.content-body li { margin-bottom: 0.4rem; }

/* ===================================================
   右侧目录栏
   =================================================== */
.sidebar {
    position: sticky;
    top: 80px;
}
.sidebar-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.sidebar-card h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.sidebar-card .toc-list {
    list-style: none;
    padding: 0;
}
.sidebar-card .toc-list li { margin-bottom: 2px; }
.sidebar-card .toc-list a {
    display: block;
    padding: 6px 10px;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: 6px;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}
.sidebar-card .toc-list a:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
}

/* ===================================================
   通用卡片
   =================================================== */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s;
}
.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.card h3 { margin-top: 0; }

/* ===================================================
   章节网格与章节卡片（首页用）
   =================================================== */
.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}
.chapter-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
    border-left: 4px solid var(--primary);
    display: block;
}
.chapter-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}
.chapter-card .ch-num {
    display: inline-block;
    background: var(--primary);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    text-align: center;
    line-height: 36px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 10px;
}
.chapter-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 6px;
}
.chapter-card p {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin: 0;
    line-height: 1.5;
}
.chapter-card .tag {
    display: inline-block;
    background: var(--gray-100);
    color: var(--gray-600);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-top: 8px;
}
/* 四阶段颜色 */
.chapter-card.phase-1 { border-left-color: var(--primary); }
.chapter-card.phase-1 .ch-num { background: var(--primary); }
.chapter-card.phase-2 { border-left-color: var(--accent); }
.chapter-card.phase-2 .ch-num { background: var(--accent); }
.chapter-card.phase-3 { border-left-color: var(--warning); }
.chapter-card.phase-3 .ch-num { background: var(--warning); }
.chapter-card.phase-4 { border-left-color: var(--purple); }
.chapter-card.phase-4 .ch-num { background: var(--purple); }

/* ===================================================
   知识卡片（info-box 系列）
   =================================================== */
.info-box {
    border-radius: var(--radius);
    padding: 1.2rem 1.5rem;
    margin: 1.5rem 0;
}
.info-box.blue   { background: var(--primary-light);  border-left: 4px solid var(--primary); }
.info-box.green  { background: var(--accent-light);   border-left: 4px solid var(--accent); }
.info-box.yellow { background: var(--warning-light);  border-left: 4px solid var(--warning); }
.info-box.red    { background: var(--danger-light);   border-left: 4px solid var(--danger); }
.info-box.purple { background: var(--purple-light);   border-left: 4px solid var(--purple); }
.info-box.teal   { background: var(--teal-light);     border-left: 4px solid var(--teal); }
.info-box .box-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.info-box p { margin-bottom: 0.5rem; }
.info-box p:last-child { margin-bottom: 0; }

/* ===================================================
   对比表格
   =================================================== */
.compare-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.compare-table th {
    background: var(--primary);
    color: white;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}
.compare-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.9rem;
    color: var(--gray-700);
}
.compare-table tr:last-child td { border-bottom: none; }
.compare-table tr:hover td { background: var(--gray-50); }

/* ===================================================
   旧版流程步骤（简单横排）
   =================================================== */
.flow-steps {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 1.5rem 0;
}
.flow-step {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 8px 18px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}
.flow-arrow {
    color: var(--gray-400);
    font-size: 1.2rem;
}

/* ===================================================
   数据统计格
   =================================================== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}
.stat-item {
    background: white;
    border-radius: var(--radius);
    padding: 1.2rem;
    text-align: center;
    box-shadow: var(--shadow);
}
.stat-item .num {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    display: block;
}
.stat-item .label {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ===================================================
   章节底部导航
   =================================================== */
.chapter-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--gray-200);
    gap: 1rem;
}
.chapter-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    padding: 12px 20px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all 0.2s;
    max-width: 48%;
}
.chapter-nav a:hover {
    box-shadow: var(--shadow-md);
    background: var(--primary-light);
}
.chapter-nav a.next { margin-left: auto; }
.chapter-nav .nav-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 400;
    display: block;
}

/* ===================================================
   页脚
   =================================================== */
.site-footer {
    background: var(--gray-800);
    color: var(--gray-300);
    text-align: center;
    padding: 2rem;
    font-size: 0.85rem;
    margin-top: 2rem;
}
.site-footer a {
    color: var(--primary-light);
    text-decoration: none;
}
.site-footer a:hover { text-decoration: underline; }

/* ===================================================
   生活案例框
   =================================================== */
.life-example {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: var(--radius);
    padding: 1.2rem 1.5rem;
    margin: 1.2rem 0;
    position: relative;
}
.life-example::before {
    content: "💡 生活案例";
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--warning);
    display: block;
    margin-bottom: 6px;
}

/* ===================================================
   个人案例框（用户亲身经历，专属高亮）
   =================================================== */
.personal-case {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border: 2px solid #6ee7b7;
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
    position: relative;
}
.personal-case::before {
    content: "👤 你的亲身经历";
    font-weight: 700;
    font-size: 0.85rem;
    color: #065f46;
    display: block;
    margin-bottom: 8px;
}
.personal-case p,
.personal-case li {
    color: #064e3b;
}

/* ===================================================
   关键概念框
   =================================================== */
.key-concept {
    background: linear-gradient(135deg, #cffafe, #a5f3fc);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 1.2rem 1.5rem;
    margin: 1.2rem 0;
}
.key-concept::before {
    content: "🔑 核心概念";
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--primary-dark);
    display: block;
    margin-bottom: 6px;
}

/* ===================================================
   误区提示（保留解剖学设计）
   =================================================== */
.misconception {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid var(--danger);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 1.2rem 1.5rem;
    margin: 1.2rem 0;
}
.misconception .myth {
    color: var(--danger);
    font-weight: 700;
    text-decoration: line-through;
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
}
.misconception .truth {
    color: var(--accent);
    font-weight: 700;
    display: block;
    font-size: 0.95rem;
}

/* ===================================================
   病理预告（轻量钩子，不深讲）
   =================================================== */
.pathology-preview {
    background: linear-gradient(135deg, #fff1f2, #ffe4e6);
    border-left: 4px solid #f43f5e;
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 1.2rem 1.5rem;
    margin: 1.2rem 0;
}
.pathology-preview::before {
    content: "🔮 病理预告";
    font-weight: 700;
    font-size: 0.85rem;
    color: #e11d48;
    display: block;
    margin-bottom: 6px;
}
.pathology-preview p { color: #9f1239; margin-bottom: 0.4rem; }
.pathology-preview p:last-child { margin-bottom: 0; }
.pathology-preview .condition {
    display: inline-block;
    background: #fecdd3;
    color: #9f1239;
    padding: 1px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* ===================================================
   CS 类比框（深色青蓝风格，区别于解剖学深紫蓝）
   =================================================== */
.cs-analogy {
    background: linear-gradient(135deg, #0c1a2e 0%, #0c4a6e 100%);
    color: #e0f2fe;
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
    position: relative;
    overflow: hidden;
}
.cs-analogy::before {
    content: '💻';
    position: absolute;
    top: -10px;
    right: 10px;
    font-size: 4rem;
    opacity: 0.12;
}
.cs-analogy .cs-title {
    font-weight: 700;
    font-size: 1rem;
    color: #67e8f9;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.cs-analogy p,
.cs-analogy li { color: #bae6fd; margin-bottom: 0.4rem; }
.cs-analogy strong { color: #e0f2fe; }
.cs-analogy code {
    background: rgba(255,255,255,0.12);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.88em;
    color: #67e8f9;
}
.cs-analogy ul,
.cs-analogy ol {
    margin-left: 1.4rem;
    margin-top: 0.3rem;
}

/* ===================================================
   【新组件】流程图系统
   用于展示调节链 A→B→C→D 和负反馈回路
   =================================================== */

/* 流程图外壳 */
.flow-diagram {
    background: #f0fdfe;
    border: 2px solid #a5f3fc;
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
    overflow-x: auto;
}
.flow-diagram .fd-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* 线性调节链（flex 横排，自动换行） */
.fd-chain {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    row-gap: 10px;
}

/* 节点 */
.fd-node {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    border: 2px solid transparent;
    line-height: 1.4;
    text-align: center;
}
.fd-node.fn-start   { background: #cffafe; color: #0c4a6e; border-color: #22d3ee; }
.fd-node.fn-default { background: #e0f2fe; color: #0369a1; border-color: #7dd3fc; }
.fd-node.fn-result  { background: #dcfce7; color: #166534; border-color: #86efac; }
.fd-node.fn-alert   { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.fd-node.fn-organ   { background: #ede9fe; color: #5b21b6; border-color: #c4b5fd; }
.fd-node.fn-hormone { background: #fef3c7; color: #92400e; border-color: #fbbf24; }
.fd-node.fn-brain   { background: #fdf2f8; color: #9d174d; border-color: #f9a8d4; }

/* 箭头 */
.fd-arrow {
    color: var(--primary);
    font-size: 1.3rem;
    flex-shrink: 0;
    line-height: 1;
    font-weight: 700;
    padding: 0 2px;
}
.fd-arrow.inhibit  { color: var(--danger); }
.fd-arrow.feedback { color: var(--purple); }

/* 负反馈回路盒子 */
.fd-loop-box {
    background: white;
    border: 2px solid #a5f3fc;
    border-radius: 14px;
    padding: 1.5rem 1.5rem 1.2rem;
    margin: 1rem 0;
    position: relative;
}
.fd-loop-badge {
    position: absolute;
    top: -12px;
    left: 1.5rem;
    background: var(--primary);
    color: white;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.fd-loop-badge.positive { background: #e11d48; }

.fd-loop-feedback-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fee2e2;
    border-radius: 8px;
    padding: 10px 14px;
    margin-top: 12px;
    font-size: 0.87rem;
    color: #991b1b;
    border-left: 3px solid var(--danger);
}
.fd-loop-feedback-row .fb-label {
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ===================================================
   【新组件】机制框（mechanism-box）
   用于深层机制解析，CS类比的升级版
   =================================================== */
.mechanism-box {
    background: linear-gradient(135deg, #0c1a2e 0%, #083344 100%);
    color: #e0f2fe;
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
    position: relative;
    overflow: hidden;
}
.mechanism-box::before {
    content: '⚙️';
    position: absolute;
    top: -8px;
    right: 12px;
    font-size: 4rem;
    opacity: 0.1;
}
.mechanism-box .mb-title {
    font-weight: 700;
    font-size: 1rem;
    color: #67e8f9;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.mechanism-box p,
.mechanism-box li { color: #bae6fd; margin-bottom: 0.4rem; }
.mechanism-box strong { color: #e0f2fe; }
.mechanism-box code {
    background: rgba(255,255,255,0.12);
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.88em;
    color: #a5f3fc;
    font-family: "Consolas", "Monaco", monospace;
}
.mechanism-box ul { margin-left: 1.4rem; margin-top: 0.3rem; }
.mechanism-box .mb-formula {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(103,232,249,0.3);
    border-radius: 8px;
    padding: 0.8rem 1.2rem;
    margin: 0.8rem 0;
    font-family: "Consolas", "Monaco", monospace;
    font-size: 0.92rem;
    color: #a5f3fc;
    text-align: center;
}

/* ===================================================
   【新组件】正常值范围卡片（data-card）
   展示生理正常范围，颜色警示区间
   =================================================== */
.data-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.2rem 1.5rem;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: var(--shadow);
}
.data-card .dc-label {
    font-weight: 700;
    color: var(--gray-800);
    font-size: 0.95rem;
    min-width: 120px;
}
.data-card .dc-range {
    flex: 1;
}
.data-card .dc-normal {
    display: inline-block;
    background: #dcfce7;
    color: #166534;
    padding: 3px 12px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-right: 6px;
}
.data-card .dc-note {
    font-size: 0.82rem;
    color: var(--gray-500);
    margin-top: 4px;
}
.data-card .dc-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

/* ===================================================
   章节导读框（chapter-intro 重设计）
   模块1：📌 导读
   =================================================== */
.chapter-intro {
    background: linear-gradient(135deg, #cffafe, #ecfeff);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 1.5rem;
    margin: 0 0 2.5rem 0;
}
.chapter-intro .ci-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 0.8rem;
}
.chapter-intro .ci-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 700;
}
.chapter-intro .ci-phase {
    font-size: 0.82rem;
    color: var(--primary-dark);
    font-weight: 600;
}
.chapter-intro h3 {
    color: var(--primary-dark);
    font-size: 1rem;
    margin-bottom: 0.6rem;
    margin-top: 0;
}
.chapter-intro .ci-anatomy-link {
    font-size: 0.85rem;
    color: var(--gray-600);
    background: white;
    display: inline-block;
    padding: 4px 12px;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid var(--gray-300);
}
.chapter-intro .ci-anatomy-link strong { color: var(--primary-dark); }
.chapter-intro .intro-hooks {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 0.8rem;
}
.chapter-intro .intro-hooks li {
    background: white;
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 0.88rem;
    color: var(--gray-700);
    border-left: 3px solid var(--primary);
    box-shadow: var(--shadow);
}
.chapter-intro .intro-hooks li::before {
    content: "❓ ";
}

/* ===================================================
   FAQ 模块
   =================================================== */
.faq-section { margin: 1.5rem 0; }
.faq-item {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 0.8rem;
    overflow: hidden;
}
.faq-q {
    background: var(--gray-50);
    padding: 0.8rem 1.2rem;
    font-weight: 700;
    color: var(--gray-800);
    border-bottom: 1px solid var(--gray-200);
}
.faq-q::before { content: 'Q: '; color: var(--primary); }
.faq-a {
    padding: 0.8rem 1.2rem;
    color: var(--gray-700);
}
.faq-a::before { content: 'A: '; color: var(--accent); font-weight: 700; }

/* ===================================================
   图示占位框
   =================================================== */
.diagram-box {
    background: white;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--gray-500);
    font-size: 0.9rem;
}

/* ===================================================
   场景卡片（scenarios.html 用）
   =================================================== */
.scenario-card {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 16px;
    padding: 2rem;
    margin: 1.5rem 0;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.scenario-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(14,116,144,0.1);
}
.scenario-card .scenario-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.scenario-card .scenario-icon {
    font-size: 2.5rem;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ecfeff, #cffafe);
    border-radius: 16px;
    flex-shrink: 0;
}
.scenario-card .scenario-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gray-900);
}
.scenario-card .scenario-subtitle {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-top: 2px;
}
.scenario-card .system-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin: 4px 4px 0 0;
    background: var(--gray-100);
    color: var(--gray-700);
}
.scenario-card .system-tag.active  { background: #cffafe;  color: #0c4a6e; }
.scenario-card .system-tag.warn    { background: #fef3c7;  color: #92400e; }
.scenario-card .system-tag.danger  { background: #fee2e2;  color: #991b1b; }
.scenario-card .system-tag.success { background: #d1fae5;  color: #065f46; }
.scenario-card .system-tag.purple  { background: #ede9fe;  color: #5b21b6; }

/* ===================================================
   首页专属内容区组件
   =================================================== */

/* ---- 区块容器 ---- */
.home-section { margin: 2.8rem 0; }
.home-section-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 1.2rem;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gray-200);
}
.home-section-header h2 {
    margin: 0;
    font-size: 1.35rem;
    color: var(--gray-900);
    border: none;
    padding: 0;
    display: inline;
}
.section-sub {
    font-size: 0.85rem;
    color: var(--gray-500);
}

/* ---- 阶段标签 ---- */
.phase-label {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin: 1.2rem 0 0.8rem;
    letter-spacing: 0.02em;
}
.phase-green  { background: #dcfce7; color: #15803d; }
.phase-yellow { background: #fef9c3; color: #92400e; }
.phase-orange { background: #ffedd5; color: #9a3412; }
.phase-blue   { background: #dbeafe; color: #1e40af; }

/* ---- 工具横条网格 ---- */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
}
.tool-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    text-decoration: none !important;
    border: 1.5px solid transparent;
    transition: all 0.2s;
}
.tool-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.1); }
.tool-icon { font-size: 1.6rem; flex-shrink: 0; line-height: 1; }
.tool-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 3px; }
.tool-desc { font-size: 0.8rem; opacity: 0.75; }

.tool-teal   { background: #f0fdfa; border-color: #99f6e4; color: #115e59 !important; }
.tool-cyan   { background: #ecfeff; border-color: #a5f3fc; color: #0c4a6e !important; }
.tool-green  { background: #f0fdf4; border-color: #86efac; color: #166534 !important; }
.tool-blue   { background: #eff6ff; border-color: #bfdbfe; color: #1e40af !important; }
.tool-amber  { background: #fffbeb; border-color: #fde68a; color: #92400e !important; }
.tool-purple { background: #faf5ff; border-color: #d8b4fe; color: #6b21a8 !important; }
.tool-orange { background: #fff7ed; border-color: #fed7aa; color: #9a3412 !important; }

.tool-teal:hover   { background: #ccfbf1; border-color: #2dd4bf; }
.tool-cyan:hover   { background: #cffafe; border-color: #22d3ee; }
.tool-green:hover  { background: #dcfce7; border-color: #4ade80; }
.tool-blue:hover   { background: #dbeafe; border-color: #93c5fd; }
.tool-amber:hover  { background: #fef3c7; border-color: #fbbf24; }
.tool-purple:hover { background: #f3e8ff; border-color: #c084fc; }
.tool-orange:hover { background: #ffedd5; border-color: #fb923c; }

/* ---- 系统联动网格 ---- */
.systems-flow-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.sf-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: all 0.2s;
}
.sf-item:hover { background: #ecfeff; border-color: #a5f3fc; transform: translateY(-2px); }
.sf-icon { font-size: 1.5rem; }
.sf-name { font-weight: 600; font-size: 0.88rem; color: var(--gray-900); }
.sf-desc { font-size: 0.78rem; color: var(--gray-500); line-height: 1.4; }

/* ===================================================
   导航系统：下拉菜单 / 汉堡按钮 / 侧边栏 / FAB
   =================================================== */

/* ---- 下拉菜单 ---- */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
    display: flex !important;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    user-select: none;
}
.nav-arrow {
    font-size: 0.65em;
    transition: transform 0.2s;
    display: inline-block;
}
.nav-dropdown.open .nav-arrow { transform: rotate(180deg); }

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.06);
    padding: 16px;
    z-index: 1000;
    gap: 12px;
}
.nav-dropdown.open .nav-dropdown-menu { display: flex; }
.chapters-menu { min-width: 640px; }
.tools-menu    { min-width: 200px; }

.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 7px solid white;
}

.dropdown-group { flex: 1; min-width: 0; }
.dropdown-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 10px 6px;
}
.nav-dropdown-menu a {
    display: block;
    padding: 7px 10px;
    border-radius: 7px;
    color: #334155 !important;
    font-size: 0.84rem;
    text-decoration: none !important;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.nav-dropdown-menu a:hover  { background: #f0fdfe; color: var(--primary) !important; }
.nav-dropdown-menu a.active { background: #cffafe; color: var(--primary-dark) !important; font-weight: 600; }

/* ---- 汉堡按钮 ---- */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 12px;
    flex-shrink: 0;
}
.nav-hamburger span {
    display: block;
    height: 2px;
    background: white;
    border-radius: 2px;
}

/* ---- 遮罩层 ---- */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1100;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.nav-overlay.show { display: block; }

/* ---- 侧边栏 ---- */
.nav-sidebar {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background: white;
    z-index: 1200;
    overflow-y: auto;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 32px rgba(0,0,0,0.2);
}
.nav-sidebar.open { right: 0; }

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 60px;
    background: linear-gradient(135deg, #0c4a6e, #0e7490);
    color: white;
    font-weight: 600;
    font-size: 0.92rem;
    position: sticky;
    top: 0;
    z-index: 1;
}
.sidebar-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.15s;
    border-radius: 4px;
}
.sidebar-close:hover { color: white; background: rgba(255,255,255,0.15); }

.sidebar-body { padding: 8px 0 32px; }

.sidebar-section {
    padding: 12px 20px 4px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 4px;
}
.sidebar-link {
    display: block;
    padding: 10px 20px;
    color: var(--gray-700);
    text-decoration: none;
    font-size: 0.88rem;
    border-left: 3px solid transparent;
    transition: all 0.15s;
}
.sidebar-link:hover  { background: #f0fdfe; color: var(--primary); border-left-color: var(--primary-light); }
.sidebar-link.active { background: #cffafe; color: var(--primary-dark); border-left-color: var(--primary); font-weight: 600; }

/* ---- FAB 返回首页 ---- */
.fab-home {
    position: fixed;
    bottom: 28px;
    right: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0e7490, #0c4a6e);
    color: white !important;
    text-decoration: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 4px 20px rgba(14,116,144,0.45);
    z-index: 900;
    transition: all 0.22s;
}
.fab-home:hover {
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 8px 28px rgba(14,116,144,0.6);
}
.fab-home::after {
    content: '返回首页';
    position: absolute;
    right: 58px;
    top: 50%;
    transform: translateY(-50%);
    background: #1e293b;
    color: white;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.fab-home:hover::after { opacity: 1; }

/* ===================================================
   首页英雄区（青蓝渐变）
   =================================================== */
.index-hero {
    background: linear-gradient(135deg, #0c1a2e 0%, #0c4a6e 55%, #0e7490 100%);
    padding: 64px 24px 52px;
    position: relative;
    overflow: hidden;
}
.index-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}
.index-hero-inner {
    max-width: 820px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
}
.index-hero-badge {
    display: inline-block;
    background: rgba(103,232,249,0.15);
    border: 1px solid rgba(103,232,249,0.3);
    color: #67e8f9;
    padding: 5px 18px;
    border-radius: 20px;
    font-size: 0.82rem;
    margin-bottom: 20px;
    letter-spacing: 0.02em;
}
.index-hero-title {
    font-size: 3.6rem;
    font-weight: 800;
    margin: 0 0 12px;
    background: linear-gradient(135deg, #ffffff 0%, #67e8f9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}
.index-hero-sub {
    font-size: 1.1rem;
    color: #94a3b8;
    margin: 0 0 36px;
}
.index-hero-stats {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 20px 8px;
    margin-bottom: 32px;
    gap: 0;
}
.ihs-item { text-align: center; padding: 0 24px; }
.ihs-divider {
    width: 1px;
    height: 36px;
    background: rgba(255,255,255,0.15);
    flex-shrink: 0;
}
.ihs-num {
    display: block;
    font-size: 2.2rem;
    font-weight: 800;
    color: #22d3ee;
    line-height: 1;
}
.ihs-label {
    display: block;
    font-size: 0.78rem;
    color: #94a3b8;
    margin-top: 4px;
}
.index-hero-cta {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}
.hero-btn-primary {
    background: #0e7490;
    color: white !important;
    text-decoration: none !important;
    padding: 13px 30px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 4px 20px rgba(14,116,144,0.5);
}
.hero-btn-primary:hover {
    background: #0c6280;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(14,116,144,0.65);
}
.hero-btn-outline {
    background: rgba(255,255,255,0.08);
    color: white !important;
    text-decoration: none !important;
    padding: 13px 30px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.22);
    transition: all 0.2s;
}
.hero-btn-outline:hover { background: rgba(255,255,255,0.15); transform: translateY(-2px); }

.index-hero-organs {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}
.index-hero-organs span {
    font-size: 1.8rem;
    opacity: 0.6;
    display: inline-block;
    transition: all 0.3s;
    cursor: default;
    animation: organFloat 3s ease-in-out infinite;
}
.index-hero-organs span:nth-child(1) { animation-delay: 0s; }
.index-hero-organs span:nth-child(2) { animation-delay: 0.35s; }
.index-hero-organs span:nth-child(3) { animation-delay: 0.7s; }
.index-hero-organs span:nth-child(4) { animation-delay: 1.05s; }
.index-hero-organs span:nth-child(5) { animation-delay: 1.4s; }
.index-hero-organs span:nth-child(6) { animation-delay: 1.75s; }
.index-hero-organs span:nth-child(7) { animation-delay: 2.1s; }
.index-hero-organs span:nth-child(8) { animation-delay: 2.45s; }
.index-hero-organs span:hover { opacity: 1; transform: scale(1.35) translateY(-5px); }

@keyframes organFloat {
    0%, 100% { opacity: 0.5; transform: translateY(0); }
    50%       { opacity: 0.85; transform: translateY(-6px); }
}

/* ===================================================
   响应式
   =================================================== */
@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    .sidebar { display: none; }
    .page-hero { padding: 1.5rem 1rem 0.5rem; }
    .page-hero h1 { font-size: 1.6rem; }
    .breadcrumb { padding: 0.8rem 1rem 0; }
    .top-nav-inner { padding: 0 1rem; }
    .top-nav .nav-links { display: none; }
    .nav-hamburger { display: flex; }
    .chapter-grid { grid-template-columns: 1fr; }
    .chapter-nav { flex-direction: column; }
    .chapter-nav a { max-width: 100%; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .flow-steps { justify-content: center; }
    .fd-chain { row-gap: 10px; }
    .systems-flow-grid { grid-template-columns: repeat(2, 1fr); }
    .tools-grid { grid-template-columns: 1fr; }
    .home-section-header { flex-direction: column; gap: 2px; }

    .index-hero { padding: 44px 20px 40px; }
    .index-hero-title { font-size: 2.4rem; }
    .index-hero-sub { font-size: 0.95rem; margin-bottom: 24px; }
    .index-hero-stats { padding: 16px 4px; }
    .ihs-item { padding: 0 14px; }
    .ihs-num { font-size: 1.7rem; }

    .fab-home { bottom: 20px; right: 16px; width: 44px; height: 44px; font-size: 1.15rem; }
    .fab-home::after { display: none; }

    .scenario-card .scenario-header { flex-direction: column; text-align: center; }
    .data-card { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .chapters-menu { min-width: unset; }
}

/* ===================================================
   打印样式
   =================================================== */
@media print {
    .top-nav, .sidebar, .chapter-nav, .site-footer, .fab-home { display: none; }
    .main-content { grid-template-columns: 1fr; }
    body { background: white; }
    .cs-analogy, .mechanism-box { background: #f0fdfe !important; color: #0c4a6e !important; }
}
