/* app/static/style.css - 箴辅导 · 全局样式（Apple 主题 · 2026-10-09 剔除 sage 绿） */
* { -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ─── Apple 中性面（白底黑字，Action Blue accent；HIG）─── */
:root {
  --bg:       #ffffff;
  --bg-card:  #fafafc;
  --bg-hover: #f5f5f7;
  --bg-sunken:#f0f0f2;
  --border:   rgba(0,0,0,.08);
  --border-strong: rgba(0,0,0,.16);
  --text:     #1d1d1f;
  --text-mid: #333333;
  --text-dim: #7a7a7a;
  --accent:   #0066cc;
  --accent-hover: #0071e3;
  --accent-2: #0077ed;
  --accent-3: #004f9e;
  --accent-light: #eaf3fc;
  --accent-2-light: #dcebfb;
}

/* ─── P2.1 诊断中心：新增语义令牌（设计令牌规范 §8.1）─── */
:root {
  /* 三态（掌握/可学/不达：蓝-琥珀-灰，去品牌绿）*/
  --state-mastered-fg:        #0050a8;
  --state-mastered-bg:        #eaf3fc;
  --state-mastered-border:    #5aa0e6;
  --state-mastered-solid:     #0066cc;
  --state-learnable-fg:       #7E5210;
  --state-learnable-bg:       #FCF2DE;
  --state-learnable-border:   #A97516;
  --state-learnable-solid:    #8A5A12;
  --state-unreachable-fg:     #635F58;
  --state-unreachable-bg:     #f0f0f2;
  --state-unreachable-border: #8a8a8a;
  /* 判题（正确=蓝，错误=红，不再用绿）*/
  --state-correct-fg:         #0050a8;
  --state-correct-bg:         #eaf3fc;
  --state-correct-border:     #5aa0e6;
  --state-correct-solid:      #0066cc;
  --state-wrong-fg:           #b02a1e;
  --state-wrong-bg:           #fdebec;
  --state-wrong-border:       #d76058;
  --state-wrong-solid:        #d70015;
  /* 文字补强 */
  --text-meta:                #6e6e73;
  --focus-ring:               #0066cc;
  /* 成就徽章 */
  --badge-gold:               #7F631B;
  --badge-bg:                 #FCF2DE;
  --badge-border:             #A97516;
  --badge-locked-fg:          #7A7264;
  --badge-locked-bg:          #E4DED2;
  --badge-locked-bd:          #867E6E;
  /* 间距 */
  --space-1:4px;  --space-2:8px;   --space-3:12px; --space-4:16px;
  --space-5:20px; --space-6:24px;  --space-8:32px; --space-10:40px; --space-12:48px;
  /* 圆角 */
  --radius-sm:8px; --radius-md:12px; --radius-lg:16px;
  --radius-xl:20px; --radius-full:999px;
  /* 阴影（中性黑调，Apple 风格）*/
  --shadow-flat:  none;
  --shadow-raise: 0 4px 20px -6px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.05);
  --shadow-lift:  0 12px 40px -10px rgba(0,0,0,.14), 0 2px 6px rgba(0,0,0,.06);
  --shadow-hover: 0 8px 24px -8px rgba(0,0,0,.12), 0 2px 5px rgba(0,0,0,.05);
  --shadow-inset: inset 0 1px 2px rgba(0,0,0,.05);
  /* 边框宽度 */
  --bw-hair:1px; --bw-strong:2px; --bw-rail:3px;
  /* 控件/分隔可见边界（≥3:1，WCAG 1.4.11）*/
  --border-input: #c7c7cc;
  /* 动效 */
  --dur-fast:150ms; --dur-base:250ms; --dur-slow:400ms;
  --ease-out: cubic-bezier(.16,1,.3,1);
  /* 数字字体（圆润数字，无则回落）*/
  --font-num: ui-rounded, -apple-system, "PingFang SC", sans-serif;
}

