/* ===================================================================
   InvestLearning - Premium Editorial Minimalist System (简约高级学术出版级蓝白色系)
   Benchmarked on Swiss International Style, Stripe Press & Oxford Marine Blue.
   Features 10 Progressive Monochromatic Blue Gradients across modules.
   =================================================================== */

:root {
  /* 1. Base Canvas & Cards: Natural Warm Alabaster Paper & Crisp Pure White */
  --bg-primary: #FBFBFA;              /* 画布底色：天然雪花石膏暖纸色 (Warm Alabaster) */
  --bg-secondary: #FFFFFF;            /* 内容卡片：纯净无瑕白 (Crisp Pure White) */
  --bg-tertiary: #F3F3F0;             /* 次级卡片与底衬：柔和暖灰砂石 (Muted Stone Sand) */
  --bg-surface: #EAEAE6;              /* 交互悬停底色 (Subtle Surface Hover) */
  --bg-card: #FFFFFF;
  --bg-glass: rgba(251, 251, 250, 0.95);
  --bg-code: #131720;                 /* 终端与代码区：深邃克制黑石墨 (Obsidian Graphite) */
  --bg-code-header: #1A1F2C;          /* 代码头部底色 */

  /* 2. Neutral Ink & Structural Hairline Borders */
  --text-primary: #18191C;            /* 主标题与主文本：高对比度深碳墨黑 (Deep Carbon Ink) */
  --text-secondary: #484A51;          /* 正文与阐述：自然玄石墨 (Charcoal Slate) */
  --text-muted: #71737D;              /* 辅助说明与元数据：柔和石墨灰 (Muted Zinc Slate) */
  --text-dim: #9FA1AC;                /* 弱化标签与边线 (Dim Slate) */

  --border-primary: #E5E5E0;          /* 极细主边框：低饱和自然石灰线 (Hairline Stone) */
  --border-subtle: #EFEFEA;           /* 极淡内部次级分隔线 */
  --border-dark: #272C38;             /* 深色代码区边框 */
  --border-focus: #1E3A5F;            /* 聚焦状态边框：牛津藏青 */

  /* 3. Primary Brand Accent: Oxford Marine Navy Blue (高级牛津海事先锋蓝) */
  --theme-blue: #1E3A5F;              /* 核心高雅主蓝 (Oxford Marine Blue) */
  --theme-blue-hover: #152A45;        /* 悬停加深蓝 */
  --theme-blue-light: rgba(30, 58, 95, 0.05);   /* 5% 极淡优雅蓝洗 */
  --theme-blue-subtle: rgba(30, 58, 95, 0.025); /* 2.5% 微弱呼吸底 */
  --theme-blue-border: rgba(30, 58, 95, 0.18);  /* 18% 克制高雅边框 */

  /* Backward Compatibility Semantic Aliases */
  --claude-terracotta: var(--theme-blue);
  --claude-terracotta-hover: var(--theme-blue-hover);
  --claude-terracotta-light: var(--theme-blue-light);
  --claude-terracotta-border: var(--theme-blue-border);
  --accent-gold: #8B6E3F;             /* 高级温润金棕 */
  --accent-gold-soft: rgba(139, 110, 63, 0.06);
  --accent-blue: var(--theme-blue);
  --accent-blue-soft: var(--theme-blue-light);
  --accent-green: #2B6858;            /* 沉稳英伦墨绿 (British Racing Green) */
  --accent-green-soft: rgba(43, 104, 88, 0.06);
  --accent-red: #A83A32;              /* 优雅庞贝深红 (Pompeian Red) */
  --accent-red-soft: rgba(168, 58, 50, 0.06);
  --accent-purple: #3B4B74;
  --accent-sage: #4E6B66;
  --accent-slate: #3B536B;
  --accent-ochre: #8F6A3B;

  /* 4. 10 Module Distinct Monochromatic Blue Gradients (十模块单色系高雅蓝阶) */
  --mod-01-color: #0F243E; /* 模块01 宏观周期：深渊午夜蓝 (Abyssal Navy) */
  --mod-01-bg: rgba(15, 36, 62, 0.05);
  --mod-01-border: rgba(15, 36, 62, 0.18);

  --mod-02-color: #152E4E; /* 模块02 微观盘口：普鲁士海蓝 (Prussian Blue) */
  --mod-02-bg: rgba(21, 46, 78, 0.05);
  --mod-02-border: rgba(21, 46, 78, 0.18);

  --mod-03-color: #1B385E; /* 模块03 财务估值：牛津学术蓝 (Oxford Navy) */
  --mod-03-bg: rgba(27, 56, 94, 0.05);
  --mod-03-border: rgba(27, 56, 94, 0.18);

  --mod-04-color: #22436F; /* 模块04 价格行为：皇家海事蓝 (Imperial Navy) */
  --mod-04-bg: rgba(34, 67, 111, 0.05);
  --mod-04-border: rgba(34, 67, 111, 0.18);

  --mod-05-color: #2A4F82; /* 模块05 量化多因子：波罗的海蓝 (Baltic Blue) */
  --mod-05-bg: rgba(42, 79, 130, 0.05);
  --mod-05-border: rgba(42, 79, 130, 0.18);

  --mod-06-color: #335C95; /* 模块06 组合风控：钢青海蓝 (Steel Marine) */
  --mod-06-bg: rgba(51, 92, 149, 0.05);
  --mod-06-border: rgba(51, 92, 149, 0.18);

  --mod-07-color: #3D6AA8; /* 模块07 交易心理：北欧雾蓝 (Nordic Mist) */
  --mod-07-bg: rgba(61, 106, 168, 0.05);
  --mod-07-border: rgba(61, 106, 168, 0.18);

  --mod-08-color: #4879BC; /* 模块08 期权衍生品：冰川岩蓝 (Glacier Slate) */
  --mod-08-bg: rgba(72, 121, 188, 0.05);
  --mod-08-border: rgba(72, 121, 188, 0.18);

  --mod-09-color: #5488D0; /* 模块09 特殊套利：阿尔卑斯湖蓝 (Alpine Lake) */
  --mod-09-bg: rgba(84, 136, 208, 0.05);
  --mod-09-border: rgba(84, 136, 208, 0.18);

  --mod-10-color: #6197E4; /* 模块10 实盘工程：极地晴空蓝 (Polar Cerulean) */
  --mod-10-bg: rgba(97, 151, 228, 0.05);
  --mod-10-border: rgba(97, 151, 228, 0.18);

  /* Shadows: Feather-soft, ambient non-blurry shadows */
  --shadow-sm: 0 1px 2px 0 rgba(24, 25, 28, 0.03);
  --shadow-md: 0 3px 6px -1px rgba(24, 25, 28, 0.04), 0 2px 4px -1px rgba(24, 25, 28, 0.02);
  --shadow-lg: 0 8px 16px -2px rgba(24, 25, 28, 0.05), 0 4px 6px -2px rgba(24, 25, 28, 0.02);

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --radius-full: 9999px;
  --header-height: 60px;
  --sidebar-width: 320px;
  --transition-fast: 0.12s ease;
  --transition-normal: 0.22s ease;
}

