/* css/base.css — 霓虹主题基座 / 布局 / 通用组件（Lead 所有） */

:root {
  /* —— 霓虹色板 —— */
  --neon-cyan: #22f5ff;
  --neon-magenta: #ff3ee8;
  --neon-purple: #a679ff;
  --neon-lime: #c6ff4a;
  --neon-amber: #ffc46b;
  --neon-blue: #4d8bff;
  --neon-rose: #ff5c8a;

  /* —— 基础色 —— */
  --bg: #04060e;
  --bg-glow: #0a1424;
  --panel: rgba(9, 14, 27, 0.86);
  --panel-2: #0b1424;
  --panel-3: #101d33;
  --border: rgba(34, 245, 255, 0.16);
  --border-soft: rgba(120, 170, 255, 0.11);
  --text: #e9f7ff;
  --text-dim: #9fb6d8;
  --muted: #6280a8;

  /* —— 语义色（含旧变量名，团队组件复用） —— */
  --accent: var(--neon-cyan);
  --accent-2: var(--neon-magenta);
  --accent-soft: rgba(34, 245, 255, 0.13);
  --teal: var(--neon-cyan);
  --teal-soft: rgba(34, 245, 255, 0.12);
  --blue: var(--neon-blue);
  --danger: #ff4d6d;
  --success: #4dffb0;
  --warn: var(--neon-amber);

  /* —— 左右手主题色 —— */
  --left-hand: var(--neon-cyan);
  --left-hand-soft: rgba(34, 245, 255, 0.14);
  --right-hand: var(--neon-magenta);
  --right-hand-soft: rgba(255, 62, 232, 0.14);

  /* —— 霓虹光效 —— */
  --glow-cyan: 0 0 6px rgba(34, 245, 255, 0.75), 0 0 18px rgba(34, 245, 255, 0.35);
  --glow-magenta: 0 0 6px rgba(255, 62, 232, 0.75), 0 0 20px rgba(255, 62, 232, 0.34);
  --glow-purple: 0 0 6px rgba(166, 121, 255, 0.7), 0 0 20px rgba(166, 121, 255, 0.32);
  --glow-soft: 0 0 0 1px rgba(34, 245, 255, 0.18), 0 0 22px rgba(34, 245, 255, 0.08);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Mono", "Consolas", "SFMono-Regular", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1100px 620px at 8% -12%, rgba(34, 245, 255, 0.16), transparent 62%),
    radial-gradient(1000px 640px at 96% 2%, rgba(255, 62, 232, 0.14), transparent 58%),
    radial-gradient(900px 700px at 55% 118%, rgba(166, 121, 255, 0.16), transparent 60%),
    linear-gradient(180deg, #050912 0%, #03050b 100%);
  background-attachment: fixed;
  overflow: hidden;
  position: relative;
}

/* 霓虹网格 + 扫描线（纯 CSS，无图片资源） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(34, 245, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 62, 232, 0.035) 1px, transparent 1px);
  background-size: 46px 46px, 46px 46px;
  mask-image: radial-gradient(circle at 50% 30%, rgba(0, 0, 0, 0.9), transparent 78%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.022) 0px,
    rgba(255, 255, 255, 0.022) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.5;
  animation: scanShift 9s linear infinite;
}

@keyframes scanShift {
  from { background-position: 0 0; }
  to { background-position: 0 120px; }
}

#app {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
}

/* 霓虹文字 */
.neon-text { color: var(--neon-cyan); text-shadow: var(--glow-cyan); }
.neon-text-magenta { color: var(--neon-magenta); text-shadow: var(--glow-magenta); }

@keyframes neonPulse {
  0%, 100% { opacity: 1; filter: brightness(1); }
  50% { opacity: 0.72; filter: brightness(1.35); }
}

/* ------------------------------- Top bar -------------------------------- */

#topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(34, 245, 255, 0.18);
  background: linear-gradient(180deg, rgba(6, 11, 22, 0.94), rgba(5, 9, 18, 0.82));
  backdrop-filter: blur(12px);
  flex: 0 0 auto;
  z-index: 20;
  box-shadow: 0 1px 0 rgba(34, 245, 255, 0.1), 0 12px 34px rgba(0, 0, 0, 0.35);
  position: relative;
}
#topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), var(--neon-magenta), transparent);
  opacity: 0.7;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.brand-icon { font-size: 22px; filter: drop-shadow(0 0 8px rgba(34, 245, 255, 0.55)); }
