/* ============================================================
   背景舞台层 — 顶部金色聚光 + 底部舞台反光
   ============================================================ */
.bg-layers {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% -10%, oklch(20% 0.02 260), transparent 60%),
    linear-gradient(180deg, var(--bg-lift), var(--bg) 40%, var(--bg-deep));
}
.spotlight {
  position: absolute;
  top: -24vh;
  left: 50%;
  transform: translateX(-50%);
  width: 130vw;
  height: 70vh;
  background:
    radial-gradient(ellipse 46% 100% at 50% 0%, oklch(86% 0.14 88 / 0.16), transparent 62%);
  filter: blur(6px);
}
.beam {
  position: absolute;
  top: 0;
  left: 50%;
  width: 60vw;
  height: 80vh;
  transform: translateX(-50%);
  background: linear-gradient(180deg, oklch(86% 0.14 88 / 0.07), transparent 55%);
  clip-path: polygon(42% 0, 58% 0, 100% 100%, 0% 100%);
  opacity: 0.55;
}
.floor-glow {
  position: absolute;
  bottom: -10vh;
  left: 50%;
  transform: translateX(-50%);
  width: 90vw;
  height: 40vh;
  background: radial-gradient(ellipse 50% 100% at 50% 100%, oklch(82% 0.13 80 / 0.10), transparent 65%);
  filter: blur(4px);
}

/* ============================================================
   App shell
   ============================================================ */
.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ---- Top nav ---- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0 14px;
  flex-shrink: 0;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  background:
    radial-gradient(circle at 30% 25%, oklch(96% 0.06 92 / 0.5), transparent 55%),
    var(--gold-grad);
  display: grid; place-items: center;
  box-shadow: 0 6px 18px -4px oklch(82% 0.14 86 / 0.4), inset 0 1px 0 oklch(98% 0.05 90 / 0.6);
}
.brand-mark svg { width: 22px; height: 22px; color: oklch(18% 0.02 70); }
.brand-name {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700;
  letter-spacing: -0.01em; line-height: 1.1;
}
.brand-name .dot { color: var(--gold-1); }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: 0.02em; margin-top: 1px; }
.nav-right { display: flex; align-items: center; gap: 14px; }
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 999px;
  background: oklch(20% 0.013 258);
  border: 1px solid var(--border);
  font-size: 11px; color: var(--fg-soft); font-weight: 500;
}
.badge-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px oklch(66% 0.16 160 / 0.8);
  animation: breathe 2.4s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.meta { font-family: var(--font-mono); font-size: 11px; color: var(--muted2); letter-spacing: 0.04em; }

/* ---- Hero ---- */
.hero { text-align: center; flex-shrink: 0; padding: 6px 0 10px; }
.eyebrow {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--gold-1); margin-bottom: 8px;
}
.title {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 700; letter-spacing: -0.025em;
  line-height: 1.08; color: var(--fg);
}
.lede { margin-top: 8px; font-size: 13.5px; color: var(--muted); letter-spacing: 0.01em; }

/* ---- Instrument tabs ---- */
.tabs-wrap { display: flex; justify-content: center; flex-shrink: 0; padding: 4px 0 2px; }
.tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  background: oklch(16% 0.011 258 / 0.72);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-md);
  padding: 5px; gap: 3px;
  border: 1px solid var(--border-2);
  box-shadow: inset 0 1px 0 oklch(100% 0 0 / 0.03);
}
.tab {
  padding: 9px 26px; border-radius: 9px; border: 0;
  background: transparent; color: var(--muted);
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}
.tab:hover { color: var(--fg-soft); }
.tab.active {
  background: var(--surface3); color: var(--fg);
  box-shadow: 0 2px 8px -2px oklch(0% 0 0 / 0.5), inset 0 0 0 1px oklch(82% 0.14 86 / 0.25);
}