/* ===================================================================
   Dark Mode: Obsidian Charcoal & Soft French Slate Blue (高级黑曜石暗调)
   =================================================================== */
[data-theme="dark"] {
  --bg-primary: #101114;              /* 暗黑画布：黑曜石深岩 (Obsidian Slate) */
  --bg-secondary: #17181D;            /* 暗黑卡片：石墨深灰 (Graphite Card) */
  --bg-tertiary: #1E2027;             /* 次级底衬 (Subtle Dark Slate) */
  --bg-surface: #272A34;              /* 悬停面 */
  --bg-card: #17181D;
  --bg-glass: rgba(17, 18, 21, 0.95);
  --bg-code: #0A0B0E;
  --bg-code-header: #14151B;

  --text-primary: #F3F3F5;            /* 主文本：珍珠象牙白 (Pearl White) */
  --text-secondary: #B4B6C0;          /* 正文：高级冷银灰 (Cool Silver) */
  --text-muted: #7A7C88;              /* 辅助说明：中性岩灰 */
  --text-dim: #545662;

  --border-primary: #252731;          /* 暗黑主边框：沉稳微弱暗线 */
  --border-subtle: #1B1D25;
  --border-dark: #22242D;
  --border-focus: #7FA8DA;

  --theme-blue: #7FA8DA;              /* 暗黑模式高雅法式板岩蓝 (French Slate Blue) */
  --theme-blue-hover: #98BEEB;
  --theme-blue-light: rgba(127, 168, 218, 0.10);
  --theme-blue-subtle: rgba(127, 168, 218, 0.05);
  --theme-blue-border: rgba(127, 168, 218, 0.25);

  --claude-terracotta: var(--theme-blue);
  --claude-terracotta-hover: var(--theme-blue-hover);
  --claude-terracotta-light: var(--theme-blue-light);
  --claude-terracotta-border: var(--theme-blue-border);
  --accent-gold: #C2A26A;
  --accent-gold-soft: rgba(194, 162, 106, 0.10);
  --accent-blue: var(--theme-blue);
  --accent-blue-soft: var(--theme-blue-light);
  --accent-green: #4FA88F;
  --accent-green-soft: rgba(79, 168, 143, 0.10);
  --accent-red: #D6635A;
  --accent-red-soft: rgba(214, 99, 90, 0.10);
  --accent-purple: #8B9CC7;
  --accent-sage: #759B93;
  --accent-slate: #7393B3;
  --accent-ochre: #C49E69;

  /* 10 Module Blue Gradients (Dark Mode) */
  --mod-01-color: #8BB2E5;
  --mod-01-bg: rgba(139, 178, 229, 0.10);
  --mod-01-border: rgba(139, 178, 229, 0.25);

  --mod-02-color: #8FB7EA;
  --mod-02-bg: rgba(143, 183, 234, 0.10);
  --mod-02-border: rgba(143, 183, 234, 0.25);

  --mod-03-color: #94BCF0;
  --mod-03-bg: rgba(148, 188, 240, 0.10);
  --mod-03-border: rgba(148, 188, 240, 0.25);

  --mod-04-color: #99C2F5;
  --mod-04-bg: rgba(153, 194, 245, 0.10);
  --mod-04-border: rgba(153, 194, 245, 0.25);

  --mod-05-color: #9EC7FA;
  --mod-05-bg: rgba(158, 199, 250, 0.10);
  --mod-05-border: rgba(158, 199, 250, 0.25);

  --mod-06-color: #A4CEFF;
  --mod-06-bg: rgba(164, 206, 255, 0.10);
  --mod-06-border: rgba(164, 206, 255, 0.25);

  --mod-07-color: #B0D4FF;
  --mod-07-bg: rgba(176, 212, 255, 0.10);
  --mod-07-border: rgba(176, 212, 255, 0.25);

  --mod-08-color: #BCD9FF;
  --mod-08-bg: rgba(188, 217, 255, 0.10);
  --mod-08-border: rgba(188, 217, 255, 0.25);

  --mod-09-color: #C8E0FF;
  --mod-09-bg: rgba(200, 224, 255, 0.10);
  --mod-09-border: rgba(200, 224, 255, 0.25);

  --mod-10-color: #D4E6FF;
  --mod-10-bg: rgba(212, 230, 255, 0.10);
  --mod-10-border: rgba(212, 230, 255, 0.25);
}
/* Typography */
  --font-serif: "Newsreader", "Georgia", "Cambria", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  /* Layout Constants */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  --header-height: 64px;
  --sidebar-width: 330px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}



