:root {
  --bg: #0b0b10;
  --bg-soft: #12121a;
  --card: #17171f;
  --card-2: #1d1d27;
  --line: rgba(255, 255, 255, 0.08);
  --text: #ececf2;
  --muted: #9a9aab;
  --accent: #8b5cf6;
  --accent-2: #a78bfa;
  --accent-dim: rgba(139, 92, 246, 0.16);
  --danger: #f87171;
  --ok: #34d399;
  --radius: 14px;
  --btn-hover: #252531;
  --topbar-bg: rgba(11, 11, 16, 0.7);
  --canvas-bg: #0e0e15;
  --chart-baseline: rgba(255, 255, 255, 0.35);
  --modal-backdrop: rgba(4, 4, 8, 0.72);
  --track: #2a2a36;
}

html[data-theme="light"] {
  --bg: #f6f5fa;
  --bg-soft: #efedf5;
  --card: #ffffff;
  --card-2: #f3f1f9;
  --line: rgba(23, 21, 31, 0.1);
  --text: #17151f;
  --muted: #5f5c70;
  --accent: #6d3fd6;
  --accent-2: #6d3fd6;
  --accent-dim: rgba(109, 63, 214, 0.1);
  --danger: #c23636;
  --ok: #0f8a5f;
  --btn-hover: #ece8f6;
  --topbar-bg: rgba(246, 245, 250, 0.82);
  --canvas-bg: #fbfaff;
  --chart-baseline: rgba(23, 21, 31, 0.35);
  --modal-backdrop: rgba(30, 26, 46, 0.35);
  --track: #ded9ec;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: radial-gradient(1200px 600px at 70% -10%, rgba(139, 92, 246, 0.12), transparent 60%), var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 26px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  backdrop-filter: blur(14px) saturate(1.2);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--text);
  font-size: 14px;
}
.brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: block;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 2px 10px rgba(0, 0, 0, 0.35);
}
html[data-theme="light"] .brand-mark {
  box-shadow: 0 0 0 1px rgba(23, 21, 31, 0.12), 0 2px 8px rgba(40, 32, 70, 0.12);
}
.brand:hover { text-decoration: none; color: var(--accent-2); }
.tag {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
}
.topbar .spacer { flex: 1; }

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}
.wrap.narrow { max-width: 760px; }

h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: 0.5px; }
.page-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--accent-2);
  margin-bottom: 10px;
}
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 20px 0 8px; color: var(--text); }
p { margin: 8px 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
.hidden { display: none !important; }

.card {
  position: relative;
  background: linear-gradient(180deg, var(--card), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.09), transparent);
  pointer-events: none;
}
.card.flat { background: var(--card); }

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.12s, box-shadow 0.18s;
}
.btn:hover {
  background: var(--btn-hover);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(135deg, #7c3aed, #8b5cf6);
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.26);
}
.btn.primary:hover {
  background: linear-gradient(135deg, #8b4cf0, #9d6bff);
  box-shadow: 0 10px 32px rgba(124, 58, 237, 0.4);
}
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: rgba(248, 113, 113, 0.3); }
.btn.wide { width: 100%; justify-content: center; }
.btn.big { font-size: 17px; padding: 14px 26px; }

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.spread { justify-content: space-between; }
.grow { flex: 1; }

.notice {
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}
.notice.warn {
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.07);
  color: #fcd34d;
}
.notice.danger {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.07);
  color: #fca5a5;
}

.checklist { display: grid; gap: 10px; margin: 14px 0; }
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
}
.check {
  transition: border-color 0.18s, background 0.18s;
}
.check:hover {
  border-color: rgba(139, 92, 246, 0.35);
  background: var(--card-2);
}
.check input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--card);
  cursor: pointer;
  position: relative;
  flex: none;
  transition: background 0.15s, border-color 0.15s;
}
.check input[type="checkbox"]:checked {
  background: linear-gradient(135deg, #7c3aed, #8b5cf6);
  border-color: transparent;
}
.check input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.check span { color: var(--muted); }
.check b { color: var(--text); font-weight: 600; }

.progress-line {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.progress-line > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.55);
  width: 0;
  transition: width 0.25s ease;
}

.ear-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 600;
}
.ear-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 8px var(--accent-2);
  flex: none;
}

