/* ============ 主题变量 ============ */
html[data-theme="warm"] {
  --bg: #FBF4EC; --bg-2: #F5E9DB; --surface: #FFFCF8; --surface-2: #FBF3E9;
  --text: #4B3F35; --text-2: #8C7A69; --text-3: #B3A395;
  --line: #EFE2D3; --accent: #E08D5B; --accent-2: #F3C79E; --accent-text: #fff;
  --shadow: 0 4px 16px rgba(186,146,105,.10);
  --shadow-lg: 0 12px 40px rgba(186,146,105,.20);
  --q1: #E57373; --q2: #6FA98C; --q3: #E0A458; --q4: #9BA8B8;
  --q1-bg: #FDECEA; --q2-bg: #E9F4EE; --q3-bg: #FCF2E2; --q4-bg: #EEF2F6;
  color-scheme: light;
}

html[data-theme="simple"] {
  --bg: #F7F7F8; --bg-2: #EFEFF1; --surface: #FFFFFF; --surface-2: #FAFAFB;
  --text: #1F2328; --text-2: #6B7280; --text-3: #9CA3AF;
  --line: #E5E7EB; --accent: #3B82F6; --accent-2: #BFDBFE; --accent-text: #fff;
  --shadow: 0 1px 3px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.10);
  --q1: #EF4444; --q2: #10B981; --q3: #F59E0B; --q4: #94A3B8;
  --q1-bg: #FEF2F2; --q2-bg: #ECFDF5; --q3-bg: #FFFBEB; --q4-bg: #F1F5F9;
  color-scheme: light;
}

html[data-theme="night"] {
  --bg: #16181D; --bg-2: #1D2027; --surface: #21242C; --surface-2: #272B34;
  --text: #E6E8EC; --text-2: #9BA3AF; --text-3: #6B7280;
  --line: #31353F; --accent: #8AA9F7; --accent-2: #3A4664; --accent-text: #0E1014;
  --shadow: 0 4px 16px rgba(0,0,0,.35);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.55);
  --q1: #F87171; --q2: #4ADE80; --q3: #FBBF24; --q4: #94A3B8;
  --q1-bg: #3A2224; --q2-bg: #1C3329; --q3-bg: #3A2F1A; --q4-bg: #262A33;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background .35s ease, color .35s ease;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

button, input, select, textarea { font-family: inherit; color: inherit; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }
::-webkit-scrollbar-track { background: transparent; }

/* 通用按钮 */
.btn {
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  padding: 9px 15px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  transition: .18s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--q1); }
.btn.ok { background: var(--q2); color: #fff; border-color: transparent; }
html[data-theme="night"] .btn.ok { color: #0E1014; }
.btn.tiny { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn.sm { padding: 7px 12px; font-size: 12.5px; }

/* 通用开关 */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 25px;
  flex: 0 0 auto;
}
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--line);
  border-radius: 999px;
  transition: .22s;
}
.switch .slider::before {
  content: "";
  position: absolute;
  height: 19px;
  width: 19px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .22s;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(19px); }

.spacer { flex: 1; }
.tip { font-size: 11.5px; color: var(--text-3); line-height: 1.7; }
