/* 主題變數：預設為深色霓虹，html[data-theme="bright"] 為多巴胺明亮配色 */

:root {
  --bg: #0b0f14;
  --bg-glow: #16202b;

  --panel: rgba(12, 19, 26, 0.78);
  --panel-solid: rgba(11, 17, 23, 0.95);
  --nav-bg: rgba(8, 13, 18, 0.82);

  --text: #d7e2ec;
  --muted: #7b8b9a;
  --placeholder: #5d6b78;
  --code-text: #b8c7d4;
  --code-bg: rgba(0, 0, 0, 0.35);
  --mark-text: #eafff5;

  --accent: #38e8a0;
  --accent-ink: #06120c;
  --accent-hover: #5cf5b8;
  --accent-line: rgba(56, 232, 160, 0.16);
  --accent-line-strong: rgba(56, 232, 160, 0.55);
  --accent-12: rgba(56, 232, 160, 0.12);
  --accent-10: rgba(56, 232, 160, 0.1);
  --accent-08: rgba(56, 232, 160, 0.08);
  --accent-06: rgba(56, 232, 160, 0.06);
  --accent-04: rgba(56, 232, 160, 0.04);
  --accent-30: rgba(56, 232, 160, 0.3);
  --accent-45: rgba(56, 232, 160, 0.45);
  --accent-13: rgba(56, 232, 160, 0.13);

  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-strong: rgba(255, 255, 255, 0.12);
  --chip: rgba(255, 255, 255, 0.03);
  --chip-strong: rgba(255, 255, 255, 0.06);

  --danger: #ff7b7b;
  --danger-line: rgba(255, 123, 123, 0.4);
  --danger-bg: rgba(255, 123, 123, 0.07);

  --unit-0: #38e8a0;
  --unit-1: #6fb6ff;
  --unit-2: #f4b860;
  --unit-3: #c78bfa;
  --unit-0-13: rgba(56, 232, 160, 0.13);
  --unit-1-13: rgba(111, 182, 255, 0.13);
  --unit-2-13: rgba(244, 184, 96, 0.13);
  --unit-3-13: rgba(199, 139, 250, 0.13);

  --sun: #f08a8a;
  --sat: #8fb8e0;
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  --glow: 0 0 12px rgba(56, 232, 160, 0.45);

  /* 時鐘七段顯示器（橘色） */
  --clock-color: #ff9f1c;
  --clock-glow: rgba(255, 159, 28, 0.55);
  --clock-off: rgba(255, 159, 28, 0.1);
}

/* ── 多巴胺明亮配色 ───────────────────────────────── */
html[data-theme="bright"] {
  --bg: #fff8ef;
  --bg-glow: #ffe9d6;

  --panel: #ffffff;
  --panel-solid: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.92);

  --text: #241b33;
  --muted: #7a6a86;
  --placeholder: #b3a4bf;
  --code-text: #4a3c58;
  --code-bg: #fff3e6;
  --mark-text: #241b33;

  --accent: #ff4d8d;
  --accent-ink: #ffffff;
  --accent-hover: #ff6ba0;
  --accent-line: rgba(255, 77, 141, 0.28);
  --accent-line-strong: rgba(255, 77, 141, 0.6);
  --accent-12: rgba(255, 77, 141, 0.12);
  --accent-10: rgba(255, 77, 141, 0.1);
  --accent-08: rgba(255, 77, 141, 0.08);
  --accent-06: rgba(255, 77, 141, 0.06);
  --accent-04: rgba(255, 77, 141, 0.04);
  --accent-30: rgba(255, 77, 141, 0.3);
  --accent-45: rgba(255, 77, 141, 0.45);
  --accent-13: rgba(255, 77, 141, 0.13);

  --hairline: rgba(36, 27, 51, 0.1);
  --hairline-strong: rgba(36, 27, 51, 0.16);
  --chip: #fff3e6;
  --chip-strong: #ffe8d4;

  --danger: #e11d5b;
  --danger-line: rgba(225, 29, 91, 0.35);
  --danger-bg: rgba(225, 29, 91, 0.08);

  --unit-0: #00b884;
  --unit-1: #2f7fff;
  --unit-2: #f08a00;
  --unit-3: #9c4dff;
  --unit-0-13: rgba(0, 184, 132, 0.16);
  --unit-1-13: rgba(47, 127, 255, 0.16);
  --unit-2-13: rgba(240, 138, 0, 0.16);
  --unit-3-13: rgba(156, 77, 255, 0.16);

  --sun: #ff5c5c;
  --sat: #2f7fff;
  --shadow: 0 10px 24px rgba(146, 106, 60, 0.16);
  --glow: 0 0 0 rgba(0, 0, 0, 0);

  /* 時鐘七段顯示器（橘色） */
  --clock-color: #f57c00;
  --clock-glow: rgba(245, 124, 0, 0.4);
  --clock-off: rgba(245, 124, 0, 0.12);
}