.brand-text {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #9dfbff, var(--neon-cyan) 35%, var(--neon-magenta) 78%, #ffb1ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px rgba(34, 245, 255, 0.35));
}
.brand-sub {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  flex: 1 1 auto;
}

.control-group { display: flex; align-items: center; gap: 6px; }

.topbar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}
.topbar-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  display: inline-block;
}
.topbar-status .dot.is-on {
  background: var(--success);
  box-shadow: 0 0 8px rgba(77, 255, 176, 0.9), 0 0 18px rgba(77, 255, 176, 0.5);
  animation: neonPulse 2.4s ease-in-out infinite;
}

/* -------------------------------- Layout -------------------------------- */

#layout {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 336px minmax(420px, 1fr) 356px;
  gap: 10px;
  padding: 10px;
  overflow: hidden;
}

.panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.panel-section {
  background: linear-gradient(180deg, rgba(15, 25, 44, 0.72) 0%, rgba(7, 12, 23, 0.9) 100%);
  border: 1px solid rgba(34, 245, 255, 0.14);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 30px rgba(0, 0, 0, 0.38);
  position: relative;
}
.panel-section::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(34, 245, 255, 0.06), transparent 36%, transparent 66%, rgba(255, 62, 232, 0.05));
}

#chord-library { flex: 1 1 58%; }
#chord-combos { flex: 1 1 42%; }
#pattern-library { flex: 1 1 55%; }
#right-combos { flex: 1 1 45%; }

#main-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}

#performance-deck { flex: 0 0 auto; min-height: 0; }

#score-area {
  flex: 1 1 auto;
  min-height: 0;
  background: linear-gradient(180deg, rgba(13, 21, 39, 0.8) 0%, rgba(6, 10, 20, 0.92) 100%);
  border: 1px solid rgba(166, 121, 255, 0.2);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 0 26px rgba(166, 121, 255, 0.07);
}

#statusbar {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 18px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid rgba(34, 245, 255, 0.12);
  background: linear-gradient(180deg, rgba(5, 9, 17, 0.92), rgba(3, 6, 12, 0.96));
}
.status-left, .status-right { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.statusbar kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 6px;
  border: 1px solid rgba(34, 245, 255, 0.32);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: rgba(34, 245, 255, 0.07);
  color: #b8f8ff;
  box-shadow: 0 0 8px rgba(34, 245, 255, 0.12);
}
.status-intro.is-on { color: var(--neon-magenta); font-weight: 700; text-shadow: var(--glow-magenta); }

/* ------------------------------ Generic UI ------------------------------ */

.btn {
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: linear-gradient(180deg, rgba(24, 38, 62, 0.9), rgba(10, 17, 31, 0.92));
  border: 1px solid rgba(34, 245, 255, 0.24);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  cursor: pointer;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s, transform 0.06s, color 0.16s;
  line-height: 1.2;
  user-select: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
}
.btn:hover {
  border-color: rgba(34, 245, 255, 0.62);
  color: #d8fdff;
  box-shadow: 0 0 12px rgba(34, 245, 255, 0.22), inset 0 0 12px rgba(34, 245, 255, 0.06);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid rgba(34, 245, 255, 0.6); outline-offset: 1px; }