/* ===================================================================
   Base Elements & Reset
   =================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  letter-spacing: -0.01em;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

a {
  color: var(--claude-terracotta);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--claude-terracotta-hover);
  text-decoration: underline;
}

.text-accent {
  color: var(--claude-terracotta) !important;
  font-weight: 600;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-primary);
  border-radius: var(--radius-full);
}

/* App Wrapper */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===================================================================
   Top Navigation Bar (Header)
   =================================================================== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: var(--shadow-sm);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-brand:hover { text-decoration: none; }

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--claude-terracotta-light);
  border: 1px solid var(--claude-terracotta-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--claude-terracotta);
}

.brand-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: var(--claude-terracotta-light);
  color: var(--claude-terracotta);
  border: 1px solid var(--claude-terracotta-border);
}

.nav-center-menu {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-item-btn {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.nav-item-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  text-decoration: none;
}

.nav-item-btn.active {
  background: var(--claude-terracotta-light);
  color: var(--claude-terracotta);
  font-weight: 600;
  border: 1px solid var(--claude-terracotta-border);
}

.nav-right-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle-btn, .sidebar-toggle-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-primary);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover, .sidebar-toggle-btn:hover {
  background: var(--bg-surface);
  border-color: var(--claude-terracotta);
  color: var(--claude-terracotta);
}

/* ===================================================================
   Main Workspace Layout
   =================================================================== */
.main-wrapper {
  display: flex;
  flex: 1;
  position: relative;
}

/* Left Sidebar */
.course-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-primary);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow: hidden;
}

.sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  margin-bottom: 10px;
}

.search-icon {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-right: 6px;
}

.search-box input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.82rem;
  outline: none;
}

.module-tree-container {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
}

