/* 新知 · 设计令牌 —— 唯一允许出现原始值的地方 */
@layer tokens, legacy, base, components, layout, pages, motion;

@font-face {
  font-family: "Geist";
  src: url("../assets/vendor/fonts/geist-sans-var.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* 纸面：教材内页的暖米，比纯白更"有机" */
  --paper: #f3f0e5;
  --paper-2: #faf7ec;
  --white: #ffffff;
  --smoke: #e8e4d5;
  --line: #d8d2c0;

  /* 墨 */
  --ink: #1f2a26;
  --muted: #5a675f;

  /* 双色：墨绿负责动作，赭红负责标记与强调（编号、印章、当前项） */
  --leaf: #1f5c41;
  --leaf-deep: #17462f;
  --leaf-wash: #dde8da;
  --rust: #a94b28;
  --rust-wash: #f6e6dc;
  --gold: #8a6a2f;

  /* 字体 */
  --font-ui: "Geist", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-word: "Iowan Old Style", "Source Serif 4", "Songti SC", Georgia, serif;
  /* 中文大标题走宋体：这是"教材"的字体记忆（Windows 上就是中易宋体） */
  --font-display: "Songti SC", "Source Han Serif SC", "Noto Serif SC", "SimSun", Georgia, serif;

  /* 字号：7 级 */
  --t-micro: 10px;   /* 仅用于底部 tab 标签与品牌副行 */
  --t-cap: 11px;
  --t-meta: 12px;
  --t-body: 14px;
  --t-lead: 16px;
  --t-h3: 18px;
  --t-h2: 22px;
  --t-h1: clamp(28px, 3.4vw, 38px);
  --t-display: clamp(34px, 5vw, 54px);
  --t-word: clamp(30px, 4.4vw, 44px);
  --t-home-title: clamp(40px, 4.4vw, 60px);
  --t-home-mobile: clamp(36px, 9.6vw, 44px);

  /* 圆角：5 档 */
  --r-hair: 2px;     /* 9px 采集印一类的微观圆角 */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;
  --r-bar: 26px;      /* 悬浮控件条（底部导航胶囊） */

  /* 间距：4 的倍数 */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;

  /* 层 */
  --z-base: 1;
  --z-sticky: 10;
  --z-nav: 45;
  --z-sheet: 60;
  --z-toast: 80;
  --z-route: 100;

  --shadow: 0 8px 28px #263b2712;
  --shadow-lift: 0 12px 36px #263b271a;
  --ease: cubic-bezier(.22, 1, .36, 1);

  /* 图版比例：教材插画 896×1200 */
  --plate-ratio: 896 / 1200;
  --plate-focus: center 32%;

  /* 插画上的描边（SVG user units 的视觉参照颜色） */
  --scene-outline: #fffdf2;
  --scene-glow: #b8892f;
  --scene-dim: #0d1f19;

  /* 玻璃透镜的文字色（无色瓷面需要自己的墨色） */
  --glass-ink: #14231b;
  --glass-muted: #3b4e43;
}

/* 双轨期：skip link 在旧版轨迹下也必须不可见（Phase 6 后由 base.css 接管） */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 80;
  padding: 12px 16px;
  background: #1f5c41;
  color: #fff;
  border-radius: 10px;
  font-size: 12px;
  transform: translateY(-200%);
}

.skip-link:focus-visible { transform: none; }

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #131a17;
    --paper-2: #1a231e;
    --white: #1d2721;
    --smoke: #26302a;
    --line: #38443c;
    --gold: #cfa969;
    --rust: #d98a63;
    --ink: #eef0e6;
    --muted: #a9b5a8;
    --leaf: #9ecfa8;
    --leaf-deep: #b9ddc1;
    --leaf-wash: #23352b;
    --rust: #e0a184;
    --rust-wash: #3a2620;
    --shadow: 0 8px 28px #0003;
    --shadow-lift: 0 12px 36px #0005;
    --glass-ink: #eaf2e6;
    --glass-muted: #c3d3c4;
  }
}