.freq-display {
  font-size: 58px;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  text-align: center;
  margin: 20px 0 8px;
  text-shadow: 0 0 34px rgba(139, 92, 246, 0.28);
}
.freq-display small { font-size: 20px; color: var(--muted); font-weight: 500; }

.slider-wrap { margin: 18px 0; }
input[type="range"] {
  width: 100%;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--track), var(--accent));
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid #8b5cf6;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}
.level-readout {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}
.level-readout b { color: var(--text); font-size: 15px; }

.tone-btn {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 1px solid rgba(167, 139, 250, 0.5);
  background: var(--accent-dim);
  color: var(--accent-2);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  transition: background 0.15s, transform 0.08s;
}
.tone-btn:hover { background: rgba(139, 92, 246, 0.28); }
.tone-btn:active { transform: scale(0.97); }
.tone-btn.playing { background: rgba(139, 92, 246, 0.45); color: #fff; }

.verify-panel {
  margin-top: 18px;
  border: 1px solid rgba(167, 139, 250, 0.35);
  background: var(--accent-dim);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data th, table.data td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}
table.data th {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.5px;
}
table.data td:first-child, table.data th:first-child { text-align: left; }
table.data tr:last-child td { border-bottom: none; }
.gain-pos { color: var(--accent-2); }
.gain-neg { color: #60a5fa; }

canvas.curve {
  width: 100%;
  height: 280px;
  display: block;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--canvas-bg);
}
canvas.curve.mini { height: 180px; }

.k-slider { max-width: 320px; }

.footer-note {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  margin-top: 26px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.tool-card {
  display: block;
  background: linear-gradient(180deg, var(--card), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  color: var(--text);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.tool-card:hover {
  text-decoration: none;
  border-color: rgba(139, 92, 246, 0.55);
  transform: translateY(-2px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}
.tool-card .num {
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--accent-2);
}
.tool-card h3 { margin: 6px 0 8px; font-size: 19px; }
.tool-card p { color: var(--muted); font-size: 14px; margin: 0; }

.kbd {
  display: inline-block;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0 6px;
  font-size: 12px;
  color: var(--text);
  background: var(--card-2);
  line-height: 18px;
  font-family: inherit;
}

.status {
  font-size: 13px;
  color: var(--muted);
}
.status.ok { color: var(--ok); }
.status.err { color: var(--danger); }

select, input[type="number"] {
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
}
input[type="file"] { color: var(--muted); font-size: 13px; max-width: 100%; }

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.vote-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vote-btns .btn { padding: 16px; font-size: 16px; }
.vote-btns .btn.neutral { grid-column: 1 / -1; }

@media (max-width: 600px) {
  .wrap { padding: 18px 14px 60px; }
  .card { padding: 18px; }
  .freq-display { font-size: 42px; }
  .vote-btns { grid-template-columns: 1fr; }
}

/* ---------- 开场界面 ---------- */

body.intro-lock { overflow: hidden; }

.intro {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(900px 600px at 50% 42%, rgba(139, 92, 246, 0.14), transparent 62%),
    radial-gradient(1200px 800px at 50% 120%, rgba(59, 130, 246, 0.08), transparent 60%),
    #07070b;
  overflow: hidden;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.intro::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 72%);
  pointer-events: none;
}

.intro::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
}

.intro-glow {
  position: absolute;
  width: min(1100px, 120vw);
  height: min(1100px, 120vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.16), transparent 62%);
  filter: blur(30px);
  animation: intro-drift 16s ease-in-out infinite alternate;
}

.intro-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px;
  max-width: 960px;
}

