/* ============================================================
 * 记着玩 · 官网设计系统 tokens.css
 * 来源：App entry/src/main/resources/{base,dark}/element/color.json
 * 主题策略：默认深色（墨夜，同 App 默认观感），data-theme="light" 切换；
 *          无 JS 时跟随系统 prefers-color-scheme。
 * 对比度红线：正文/次要文字对比度均 ≥ 4.5:1（已按 WCAG AA 校验）。
 * ============================================================ */

:root {
  /* —— 品牌（双主题同值，源自 App brand_primary）—— */
  --brand: #1B7A43;              /* 翡翠绿 · 主品牌色 */
  --brand-strong: #2E9E5B;       /* 深色主题按钮实色（App btn_primary_bg dark） */
  --brand-pressed: #27884D;      /* App btn_primary_pressed dark */
  --brand-on: #FFFFFF;           /* text_on_brand */
  --brand-tint: #143226;         /* 深色主题品牌浅底（App brand_primary_light dark） */
  --brand-tint-light: #D5F5E3;   /* 浅色主题品牌浅底 */

  /* —— 点缀金（境界升级点缀色，非主色）—— */
  --gold: #FFD700;               /* App level_up_gold */
  --gold-stream: #E9B33B;        /* App fx_stream_gold dark（深底上的金，降刺眼） */

  /* —— 语义 —— */
  --income: #1B7A43;             /* App brand_income（涨=红绿按 App 记账语义：收入绿） */
  --expense: #E53935;            /* App brand_expense dark */
  --warning: #F39C12;
  --danger: #EF5350;             /* App level_drop_severe dark */

  /* —— 八境界 aura（App aura_realm_*，用于境界条/装饰渐变）—— */
  --aura-1: #3A4243;  /* 引气 */
  --aura-2: #1F3D54;  /* 炼气 */
  --aura-3: #173A55;  /* 筑基 */
  --aura-4: #5C3D0A;  /* 金丹 */
  --aura-5: #3A2152;  /* 元婴 */
  --aura-6: #5A2018;  /* 化神 */
  --aura-7: #4A3710;  /* 渡劫 */
  --aura-8: #6B5200;  /* 地仙 */
}

/* —— 默认：墨夜深色（App dark 色板）—— */
:root,
:root[data-theme="dark"] {
  --page-bg: #121212;            /* App page_bg dark */
  --surface: #1E1E1E;            /* App bg_primary dark */
  --surface-2: #2A2A2A;          /* App bg_secondary dark */
  --divider: #2A2A2A;

  --text-1: #E8E8E8;             /* App text_primary dark */
  --text-2: #A8A8A8;             /* App text_secondary dark（对 #121212 ≈ 7.9:1）*/
  --text-3: #929292;             /* App text_hint dark */

  /* 玻璃拟态（App glass_dialog_bg/border dark）*/
  --glass-bg: rgba(28, 28, 32, 0.85);
  --glass-border: #2A352C;       /* App glass_border dark */
  --glass-highlight: rgba(255, 255, 255, 0.06);

  /* 径向光晕（App bg_glow_*：翡翠绿低透明度）*/
  --glow-top: rgba(27, 122, 67, 0.15);
  --glow-bottom: rgba(27, 122, 67, 0.06);

  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.45);
  --hero-veil: rgba(10, 12, 11, 0.55);
}

/* —— 浅色（App base 色板）—— */
:root[data-theme="light"] {
  --page-bg: #F5F6FA;            /* App page_bg */
  --surface: #FFFFFF;
  --surface-2: #ECEFF1;
  --divider: #ECEFF1;

  --text-1: #212121;
  --text-2: #616161;             /* 对 #F5F6FA ≈ 5.6:1 */
  --text-3: #65656A;             /* App text_hint（阶段四合规定版值）*/

  --glass-bg: rgba(253, 254, 251, 0.85);   /* App glass_scrim_top */
  --glass-border: #DCE8DA;
  --glass-highlight: rgba(255, 255, 255, 0.65);

  --glow-top: rgba(27, 122, 67, 0.10);
  --glow-bottom: rgba(27, 122, 67, 0.04);

  --shadow-card: 0 8px 28px rgba(33, 33, 33, 0.10);
  --hero-veil: rgba(245, 246, 250, 0.60);

  /* 浅色下金/expense 用 App base 值 */
  --gold-stream: #F7C84B;        /* App fx_stream_gold base */
  --expense: #C0392B;            /* App brand_expense base */
  --danger: #C62828;
}

/* —— 系统跟随（页面未显式声明 data-theme 时生效）—— */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --page-bg: #F5F6FA;
    --surface: #FFFFFF;
    --surface-2: #ECEFF1;
    --divider: #ECEFF1;
    --text-1: #212121;
    --text-2: #616161;
    --text-3: #65656A;
    --glass-bg: rgba(253, 254, 251, 0.85);
    --glass-border: #DCE8DA;
    --glass-highlight: rgba(255, 255, 255, 0.65);
    --glow-top: rgba(27, 122, 67, 0.10);
    --glow-bottom: rgba(27, 122, 67, 0.04);
    --shadow-card: 0 8px 28px rgba(33, 33, 33, 0.10);
    --hero-veil: rgba(245, 246, 250, 0.60);
    --gold-stream: #F7C84B;
    --expense: #C0392B;
    --danger: #C62828;
  }
}