/* ─── W3 组件令牌（grammar/reading/student_topic detail 三页上提至全局，消费全局 Apple 令牌）─── */
:root {
  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-serif: "Newsreader", "Source Han Serif SC", "Songti SC", serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --font-phonetic: "Doulos SIL", "Charis SIL", "Times New Roman", serif;
  /* 字阶（旧固定 px 档：ia-components 等在消费，保留勿删） */
  --fs-2xs:12px; --fs-xs:14px; --fs-sm:16px; --fs-md:20px; --fs-lg:24px; --fs-xl:32px; --fs-2xl:40px;
  /* 字阶（工作台 02 章定稿 9 档语义角色令牌，2026-10-31 落地；正本 ui-kit/tokens/app-tokens.css，逐字一致） */
  --fs-ltitle:clamp(26px,3.2vw,34px); --fs-h1:clamp(23px,2.6vw,28px);
  --fs-h2:clamp(20px,2.1vw,22px); --fs-h3:clamp(18px,1.8vw,20px);
  --fs-body:clamp(15px,1.5vw,16px); --fs-callout:clamp(14px,1.4vw,15px);
  --fs-sub:clamp(14px,1.3vw,15px); --fs-foot:13px; --fs-cap:12px;
  --fs-word:clamp(30px,3.6vw,40px);
  --lh-ltitle:1.2; --lh-h1:1.25; --lh-h2:1.3; --lh-h3:1.35; --lh-body:1.7; --lh-cap:1.6;
  --track-tight:-.01em; --track-body:0;
  --lh-tight:1.2; --lh-snug:1.35; --lh-base:1.6;
  --fw-regular:400; --fw-medium:500; --fw-semibold:600; --fw-bold:700;
  /* 间距补充 */
  --space-16:64px;
  --gap-sm:8px; --gap-md:16px; --gap-lg:24px;
  /* 表面 / 文字补充 */
  --surface-2:#f0f0f2;
  --text-strong:#1d1d1f;
  /* on-accent＝品牌蓝实底上的文字色（2026-10-18 升为正式基线令牌，与工作台 01 章同名；
     --accent-contrast 为既有同源别名，学习线老组件在用，两者值恒等勿分叉）*/
  --accent-contrast:#FFFFFF;
  --on-accent:#FFFFFF;
  --data-ink:#0A2540;
  /* 阴影补充 */
  --shadow-nav:0 1px 0 rgba(0,0,0,.06);
  /* 布局 */
  --maxw:1200px; --nav-h:56px;
  /* 视频播放器 */
  --video-bg:#1c1c1e;
  --video-radius:8px;
  --video-aspect:16/9;
  --video-placeholder-bg:#f0f0f2;
  /* 例句 */
  --example-border:#e5e5ea;
  --example-bg:#f5f5f7;
  /* 占位 / 骨架 */
  --placeholder-bg:#f0f0f2;
  --placeholder-border:#e5e5ea;
  --placeholder-text:#6e6e73;
  --placeholder-icon-color:#b0b0b5;
  /* 分类标签 */
  --tag-tense-bg:#f0f2f5;      --tag-tense-fg:#3d4a57;
  --tag-syntax-bg:#eaf3fc;     --tag-syntax-fg:#0050a8;
  --tag-morphology-bg:#f5f2ec; --tag-morphology-fg:#5a5240;
  --tag-voice-bg:#eef0f5;      --tag-voice-fg:#3f4a57;
  --tag-clause-bg:#f1eef5;     --tag-clause-fg:#513e50;
  --tag-radius:999px;
  --tag-fs:12px;
  /* 年级段 chip */
  --grade-chip-bg:#FFFFFF;
  --grade-chip-fg:#0050a8;
  --grade-chip-border:#0066cc;
  --grade-chip-fw:700;
  --grade-chip-fs:12px;
  --grade-chip-radius:999px;
  --grade-chip-pad:5px 12px;
  --grade-chip-key-opacity:1;
  --grade-chip-null-bg:#f0f0f2;
  --grade-chip-null-fg:#6e6e73;
  --grade-chip-null-border:#e5e5ea;
  --grade-chip-null-text:"年级待定";
  /* 批次胶囊（reading） */
  --batch-tag-bg:#f0f0f2;
  --batch-tag-fg:#4d4d52;
  --batch-tag-border:#dcdce0;
  /* 幻灯片占位（reading） */
  --slide-ph-bg:#f0f0f2;
  --slide-ph-fg:#6e6e73;
  --slide-ph-border:#e5e5ea;
}

