/* theme_tokens.css — 大廳共用配色變數（2026-10-30）。hall.html 最先載入。
   原則：白天、夜間各一組；夜間是「底色和文字一起換」。夜間開關沿用 body.night（main.js setNightUI）。
   成對使用：背景用 --xxx、放在上面的字用 --on-xxx，永遠一起用，才不會「淺底淺字」。
   詳見 README_theme.md。 */
:root {
  /* 頁面／面板底 */
  --surface: #fffaf0;      --on-surface: #4a3a5c;
  /* 卡片、彈窗、列表項 */
  --card: #fffaf0;         --on-card: #4a3a5c;
  --card-2: #f4f0ff;       --on-card-2: #4a3a5c;     /* 次層卡片（淡紫） */
  --card-warm: #fff8e6;    --on-card-warm: #4a3a5c;  /* 活動／公告類暖色卡 */
  /* 強調（按鈕、選中分頁）：底色在白天夜間都是亮色，字固定深色 */
  --accent: #ffb02e;       --on-accent: #3a2a1a;
  --good: #1d7a3a;         --on-good: #ffffff;
  --danger: #c4281f;       --on-danger: #ffffff;
  /* 次要文字（要放在 --surface／--card 上） */
  --muted: #6b5f80;
  --warn-text: #8a5200;    --bad-text: #b02a2a;      --good-text: #15803d;
  --line-soft: rgba(120, 90, 140, .24);
}
body.night {
  --surface: #121733;      --on-surface: #f4f1e8;
  --card: #1a2147;         --on-card: #f4f1e8;
  --card-2: #232a5c;       --on-card-2: #f4f1e8;
  --card-warm: #2a2340;    --on-card-warm: #ffe9a8;
  --accent: #ffb02e;       --on-accent: #1b1424;
  --good: #2f7a35;         --on-good: #ffffff;
  --danger: #d6453b;       --on-danger: #ffffff;
  --muted: #d6dbf0;
  --warn-text: #ffc27a;    --bad-text: #ff9a8a;      --good-text: #7bed9f;
  --line-soft: rgba(255, 255, 255, .28);
}

/* ---- 面板自己的小色盤（面板用 --bg/--card/--tx 當區域變數，夜間整組換成深底淺字） ---- */
body.night #fmPanel { --bg: #121733; --card: #1a2147; --tx: #f4f1e8; --sub: #d6dbf0; --line: rgba(255, 255, 255, .3); --acc: #2f7a35; --accTx: #ffffff; --warn: #ffc27a; --chip: #262e5c; background: rgba(4, 6, 18, .72); }
body.night #fmPanel .fm-plot { background: #3d2c1a; border-color: #c9a56a; color: #fff6dc; }
body.night #fmPanel .fm-plot.empty { background: #2a2018; color: #f1e3c8; }
body.night #fmPanel .fm-plot.ready { background: #2d5a22; border-color: #ffd23a; }
body.night #fmPanel .fm-bgrid { background: #3a281a; border-color: #c9a56a; }
body.night #fmPanel button.bc { background: #4a3321; border-color: #1c130b; }
body.night #fmPanel .fm-info { background: #1a2147; }
body.night #wishPanel { --bg: #121733; --card: #1b2145; --tx: #f4f1e8; --sub: #d6dbf0; --line: rgba(255, 255, 255, .28); --acc: #5aaeff; --accTx: #06142a; }
body.night #wishPanel .wp-card { background: #121733; color: #f4f1e8; }

/* ---- 一般元件的夜間基底（按鈕、膠囊、彈窗：深底＋淺字，邊線提亮） ---- */
body.night { --panel: rgba(10, 13, 32, .95); --line: rgba(255, 255, 255, .28); --sub: #d6dbf0; }
body.night button { background: rgba(16, 20, 44, .95); color: #f4f1e8; border-color: rgba(255, 255, 255, .3); }
body.night button:hover { border-color: var(--acc); }
body.night .dim, body.night small.dim { color: var(--muted); }
/* 彩色底＋白字的小徽章：兩種模式都用深一階的底色，白字 >= 4.5:1 */
.rh { display: block; margin-top: 2px; font-weight: 700; color: #6b3a00; }
body.night .rh { color: #ffd98a; }
.pg-coin { color: var(--on-card-warm); }
body.night .pg-coin { background: var(--card-warm); border-color: rgba(255, 220, 120, .45); }
body.night .pg-coin b { color: var(--on-card-warm); }
body.night.mui #prog .pg-coin { background: none; }
body.night .pg-bar em { color: #fff; text-shadow: 0 0 2px #000, 0 0 3px #000; }
body #wtool button.on, body.night #wtool button.on { background: #1d7a3a; color: #fff; }
#marquee .mq-ic { color: var(--on-card); }
body.night #petChip { background: var(--card); color: var(--on-card); border-color: #ffb020; box-shadow: 0 6px 18px rgba(0, 0, 0, .6); }
body.night #petChip small { color: var(--muted); }
body.night #petChip .pc-ic { background: #2a2f63; }
body.night #petChip.miss { background: #232a3c; color: #e6ebf5; border-color: #6c7a99; }
body.night #petChip.miss small { color: #cfd6e6; }
body.night #fwhChip, body.night #fwhFeed div { background: rgba(14, 12, 40, .96); color: #fff7d6; }
body.night #fdBtnMm { background: var(--card); color: var(--on-card); border-color: #ffb020; }
