/* ═══════════════════════════════════════════
   鬼谷子 · 原典精读 — Design System
   ═══════════════════════════════════════════ */

/* ─── Variables ─── */
:root {
  /* 核心色板 - 墨韵系列 */
  --ink-black: #1a1a1f;
  --ink-deep: #2d2d35;
  --ink-light: #3d3d48;

  /* 点缀色 - 朱砂金 */
  --vermillion: #c94043;
  --antique-gold: #d4a84b;
  --jade-green: #4a9e7d;

  /* 文字色 */
  --text-primary: #f5f0e8;
  --text-secondary: #a8a4a0;
  --text-muted: #6b6865;

  /* 功能色 */
  --highlight: rgba(201, 64, 67, 0.15);
  --glow: rgba(212, 168, 75, 0.3);
  --card-bg: var(--ink-deep);
  --card-border: var(--ink-light);
  --header-bg: rgba(26, 26, 31, 0.92);
  --body-bg: var(--ink-black);

  /* 字体 */
  --font-classical: 'Noto Serif SC', 'Source Han Serif CN', 'SimSun', serif;
  --font-modern: 'Outfit', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-english: 'Cormorant Garamond', 'Georgia', serif;

  /* 字号 */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --text-3xl: 3rem;
  --text-4xl: 4rem;

  /* 空间 */
  --space-unit: 8px;
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 40px;
  --space-xl: 64px;
  --space-2xl: 104px;

  /* 布局 */
  --max-width: 1400px;
  --sidebar-width: 280px;
  --card-radius: 12px;

  /* 动效 */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 200ms;
  --duration-normal: 400ms;
  --duration-slow: 600ms;
}

/* ─── Light Theme ─── */
[data-theme="light"] {
  --ink-black: #f5f0e8;
  --ink-deep: #ffffff;
  --ink-light: #e0dbd3;
  --text-primary: #1a1a1f;
  --text-secondary: #5a5755;
  --text-muted: #8a8785;
  --card-bg: #ffffff;
  --card-border: #e0dbd3;
  --header-bg: rgba(245, 240, 232, 0.92);
  --body-bg: #f5f0e8;
  --highlight: rgba(201, 64, 67, 0.08);
  --glow: rgba(212, 168, 75, 0.15);
}

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-modern);
  background: var(--body-bg);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--antique-gold); text-decoration: none; transition: color var(--duration-fast); }
a:hover { color: var(--vermillion); }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-md); }

/* ─── Typography ─── */
.font-classical { font-family: var(--font-classical); }
.font-english { font-family: var(--font-english); }

/* ─── Language Visibility ─── */
[data-lang="zh"] .en-only { display: none !important; }
[data-lang="en"] .zh-only { display: none !important; }
[data-lang="bilingual"] .zh-only,
[data-lang="bilingual"] .en-only { display: block; }

/* ═══════════════ HEADER ═══════════════ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--card-border);
  transition: transform var(--duration-normal) var(--ease-out);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  text-decoration: none;
}

.logo-icon { width: 36px; height: 36px; }

.logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.logo-zh { font-family: var(--font-classical); font-weight: 700; font-size: var(--text-sm); }
.logo-en { font-family: var(--font-english); font-size: var(--text-xs); color: var(--text-secondary); letter-spacing: 0.05em; }

.header-nav { flex: 1; display: flex; justify-content: center; }
.nav-label {
  font-family: var(--font-classical);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  letter-spacing: 0.1em;
}

.header-actions { display: flex; align-items: center; gap: var(--space-sm); }

/* Language Switcher */
.lang-switcher { display: flex; gap: 2px; background: var(--ink-light); border-radius: 8px; padding: 3px; }

.lang-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-modern);
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--duration-fast);
  display: flex;
  align-items: center;
  gap: 1px;
}

.lang-btn.active {
  background: var(--antique-gold);
  color: var(--ink-black);
}

.lang-btn:hover:not(.active) { color: var(--text-primary); }
.lang-slash { opacity: 0.5; }

/* Theme Toggle */
.theme-toggle {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all var(--duration-fast);
  display: flex;
  align-items: center;
}

.theme-toggle:hover { color: var(--text-primary); background: var(--ink-light); }
.theme-toggle svg { width: 20px; height: 20px; }

[data-theme="dark"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: none; }

