/* theme.css — multi-agents.site theme picker
   Drop in AFTER the page's main stylesheet. Six palettes are wired in:
   4 light (Cream default, Paper, Sky, Mint) and 2 dark (Terminal, Nebula).
   Page-specific CSS can keep its own design; theme.css just overrides the
   shared vars so any palette-sensitive code (--accent, --bg, --ink ...) changes too. */

/* === Cream (default) — 淡黄纸 · 琥珀红绿蓝 === */
:root {
  --bg: #fffbf0;
  --bg-card: #ffffff;
  --bg-elev: #f5ecd9;
  --ink: #292524;
  --ink-soft: #57534e;
  --ink-mute: #a8a29e;
  --accent: #f59e0b;          /* amber */
  --accent-2: #ef4444;        /* red */
  --accent-3: #10b981;        /* emerald */
  --accent-4: #3b82f6;        /* blue */
  --accent-soft: rgba(245, 158, 11, 0.14);
  --accent-faint: rgba(245, 158, 11, 0.06);
  --rule: #e7e1d1;
  /* rgb triplets for any rgba()-based usage */
  --accent-rgb: 245, 158, 11;
  --accent-2-rgb: 239, 68, 68;
  --accent-3-rgb: 16, 185, 129;
  --accent-4-rgb: 59, 130, 246;
}

/* === Paper — 纯白 · 粉紫青琥珀 === */
:root[data-theme="paper"] {
  --bg: #ffffff;
  --bg-card: #fafafa;
  --bg-elev: #f1f5f9;
  --ink: #0f172a;
  --ink-soft: #475569;
  --ink-mute: #94a3b8;
  --accent: #ec4899;
  --accent-2: #8b5cf6;
  --accent-3: #06b6d4;
  --accent-4: #f59e0b;
  --accent-soft: rgba(236, 72, 153, 0.12);
  --accent-faint: rgba(236, 72, 153, 0.05);
  --rule: #e2e8f0;
  --accent-rgb: 236, 72, 153;
  --accent-2-rgb: 139, 92, 246;
  --accent-3-rgb: 6, 182, 212;
  --accent-4-rgb: 245, 158, 11;
}

/* === Sky — 淡蓝天 · 青 · 蓝 · 珊瑚 === */
:root[data-theme="sky"] {
  --bg: #e0f2fe;
  --bg-card: #f0f9ff;
  --bg-elev: #bae6fd;
  --ink: #0c2340;
  --ink-soft: #334155;
  --ink-mute: #64748b;
  --accent: #0284c7;          /* sky-600 */
  --accent-2: #14b8a6;        /* teal-500 */
  --accent-3: #6366f1;        /* indigo-500 */
  --accent-4: #f97316;        /* coral */
  --accent-soft: rgba(2, 132, 199, 0.14);
  --accent-faint: rgba(2, 132, 199, 0.06);
  --rule: #bae6fd;
  --accent-rgb: 2, 132, 199;
  --accent-2-rgb: 20, 184, 166;
  --accent-3-rgb: 99, 102, 241;
  --accent-4-rgb: 249, 115, 22;
}

/* === Mint — 薄荷绿 · 翠绿 · 茶青 · 苔黄 === */
:root[data-theme="mint"] {
  --bg: #ecfdf5;
  --bg-card: #f0fdf4;
  --bg-elev: #d1fae5;
  --ink: #14321f;
  --ink-soft: #3f5942;
  --ink-mute: #6b7e6e;
  --accent: #10b981;          /* emerald-500 */
  --accent-2: #84cc16;        /* lime-500 */
  --accent-3: #14b8a6;        /* teal-500 */
  --accent-4: #eab308;        /* yellow-500 */
  --accent-soft: rgba(16, 185, 129, 0.14);
  --accent-faint: rgba(16, 185, 129, 0.06);
  --rule: #d1fae5;
  --accent-rgb: 16, 185, 129;
  --accent-2-rgb: 132, 204, 22;
  --accent-3-rgb: 20, 184, 166;
  --accent-4-rgb: 234, 179, 8;
}

