/* ==========================================================================
   tokens.css — 设计令牌
   风格：明亮圆润的 App 官网 / 冷白底 + 深墨字 + 蛙绿主色
   参考视觉语言：胶囊标签、大圆角卡片、柔和阴影、深浅区块交替
   ========================================================================== */

:root {
  /* ---- 色板 · 日间（冷白） ---- */
  --paper:        #fafbfd;
  --paper-deep:   #f2f4f8;
  --surface:      #ffffff;
  --surface-alt:  #f6f8fb;
  --ink:          #1b1d2a;
  --ink-2:        #4a4d5e;
  --muted:        #7c8091;
  --muted-2:      #a8acb9;
  --line:         rgba(27, 29, 42, .10);
  --line-soft:    rgba(27, 29, 42, .055);

  --brand:        #12684e;
  --brand-deep:   #0d513d;
  --brand-soft:   #e3f0ea;
  --brand-ghost:  rgba(18, 104, 78, .07);
  --accent:       #c9563b;
  --accent-soft:  #f8e9e4;
  --gold:         #a8823f;

  --on-brand:     #ffffff;

  /* ---- 质感：参考站是干净的，去掉纸纹 ---- */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  --grain-opacity: 0;

  --shadow-xs: 0 1px 2px rgba(27, 29, 42, .05);
  --shadow-sm: 0 2px 12px -4px rgba(27, 29, 42, .12);
  --shadow-md: 0 12px 32px -16px rgba(27, 29, 42, .22);
  --shadow-lg: 0 30px 70px -30px rgba(27, 29, 42, .38);

  /* ---- 字体 ---- */
  --font-sans: "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB",
               "MiSans", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Iowan Old Style", Georgia, "Times New Roman", "Songti SC",
                "Source Han Serif SC", serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Consolas, monospace;

  /* ---- 字阶 ---- */
  --fs-display: clamp(2.7rem, 6.6vw, 5.3rem);
  --fs-h1:      clamp(2.3rem, 5vw, 3.8rem);
  --fs-h2:      clamp(1.95rem, 3.6vw, 2.95rem);
  --fs-h3:      clamp(1.28rem, 1.9vw, 1.58rem);
  --fs-h4:      1.0625rem;
  --fs-lead:    clamp(1.05rem, 1.4vw, 1.2rem);
  --fs-body:    .9688rem;
  --fs-sm:      .875rem;
  --fs-xs:      .78rem;
  --fs-micro:   .6875rem;

  --lh-tight: 1.16;
  --lh-snug:  1.4;
  --lh-body:  1.78;

  /* ---- 间距 ---- */
  --s-1: 4px;   --s-2: 8px;   --s-3: 12px;  --s-4: 16px;
  --s-5: 24px;  --s-6: 32px;  --s-7: 44px;  --s-8: 60px;
  --s-9: 88px;  --s-10: 120px;

  --gutter: clamp(20px, 4.5vw, 56px);
  --maxw: 1240px;
  --maxw-narrow: 820px;

  /* ---- 形状：参考站偏圆润 ---- */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;
  --r-pill: 999px;

  --header-h: 72px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: .34s;
}

/* ---- 深色 · 夜读 ---- */
[data-theme="dark"] {
  --paper:        #10121a;
  --paper-deep:   #0b0d13;
  --surface:      #191c26;
  --surface-alt:  #141720;
  --ink:          #f2f3f8;
  --ink-2:        #c9ccd8;
  --muted:        #9296a6;
  --muted-2:      #6b6f80;
  --line:         rgba(242, 243, 248, .14);
  --line-soft:    rgba(242, 243, 248, .07);

  --brand:        #4fbf95;
  --brand-deep:   #7ad3af;
  --brand-soft:   #17281f;
  --brand-ghost:  rgba(79, 191, 149, .12);
  --accent:       #e0795c;
  --accent-soft:  #2c1d18;
  --gold:         #cda964;

  --on-brand:     #08120d;

  --grain-opacity: 0;
  --shadow-sm: 0 2px 12px -4px rgba(0, 0, 0, .5);
  --shadow-md: 0 12px 32px -16px rgba(0, 0, 0, .7);
  --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, .9);
}

/* 跟随系统（未手动指定时） */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:        #10121a;
    --paper-deep:   #0b0d13;
    --surface:      #191c26;
    --surface-alt:  #141720;
    --ink:          #f2f3f8;
    --ink-2:        #c9ccd8;
    --muted:        #9296a6;
    --muted-2:      #6b6f80;
    --line:         rgba(242, 243, 248, .14);
    --line-soft:    rgba(242, 243, 248, .07);
    --brand:        #4fbf95;
    --brand-deep:   #7ad3af;
    --brand-soft:   #17281f;
    --brand-ghost:  rgba(79, 191, 149, .12);
    --accent:       #e0795c;
    --accent-soft:  #2c1d18;
    --gold:         #cda964;
    --on-brand:     #08120d;
    --grain-opacity: 0;
    --shadow-sm: 0 2px 12px -4px rgba(0, 0, 0, .5);
    --shadow-md: 0 12px 32px -16px rgba(0, 0, 0, .7);
    --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, .9);
  }
}