/* 全局焦点环（§6.7）*/
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* reduced-motion 降级（§7.3）：状态靠颜色+形状+文案，不依赖动效 */
@media (prefers-reduced-motion: reduce) {
  .gm-kp, .dx-badge, .rv-card, .gm-progress-fill,
  .dx-nextup, .dx-achv, .gm-chip, .rv-q, .gm-legend,
  .dx-nu-item, .rv-gp, .rv-submit, .btn-primary, .gm-fbtn, .gm-back, .rv-back-top {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
  .gm-progress-fill { transition: none !important; }
  .animate-up { animation: none !important; opacity: 1; transform: none; }
}

/* ─── 标题排版（product：静态字阶，禁用 clamp 巨标 / 品牌 hero）─── */
.headline-display {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
}
.headline-section {
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -.01em;
  line-height: 1.25;
}

/* ─── 半透明边框（§3 universal craft floor）─── */
.border-translucent {
  border: 1px solid rgba(0,0,0,.06);
}
.border-translucent-light {
  border: 1px solid rgba(255,255,255,.12);
}

/* ─── 中性黑调阴影 ─── */
.shadow-tinted {
  box-shadow: 0 4px 20px -6px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.05);
}
.shadow-tinted-lg {
  box-shadow: 0 12px 40px -10px rgba(0,0,0,.14), 0 2px 6px rgba(0,0,0,.06);
}

/* ─── 导航栏 ─── */
.nav-bar {
  background: rgba(255,255,255,.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.nav-bar-scrolled {
  background: rgba(255,255,255,.95);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

/* ─── 功能卡片（§6 禁止 identical card grids：变体尺寸）─── */
.feature-card {
  transition: transform .25s ease, box-shadow .25s ease;
}
.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px -8px rgba(0,0,0,.12);
}

/* ─── 学生卡片 ─── */
.student-card {
  transition: transform .25s ease, box-shadow .25s ease;
}
.student-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 20px 48px -12px rgba(0,0,0,.16);
}

/* ─── CTA 按钮 ─── */
.btn-primary {
  background: var(--accent);
  color: var(--bg);
  transition: background .2s, transform .15s;
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(0,0,0,.16);
  transition: background .2s, border-color .2s;
}
.btn-ghost:hover {
  background: rgba(0,0,0,.03);
  border-color: rgba(0,0,0,.28);
}

/* ─── 滚动指示 ─── */
@keyframes gentle-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(6px); }
}
.bounce-gentle {
  animation: gentle-bounce 2.5s ease-in-out infinite;
}

/* ─── 步骤连接线 ─── */
.step-line::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -50%;
  width: 100%;
  height: 1px;
  background: rgba(0,0,0,.08);
}
.step-line:last-child::after {
  display: none;
}

/* ─── 折叠区（details/summary）─── */
details summary::-webkit-details-marker { display: none; }
details summary::marker { display: none; content: ''; }
details[open] summary .rotate-icon { transform: rotate(180deg); }

/* ─── 入场动画 ─── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-up {
  animation: fade-up 0.6s ease-out both;
}
.anim-d1 { animation-delay: 0.1s; }
.anim-d2 { animation-delay: 0.2s; }
.anim-d3 { animation-delay: 0.3s; }
.anim-d4 { animation-delay: 0.4s; }
.anim-d5 { animation-delay: 0.5s; }

/* ─── 响应式 ─── */
@media (max-width: 640px) {
  .headline-display {
    font-size: 1.5rem;
    line-height: 1.15;
  }
  .step-line::after { display: none; }
  .grid-cols-3 { grid-template-columns: repeat(3, 1fr) !important; gap: 0.5rem !important; }
}