.btn-primary {
  background: linear-gradient(100deg, rgba(34, 245, 255, 0.92), rgba(166, 121, 255, 0.92) 55%, rgba(255, 62, 232, 0.92));
  border-color: rgba(34, 245, 255, 0.75);
  color: #04121b;
  font-weight: 800;
  box-shadow: 0 0 14px rgba(34, 245, 255, 0.32), 0 0 26px rgba(255, 62, 232, 0.16);
}
.btn-primary:hover {
  color: #02101a;
  background: linear-gradient(100deg, #8bfcff, #c7a6ff 55%, #ff9cf1);
  box-shadow: 0 0 18px rgba(34, 245, 255, 0.5), 0 0 34px rgba(255, 62, 232, 0.3);
}
.btn-ghost { background: transparent; }
.btn-magenta { border-color: rgba(255, 62, 232, 0.4); color: #ffd7fb; }
.btn-magenta:hover { border-color: rgba(255, 62, 232, 0.8); box-shadow: 0 0 14px rgba(255, 62, 232, 0.3); }
.btn-danger { color: #ffd6e2; border-color: rgba(255, 77, 109, 0.45); background: rgba(48, 12, 24, 0.75); }
.btn-danger:hover { background: rgba(66, 14, 30, 0.9); border-color: rgba(255, 77, 109, 0.8); box-shadow: 0 0 14px rgba(255, 77, 109, 0.32); }
.btn-icon { padding: 4px 9px; font-size: 14px; }
.btn-audio.is-on {
  border-color: rgba(77, 255, 176, 0.65);
  color: #d8fff0;
  background: rgba(8, 42, 32, 0.85);
  box-shadow: 0 0 12px rgba(77, 255, 176, 0.3), inset 0 0 10px rgba(77, 255, 176, 0.08);
}
.btn-sm { padding: 3px 8px; font-size: 12px; }
.btn-xs { padding: 1px 6px; font-size: 11px; border-radius: 6px; }

.input {
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: rgba(4, 9, 18, 0.85);
  border: 1px solid rgba(34, 245, 255, 0.22);
  border-radius: var(--radius-sm);
  padding: 6px 9px;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
  min-width: 0;
}
.input:focus {
  border-color: rgba(34, 245, 255, 0.8);
  box-shadow: 0 0 0 2px rgba(34, 245, 255, 0.14), 0 0 14px rgba(34, 245, 255, 0.2);
}
.input-num { width: 62px; text-align: center; }
.input-select { width: 96px; }
.input-range { width: 92px; accent-color: var(--neon-cyan); padding: 0; background: transparent; border: none; }
.input::placeholder { color: var(--muted); }
select.input option { background: #081020; color: var(--text); }

.field-label {
  font-size: 10.5px;
  color: var(--text-dim);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  white-space: nowrap;
}

kbd, .kbd {
  font-family: var(--mono);
  font-size: 11px;
  min-width: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border: 1px solid rgba(34, 245, 255, 0.3);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: rgba(34, 245, 255, 0.07);
  color: #b8f8ff;
  line-height: 1.1;
  box-shadow: 0 0 8px rgba(34, 245, 255, 0.1);
}

/* section header used by all panels */
.section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 8px;
  border-bottom: 1px solid rgba(34, 245, 255, 0.12);
  flex: 0 0 auto;
  position: relative;
}
.section-head::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, rgba(34, 245, 255, 0.55), rgba(255, 62, 232, 0.4), transparent);
  opacity: 0.7;
}
.section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #d9fbff;
  text-shadow: 0 0 10px rgba(34, 245, 255, 0.28);
}
.section-title .count {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  text-shadow: none;
}
.section-head .spacer { flex: 1 1 auto; }
.section-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 10px 12px;
  position: relative;
}

.section-body::-webkit-scrollbar { width: 8px; height: 8px; }
.section-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(34, 245, 255, 0.4), rgba(255, 62, 232, 0.3));
  border-radius: 8px;
}
.section-body::-webkit-scrollbar-track { background: transparent; }

.empty-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  padding: 14px 6px;
  text-align: center;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-dim);
  background: rgba(34, 245, 255, 0.06);
  border: 1px solid rgba(34, 245, 255, 0.18);
  border-radius: 999px;
  padding: 1px 8px;
}

.divider { height: 1px; background: linear-gradient(90deg, transparent, rgba(34, 245, 255, 0.25), transparent); margin: 8px 0; }

/* -------------------------------- Toast --------------------------------- */