/* Module Group & Items */
.module-group {
  margin-bottom: 4px;
}

.module-header {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all var(--transition-fast);
}

.module-header:hover {
  background: var(--bg-tertiary);
}

.module-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
}

.module-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
}

.module-chevron {
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.module-group.expanded .module-chevron {
  transform: rotate(90deg);
}

.lesson-list {
  display: none;
  padding: 2px 0 6px;
}

.module-group.expanded .lesson-list {
  display: block;
}

.lesson-item {
  padding: 8px 16px 8px 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-secondary);
  border-left: 3px solid transparent;
  transition: all var(--transition-fast);
}

.lesson-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.lesson-item.active {
  background: var(--claude-terracotta-light);
  color: var(--claude-terracotta);
  border-left-color: var(--claude-terracotta);
  font-weight: 600;
}

.lesson-left-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border: 1px solid var(--border-primary);
}

/* ===================================================================
   Center Content Area
   =================================================================== */
.content-area {
  flex: 1;
  padding: 36px 48px 80px;
  max-width: 1080px;
  margin: 0 auto;
}

/* Intro Overview Card (Shown only once) */
.intro-overview-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.overview-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--claude-terracotta);
  background: var(--claude-terracotta-light);
  border: 1px solid var(--claude-terracotta-border);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

/* Lesson Header */
.lesson-card-header {
  margin-bottom: 24px;
}

.lesson-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.lesson-title-main {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.lesson-tags {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
}

.meta-chip b {
  color: var(--text-primary);
}

.learning-objectives-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 22px;
}

.learning-objectives-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.objectives-list {
  list-style: none;
  padding-left: 0;
}

.objectives-list li {
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  position: relative;
  padding-left: 18px;
  line-height: 1.55;
}

.objectives-list li::before {
  content: "•";
  color: var(--claude-terracotta);
  font-weight: bold;
  position: absolute;
  left: 0;
}

/* Content Tabs */
.content-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-primary);
  margin-bottom: 24px;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--claude-terracotta);
  border-bottom-color: var(--claude-terracotta);
  font-weight: 600;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ===================================================================
   Typography, Quarto Callouts & Math Blocks (Strict 3 Colors)
   =================================================================== */
.prose {
  line-height: 1.75;
  font-size: 0.94rem;
  color: var(--text-secondary);
}

.prose h3 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--text-primary);
  margin: 26px 0 12px;
  font-weight: 600;
}

.prose p {
  margin-bottom: 14px;
}

.prose strong {
  color: var(--text-primary);
}

/* Quarto Callout Containers (Monochrome or Terracotta) */
.callout {
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 22px 0;
  border-left: 4px solid var(--border-primary);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.callout-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.callout-note {
  border-left-color: var(--text-primary);
}

.callout-warning, .callout-info, .callout-tip {
  border-left-color: var(--claude-terracotta);
  background: var(--claude-terracotta-light);
}

.callout-warning .callout-title, .callout-tip .callout-title {
  color: var(--claude-terracotta);
}


.callout-body {
  font-size: 0.90rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.callout-body p {
  margin: 0 0 8px 0;
}

.callout-body p:last-child {
  margin-bottom: 0;
}

/* Chapter Progression Stepper (Inline Micro-Timeline) */
.chapter-stepper-box {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.chapter-stepper-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.chapter-stepper-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.chapter-stepper-counter {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  padding: 1px 7px;
  border-radius: 10px;
}

.chapter-stepper-track {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.chapter-stepper-track::-webkit-scrollbar {
  height: 3px;
}

.chapter-stepper-track::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 3px;
}

.step-node {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid var(--border-primary);
  background: var(--bg-primary);
  color: var(--text-secondary);
  transition: all 0.15s ease;
  cursor: pointer;
  line-height: 1.4;
}

.step-node:hover {
  border-color: var(--claude-terracotta);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.step-node.current {
  background: rgba(204, 90, 54, 0.12);
  border-color: var(--claude-terracotta);
  color: var(--claude-terracotta);
  font-weight: 700;
}

[data-theme="dark"] .step-node.current {
  background: rgba(217, 119, 87, 0.18);
  border-color: var(--claude-terracotta);
  color: #ff8c6b;
}

.step-node-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.step-node.current .step-node-num {
  background: var(--claude-terracotta);
  color: #ffffff;
}

.step-node-curr-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--claude-terracotta);
}

.step-track-sep {
  color: var(--border-primary);
  font-size: 0.75rem;
  flex-shrink: 0;
  user-select: none;
  display: inline-flex;
  align-items: center;
}

.callout-body ul.label-list {
  margin: 6px 0 0 0;
}

.mermaid-wrap svg {
  max-width: 100% !important;
  height: auto !important;
}

/* 三位一体就近图文卡片 */
.diagram-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 22px;
  margin: 24px 0;
  box-shadow: var(--shadow-sm);
}

.diagram-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.diagram-title {
  font-family: var(--font-serif);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
}

.diagram-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.diagram-svg-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 0;
}

