/* ============================================================
   主题配色包 · 5 套
   日间清新：mint(薄荷) / sakura(樱粉) / sky(晴空)
   夜间高端：obsidian(曜石紫金) / navy(深海军蓝金·原默认)
   通过 <html data-theme="xxx"> 切换，由 theme.js 控制与记忆
   每套需定义同一组变量：
   --navy(主背景) --navy-2(次背景) --card(卡片) --gold(主强调) --gold-dim(强调深)
   --ink(主文字) --muted(次文字) --line(描边) --ok --danger --warn
   变量名沿用旧名以零改动兼容现有页面
   ============================================================ */

/* ---------- 日间 1：薄荷清新 ---------- */
:root[data-theme="mint"] {
  --input-bg:#ffffff;
  --navy:#f4faf7; --navy-2:#eafaf3; --card:#ffffff; --gold:#1aa672; --gold-dim:#14855b;
  --ink:#183b30; --muted:#6d8a7f; --line:rgba(26,166,114,.22);
  --ok:#1aa672; --danger:#e0685c; --warn:#e0a03f;
}
/* ---------- 日间 2：樱粉清新 ---------- */
:root[data-theme="sakura"] {
  --input-bg:#ffffff;
  --navy:#fdf6f8; --navy-2:#fceef2; --card:#ffffff; --gold:#e0568a; --gold-dim:#c23f72;
  --ink:#4a2432; --muted:#9c7683; --line:rgba(224,86,138,.20);
  --ok:#3fb489; --danger:#e0525c; --warn:#e0a03f;
}
/* ---------- 日间 3：晴空清新 ---------- */
:root[data-theme="sky"],
:root:not([data-theme]) {
  --input-bg:#ffffff;
  --navy:#f3f8fd; --navy-2:#e8f2fc; --card:#ffffff; --gold:#2e86d8; --gold-dim:#2069b0;
  --ink:#173049; --muted:#6a8199; --line:rgba(46,134,216,.20);
  --ok:#2ba579; --danger:#e0605c; --warn:#e09a3f;
}

/* ---------- 夜间 1：曜石紫金（高端） ---------- */
:root[data-theme="obsidian"] {
  --input-bg:rgba(20,16,25,.6);
  --navy:#141019; --navy-2:#1e1729; --card:#241c33; --gold:#c9a35b; --gold-dim:#a58343;
  --ink:#ece7f2; --muted:#9b8fb0; --line:rgba(201,163,91,.24);
  --ok:#5fb489; --danger:#e0656e; --warn:#e0b055;
}
/* ---------- 夜间 2：深海军蓝金（高端） ---------- */
:root[data-theme="navy"] {
  --input-bg:rgba(13,27,46,.6);
  --navy:#0d1b2e; --navy-2:#14263f; --card:#182d4a; --gold:#d4a843; --gold-dim:#a8863a;
  --ink:#e8ecf3; --muted:#8b98ac; --line:rgba(212,168,67,.22);
  --ok:#4fb477; --danger:#e05c5c; --warn:#e0a94f;
}

/* ---------- 主题选择器控件 ---------- */
.theme-picker { position:relative; }
.theme-picker > button {
  background:transparent; border:1px solid var(--line); color:var(--muted);
  border-radius:6px; padding:5px 12px; font-size:13px; cursor:pointer; display:flex; align-items:center; gap:6px;
}
.theme-picker > button:hover { border-color:var(--gold); color:var(--gold); }
.theme-dot { width:12px; height:12px; border-radius:50%; background:var(--gold); border:1px solid var(--line); }
.theme-menu {
  display:none; position:absolute; right:0; top:calc(100% + 6px); z-index:30;
  background:var(--card); border:1px solid var(--line); border-radius:10px;
  padding:8px; min-width:180px; box-shadow:0 8px 28px rgba(0,0,0,.25);
}
.theme-menu.open { display:block; }
.theme-menu .group-label { font-size:11px; color:var(--muted); padding:6px 8px 4px; }
.theme-menu .theme-item {
  display:flex; align-items:center; gap:10px; padding:7px 8px; border-radius:6px;
  cursor:pointer; font-size:13px; color:var(--ink);
}
.theme-menu .theme-item:hover { background:var(--navy-2); }
.theme-menu .theme-item.active { color:var(--gold); font-weight:600; }
.theme-menu .swatch { width:26px; height:16px; border-radius:4px; border:1px solid var(--line); flex-shrink:0; display:flex; overflow:hidden; }
.theme-menu .swatch i { flex:1; height:100%; display:block; }

/* ---------- 主题背景图（管理员可配，作为柔和叠加层，不影响可读性） ---------- */
body.has-bg-image::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background-image: var(--bg-image);
  background-size: cover; background-position: center; background-attachment: fixed;
  opacity: 0.10; pointer-events: none;
}
/* 夜间主题背景图稍亮一点，日间稍淡，保证文字对比 */
:root[data-theme="obsidian"] body.has-bg-image::before,
:root[data-theme="navy"] body.has-bg-image::before { opacity: 0.16; }