#toast-root {
  position: fixed;
  right: 18px;
  bottom: 44px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 200px;
  max-width: 380px;
  padding: 10px 15px;
  border-radius: 11px;
  font-size: 13px;
  background: rgba(8, 15, 28, 0.94);
  border: 1px solid rgba(34, 245, 255, 0.4);
  box-shadow: 0 0 18px rgba(34, 245, 255, 0.18), 0 12px 34px rgba(0, 0, 0, 0.5);
  color: var(--text);
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.2s, transform 0.2s;
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.toast.is-in { opacity: 1; transform: translateY(0) scale(1); }
.toast-success { border-color: rgba(77, 255, 176, 0.55); box-shadow: 0 0 18px rgba(77, 255, 176, 0.22), 0 12px 34px rgba(0, 0, 0, 0.5); }
.toast-warn { border-color: rgba(255, 196, 107, 0.6); box-shadow: 0 0 18px rgba(255, 196, 107, 0.2), 0 12px 34px rgba(0, 0, 0, 0.5); }
.toast-error { border-color: rgba(255, 77, 109, 0.65); box-shadow: 0 0 18px rgba(255, 77, 109, 0.25), 0 12px 34px rgba(0, 0, 0, 0.5); }
.toast-info { border-color: rgba(34, 245, 255, 0.45); }

/* -------------------------------- Modal --------------------------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(700px 400px at 30% 20%, rgba(34, 245, 255, 0.1), transparent 60%),
    radial-gradient(700px 400px at 75% 80%, rgba(255, 62, 232, 0.1), transparent 60%),
    rgba(2, 5, 11, 0.72);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.18s;
}
.modal-overlay.is-in { opacity: 1; }

.modal-dialog {
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0a1220, #060b15);
  border: 1px solid rgba(34, 245, 255, 0.32);
  border-radius: 16px;
  box-shadow: 0 0 34px rgba(34, 245, 255, 0.16), 0 28px 80px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.18s;
  overflow: hidden;
}
.modal-overlay.is-in .modal-dialog { transform: translateY(0) scale(1); }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(34, 245, 255, 0.14);
  background: linear-gradient(90deg, rgba(34, 245, 255, 0.06), transparent);
}
.modal-title { font-size: 14px; font-weight: 700; color: #d9fbff; text-shadow: 0 0 10px rgba(34, 245, 255, 0.25); }
.modal-close {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 6px;
}
.modal-close:hover { color: var(--neon-cyan); border-color: rgba(34, 245, 255, 0.3); }
.modal-body {
  padding: 14px 16px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.7;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px 14px;
  border-top: 1px solid rgba(34, 245, 255, 0.1);
}
.modal-form { display: flex; flex-direction: column; gap: 8px; }
.modal-text { margin: 0 0 8px; color: var(--text-dim); }
.modal-text:last-child { margin-bottom: 0; }

.key-capture {
  margin: 10px 0 2px;
  padding: 18px;
  border: 1px dashed rgba(34, 245, 255, 0.42);
  border-radius: 10px;
  text-align: center;
  font-family: var(--mono);
  font-size: 20px;
  color: var(--neon-cyan);
  text-shadow: var(--glow-cyan);
  background: rgba(4, 10, 20, 0.9);
  transition: color 0.15s, border-color 0.15s;
}
.key-capture.is-invalid { color: var(--danger); border-color: rgba(255, 77, 109, 0.6); text-shadow: 0 0 12px rgba(255, 77, 109, 0.6); }

/* --------------------------- 演奏台 (deck) ------------------------------ */
/* 左手区：青色霓虹（键盘左侧）；右手区：品红霓虹（键盘右侧） */

.deck {
  background:
    radial-gradient(560px 260px at 0% 0%, rgba(34, 245, 255, 0.1), transparent 60%),
    radial-gradient(560px 260px at 100% 0%, rgba(255, 62, 232, 0.1), transparent 60%),
    linear-gradient(180deg, rgba(12, 20, 37, 0.94), rgba(5, 9, 18, 0.96));
  border: 1px solid rgba(34, 245, 255, 0.2);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 28px rgba(34, 245, 255, 0.08), 0 10px 30px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  container-type: inline-size;
  position: relative;
}
.deck::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(34, 245, 255, 0.04), transparent 30%, transparent 70%, rgba(255, 62, 232, 0.04));
}