/* Reading Progress */
.reading-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--vermillion), var(--antique-gold));
  transition: width 100ms linear;
}

/* ═══════════════ HERO ═══════════════ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: var(--space-xl) var(--space-md);
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.3;
}

.hero-orb--1 {
  width: 600px;
  height: 600px;
  background: var(--vermillion);
  top: -200px;
  right: -100px;
  animation: orbFloat 20s ease-in-out infinite;
}

.hero-orb--2 {
  width: 500px;
  height: 500px;
  background: var(--antique-gold);
  bottom: -150px;
  left: -100px;
  animation: orbFloat 25s ease-in-out infinite reverse;
}

.hero-noise {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.5;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

.hero-content {
  position: relative;
  text-align: center;
  max-width: 800px;
  animation: heroFadeIn 1.2s var(--ease-out) both;
}

@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: var(--highlight);
  border: 1px solid rgba(201, 64, 67, 0.2);
  border-radius: 100px;
  font-size: var(--text-sm);
  color: var(--vermillion);
  font-weight: 500;
  margin-bottom: var(--space-lg);
  animation: heroFadeIn 1.2s var(--ease-out) 0.2s both;
}

.hero-title {
  margin-bottom: var(--space-md);
  animation: heroFadeIn 1.2s var(--ease-out) 0.3s both;
}

.hero-title-zh {
  display: block;
  font-family: var(--font-classical);
  font-size: clamp(3rem, 10vw, var(--text-4xl));
  font-weight: 700;
  letter-spacing: 0.15em;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--antique-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.hero-title-en {
  display: block;
  font-family: var(--font-english);
  font-size: clamp(1.5rem, 4vw, var(--text-2xl));
  font-weight: 400;
  font-style: italic;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  margin-top: var(--space-xs);
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 600px;
  margin: 0 auto var(--space-lg);
  animation: heroFadeIn 1.2s var(--ease-out) 0.4s both;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  animation: heroFadeIn 1.2s var(--ease-out) 0.5s both;
}

.stat { text-align: center; }
.stat-num {
  display: block;
  font-family: var(--font-english);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--antique-gold);
}
.stat-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--card-border);
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  background: linear-gradient(135deg, var(--vermillion), #a83235);
  color: var(--text-primary);
  border-radius: 100px;
  font-family: var(--font-classical);
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: 0.1em;
  transition: all var(--duration-normal) var(--ease-out);
  animation: heroFadeIn 1.2s var(--ease-out) 0.6s both;
  box-shadow: 0 4px 24px rgba(201, 64, 67, 0.3);
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(201, 64, 67, 0.4);
  color: var(--text-primary);
}

.hero-cta svg { animation: ctaBounce 2s ease-in-out infinite; }
@keyframes ctaBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* ═══════════════ FILTER BAR ═══════════════ */
.filter-bar {
  position: sticky;
  top: 64px;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--card-border);
  padding: var(--space-sm) 0;
}

.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.filter-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-tabs::-webkit-scrollbar { display: none; }

.filter-tab {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-modern);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 8px 20px;
  border-radius: 100px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-fast);
}

.filter-tab:hover { color: var(--text-primary); }
.filter-tab.active {
  background: var(--antique-gold);
  color: var(--ink-black);
}

.filter-count {
  font-size: var(--text-sm);
  color: var(--text-muted);
  white-space: nowrap;
}

/* ═══════════════ CHAPTER GRID ═══════════════ */
.chapter-grid-section {
  padding: var(--space-xl) 0 var(--space-2xl);
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-md);
}

/* Chapter Card */
.chapter-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: var(--space-md);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
}

.chapter-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--vermillion), var(--antique-gold));
  opacity: 0;
  transition: opacity var(--duration-normal);
}

.chapter-card:hover {
  transform: translateY(-4px);
  border-color: var(--antique-gold);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3), 0 0 60px var(--glow);
}

.chapter-card:hover::before { opacity: 1; }

.chapter-card.completed { border-color: var(--jade-green); }
.chapter-card.completed::after {
  content: '✓';
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: 24px;
  height: 24px;
  background: var(--jade-green);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.card-number {
  font-family: var(--font-english);
  font-size: var(--text-3xl);
  font-weight: 300;
  color: var(--antique-gold);
  opacity: 0.4;
  line-height: 1;
  min-width: 48px;
}

.card-titles { flex: 1; }

.card-title-zh {
  font-family: var(--font-classical);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.card-title-en {
  font-family: var(--font-english);
  font-size: var(--text-sm);
  font-style: italic;
  color: var(--text-secondary);
}

.card-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-sm);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.card-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.card-tag {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--highlight);
  color: var(--vermillion);
  font-weight: 500;
}