/* 明亮主題：繽紛邊框與柔和陰影 */
html[data-theme="bright"] body {
  background:
    radial-gradient(circle at 12% 8%, #ffe0ef 0%, transparent 42%),
    radial-gradient(circle at 88% 4%, #dff2ff 0%, transparent 40%),
    radial-gradient(circle at 50% 100%, #fff0c2 0%, transparent 45%),
    var(--bg);
}

html[data-theme="bright"] .site-nav {
  box-shadow: 0 4px 18px rgba(146, 106, 60, 0.1);
}

html[data-theme="bright"] .site-nav a {
  color: var(--muted);
}

html[data-theme="bright"] .site-nav a:hover {
  color: var(--text);
  background: var(--chip-strong);
}

html[data-theme="bright"] .site-nav a[aria-current="page"] {
  color: #fff;
  background: linear-gradient(135deg, #e01e6e, #c2410c);
  box-shadow: 0 4px 12px rgba(255, 77, 141, 0.35);
}

/* 多巴胺主題：卡片彩色左側標記 */
html[data-theme="bright"] .month,
html[data-theme="bright"] .card,
html[data-theme="bright"] .panel,
html[data-theme="bright"] .identity,
html[data-theme="bright"] .question,
html[data-theme="bright"] .result,
html[data-theme="bright"] .search,
html[data-theme="bright"] .clock,
html[data-theme="bright"] .day-panel {
  border-color: var(--hairline-strong);
  box-shadow: var(--shadow);
}

html[data-theme="bright"] .month:nth-child(3n + 1) { border-top: 4px solid #ff4d8d; }
html[data-theme="bright"] .month:nth-child(3n + 2) { border-top: 4px solid #ffb000; }
html[data-theme="bright"] .month:nth-child(3n + 3) { border-top: 4px solid #2f7fff; }

html[data-theme="bright"] .grid button {
  background: #fff8ef;
}

html[data-theme="bright"] .grid button.has-event {
  border-color: var(--hairline);
  background: #fff;
}

html[data-theme="bright"] .grid button.has-event:hover {
  background: #fff3e6;
}

html[data-theme="bright"] .grid button.is-active {
  background: rgba(255, 77, 141, 0.14);
  border-color: #ff4d8d;
}

html[data-theme="bright"] .option {
  background: #fffaf4;
  border-color: var(--hairline);
}

html[data-theme="bright"] .option:has(input:checked) {
  background: rgba(255, 77, 141, 0.1);
  border-color: #ff4d8d;
}

html[data-theme="bright"] .pill {
  background: #fff;
  border-color: var(--hairline-strong);
}

html[data-theme="bright"] .pill:hover {
  border-color: #ff4d8d;
  color: #ff4d8d;
}

html[data-theme="bright"] .pill[aria-pressed="true"] {
  background: linear-gradient(135deg, #e01e6e, #c2410c);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 10px rgba(255, 77, 141, 0.3);
}

html[data-theme="bright"] .switch button[aria-selected="true"] {
  background: linear-gradient(135deg, #e01e6e, #c2410c);
  color: #fff;
}

html[data-theme="bright"] .filters button[aria-pressed="true"][data-unit="all"] {
  background: #241b33;
  color: #fff;
}

html[data-theme="bright"] .btn--primary {
  background: linear-gradient(135deg, #e01e6e, #c2410c);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 77, 141, 0.3);
}

html[data-theme="bright"] .btn--primary:hover {
  background: linear-gradient(135deg, #ef3b85, #d9530f);
  color: #fff;
}

html[data-theme="bright"] input,
html[data-theme="bright"] .search__input,
html[data-theme="bright"] .code--input {
  background: #fffaf4;
  border-color: var(--hairline-strong);
}

html[data-theme="bright"] .code {
  background: var(--code-bg);
  border-color: var(--hairline);
}

html[data-theme="bright"] .bar {
  background: rgba(36, 27, 51, 0.1);
}

html[data-theme="bright"] .bar i {
  background: linear-gradient(90deg, #ff4d8d, #ff8a3d);
}

html[data-theme="bright"] .bar i.is-low {
  background: linear-gradient(90deg, #ff5c5c, #ffb000);
}

html[data-theme="bright"] .card__value,
html[data-theme="bright"] .result__score {
  color: #ff4d8d;
}

/* 主題切換鈕 */
.theme-toggle {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font: inherit;
  font-size: 0.8rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--accent-line);
  background: var(--panel-solid);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.theme-toggle__icon {
  font-size: 0.95rem;
  line-height: 1;
}

@media (max-width: 520px) {
  .theme-toggle {
    right: 0.6rem;
    bottom: 0.6rem;
    padding: 0.45rem 0.7rem;
    font-size: 0.74rem;
  }
}