.diagram-svg-container svg {
  max-width: 100%;
  height: auto;
}

/* 标签式段落排版 (Strict List Style) */
.label-list {
  list-style: none;
  margin: 14px 0 22px;
  padding-left: 0;
}

.label-list li {
  margin-bottom: 12px;
  line-height: 1.65;
  font-size: 0.92rem;
  position: relative;
  padding-left: 18px;
  color: var(--text-secondary);
}

.label-list li::before {
  content: "•";
  color: var(--claude-terracotta);
  font-weight: bold;
  position: absolute;
  left: 0;
}

.label-list li strong {
  color: var(--text-primary);
}

/* KaTeX 独立行公式容器 */
.math-block {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 18px 0;
  text-align: center;
  overflow-x: auto;
  font-family: var(--font-serif);
}

.math-formula {
  font-size: 1.15rem;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.math-domain {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.inline-math {
  font-family: var(--font-mono);
  background: var(--bg-tertiary);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.85em;
  color: var(--text-primary);
}

/* ===================================================================
   Code Blocks (Answer Branch Implementation)
   =================================================================== */
.code-container {
  background: var(--bg-code);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-md);
  margin: 18px 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.code-header-bar {
  background: var(--bg-code-header);
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-dark);
}

.code-lang-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.code-btn {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  border: 1px solid var(--border-dark);
  background: var(--bg-code);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.code-btn:hover {
  background: var(--bg-code-header);
  color: #FFFFFF;
}

.code-pre {
  padding: 18px 20px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  color: #E2DFD8;
  overflow-x: auto;
  white-space: pre;
}

/* ===================================================================
   Q&A Section (Answer Branch Directly Displayed)
   =================================================================== */
.qa-accordion {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.qa-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.qa-header {
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background: var(--bg-secondary);
  transition: background var(--transition-fast);
}

.qa-header:hover {
  background: var(--bg-tertiary);
}

.qa-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.qa-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: var(--claude-terracotta-light);
  color: var(--claude-terracotta);
  border: 1px solid var(--claude-terracotta-border);
}

.qa-toggle-icon {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.qa-body {
  display: none;
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.9rem;
  line-height: 1.65;
  background: var(--bg-primary);
}

.qa-card.open .qa-body {
  display: block;
}

.qa-answer-content ul.label-list {
  margin: 6px 0;
  padding-left: 18px;
}

.qa-answer-content code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 2px 5px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-primary);
}

.qa-hint-box {
  background: var(--bg-tertiary);
  border-left: 3px solid var(--border-primary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.qa-answer-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
}

/* ===================================================================
   Visualizer Lab Section (Standalone)
   =================================================================== */
.interactive-visualizer-section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 30px 40px;
}

.visualizer-top-header {
  margin-bottom: 24px;
}

.visualizer-title {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.visualizer-nav-pills {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.viz-pill {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.viz-pill:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.viz-pill.active {
  background: var(--claude-terracotta);
  color: #FFFFFF;
  border-color: var(--claude-terracotta);
}

.visualizer-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.visualizer-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-title-group h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.card-title-group p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Canvas Wrappers */
.canvas-wrapper {
  width: 100%;
  height: 340px;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ===================================================================
   Anna's Archive Classical Library Section (Standalone)
   =================================================================== */
.library-section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 30px 40px;
}

.library-top-header h2 {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.library-top-header p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.book-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.book-card:hover {
  transform: translateY(-2px);
  border-color: var(--claude-terracotta);
}

.book-title-cn {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.book-author-line {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.book-takeaway {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 14px;
}

.book-card-actions {
  display: flex;
  gap: 8px;
}

.book-btn {
  flex: 1;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-primary);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  text-align: center;
  transition: all var(--transition-fast);
}

.book-btn:hover {
  background: var(--bg-surface);
  border-color: var(--claude-terracotta);
}

.book-btn.primary {
  background: var(--claude-terracotta);
  color: #FFFFFF;
  border-color: var(--claude-terracotta);
}

/* ===================================================================
   Footer & Modal
   =================================================================== */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-primary);
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--claude-terracotta);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(4px);
}

.modal-content-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  max-width: 580px;
  width: 90%;
  padding: 28px;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-left: 4px solid var(--claude-terracotta);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  animation: slideIn 0.25s ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}


/* Mermaid Diagram Flowchart Wrappers */
.mermaid-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: auto;
  padding: 16px 0;
}

.mermaid-wrap pre.mermaid {
  font-family: var(--font-sans);
  background: transparent;
  border: none;
  color: var(--text-primary);
  text-align: center;
  margin: 0;
  padding: 0;
}


/* Individual Investor Step-by-Step Practical Guide */
ol.step-guide-list {
  margin: 14px 0 22px 0;
  padding-left: 22px;
}

ol.step-guide-list > li {
  margin-bottom: 14px;
  font-size: 0.92rem;
  line-height: 1.72;
  color: var(--text-secondary);
}

ol.step-guide-list > li strong {
  color: var(--text-primary);
  font-weight: 700;
}

ol.step-guide-list ul {
  margin-top: 6px;
  padding-left: 18px;
}

ol.step-guide-list ul li {
  margin-bottom: 5px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.course-sidebar.collapsed {
  display: none !important;
}

/* Prevent duplicate MathML text rendering in KaTeX */
.katex-mathml {
  display: none !important;
}


/* Enlarged Scientific Diagram Container & Fullscreen Lightbox */
.diagram-svg-container {
  width: 100%;
  overflow-x: auto;
  padding: 8px 0;
  border-radius: var(--radius-sm);
  transition: box-shadow 0.15s ease;
}

.diagram-svg-container:hover {
  box-shadow: 0 0 0 2px var(--claude-terracotta-border);
}

.diagram-svg-container svg {
  width: 100% !important;
  min-width: 680px;
  height: auto !important;
  display: block;
  margin: 0 auto;
}

.diagram-lightbox-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  width: 94vw;
  height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.diagram-lightbox-toolbar {
  padding: 12px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.diagram-lightbox-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.diagram-lightbox-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zoom-level-badge {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--claude-terracotta);
  padding: 4px 10px;
  background: var(--claude-terracotta-light);
  border-radius: var(--radius-sm);
  min-width: 58px;
  text-align: center;
}

.diagram-lightbox-viewport {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px;
  background: var(--bg-primary);
}

.diagram-lightbox-stage {
  display: inline-block;
  background: var(--bg-primary);
  padding: 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}


/* Feynman Intuition Scaffolding Bridge Card (Anthropic 3-Color Aesthetic) */
.feynman-bridge-card {
  background: var(--bg-secondary);
  border: 1.5px solid var(--claude-terracotta);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 0 0 28px 0;
  box-shadow: var(--shadow-sm);
}

.feynman-bridge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-primary);
}

