/* ============================================================================
 * tokens.css —— 设计令牌的跨端唯一真源
 * 严格镜像 iOS `Shared/PlanetTheme.swift` 的全部取值，逐个色值换算自
 * `Color(red:green:blue:)` 的 0–1 浮点通道（换算公式 round(v*255)）。
 *
 * 改动纪律：只追加，不改旧值。任何新增 token 必须注明来源。
 * ========================================================================= */

:root {
  /* ---- 天空与草地（场景背景） ---- */
  --sky-top:        #9edbff;  /* Color(0.62, 0.86, 1.00) */
  --sky-bottom:     #e6f7ff;  /* Color(0.90, 0.97, 1.00) */
  --grass:          #8cd68c;  /* Color(0.55, 0.84, 0.55) */
  --grass-dark:     #66b86b;  /* Color(0.40, 0.72, 0.42) */

  /* ---- 三座岛主题色 ---- */
  --band-rainbow:        #ff9e9e;  /* Color(1.00, 0.62, 0.62) 彩虹岛·暖粉 */
  --band-dataCity:       #5cade5;  /* Color(0.36, 0.68, 0.95) 数据城·科技蓝 */
  --band-creationValley: #8f78eb;  /* Color(0.56, 0.47, 0.92) 创造谷·想象紫 */

  /* ---- 语义色 ---- */
  --happy:   #ffcc33;  /* Color(1.00, 0.80, 0.20) 开心黄 */
  --correct: #59c76b;  /* Color(0.35, 0.78, 0.42) 答对绿 */
  --wrong:   #f56b6b;  /* Color(0.96, 0.42, 0.42) 答错红 */
  --star:    #ffc726;  /* Color(1.00, 0.78, 0.15) 星星金 */
  --footer-ink: #243358; /* Color(0.14, 0.20, 0.36) 页脚墨色 */

  /* ---- 字号（iOS: title 40 / body 24 / caption 18） ---- */
  --fs-title:   40px;
  --fs-body:    24px;
  --fs-caption: 18px;

  /* ---- 间距阶梯（8pt 节奏） ---- */
  --sp-xxs: 4px;  --sp-xs: 8px;   --sp-s: 12px;  --sp-m: 16px;
  --sp-l:  24px;  --sp-xl: 32px;  --sp-xxl: 48px;

  /* ---- 圆角梯度（6 档） ---- */
  --r-chip:   10px;
  --r-card:   18px;
  --r-bubble: 22px;
  --r-button: 28px;
  --r-panel:  32px;
  --r-stage:  40px;
  --r-legacy: 24px;   /* PlanetTheme.corner */
  --r-legacy-s: 16px; /* PlanetTheme.cornerSmall */

  /* ---- 阴影系统（按高度分级） ---- */
  --el-rest-color:   rgba(0, 0, 0, 0.06);  --el-rest-r: 6px;  --el-rest-y: 2px;
  --el-lifted-color: rgba(0, 0, 0, 0.10);  --el-lifted-r: 14px; --el-lifted-y: 6px;
  --el-float-color:  rgba(0, 0, 0, 0.14);  --el-float-r: 22px;  --el-float-y: 10px;
  --el-glow-color:   rgba(255, 199, 38, 0.55); --el-glow-r: 18px; --el-glow-y: 0px;

  /* ---- 渐变库（对应 iOS Gradient 枚举） ---- */
  --grad-sky:       linear-gradient(180deg, #2e52a8 0%, #5cade5 52%, #e6f7ff 100%);
  --grad-aurora:    linear-gradient(135deg, #fa9ec7 0%, #9e80f2 50%, #5cade5 100%);
  --grad-deepSpace: linear-gradient(180deg, #1a2147 0%, #0d122e 100%);
  --grad-paperWarm: linear-gradient(180deg, #fff7eb 0%, #fdeddb 100%);
  --grad-island-rainbow:        linear-gradient(135deg, #ffc7c7 0%, #fd8c9e 100%);
  --grad-island-dataCity:       linear-gradient(135deg, #8fd1ff 0%, #529eeb 100%);
  --grad-island-creationValley: linear-gradient(135deg, #c2a8ff 0%, #8570e6 100%);

  /* ---- Nova 角色色板 ---- */
  --nova-skin:      #ffe09e;  /* Color(1.00, 0.88, 0.62) */
  --nova-skin-shade:#fbc775;  /* Color(0.95, 0.78, 0.46) */
  --nova-sparkle:   #fff28c;  /* Color(1.00, 0.92, 0.55) */
  --nova-cheek:     rgba(250, 158, 158, 0.55);
  --nova-eye:       #2e335c;  /* Color(0.18, 0.20, 0.36) */
  --nova-outfit:    #8f78eb;  /* Color(0.56, 0.47, 0.92) */
  --nova-outfit-alt:#ff9ec7;  /* Color(1.00, 0.62, 0.78) */

  /* ---- 庆祝火花五色 ---- */
  --spark-1: #ffc726;  /* 金 */
  --spark-2: #ff9ec7;  /* 粉 */
  --spark-3: #8f78eb;  /* 紫 */
  --spark-4: #5cade5;  /* 蓝 */
  --spark-5: #59c76b;  /* 绿 */

  /* ---- 工程师线（Feature/Engineer/EngineerTheme.swift） ---- */
  --eng-bg-1:   #1a2147;
  --eng-bg-2:   #0d122e;
  --eng-panel:  #222c5c;
  --eng-accent: #7ee0ff;
  --eng-accent-2: #b69cff;

  /* ---- 动效时长（对应 iOS Motion） ---- */
  --mo-tap:     0.12s;
  --mo-quick:   0.18s;
  --mo-stagger: 0.06s;
  --mo-enter:   0.55s;

  /* ---- 学段关键词（iOS AgeBand.cognition） ---- */
  --cognition-rainbow:见过;
  --cognition-dataCity:懂;
  --cognition-creationValley:用与辨;
}

/* 尊重系统的「减少动态效果」偏好 —— iOS Motion.prefersReducedMotion 的跨端等价 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}