.card-tag--gold { background: rgba(212, 168, 75, 0.12); color: var(--antique-gold); }
.card-tag--jade { background: rgba(74, 158, 125, 0.12); color: var(--jade-green); }

.card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.card-difficulty {
  display: flex;
  gap: 2px;
}

.diff-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-light);
}

.diff-dot.filled { background: var(--antique-gold); }

/* ═══════════════ ARTICLE VIEW ═══════════════ */
.view-article { padding-top: 64px; }
.view-article.hidden { display: none; }
.view-index.hidden { display: none; }

.article-layout {
  display: flex;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Progress Sidebar */
.progress-sidebar {
  position: sticky;
  top: 80px;
  width: var(--sidebar-width);
  height: calc(100vh - 80px);
  flex-shrink: 0;
  overflow-y: auto;
  padding: var(--space-lg) var(--space-md);
  scrollbar-width: thin;
  scrollbar-color: var(--ink-light) transparent;
}

.sidebar-inner { position: sticky; top: 0; }

.sidebar-title {
  font-family: var(--font-classical);
  font-size: var(--text-sm);
  color: var(--text-muted);
  letter-spacing: 0.15em;
  margin-bottom: var(--space-md);
  text-transform: uppercase;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--duration-fast);
  border-left: 2px solid transparent;
}

.sidebar-link:hover { color: var(--text-primary); background: var(--ink-light); }
.sidebar-link.active {
  color: var(--antique-gold);
  background: rgba(212, 168, 75, 0.08);
  border-left-color: var(--antique-gold);
}

.sidebar-link-icon {
  width: 18px;
  height: 18px;
  opacity: 0.6;
}

/* Article Content */
.article-content {
  flex: 1;
  min-width: 0;
  padding: var(--space-lg) var(--space-md);
  max-width: 960px;
}

/* Article Hero */
.article-hero {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--card-border);
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  transition: color var(--duration-fast);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-modern);
}

.article-back:hover { color: var(--antique-gold); }

.article-chapter-num {
  font-family: var(--font-english);
  font-size: var(--text-4xl);
  font-weight: 300;
  color: var(--antique-gold);
  opacity: 0.3;
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.article-title-zh {
  font-family: var(--font-classical);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.article-title-en {
  font-family: var(--font-english);
  font-size: var(--text-xl);
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.article-intro {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 640px;
}

/* ═══════════════ CONTENT SECTIONS ═══════════════ */
.content-section {
  margin-bottom: var(--space-xl);
  scroll-margin-top: 80px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--card-border);
}

.section-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--highlight);
  border-radius: 10px;
  color: var(--vermillion);
  flex-shrink: 0;
}

.section-title {
  font-family: var(--font-classical);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-primary);
}

.section-body { padding-left: 52px; }

/* Bilingual Block */
.bilingual-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

/* When bilingual mode has 3 columns, allow full-width English section */
.bilingual-col[style*="grid-column:1/-1"] {
  grid-column: 1 / -1;
}

.bilingual-col {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: var(--space-md);
}

.bilingual-col-header {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--card-border);
}

.bilingual-text {
  font-size: var(--text-base);
  line-height: 2;
}

.bilingual-text--zh {
  font-family: var(--font-classical);
  color: var(--text-primary);
}

.bilingual-text--en {
  font-family: var(--font-english);
  font-size: var(--text-lg);
  color: var(--text-primary);
  line-height: 1.8;
}

/* English translation subtitle below Chinese in bilingual mode */
.en-translation {
  font-family: var(--font-english);
  font-size: var(--text-base);
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 6px;
  line-height: 1.7;
}

.bilingual-line {
  padding: 4px 8px;
  border-radius: 4px;
  transition: background var(--duration-fast);
  cursor: pointer;
}

.bilingual-line:hover { background: var(--highlight); }
.bilingual-line.active { background: var(--highlight); }