.feynman-bridge-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--claude-terracotta);
  display: flex;
  align-items: center;
  gap: 8px;
}

.feynman-bridge-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--claude-terracotta-light);
  color: var(--claude-terracotta);
}

.feynman-section {
  margin-bottom: 16px;
}

.feynman-sub-label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.feynman-analogy-text {
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--text-primary);
  margin: 0;
}

.feynman-jargon-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feynman-jargon-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 0.87rem;
  line-height: 1.6;
}

.feynman-jargon-term {
  font-weight: 700;
  color: var(--text-primary);
}

.feynman-jargon-arrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--claude-terracotta);
  margin: 0 4px;
}

.feynman-jargon-plain {
  color: var(--text-secondary);
}

.feynman-calc-box {
  background: var(--claude-terracotta-light);
  border: 1px dashed var(--claude-terracotta);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.89rem;
  line-height: 1.72;
  color: var(--text-primary);
}


/* Unified Single-Page Lesson Sections (All Expanded Vertically) */
.lesson-unified-section {
  display: block;
  margin-bottom: 42px;
  scroll-margin-top: 84px;
}

.lesson-section-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border-primary);
}

.lesson-section-num {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--claude-terracotta-light);
  color: var(--claude-terracotta);
  border: 1px solid var(--claude-terracotta-border);
  letter-spacing: 0.04em;
}

.lesson-section-heading {
  font-family: var(--font-serif);
  font-size: 1.32rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}


/* Fix Nested List Double-Bullet Bug (○ •) */
.prose ul.label-list ul,
.label-list ul {
  list-style: none !important;
  margin: 8px 0 6px 16px;
  padding-left: 12px;
  border-left: 2px solid var(--border-subtle);
}

