/* 高对比界面风格 */

:root,
html[data-theme="qingshi"] {
  --theme-name: "青石";
  --bg: #cfd9e3;
  --bg-elevated: #e8eef4;
  --surface: #ffffff;
  --ink: #0a1219;
  --ink-soft: #2c3e4d;
  --line: #7f93a6;
  --accent: #067a6c;
  --accent-deep: #045348;
  --accent-soft: #b8ebe3;
  --warn: #c2410c;
  --danger: #b91c1c;
  --ok: #15803d;
  --info: #075985;
  --sidebar: #071018;
  --sidebar-ink: #e2eef6;
  --sidebar-active: #0f2a32;
  --shadow: 0 10px 28px rgba(7, 16, 24, 0.22);
  --radius: 12px;
  --font-display: "Sora", "Noto Sans SC", sans-serif;
  --font-body: "Noto Sans SC", "Sora", sans-serif;
  --glow-a: rgba(6, 122, 108, 0.22);
  --glow-b: rgba(7, 89, 133, 0.16);
  --login-card-bg: #ffffff;
  --table-hover: #d9f3ee;
  --map-grad: linear-gradient(135deg, #9eb0c2, #e8eef4 48%, #8ea2b6);
  --preview-grad: linear-gradient(145deg, #0b2a36, #155e63);
}

html[data-theme="yuanhai"] {
  --theme-name: "远洋";
  --bg: #b9cbe0;
  --bg-elevated: #dce7f3;
  --surface: #ffffff;
  --ink: #071526;
  --ink-soft: #1e3a55;
  --line: #5f7fa0;
  --accent: #0b4f9c;
  --accent-deep: #083a74;
  --accent-soft: #bfd8f7;
  --warn: #b45309;
  --danger: #991b1b;
  --ok: #166534;
  --info: #0c4a6e;
  --sidebar: #041525;
  --sidebar-ink: #e7f1fb;
  --sidebar-active: #0d2d4d;
  --shadow: 0 12px 30px rgba(4, 21, 37, 0.25);
  --radius: 10px;
  --glow-a: rgba(11, 79, 156, 0.25);
  --glow-b: rgba(4, 21, 37, 0.14);
  --login-card-bg: #ffffff;
  --table-hover: #d4e6fb;
  --map-grad: linear-gradient(135deg, #7f9dbc, #dce7f3 50%, #6d8cb0);
  --preview-grad: linear-gradient(145deg, #08233f, #1d4f82);
}

html[data-theme="moye"] {
  --theme-name: "墨夜";
  --bg: #070b10;
  --bg-elevated: #121a22;
  --surface: #18222c;
  --ink: #f3f8fc;
  --ink-soft: #b7c9d8;
  --line: #3d5163;
  --accent: #14b8a6;
  --accent-deep: #0f766e;
  --accent-soft: #134e4a;
  --warn: #fb923c;
  --danger: #f87171;
  --ok: #4ade80;
  --info: #38bdf8;
  --sidebar: #020508;
  --sidebar-ink: #e8f2fa;
  --sidebar-active: #12303a;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
  --radius: 12px;
  --glow-a: rgba(20, 184, 166, 0.18);
  --glow-b: rgba(56, 189, 248, 0.12);
  --login-card-bg: #18222c;
  --table-hover: #243442;
  --map-grad: linear-gradient(135deg, #0f1a22, #1c2d3a 50%, #0b141b);
  --preview-grad: linear-gradient(145deg, #061018, #134e4a);
}

html[data-theme="linpo"] {
  --theme-name: "林珀";
  --bg: #c5cfb4;
  --bg-elevated: #e4ebd6;
  --surface: #f7faef;
  --ink: #11180d;
  --ink-soft: #2f3d24;
  --line: #6f8158;
  --accent: #3f6b1d;
  --accent-deep: #2d4d14;
  --accent-soft: #cfe8ad;
  --warn: #b45309;
  --danger: #9f1239;
  --ok: #166534;
  --info: #115e59;
  --sidebar: #10180c;
  --sidebar-ink: #eef6df;
  --sidebar-active: #24351a;
  --shadow: 0 12px 30px rgba(16, 24, 12, 0.22);
  --radius: 14px;
  --glow-a: rgba(63, 107, 29, 0.22);
  --glow-b: rgba(17, 94, 89, 0.12);
  --login-card-bg: #f7faef;
  --table-hover: #dcebba;
  --map-grad: linear-gradient(135deg, #9aab82, #e4ebd6 48%, #87996d);
  --preview-grad: linear-gradient(145deg, #1a2a12, #3f6b1d);
}

html[data-theme="xueyuan"] {
  --theme-name: "雪原";
  --bg: #d7dde5;
  --bg-elevated: #eef2f7;
  --surface: #ffffff;
  --ink: #020617;
  --ink-soft: #1e293b;
  --line: #64748b;
  --accent: #0f766e;
  --accent-deep: #115e59;
  --accent-soft: #99f6e4;
  --warn: #c2410c;
  --danger: #b91c1c;
  --ok: #15803d;
  --info: #0369a1;
  --sidebar: #020617;
  --sidebar-ink: #f8fafc;
  --sidebar-active: #1e293b;
  --shadow: 0 10px 26px rgba(2, 6, 23, 0.18);
  --radius: 8px;
  --glow-a: rgba(15, 118, 110, 0.18);
  --glow-b: rgba(3, 105, 161, 0.12);
  --login-card-bg: #ffffff;
  --table-hover: #ccfbf1;
  --map-grad: linear-gradient(135deg, #94a3b8, #eef2f7 50%, #8392a8);
  --preview-grad: linear-gradient(145deg, #0f172a, #334155);
}

html[data-theme="hupo"] {
  --theme-name: "琥珀";
  --bg: #d9cbb6;
  --bg-elevated: #efe5d5;
  --surface: #fffaf2;
  --ink: #1c1208;
  --ink-soft: #4a3420;
  --line: #8b7355;
  --accent: #b45309;
  --accent-deep: #92400e;
  --accent-soft: #fed7aa;
  --warn: #c2410c;
  --danger: #9f1239;
  --ok: #3f6212;
  --info: #075985;
  --sidebar: #140e08;
  --sidebar-ink: #fff7ed;
  --sidebar-active: #2c1d10;
  --shadow: 0 12px 30px rgba(20, 14, 8, 0.24);
  --radius: 16px;
  --glow-a: rgba(180, 83, 9, 0.22);
  --glow-b: rgba(7, 89, 133, 0.12);
  --login-card-bg: #fffaf2;
  --table-hover: #ffedd5;
  --map-grad: linear-gradient(135deg, #b79d7c, #efe5d5 48%, #a68968);
  --preview-grad: linear-gradient(145deg, #1c1208, #b45309);
}

.theme-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.theme-picker-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
  margin-right: 2px;
}
.theme-swatch {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 2px solid var(--ink);
  cursor: pointer;
  padding: 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s, border-color 0.15s;
}
.theme-swatch:hover { transform: translateY(-1px); }
.theme-swatch.active {
  border-color: var(--accent);
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
}
.theme-swatch .sw-a,
.theme-swatch .sw-b { position: absolute; inset: 0; }
.theme-swatch .sw-b { clip-path: polygon(45% 0, 100% 0, 100% 100%, 20% 100%); }
.theme-swatch[data-set-theme="qingshi"] .sw-a,
.theme-swatch.theme-swatch--qingshi .sw-a { background: #067a6c; }
.theme-swatch[data-set-theme="qingshi"] .sw-b,
.theme-swatch.theme-swatch--qingshi .sw-b { background: #cfd9e3; }
.theme-swatch[data-set-theme="yuanhai"] .sw-a,
.theme-swatch.theme-swatch--yuanhai .sw-a { background: #0b4f9c; }
.theme-swatch[data-set-theme="yuanhai"] .sw-b,
.theme-swatch.theme-swatch--yuanhai .sw-b { background: #b9cbe0; }
.theme-swatch[data-set-theme="moye"] .sw-a,
.theme-swatch.theme-swatch--moye .sw-a { background: #14b8a6; }
.theme-swatch[data-set-theme="moye"] .sw-b,
.theme-swatch.theme-swatch--moye .sw-b { background: #070b10; }
.theme-swatch[data-set-theme="linpo"] .sw-a,
.theme-swatch.theme-swatch--linpo .sw-a { background: #3f6b1d; }
.theme-swatch[data-set-theme="linpo"] .sw-b,
.theme-swatch.theme-swatch--linpo .sw-b { background: #c5cfb4; }
.theme-swatch[data-set-theme="xueyuan"] .sw-a,
.theme-swatch.theme-swatch--xueyuan .sw-a { background: #0f766e; }
.theme-swatch[data-set-theme="xueyuan"] .sw-b,
.theme-swatch.theme-swatch--xueyuan .sw-b { background: #ffffff; }
.theme-swatch[data-set-theme="hupo"] .sw-a,
.theme-swatch.theme-swatch--hupo .sw-a { background: #b45309; }
.theme-swatch[data-set-theme="hupo"] .sw-b,
.theme-swatch.theme-swatch--hupo .sw-b { background: #d9cbb6; }

.theme-select {
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 10px;
  min-width: 120px;
  font-weight: 600;
}

html[data-theme="moye"] .login-card,
html[data-theme="moye"] .card,
html[data-theme="moye"] .modal,
html[data-theme="moye"] table.data,
html[data-theme="moye"] .field input,
html[data-theme="moye"] .field select,
html[data-theme="moye"] .toolbar input,
html[data-theme="moye"] .toolbar select,
html[data-theme="moye"] .theme-select {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
html[data-theme="moye"] table.data th { background: var(--bg-elevated); color: var(--ink); }
html[data-theme="moye"] .btn.ghost { color: var(--ink); border-color: var(--line); }
html[data-theme="moye"] .side-foot .btn.ghost { color: #fff; }