/* Annotation Items */
.annotation-item {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.annotation-item:last-child { border-bottom: none; }

.annotation-word {
  font-family: var(--font-classical);
  font-weight: 600;
  color: var(--antique-gold);
  font-size: var(--text-lg);
}

.annotation-pinyin {
  font-family: var(--font-english);
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-style: italic;
  margin-left: 8px;
}

.annotation-meaning {
  margin-top: 4px;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* English annotation text — ensure readability */
.annotation-meaning.en-translation {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

/* Analysis Cards */
.analysis-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
}

.analysis-card-title {
  font-family: var(--font-classical);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.analysis-card-body {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.8;
}

/* Case Cards */
.case-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
  overflow: hidden;
}

.case-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--vermillion), var(--antique-gold));
}

.case-era {
  font-size: var(--text-xs);
  color: var(--antique-gold);
  font-weight: 600;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.case-title {
  font-family: var(--font-classical);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.case-body {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.8;
}

/* Tool Cards */
.tool-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
}

.tool-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-classical);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--jade-green);
  margin-bottom: var(--space-xs);
}

.tool-steps {
  list-style: none;
  counter-reset: step;
}

.tool-steps li {
  counter-increment: step;
  position: relative;
  padding-left: 32px;
  margin-bottom: 8px;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

.tool-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 22px;
  height: 22px;
  background: var(--ink-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--antique-gold);
}

/* Review Section */
.review-block {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
}

.review-question {
  font-family: var(--font-classical);
  font-weight: 600;
  color: var(--antique-gold);
  margin-bottom: var(--space-xs);
}

.review-answer {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.8;
}

/* Chapter Navigation */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--card-border);
}

.chapter-nav-btn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-sm) var(--space-md);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  color: inherit;
  text-decoration: none;
  transition: all var(--duration-fast);
  cursor: pointer;
  font-family: inherit;
  min-width: 160px;
}

.chapter-nav-btn:hover { border-color: var(--antique-gold); }
.chapter-nav-btn--next { text-align: right; margin-left: auto; }

.chapter-nav-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.chapter-nav-title {
  font-family: var(--font-classical);
  font-weight: 600;
  color: var(--text-primary);
}

/* ═══════════════ FOOTER ═══════════════ */
.site-footer {
  border-top: 1px solid var(--card-border);
  padding: var(--space-xl) 0;
  background: var(--ink-deep);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-title {
  font-family: var(--font-classical);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}
.footer-desc { font-size: var(--text-xs); color: var(--text-muted); }

.footer-links { display: flex; gap: var(--space-md); }
.footer-links a {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: color var(--duration-fast);
}
.footer-links a:hover { color: var(--antique-gold); }

.footer-copy {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.footer-divider { margin: 0 6px; }

/* ═══════════════ ANIMATIONS ═══════════════ */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--duration-slow) var(--ease-out), transform var(--duration-slow) var(--ease-out);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════ RESPONSIVE ═══════════════ */

/* Tablet */
@media (max-width: 1200px) {
  .progress-sidebar { display: none; }

  .article-layout { display: block; }

  .article-content {
    max-width: 100%;
    padding: var(--space-md);
  }

  .bilingual-block {
    grid-template-columns: 1fr;
  }

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

/* Mobile */
@media (max-width: 768px) {
  :root {
    --text-4xl: 2.5rem;
    --text-3xl: 2rem;
    --text-2xl: 1.5rem;
  }

  .header-inner { padding: 0 var(--space-sm); }
  .logo-text { display: none; }
  .header-nav { display: none; }

  .hero { min-height: 80vh; padding: var(--space-lg) var(--space-sm); }
  .hero-stats { flex-direction: column; gap: var(--space-sm); }
  .stat-divider { width: 40px; height: 1px; }

  .filter-bar { top: 64px; }
  .filter-row { flex-direction: column; align-items: flex-start; }

  .chapter-grid {
    grid-template-columns: 1fr;
  }

  .chapter-card { padding: var(--space-sm); }

  .article-content { padding: var(--space-sm); }

  .section-body { padding-left: 0; }

  .chapter-nav { flex-direction: column; }
  .chapter-nav-btn--next { text-align: left; }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

/* ═══════════════ SCROLLBAR ═══════════════ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--ink-light);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══════════════ SELECTION ═══════════════ */
::selection {
  background: var(--vermillion);
  color: var(--text-primary);
}