/* Direct Result Data Dashboard Card (Anthropic 3-Color Institutional Style) */
.result-data-card {
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-primary);
  border-top: 3px solid var(--claude-terracotta);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin: 0 0 26px 0;
  box-shadow: var(--shadow-sm);
}

.result-data-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.result-data-title {
  font-family: var(--font-serif);
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--text-primary);
}

.result-data-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--claude-terracotta-light);
  color: var(--claude-terracotta);
}

.result-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.result-kpi-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.result-kpi-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.result-kpi-val {
  font-family: var(--font-mono);
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 3px;
}

.result-kpi-sub {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.result-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
}

.result-data-table th {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 700;
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1.5px solid var(--border-primary);
  white-space: nowrap;
}

.result-data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  line-height: 1.5;
}

.result-data-table tr:last-child td {
  border-bottom: none;
  color: var(--text-primary);
}

.result-table-footnote {
  margin-top: 12px;
  padding: 9px 14px;
  background: var(--bg-tertiary);
  border-left: 3px solid var(--claude-terracotta);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--text-primary);
}


/* Real-Time Cloud Sync Pill & Interactive Calculator Bar */
.live-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  padding: 3px 9px;
  border-radius: 999px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2B6858;
  display: inline-block;
  animation: livePulse 2.2s infinite ease-in-out;
}

.live-calc-bar {
  background: var(--bg-tertiary);
  border: 1px dashed var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
}


/* 1-Line Plain-Chinese Formula Translation Bar inside .math-block */
.math-plain-bar {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-primary);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text-secondary);
  text-align: center;
}

.math-plain-bar span {
  color: var(--claude-terracotta);
  font-weight: 600;
}

.math-plain-bar strong {
  color: var(--text-primary);
  font-weight: 600;
}


/* Trader's Action Card (Institutional Execution Sheet) */
.trader-action-card {
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-primary);
  border-left: 4px solid var(--claude-terracotta);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  margin: 0 0 24px 0;
  box-shadow: var(--shadow-sm);
}

.trader-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-primary);
}

.trader-card-title {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--claude-terracotta);
  display: flex;
  align-items: center;
  gap: 8px;
}

.trader-card-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--claude-terracotta-light);
  color: var(--claude-terracotta);
  border: 1px solid var(--claude-terracotta-border);
}

.trader-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.trader-grid-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.trader-item-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--claude-terracotta);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.trader-item-content {
  font-size: 0.86rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.trader-checklist-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 16px;
}

.trader-box-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.trader-calc-box {
  background: var(--claude-terracotta-light);
  border: 1px dashed var(--claude-terracotta);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
}


/* 10 Module Distinct Blue Concentrations in Sidebar & Badges */
.module-group[data-mod-idx="0"] .module-tag { background: var(--mod-01-bg); color: var(--mod-01-color); border: 1px solid var(--mod-01-border); }
.module-group[data-mod-idx="1"] .module-tag { background: var(--mod-02-bg); color: var(--mod-02-color); border: 1px solid var(--mod-02-border); }
.module-group[data-mod-idx="2"] .module-tag { background: var(--mod-03-bg); color: var(--mod-03-color); border: 1px solid var(--mod-03-border); }
.module-group[data-mod-idx="3"] .module-tag { background: var(--mod-04-bg); color: var(--mod-04-color); border: 1px solid var(--mod-04-border); }
.module-group[data-mod-idx="4"] .module-tag { background: var(--mod-05-bg); color: var(--mod-05-color); border: 1px solid var(--mod-05-border); }
.module-group[data-mod-idx="5"] .module-tag { background: var(--mod-06-bg); color: var(--mod-06-color); border: 1px solid var(--mod-06-border); }
.module-group[data-mod-idx="6"] .module-tag { background: var(--mod-07-bg); color: var(--mod-07-color); border: 1px solid var(--mod-07-border); }
.module-group[data-mod-idx="7"] .module-tag { background: var(--mod-08-bg); color: var(--mod-08-color); border: 1px solid var(--mod-08-border); }
.module-group[data-mod-idx="8"] .module-tag { background: var(--mod-09-bg); color: var(--mod-09-color); border: 1px solid var(--mod-09-border); }
.module-group[data-mod-idx="9"] .module-tag { background: var(--mod-10-bg); color: var(--mod-10-color); border: 1px solid var(--mod-10-border); }