/* === Terminal — 深绿 · 黑客风（原版保留） === */
:root[data-theme="terminal"] {
  --bg: #07111b;
  --bg-card: #0e1d2a;
  --bg-elev: #142838;
  --ink: #e8eef4;
  --ink-soft: #97a7b5;
  --ink-mute: #6b7a87;
  --accent: #6ad6c0;
  --accent-2: #9ce8d6;
  --accent-3: #4fb8a0;
  --accent-4: #2a8c7a;
  --accent-soft: rgba(106, 214, 192, 0.18);
  --accent-faint: rgba(106, 214, 192, 0.07);
  --rule: #1c2a36;
  --accent-rgb: 106, 214, 192;
  --accent-2-rgb: 156, 232, 214;
  --accent-3-rgb: 79, 184, 160;
  --accent-4-rgb: 42, 140, 122;
}

/* === Nebula — 深色较浅 · 多彩 === */
:root[data-theme="nebula"] {
  --bg: #1f1b3a;
  --bg-card: #2a254a;
  --bg-elev: #352f5a;
  --ink: #f5f0ff;
  --ink-soft: #c4b8e8;
  --ink-mute: #8a7ca8;
  --accent: #c084fc;          /* lavender */
  --accent-2: #f472b6;        /* pink */
  --accent-3: #60a5fa;        /* sky */
  --accent-4: #fbbf24;        /* gold */
  --accent-soft: rgba(192, 132, 252, 0.18);
  --accent-faint: rgba(192, 132, 252, 0.08);
  --rule: #2d2552;
  --accent-rgb: 192, 132, 252;
  --accent-2-rgb: 244, 114, 182;
  --accent-3-rgb: 96, 165, 250;
  --accent-4-rgb: 251, 191, 36;
}

/* === Theme picker UI ===
   - `.theme-picker.fixed` floats top-right (for pages without topbar nav)
   - `.theme-picker.inline` sits inside a header next to other nav elements */
.theme-picker {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  position: relative;
  z-index: 1000;
}
.theme-picker.fixed {
  position: fixed;
  top: 14px;
  right: 14px;
}
@media (max-width: 640px) {
  .theme-picker.fixed { top: 10px; right: 10px; }
}

.theme-picker-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 10px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.1s ease, background 0.15s ease;
  font-family: inherit;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.theme-picker-btn:hover {
  border-color: var(--accent);
  background: var(--bg-elev);
}
.theme-picker-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.theme-picker-btn:active { transform: translateY(1px); }

.theme-picker-btn .swatches {
  display: inline-flex;
  gap: 3px;
}
.theme-picker-btn .swatches i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.2) inset;
}
.theme-picker-btn .label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.theme-picker-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  padding: 8px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(0,0,0,0.25), 0 2px 6px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
}
.theme-picker-menu[hidden] { display: none; }

.theme-picker-menu button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.875rem;
  font-family: inherit;
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}
.theme-picker-menu button:hover {
  background: var(--accent-soft);
  color: var(--ink);
}
.theme-picker-menu button[aria-current="true"] {
  background: var(--accent-soft);
  color: var(--ink);
}
.theme-picker-menu button .label { flex: 1; font-weight: 500; }
.theme-picker-menu button .name { color: inherit; font-weight: 600; }
.theme-picker-menu button .desc {
  display: block;
  font-size: 0.72rem;
  color: var(--ink-mute);
  margin-top: 1px;
  font-weight: 400;
}
.theme-picker-menu button .kind {
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-right: 4px;
  font-weight: 700;
}
.theme-picker-menu button .swatches {
  display: inline-flex;
  gap: 3px;
  flex-shrink: 0;
}
.theme-picker-menu button .swatches i {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.25) inset;
}