/* ---- Stage ---- */
.stage {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px;
  min-height: 0; padding: 12px 0 4px;
  overflow-y: auto;
}
.stage::-webkit-scrollbar { width: 8px; }
.stage::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 4px; }
.layout { display: none; width: 100%; flex-direction: column; align-items: center; gap: 14px; }
.layout.active { display: flex; }
.row { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; max-width: 940px; }
/* ---- 底部设置条：八度 / 移调 / 键位布局 ---- */
.settings-bar {
  display: flex; align-items: center; justify-content: center;
  gap: 30px; padding: 10px 0 4px;
  flex-shrink: 0; flex-wrap: wrap;
}
.setting { display: inline-flex; align-items: center; gap: 10px; }
.setting-label {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted2);
}
.step-btn {
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--border-2); background: oklch(18% 0.012 258);
  color: var(--fg-soft); cursor: pointer;
  font-size: 15px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.1s;
}
.step-btn:hover { background: var(--surface2); color: var(--fg); border-color: var(--surface3); }
.step-btn:active { transform: scale(0.92); }
.step-val {
  min-width: 30px; text-align: center;
  font-family: var(--font-mono); font-size: 14px; color: var(--gold-1); font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.tabs.mini { padding: 4px; gap: 2px; }
.tabs.mini .tab { padding: 6px 18px; font-size: 13px; }
.instrument { width: 100%; display: none; }
.instrument.active {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  animation: fade-up 0.4s ease;
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.stage-frame {
  position: relative; width: 100%; max-width: 940px;
  background: linear-gradient(180deg, oklch(17% 0.012 258), oklch(13% 0.012 260));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 26px 26px;
  box-shadow: var(--shadow-stage), inset 0 1px 0 oklch(100% 0 0 / 0.04);
}
.stage-frame::before {
  content: ""; position: absolute; top: 0; left: 14%; right: 14%; height: 1px;
  background: var(--gold-line); opacity: 0.7;
}
.stage-label {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--muted2); margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.stage-label .pip {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--gold-1);
  box-shadow: 0 0 6px oklch(82% 0.14 86 / 0.7);
}

/* ============================================================
   Dock — now playing + controls
   ============================================================ */
.dock {
  display: flex; align-items: center; justify-content: center;
  gap: 18px; padding: 10px 0 4px;
  flex-shrink: 0; flex-wrap: wrap;
}
.now-playing { font-size: 13px; color: var(--muted); min-width: 150px; text-align: right; }
.now-playing .note-name {
  color: var(--gold-1); font-weight: 700; font-size: 16px;
  font-family: var(--font-mono); letter-spacing: 0.02em;
}
.pedal-indicator {
  font-family: var(--font-mono); font-size: 11px;
  padding: 6px 12px; border-radius: 999px;
  background: oklch(18% 0.012 258); border: 1px solid var(--border-2);
  color: var(--muted2); letter-spacing: 0.04em;
  transition: all 0.15s; white-space: nowrap;
}
.pedal-indicator.on {
  background: var(--gold-grad); border-color: oklch(72% 0.12 78);
  color: oklch(18% 0.02 70); font-weight: 600;
  box-shadow: 0 0 14px oklch(82% 0.14 86 / 0.4);
}

.controls {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; justify-content: center;
}
.timbre-pick {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: var(--radius-md);
  background: oklch(19% 0.012 258); border: 1px solid var(--border);
  color: var(--fg-soft); font-size: 13px;
}
.timbre-pick span { color: var(--muted); font-size: 12px; }
.timbre-pick select {
  background: transparent; color: var(--fg); border: 0;
  font-family: var(--font-body); font-size: 13px; cursor: pointer; outline: none;
}
.timbre-pick select option { background: oklch(16% 0.011 258); color: var(--fg); }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: oklch(19% 0.012 258); color: var(--fg-soft);
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all 0.18s; white-space: nowrap;
}
.btn .ic { width: 15px; height: 15px; flex-shrink: 0; }
.btn:hover { background: var(--surface2); border-color: var(--surface3); color: var(--fg); }
.btn:active { transform: scale(0.97); }
.btn.primary {
  background: var(--gold-grad);
  border: 1px solid oklch(72% 0.12 78);
  color: oklch(18% 0.02 70); font-weight: 600;
  box-shadow: 0 6px 18px -4px oklch(82% 0.14 86 / 0.35), inset 0 1px 0 oklch(98% 0.05 90 / 0.5);
}
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger {
  background: oklch(24% 0.06 22);
  border-color: oklch(46% 0.14 22 / 0.6);
  color: oklch(82% 0.16 22);
}
.btn.danger:hover { background: oklch(30% 0.08 22); }
.btn:disabled { opacity: 0.32; cursor: not-allowed; pointer-events: none; }
.btn.active {
  background: var(--gold-grad); color: oklch(18% 0.02 70); font-weight: 600;
  border-color: oklch(72% 0.12 78);
  box-shadow: 0 6px 18px -4px oklch(82% 0.14 86 / 0.35);
}
.metro { display: inline-flex; align-items: center; gap: 6px; }
.metro input {
  width: 56px; padding: 4px 6px; border-radius: 6px;
  background: oklch(16% 0.011 258); color: var(--fg);
  border: 1px solid var(--border-2);
  font-family: var(--font-mono); font-size: 13px; text-align: center; outline: none;
}
.metro-unit { font-size: 11px; color: var(--muted2); }
.demo { display: inline-flex; align-items: center; gap: 6px; }
.demo select {
  padding: 5px 8px; border-radius: 6px;
  background: oklch(16% 0.011 258); color: var(--fg);
  border: 1px solid var(--border-2); font-size: 13px; cursor: pointer; outline: none;
}
.demo select option { background: oklch(16% 0.011 258); }
.rec-timer {
  font-family: var(--font-mono); font-size: 13px; color: var(--danger);
  min-width: 50px; text-align: center; letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.rec-timer.live::before {
  content: ""; display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; background: var(--danger);
  margin-right: 6px; vertical-align: -1px;
  animation: pulse 1s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* 琴键下方的键位提示条已移除（键位标签仍显示在琴键表面） */

/* ---- Footer ---- */
.footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 0 16px;
  flex-shrink: 0; font-size: 11.5px; color: var(--muted2); flex-wrap: wrap;
}
.footer .sep { color: oklch(30% 0.012 258); margin: 0 6px; }
.footer .mono { font-family: var(--font-mono); color: var(--muted); }

/* ---- Toast ---- */
.toast {
  position: fixed; bottom: 44px; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: oklch(22% 0.013 258);
  border: 1px solid var(--border); color: var(--fg);
  padding: 11px 22px; border-radius: var(--radius-md);
  font-size: 14px; z-index: 100;
  transition: transform 0.3s ease; pointer-events: none;
  box-shadow: 0 12px 30px -8px oklch(0% 0 0 / 0.6);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .app { padding: 0 18px; }
  .lede { display: none; }
  .stage-frame { padding: 18px 18px 22px; }
}
@media (max-width: 768px) {
  .nav-right .meta { display: none; }
  .hero { padding: 2px 0 6px; }
  .tab { padding: 8px 18px; font-size: 13px; }
  .btn { padding: 9px 16px; font-size: 13px; }
  .now-playing { display: none; }
  .dock { gap: 10px; }
  .settings-bar { gap: 16px; }
}
@media (max-width: 520px) {
  .app { padding: 0 12px; }
  .brand-sub { display: none; }
  .badge { display: none; }
  .stage-frame { padding: 14px 12px 18px; }
  .tab { padding: 7px 12px; font-size: 12px; }
  .footer { font-size: 10.5px; justify-content: center; text-align: center; }
}