.module-group[data-mod-idx="0"].expanded .module-header { border-left-color: var(--mod-01-color); }
.module-group[data-mod-idx="1"].expanded .module-header { border-left-color: var(--mod-02-color); }
.module-group[data-mod-idx="2"].expanded .module-header { border-left-color: var(--mod-03-color); }
.module-group[data-mod-idx="3"].expanded .module-header { border-left-color: var(--mod-04-color); }
.module-group[data-mod-idx="4"].expanded .module-header { border-left-color: var(--mod-05-color); }
.module-group[data-mod-idx="5"].expanded .module-header { border-left-color: var(--mod-06-color); }
.module-group[data-mod-idx="6"].expanded .module-header { border-left-color: var(--mod-07-color); }
.module-group[data-mod-idx="7"].expanded .module-header { border-left-color: var(--mod-08-color); }
.module-group[data-mod-idx="8"].expanded .module-header { border-left-color: var(--mod-09-color); }
.module-group[data-mod-idx="9"].expanded .module-header { border-left-color: var(--mod-10-color); }


/* Interactive Simulators & Diagnostic Sandbox Cards */
.interactive-simulator-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-left: 4px solid var(--claude-terracotta);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  margin: 26px 0;
  box-shadow: var(--shadow-sm);
}

.sim-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-primary);
}

.sim-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--claude-terracotta);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sim-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--claude-terracotta-light);
  color: var(--claude-terracotta);
  border: 1px solid var(--claude-terracotta-border);
}

.sim-btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sim-btn {
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-primary);
  background: var(--bg-primary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sim-btn:hover, .sim-btn.active {
  background: var(--claude-terracotta);
  color: #FFFFFF;
  border-color: var(--claude-terracotta);
}


/* ===================================================================
   Swiss & Editorial Luxury Polish Pack (瑞士国际主义与学术出版级高级质感)
   =================================================================== */

/* 1. Universal Tabular Numbers for High-Precision Financial Data */
.result-kpi-val, .result-data-table, .stat-metric-val, .feynman-calc-box, 
.trader-calc-box, .sim-control-label b, .heatmap-cell, .heatmap-table,
code, pre, .step-node-num, .qa-badge, .live-calc-bar input {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* 2. Custom Editorial Range Sliders (Institutional Bloomberg/Stripe Style) */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  background: var(--border-primary);
  border-radius: var(--radius-full);
  outline: none;
  transition: background var(--transition-fast);
  cursor: pointer;
  margin: 6px 0;
}

input[type="range"]:hover {
  background: var(--border-focus);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--theme-blue);
  border: 2.5px solid var(--bg-secondary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), 0 0 0 1px var(--theme-blue-border);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.18);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 0 0 3px var(--theme-blue-light);
}

input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(1.05);
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--theme-blue);
  border: 2.5px solid var(--bg-secondary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.18);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 0 0 3px var(--theme-blue-light);
}

/* 3. Live Breathing Pulse Indicator for Macro & Real-Time Data */
@keyframes livePulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(43, 104, 88, 0.55); }
  70% { transform: scale(1); box-shadow: 0 0 0 7px rgba(43, 104, 88, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(43, 104, 88, 0); }
}

.live-pulse-dot {
  display: inline-block;
  width: 7.5px;
  height: 7.5px;
  border-radius: 50%;
  background: #2B6858;
  margin-right: 6px;
  animation: livePulse 2.2s infinite ease-in-out;
}

/* 4. Frosted Glass Luxury Top Bar */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-primary);
  box-shadow: 0 1px 2px 0 rgba(24, 25, 28, 0.02);
}

/* 5. Refined Consistent Card Borders & Feather Elevation */
.feynman-bridge-card {
  border: 1px solid var(--border-primary);
  border-left: 3.5px solid var(--theme-blue);
  box-shadow: var(--shadow-sm);
  background: var(--bg-secondary);
}

.trader-action-card {
  border: 1px solid var(--border-primary);
  border-left: 3.5px solid var(--theme-blue);
  box-shadow: var(--shadow-sm);
}

.interactive-simulator-card {
  border: 1px solid var(--border-primary);
  border-left: 3.5px solid var(--theme-blue);
  box-shadow: var(--shadow-sm);
}

.book-card {
  border: 1px solid var(--border-primary);
  border-left: 3.5px solid var(--theme-blue);
  box-shadow: var(--shadow-sm);
}

/* 6. Refined Table Hover & Zebra Striping */
.result-data-table tbody tr:nth-child(even) {
  background: rgba(30, 58, 95, 0.015);
}

.result-data-table tbody tr:hover {
  background: rgba(30, 58, 95, 0.04);
}