.intro-logo {
  width: 86px;
  height: 86px;
  margin: 0 auto 26px;
  display: block;
  border-radius: 22px;
  box-shadow: 0 22px 60px rgba(124, 58, 237, 0.3);
  opacity: 0;
  animation: intro-rise 0.9s 0.05s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.intro-kicker {
  font-size: 11px;
  letter-spacing: 0.52em;
  text-indent: 0.52em;
  color: rgba(255, 255, 255, 0.34);
  opacity: 0;
  animation: intro-rise 1.05s 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.intro-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 20px 0 30px;
  opacity: 0;
  animation: intro-rise 1.2s 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.intro-brand {
  font-size: clamp(12px, 1.3vw, 15px);
  font-weight: 600;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  color: #8f7bd6;
}

.intro-name {
  font-size: clamp(44px, 6.6vw, 78px);
  line-height: 1.02;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #ffffff 28%, #b7a6ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.intro-line {
  margin: 9px 0;
  font-size: clamp(14px, 1.5vw, 17px);
  letter-spacing: 0.08em;
  color: #8f8fa3;
  opacity: 0;
  animation: intro-rise 1.05s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.intro-line-1 { animation-delay: 1.4s; }
.intro-line-2 { animation-delay: 1.85s; }
.intro-line-3 { animation-delay: 2.3s; }

.intro-start {
  position: absolute;
  left: 50%;
  bottom: 11vh;
  z-index: 2;
  appearance: none;
  border: 1px solid rgba(167, 139, 250, 0.42);
  background: rgba(139, 92, 246, 0.1);
  color: #ece7ff;
  font: inherit;
  font-size: 14px;
  letter-spacing: 0.4em;
  text-indent: 0.4em;
  padding: 15px 56px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 44px rgba(124, 58, 237, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  opacity: 0;
  transform: translateX(-50%) scale(0.92);
  animation: intro-emerge 0.95s 2.95s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.intro-start:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(196, 181, 253, 0.72);
  box-shadow: 0 0 34px rgba(139, 92, 246, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.intro.leaving {
  opacity: 0;
  transform: scale(1.015);
  pointer-events: none;
}

main h1[tabindex="-1"]:focus { outline: none; }

@keyframes intro-rise {
  from { opacity: 0; transform: translateY(16px); filter: blur(6px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes intro-emerge {
  from { opacity: 0; transform: translateX(-50%) scale(0.9); filter: blur(10px); }
  to { opacity: 1; transform: translateX(-50%) scale(1); filter: blur(0); }
}

@keyframes intro-drift {
  from { transform: translate3d(-4%, -2%, 0) scale(1); }
  to { transform: translate3d(4%, 3%, 0) scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  .intro-glow { animation: none; }
  .intro-logo, .intro-kicker, .intro-title, .intro-line, .intro-start {
    animation: none;
    opacity: 1;
    transform: none;
    filter: none;
  }
  .intro-start { transform: translateX(-50%); }
  .intro { transition: none; }
}

/* ---------- 窗口关闭与确认 ---------- */

.win-close {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  margin-left: 8px;
  flex: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.win-close:hover {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}

body.modal-open { overflow: hidden; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--modal-backdrop);
  backdrop-filter: blur(6px);
}

.modal {
  width: min(430px, 100%);
  background: linear-gradient(180deg, var(--card), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.modal h2 {
  margin: 0 0 10px;
  font-size: 18px;
}
.modal p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ---------- 主题切换 ---------- */

.intro-prefs {
  position: absolute;
  top: 22px;
  right: 26px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}
.intro-prefs-label {
  letter-spacing: 0.06em;
}
.theme-dot {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  cursor: pointer;
  flex: none;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.theme-dot:hover { transform: scale(1.08); }
.theme-dark { background: #0d0d12; }
.theme-light { background: #f4f2f9; }
.theme-dot.active {
  border-color: transparent;
  box-shadow: 0 0 0 2px var(--accent-2);
}
.lang-switch {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.03em;
  padding: 5px 9px;
  border-radius: 8px;
  cursor: pointer;
  margin-left: 4px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.lang-switch:hover {
  border-color: var(--accent-2);
  color: var(--text);
}
html[data-theme="light"] .lang-switch {
  border-color: rgba(23, 21, 31, 0.18);
}

html[data-theme="light"] body {
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(109, 63, 214, 0.08), transparent 60%),
    var(--bg);
}
html[data-theme="light"] .btn:hover {
  border-color: rgba(23, 21, 31, 0.16);
}
html[data-theme="light"] .progress-line {
  background: rgba(23, 21, 31, 0.1);
}
html[data-theme="light"] .notice {
  background: rgba(23, 21, 31, 0.03);
}
html[data-theme="light"] .notice.warn {
  background: rgba(180, 120, 0, 0.08);
  border-color: rgba(180, 120, 0, 0.28);
  color: #8a5a00;
}
html[data-theme="light"] .notice.danger {
  background: rgba(194, 54, 54, 0.06);
  border-color: rgba(194, 54, 54, 0.28);
  color: #a02a2a;
}
html[data-theme="light"] .modal {
  box-shadow: 0 24px 60px rgba(40, 32, 70, 0.18);
}
html[data-theme="light"] .intro-prefs {
  color: rgba(23, 21, 31, 0.55);
}
html[data-theme="light"] .theme-dot {
  border-color: rgba(23, 21, 31, 0.22);
}
html[data-theme="light"] .intro {
  background:
    radial-gradient(900px 600px at 50% 42%, rgba(109, 63, 214, 0.1), transparent 62%),
    radial-gradient(1200px 800px at 50% 120%, rgba(59, 130, 246, 0.06), transparent 60%),
    #f6f5fa;
}
html[data-theme="light"] .intro::before {
  background-image:
    linear-gradient(rgba(23, 21, 31, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 21, 31, 0.05) 1px, transparent 1px);
}
html[data-theme="light"] .intro::after {
  background: radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(246, 245, 250, 0.6) 100%);
}
html[data-theme="light"] .intro-glow {
  background: radial-gradient(circle, rgba(109, 63, 214, 0.12), transparent 62%);
}
html[data-theme="light"] .intro-logo {
  box-shadow: 0 20px 50px rgba(109, 63, 214, 0.2);
}
html[data-theme="light"] .intro-kicker {
  color: rgba(23, 21, 31, 0.38);
}
html[data-theme="light"] .intro-brand {
  color: #6d3fd6;
}
html[data-theme="light"] .intro-name {
  background: linear-gradient(180deg, #1b1826 24%, #5b3bbd 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
html[data-theme="light"] .intro-line {
  color: #6b687c;
}
html[data-theme="light"] .intro-start {
  border-color: rgba(109, 63, 214, 0.3);
  background: rgba(109, 63, 214, 0.08);
  color: #3f2a7a;
  box-shadow: 0 10px 44px rgba(109, 63, 214, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
html[data-theme="light"] .intro-start:hover {
  background: rgba(109, 63, 214, 0.14);
  border-color: rgba(109, 63, 214, 0.5);
  box-shadow: 0 0 34px rgba(109, 63, 214, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* ---------- 视觉细节 ---------- */

::selection {
  background: rgba(139, 92, 246, 0.35);
}

* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.16) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.24); background-clip: padding-box; }
html[data-theme="light"] * { scrollbar-color: rgba(23, 21, 31, 0.2) transparent; }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(23, 21, 31, 0.18); background-clip: padding-box; }

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

select:focus,
input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

input[type="range"]::-webkit-slider-thumb {
  transition: box-shadow 0.15s;
}
input[type="range"]:hover::-webkit-slider-thumb {
  box-shadow: 0 0 0 6px rgba(139, 92, 246, 0.14), 0 2px 10px rgba(0, 0, 0, 0.4);
}

table.data tbody tr { transition: background 0.15s; }
table.data tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.015); }
table.data tbody tr:hover { background: var(--accent-dim); }

@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
main > section:not(.hidden) {
  animation: view-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

html[data-theme="light"] .card {
  box-shadow: 0 14px 40px rgba(40, 32, 70, 0.08);
}
html[data-theme="light"] .tool-card {
  box-shadow: 0 12px 34px rgba(40, 32, 70, 0.07);
}
html[data-theme="light"] .tool-card:hover {
  box-shadow: 0 18px 44px rgba(40, 32, 70, 0.12);
}
html[data-theme="light"] .card::before {
  background: linear-gradient(90deg, transparent, rgba(23, 21, 31, 0.06), transparent);
}
html[data-theme="light"] .btn.primary {
  box-shadow: 0 8px 22px rgba(109, 63, 214, 0.22);
}
html[data-theme="light"] .btn.primary:hover {
  box-shadow: 0 10px 30px rgba(109, 63, 214, 0.32);
}
html[data-theme="light"] .freq-display {
  text-shadow: 0 0 30px rgba(109, 63, 214, 0.16);
}
html[data-theme="light"] table.data tbody tr:nth-child(even) {
  background: rgba(23, 21, 31, 0.02);
}
html[data-theme="light"] .check input[type="checkbox"] {
  background: #fff;
}

@media (prefers-reduced-motion: reduce) {
  main > section:not(.hidden) { animation: none; }
  .btn:hover { transform: none; }
}
