/*
 * chengmaai.cn 设计 Token（Phase 2a · 颜好看）
 * 真相源：design/DESIGN.md（YAML 契约）+ design-choice.json.brandOverride
 * 品牌色实测来源：https://www.changjing.cc/css/style.css?v=20261117（抓取 2026-11-17）
 * 消费方式：EJS 模板 <link rel="stylesheet" href="/css/tokens.css">，组件只用 var(--*)，不写裸值。
 * 无构建链、无 @import、无外链字体——首屏 <3s、微信内置浏览器可用。
 */

:root {
  /* ── A1 identity：场景学社品牌资产（真实 VI，非默认色） ───────────── */
  --brand: #E65100;          /* 场景学社 --primary：工业橙，CTA/飞轮高亮/关键数字 */
  --brand-light: #FF6D00;    /* 场景学社 --primary-light */
  --brand-pale: #FFF3E0;     /* 场景学社 --primary-pale：选中态浅底 */
  --brand-deep: #BF360C;     /* 场景学社 --guanzi-red：深橙，白字按钮底（5.6:1） */
  --opc-blue: #1565C0;       /* 场景学社 --opc-blue：info 语义源 */
  --scene-green: #2E7D32;    /* 场景学社 --scene-green：success 语义源 */

  /* ── A1 中性：字阶与页面底 ─────────────────────────────────────── */
  --bg: #FAFAFA;             /* 场景学社 --bg-page */
  --page: #FAFAFA;
  --surface: #FFFFFF;        /* 场景学社 --bg-card */
  --raised: #F5F5F5;
  --ink: #1A1A1A;            /* 场景学社 --text-primary，正文/标题 */
  --muted: #555555;          /* 场景学社 --text-secondary，次要文字 */
  --ink-3: #999999;          /* 场景学社 --text-muted，meta/占位 */
  --border: #E6E3DC;         /* 暖灰描边，与纸白底同色系，不用默认纯灰 */
  --over-text: #FFFFFF;

  /* ── A2 semantic：四语义色（浅染底 + 深一档文字，实测对比见 DESIGN.md §2） */
  --info: #1565C0;
  --info-bg: #E3F2FD;
  --info-text: #0D47A1;
  --success: #2E7D32;
  --success-bg: #E8F5E9;
  --success-text: #1B5E20;
  --warning: #E65100;
  --warning-bg: #FFF3E0;
  --warning-text: #BF360C;
  --danger: #C62828;
  --danger-bg: #FBE9E7;
  --danger-text: #9B1C1C;

  /* ── accent 对（on-accent 用深墨，4.59:1，达 AA；不用白字） ────────── */
  --accent: #E65100;
  --on-accent: #1A1A1A;
  --ring: #E65100;

  /* ── A2 typography：字号 8 档（中文行高，正字距） ────────────────── */
  --font-ui: "PingFang SC", "Microsoft YaHei", sans-serif;
  --fs-caption: 13px;
  --fs-body-sm: 15px;
  --fs-body: 17px;
  --fs-lead: 22px;
  --fs-h3: 26px;
  --fs-h2: 34px;
  --fs-h1: 46px;
  --fs-display: 61px;
  --lh-display: 1.3;
  --lh-title: 1.35;
  --lh-body: 1.7;
  --lh-caption: 1.5;
  --tracking-caps: 0.08em;

  /* ── A2 spacing：4px 网格，只这些值 ─────────────────────────────── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-18: 72px;

  /* ── A2 radius / elevation / container ──────────────────────────── */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.10);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.16);
  --z-dropdown: 1000;
  --z-sticky: 1100;
  --z-modal: 1200;
  --z-toast: 1300;
  --container: 1040px;
  --container-wide: 1200px;

  /* ── motion：基准 150ms，入场 300–400ms ─────────────────────────── */
  --t-fast: 150ms;
  --t-enter: 320ms;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* ── B/C slot：组件别名（引用 A 层，不产生第二套值） ────────────────── */
:root {
  --btn-primary-bg: var(--brand-deep);
  --btn-primary-fg: var(--over-text);
  --btn-cta-bg: var(--brand);
  --btn-cta-fg: var(--on-accent);
  --btn-ghost-bg: transparent;
  --btn-ghost-fg: var(--ink);
  --btn-radius: var(--r-md);
  --btn-min-h: 44px;
  --input-bg: var(--surface);
  --input-border: var(--border);
  --input-focus: var(--ring);
  --input-error: var(--danger);
  --card-bg: var(--surface);
  --card-fg: var(--ink);
  --card-radius: var(--r-lg);
  --notice-info-bg: var(--info-bg);
  --notice-info-fg: var(--info-text);
  --notice-success-bg: var(--success-bg);
  --notice-success-fg: var(--success-text);
  --notice-warning-bg: var(--warning-bg);
  --notice-warning-fg: var(--warning-text);
  --notice-danger-bg: var(--danger-bg);
  --notice-danger-fg: var(--danger-text);
}

/* ── 浏览器表面（跟着出货的高级感） ─────────────────────────────────── */
::selection { background: var(--brand); color: var(--on-accent); }
::placeholder { color: var(--ink-3); opacity: 1; }
html { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }
body, input, textarea, select { caret-color: var(--brand); accent-color: var(--brand); }
.num, .price, time { font-variant-numeric: tabular-nums; }

/* ── 容器：随视口长，1440 屏不空，手机不挤 ─────────────────────────── */
.wrap { max-width: var(--container); margin: 0 auto; padding: 0 var(--space-6); }
@media (min-width: 1280px) { .wrap { max-width: var(--container-wide); } }
@media (max-width: 767px)  { .wrap { max-width: 100%; padding: 0 var(--space-3); } }

/* ── 节节奏：节内 48，节间 72/112 交替 ─────────────────────────────── */
.section { padding-top: var(--space-12); padding-bottom: var(--space-12); }
.section--loose { padding-top: var(--space-18); padding-bottom: var(--space-18); }

/* ── 入场动效（只做一次），reduced-motion 下全关 ───────────────────── */
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.enter { animation: rise var(--t-enter) var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