.deck-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-bottom: 1px solid rgba(34, 245, 255, 0.12);
}
.deck-legend {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-dim);
}
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.legend-dot-left { background: var(--left-hand); box-shadow: 0 0 9px rgba(34, 245, 255, 0.85); }
.legend-dot-right { background: var(--right-hand); box-shadow: 0 0 9px rgba(255, 62, 232, 0.85); }
.legend-sep { color: var(--border); }

.deck-body-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); }
.deck-hand {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 7px 12px 10px;
  position: relative;
}
.deck-hand-left {
  border-right: 1px solid rgba(34, 245, 255, 0.18);
  background: linear-gradient(180deg, rgba(34, 245, 255, 0.055), transparent 60%);
}
.deck-hand-left::after {
  content: "";
  position: absolute;
  top: 10%;
  bottom: 10%;
  right: -1px;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--left-hand), transparent);
  box-shadow: 0 0 12px rgba(34, 245, 255, 0.8);
  opacity: 0.65;
}
.deck-hand-right { background: linear-gradient(180deg, rgba(255, 62, 232, 0.05), transparent 60%); }

.deck-hand-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
  row-gap: 3px;
}
.hand-badge {
  font-size: 11px;
  font-weight: 800;
  border-radius: 7px;
  padding: 2px 8px;
  white-space: nowrap;
  letter-spacing: 0.5px;
}
.hand-badge-left {
  color: #032028;
  background: linear-gradient(100deg, #9bfbff, var(--left-hand));
  border: 1px solid rgba(34, 245, 255, 0.7);
  box-shadow: 0 0 12px rgba(34, 245, 255, 0.45);
}
.hand-badge-right {
  color: #22021f;
  background: linear-gradient(100deg, #ffc2f6, var(--right-hand));
  border: 1px solid rgba(255, 62, 232, 0.7);
  box-shadow: 0 0 12px rgba(255, 62, 232, 0.42);
}
.hand-title { font-size: 12px; font-weight: 700; color: var(--text); white-space: nowrap; }
.hand-hint { font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck-hand-head .spacer { flex: 1 1 auto; }

.deck-hand-body { min-width: 0; display: flex; }
.deck-left-content { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 auto; }
.deck-left-top { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.deck-left-body { gap: 10px; align-items: flex-start; }
.deck-right-body { flex-direction: column; gap: 4px; flex: 1 1 auto; }

.deck-diagram-col { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.deck-diagram { display: flex; align-items: center; justify-content: center; filter: drop-shadow(0 0 10px rgba(34, 245, 255, 0.2)); }
.deck-strings {
  width: 116px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 1px 0 0;
}
.deck-string {
  position: relative;
  height: 6px;
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(120, 190, 230, 0.35), rgba(30, 50, 80, 0.6));
  opacity: 0.5;
  transition: opacity 0.15s, box-shadow 0.15s, background 0.15s;
}
.deck-string .deck-string-label {
  position: absolute;
  right: -12px;
  top: -2px;
  font-size: 8px;
  color: var(--muted);
}
.deck-string.is-hit {
  opacity: 1;
  background: linear-gradient(180deg, #e6ffff, var(--left-hand));
  box-shadow: 0 0 12px rgba(34, 245, 255, 0.9), 0 0 24px rgba(34, 245, 255, 0.4);
}

.deck-info { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.deck-chord-name {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #d9fdff;
  line-height: 1.1;
  text-shadow: 0 0 8px rgba(34, 245, 255, 0.85), 0 0 24px rgba(34, 245, 255, 0.35);
}
.deck-meta { font-size: 10px; color: var(--text-dim); line-height: 1.5; }

/* 左手和弦按键 chips（v3 增大，更醒目；单行横向滚动，避免和弦多时撑高演奏台） */
.deck-progression {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  margin-top: 6px;
  padding: 2px 2px 4px;
  max-height: 46px;
  scrollbar-width: thin;
}
.deck-chord-chip { flex: 0 0 auto; }
.deck-chord-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 5px;
  border-radius: 11px;
  border: 1px solid rgba(34, 245, 255, 0.32);
  background: linear-gradient(180deg, rgba(8, 20, 34, 0.92), rgba(5, 12, 22, 0.92));
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.14s, box-shadow 0.14s, background 0.14s, transform 0.06s;
}
.deck-chord-chip:hover {
  border-color: rgba(34, 245, 255, 0.75);
  box-shadow: 0 0 14px rgba(34, 245, 255, 0.25);
}
.deck-chord-chip:active { transform: translateY(1px); }
.deck-chord-chip.is-current {
  border-color: rgba(34, 245, 255, 0.95);
  background: linear-gradient(180deg, rgba(34, 245, 255, 0.28), rgba(34, 245, 255, 0.08));
  box-shadow: 0 0 16px rgba(34, 245, 255, 0.38), inset 0 0 18px rgba(34, 245, 255, 0.12);
}
.deck-chip-key {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 800;
  min-width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(34, 245, 255, 0.22), rgba(34, 245, 255, 0.06));
  border: 1px solid rgba(34, 245, 255, 0.5);
  color: #aefcff;
  text-shadow: 0 0 8px rgba(34, 245, 255, 0.8);
  box-shadow: 0 0 10px rgba(34, 245, 255, 0.22);
}
.deck-chord-chip.is-current .deck-chip-key {
  background: linear-gradient(180deg, #c9feff, var(--left-hand));
  color: #021318;
  text-shadow: none;
  border-color: rgba(34, 245, 255, 0.9);
  box-shadow: 0 0 14px rgba(34, 245, 255, 0.6);
}
.deck-chip-name { font-weight: 700; font-size: 14px; }

.deck-left-actions { display: flex; gap: 4px; flex: 0 0 auto; }
.deck-hand-hint { font-size: 9.5px; color: var(--muted); line-height: 1.45; }
.deck-intro-toggle {
  font-size: 10.5px;
  padding: 2px 8px;
  white-space: nowrap;
  border-color: rgba(255, 62, 232, 0.35);
}
.deck-intro-toggle.is-on {
  border-color: rgba(255, 62, 232, 0.9);
  color: #ffe3fb;
  background: rgba(52, 8, 46, 0.9);
  box-shadow: 0 0 16px rgba(255, 62, 232, 0.4);
  animation: neonPulse 1.8s ease-in-out infinite;
}
.deck-intro-toggle:disabled { opacity: 0.5; }

/* 右手播放模式：三段式大按钮（v3 新增“和弦联动”） */
.deck-right-actions { display: flex; gap: 4px; flex: 0 0 auto; align-items: center; }
.deck-right-actions > .btn { white-space: nowrap; }
.deck-mode-seg {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 11px;
  background: rgba(4, 9, 18, 0.8);
  border: 1px solid rgba(255, 62, 232, 0.24);
  box-shadow: inset 0 0 14px rgba(255, 62, 232, 0.06);
}
.deck-mode-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  line-height: 1.15;
}
.deck-mode-btn:hover { color: #ffd7fb; border-color: rgba(255, 62, 232, 0.4); }
.deck-mode-btn.is-active {
  color: #24021f;
  background: linear-gradient(100deg, #ffb3f2, var(--right-hand));
  border-color: rgba(255, 62, 232, 0.9);
  box-shadow: 0 0 14px rgba(255, 62, 232, 0.5);
}
.deck-mode-btn.is-active[data-mode="chord"] {
  background: linear-gradient(100deg, #b9a2ff, var(--neon-purple));
  border-color: rgba(166, 121, 255, 0.95);
  box-shadow: 0 0 16px rgba(166, 121, 255, 0.55);
}
/* 演奏台右手区：三段式模式按钮占满整行，更醒目 */
.deck-right-body .deck-mode-seg { width: 100%; }
.deck-right-body .deck-mode-btn { flex: 1 1 0; padding: 8px 6px; font-size: 13px; }

.deck-pattern-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.deck-pattern-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #ffd7fb;
  text-shadow: 0 0 10px rgba(255, 62, 232, 0.3);
}
.deck-pattern-meta { font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.deck-pattern { min-width: 0; overflow-x: auto; overflow-y: hidden; }

.deck-action {
  font-size: 10px;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(34, 245, 255, 0.45);
  min-height: 14px;
  font-family: var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deck-intro {
  margin-top: 3px;
  border-top: 1px solid rgba(255, 62, 232, 0.16);
  padding-top: 5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.deck-intro.is-active {
  background: rgba(255, 62, 232, 0.07);
  border: 1px solid rgba(255, 62, 232, 0.4);
  border-radius: 9px;
  margin: 3px -5px 0;
  padding: 6px 7px;
  box-shadow: 0 0 18px rgba(255, 62, 232, 0.16), inset 0 0 16px rgba(255, 62, 232, 0.05);
}
.deck-intro-empty { font-size: 10px; color: var(--muted); }
.deck-intro-progress { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 10.5px; }
.deck-intro-label { color: var(--right-hand); font-weight: 800; text-shadow: var(--glow-magenta); }
.deck-intro-count { color: var(--muted); }
.deck-intro-now { color: var(--text-dim); }
.deck-intro-note { font-family: var(--mono); color: var(--neon-amber); font-size: 10px; text-shadow: 0 0 8px rgba(255, 196, 107, 0.5); }
.deck-intro-desc {
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.deck-intro-chips { display: flex; gap: 3px; flex-wrap: wrap; max-height: 40px; overflow: hidden; }
.deck-intro-chip {
  font-family: var(--mono);
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(255, 62, 232, 0.06);
  border: 1px solid rgba(255, 62, 232, 0.2);
  color: #ffd7fb;
}
.deck-intro-chip.is-current {
  color: #24021f;
  background: linear-gradient(180deg, #ffc2f6, var(--right-hand));
  border-color: rgba(255, 62, 232, 0.9);
  font-weight: 800;
  box-shadow: 0 0 10px rgba(255, 62, 232, 0.55);
}
.deck-intro-more { font-size: 9.5px; color: var(--muted); }
.deck-intro-hint { font-size: 10px; color: var(--muted); }
.deck-intro-hint.is-active { color: var(--right-hand); font-weight: 700; text-shadow: 0 0 8px rgba(255, 62, 232, 0.4); }

/* ------------------------- 和弦组合面板 ------------------------- */

.combo-body { display: flex; flex-direction: column; gap: 8px; }

.combo-card {
  border: 1px solid rgba(34, 245, 255, 0.14);
  border-radius: 11px;
  background: rgba(8, 14, 26, 0.6);
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.combo-card.is-active {
  border-color: rgba(34, 245, 255, 0.55);
  background: linear-gradient(180deg, rgba(34, 245, 255, 0.09), rgba(8, 14, 26, 0.7));
  box-shadow: 0 0 18px rgba(34, 245, 255, 0.14), inset 0 0 0 1px rgba(34, 245, 255, 0.1);
}

.combo-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  cursor: pointer;
  user-select: none;
}
.combo-head:hover { background: rgba(34, 245, 255, 0.04); }
.combo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22344d;
  flex: 0 0 auto;
}
.combo-card.is-active .combo-dot {
  background: var(--left-hand);
  box-shadow: 0 0 10px rgba(34, 245, 255, 0.95);
  animation: neonPulse 2s ease-in-out infinite;
}
.combo-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}
.combo-count { font-size: 10px; padding: 0 6px; }

.combo-items { display: flex; flex-direction: column; gap: 5px; padding: 0 8px 6px; }
.combo-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px;
  border-radius: 9px;
  background: rgba(4, 9, 18, 0.62);
  border: 1px solid rgba(34, 245, 255, 0.1);
}
.combo-key {
  flex: 0 0 auto;
  min-width: 40px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid rgba(34, 245, 255, 0.4);
  border-bottom-width: 3px;
  background: linear-gradient(180deg, rgba(20, 38, 58, 0.95), rgba(8, 16, 28, 0.95));
  color: #aefcff;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.12s;
  text-shadow: 0 0 8px rgba(34, 245, 255, 0.6);
}
.combo-key.is-bound {
  color: #021318;
  background: linear-gradient(180deg, #c9feff, var(--left-hand));
  border-color: rgba(34, 245, 255, 0.9);
  box-shadow: 0 0 14px rgba(34, 245, 255, 0.45);
  text-shadow: none;
}
.combo-key.is-unbound { color: var(--muted); border-style: dashed; text-shadow: none; }
.combo-key:hover { border-color: rgba(34, 245, 255, 0.9); box-shadow: 0 0 14px rgba(34, 245, 255, 0.35); }

.combo-chord {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
}
.combo-chord:hover { background: rgba(34, 245, 255, 0.1); }
.combo-chord-name { font-size: 14px; font-weight: 700; }
.combo-chord-voicing {
  font-size: 10px;
  color: var(--muted);
  border: 1px dashed rgba(34, 245, 255, 0.25);
  border-radius: 999px;
  padding: 0 6px;
  white-space: nowrap;
}
.combo-chord-voicing:hover { color: var(--neon-cyan); border-color: rgba(34, 245, 255, 0.6); }
.combo-item-tools { display: flex; gap: 2px; flex: 0 0 auto; }
.combo-actions { display: flex; gap: 6px; padding: 0 8px 8px; }

/* 和弦选择器 */
.chord-picker { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; }
.chord-picker .input { width: 100%; }
.picker-tip { font-size: 11px; color: var(--muted); }
.picker-added { font-size: 11px; color: var(--neon-lime); min-height: 14px; }
.picker-list { overflow: auto; max-height: 42vh; display: flex; flex-direction: column; gap: 2px; }
.picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}
.picker-row:hover {
  background: rgba(34, 245, 255, 0.09);
  border-color: rgba(34, 245, 255, 0.35);
  box-shadow: 0 0 12px rgba(34, 245, 255, 0.12);
}
.picker-symbol { font-weight: 800; min-width: 70px; color: #d9fdff; }
.picker-quality { color: var(--muted); font-size: 11px; flex: 1 1 auto; }
.picker-plus { color: var(--neon-cyan); font-size: 12px; text-shadow: var(--glow-cyan); }

/* 帮助 */
.help-body h4 { margin: 14px 0 4px; font-size: 13px; color: var(--neon-cyan); text-shadow: 0 0 10px rgba(34, 245, 255, 0.3); }
.help-body h4:first-child { margin-top: 0; }
.help-body p { margin: 0 0 8px; color: var(--text-dim); font-size: 12.5px; line-height: 1.75; }
.help-body .muted { color: var(--muted); }

/* ------------------------------ Scrollbars ------------------------------ */

*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(34, 245, 255, 0.42), rgba(255, 62, 232, 0.32));
  border-radius: 9px;
}
*::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, rgba(34, 245, 255, 0.7), rgba(255, 62, 232, 0.55)); }
*::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------ Responsive ------------------------------ */

@media (max-width: 1280px) {
  #layout { grid-template-columns: 300px minmax(360px, 1fr) 320px; }
  .deck-body-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

@media (max-width: 1080px) {
  #layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    overflow: auto;
  }
  #left-panel, #right-panel { flex-direction: row; overflow: visible; }
  #left-panel .panel-section, #right-panel .panel-section { flex: 1 1 0; min-height: 320px; }
  #main-panel { min-height: 620px; }
  body { overflow: auto; }
}

/* 演奏台变窄时左右手区自动上下堆叠（容器查询，适配任意主区域宽度） */
@container (max-width: 700px) {
  .deck-body-split { grid-template-columns: 1fr; }
  .deck-hand-left { border-right: none; border-bottom: 1px solid rgba(34, 245, 255, 0.18); }
  .deck-hand-left::after { display: none; }
  .deck-left-top { flex-wrap: wrap; }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  body::after { animation: none; }
  .combo-card.is-active .combo-dot,
  .deck-intro-toggle.is-on,
  .topbar-status .dot.is-on { animation: none; }
}
