/* HKIIT Sound Mixing Simulator — Tab2 Channel Strip
   Dark console aesthetic; original styles (not Pro Tools / Sound Desk assets). */

:root {
  --cs-bg: #0b0e12;
  --cs-panel: #141a22;
  --cs-panel-2: #1a222d;
  --cs-border: #2a3544;
  --cs-border-lit: #3d8bfd;
  --cs-text: #e6edf3;
  --cs-muted: #8b9bb0;
  --cs-label: #9aa8b8;
  --cs-solo: #f0c14b;
  --cs-solo-bg: #5a4a12;
  --cs-mute: #ff6b6b;
  --cs-mute-bg: #5a1e1e;
  --cs-accent: #3ddc97;
  --cs-knob: #2c3644;
  --cs-fader: #3ddc97;
  --cs-master: #4c6fff;
  --cs-effect: #9b59ff;
  --cs-flash: #f0c14b; /* task focus yellow */
  --cs-font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --cs-mono: "SF Mono", "Cascadia Mono", "Consolas", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.cs-page {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at top, #121820 0%, var(--cs-bg) 60%);
  color: var(--cs-text);
  font-family: var(--cs-font);
}

.cs-page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--cs-border);
  background: rgba(10, 14, 20, 0.85);
}

.cs-page-header h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.cs-page-header .cs-sub {
  color: var(--cs-muted);
  font-size: 0.8rem;
}

.cs-page-header .cs-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--cs-border);
  color: var(--cs-accent);
}

.cs-console {
  padding: 1rem 0.75rem 1.5rem;
  overflow-x: auto;
}

.cs-strips {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0.45rem;
  min-width: max-content;
  margin: 0 auto;
  padding: 0.5rem;
  background: linear-gradient(180deg, #0e131a 0%, #0a0d12 100%);
  border: 1px solid var(--cs-border);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.cs-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 118px;
  min-height: 560px;
  padding: 0.55rem 0.4rem 0.65rem;
  background: linear-gradient(180deg, var(--cs-panel) 0%, var(--cs-panel-2) 100%);
  border: 1px solid var(--cs-border);
  border-radius: 8px;
  gap: 0.45rem;
}

.cs-channel:hover {
  border-color: #3a4a5c;
}

.cs-strip.cs-sound[data-user-added="true"] {
  box-shadow: inset 0 3px 0 var(--cs-accent);
}

.cs-effect {
  border-color: color-mix(in srgb, var(--cs-effect) 45%, var(--cs-border));
  box-shadow: inset 0 0 0 1px rgba(155, 89, 255, 0.15);
}

.cs-master {
  width: 128px;
  border-color: color-mix(in srgb, var(--cs-master) 50%, var(--cs-border));
  box-shadow: inset 0 0 0 1px rgba(76, 111, 255, 0.18);
}

/* Nameplate */
.cs-nameplate {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
}

.cs-name {
  width: 100%;
  background: #0a0e14;
  border: 1px solid #243041;
  border-radius: 4px;
  color: var(--cs-text);
  font-size: 0.68rem;
  padding: 0.28rem 0.3rem;
  text-align: center;
}

.cs-name:focus {
  outline: none;
  border-color: var(--cs-border-lit);
}

.cs-name-static {
  display: block;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.28rem 0.2rem;
  background: #0a0e14;
  border: 1px solid #243041;
  border-radius: 4px;
}

.cs-abbr {
  display: block;
  text-align: center;
  font-family: var(--cs-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--cs-accent);
  padding: 0.1rem 0;
}

.cs-nameplate-fx .cs-abbr { color: #c9a0ff; }
.cs-nameplate-mst .cs-abbr { color: #8eabff; }

.cs-label {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  color: var(--cs-label);
  text-transform: uppercase;
}

/* Buttons */
.cs-btn-row {
  display: flex;
  gap: 0.3rem;
  width: 100%;
  justify-content: center;
}

.cs-btn {
  appearance: none;
  border: 1px solid #334155;
  background: #1c2430;
  color: var(--cs-muted);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 4px;
  padding: 0.28rem 0.45rem;
  cursor: pointer;
  min-width: 2rem;
  transition: background 0.12s, color 0.12s, box-shadow 0.12s, border-color 0.12s;
}

.cs-btn:hover {
  border-color: #4a5d73;
  color: var(--cs-text);
}

.cs-btn.cs-solo.is-lit {
  background: var(--cs-solo);
  color: #1a1400;
  border-color: #ffe08a;
  box-shadow: 0 0 10px rgba(240, 193, 75, 0.45);
}

.cs-btn.cs-mute.is-lit {
  background: var(--cs-mute);
  color: #1a0505;
  border-color: #ff9a9a;
  box-shadow: 0 0 10px rgba(255, 107, 107, 0.4);
}

.cs-btn.cs-lowcut {
  width: 100%;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
}

.cs-btn.cs-lowcut.is-lit {
  background: #2a6f9e;
  color: #e8f6ff;
  border-color: #6eb5ff;
  box-shadow: 0 0 8px rgba(110, 181, 255, 0.35);
}

/* Rotary */
.cs-rotary-block {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.cs-rotary {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #3a4658, var(--cs-knob));
  border: 2px solid #0a0d12;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255, 255, 255, 0.05);
  cursor: ns-resize;
  touch-action: none;
  user-select: none;
}

.cs-rotary-knob {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #1a222c, #2e3a4a, #1a222c);
  transform: rotate(var(--rot, -135deg));
}

.cs-rotary-knob::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 50%;
  width: 3px;
  height: 10px;
  margin-left: -1.5px;
  background: var(--cs-accent);
  border-radius: 1px;
  box-shadow: 0 0 4px rgba(61, 220, 151, 0.6);
}

.cs-rotary-value {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -40%);
  font-family: var(--cs-mono);
  font-size: 0.58rem;
  color: var(--cs-text);
  pointer-events: none;
  z-index: 1;
}

/* Pan */
.cs-pan-block {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.cs-pan {
  width: 100%;
  cursor: ew-resize;
  touch-action: none;
  user-select: none;
  padding: 0.15rem 0;
}

.cs-pan-track {
  position: relative;
  height: 8px;
  margin: 0.15rem 0.2rem;
  background: #0a0e14;
  border-radius: 4px;
  border: 1px solid #243041;
}

.cs-pan-thumb {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  margin-top: -6px;
  background: #d0dae8;
  border-radius: 2px;
  border: 1px solid #6b7c90;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
}

.cs-pan-value {
  display: block;
  text-align: center;
  font-family: var(--cs-mono);
  font-size: 0.62rem;
  color: var(--cs-muted);
}

/* Fader */
.cs-fader-block {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  gap: 0.25rem;
  width: 100%;
  min-height: 160px;
  padding: 0.2rem 0;
}

.cs-fader-readout {
  position: absolute;
  top: -0.1rem;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--cs-mono);
  font-size: 0.62rem;
  color: var(--cs-accent);
  pointer-events: none;
}

.cs-fader-track {
  position: relative;
  width: 22px;
  margin-top: 1.1rem;
  background: #070a0e;
  border: 1px solid #243041;
  border-radius: 4px;
  cursor: ns-resize;
  touch-action: none;
  user-select: none;
  overflow: hidden;
}

.cs-fader-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(61, 220, 151, 0.55), rgba(61, 220, 151, 0.15));
  pointer-events: none;
}

.cs-fader-thumb {
  position: absolute;
  left: 1px;
  right: 1px;
  height: 14px;
  margin-bottom: -7px;
  background: linear-gradient(180deg, #e8eef6, #9aa8b8);
  border-radius: 2px;
  border: 1px solid #6b7c90;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.cs-fader-scale {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin-top: 1.1rem;
  font-size: 0.5rem;
  color: #5a6a7c;
  font-family: var(--cs-mono);
  line-height: 1;
  padding: 0.15rem 0;
}

.cs-fader-master .cs-fader-fill {
  background: linear-gradient(180deg, rgba(76, 111, 255, 0.65), rgba(76, 111, 255, 0.18));
}

.cs-effect .cs-fader-fill {
  background: linear-gradient(180deg, rgba(155, 89, 255, 0.6), rgba(155, 89, 255, 0.18));
}

/* Task highlight flash (wired for later task bots) */
@keyframes cs-task-flash {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(240, 193, 75, 0.35);
  }
  50% {
    box-shadow: 0 0 0 2px var(--cs-flash), 0 0 18px rgba(240, 193, 75, 0.75);
  }
}

@keyframes cs-task-flash-yellow {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(240, 193, 75, 0.35);
  }
  50% {
    box-shadow: 0 0 0 2px var(--cs-flash), 0 0 18px rgba(240, 193, 75, 0.75);
  }
}

/* Task-selected related faders: yellow pulse until clear */
.cs-fader-block.task-flash-yellow {
  animation: cs-task-flash-yellow 0.45s ease-in-out infinite;
  border-radius: 6px;
}

/* Legacy one-shot (non-focus) */
.cs-fader-block.task-flash,
.task-flash {
  animation: cs-task-flash-yellow 0.45s ease-in-out infinite;
  border-radius: 6px;
}

/* EQ */
.cs-eq-block {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  margin-top: auto;
}

.cs-eq-canvas {
  width: 100%;
  height: 80px;
  background: #0d1117;
  border: 1px solid #243041;
  border-radius: 4px;
  cursor: crosshair;
  touch-action: none;
}

.cs-eq-hint {
  font-size: 0.52rem;
  color: #5a6a7c;
  letter-spacing: 0.04em;
}

.cs-fx-note {
  font-size: 0.55rem;
  color: #8a7ab0;
  text-align: center;
  line-height: 1.3;
  padding: 0.2rem;
}

.cs-master-spacer {
  flex: 0 0 2.5rem;
}

.cs-master-badge {
  margin-top: auto;
  font-family: var(--cs-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #8eabff;
  border: 1px solid #3a4f8a;
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
}

.cs-demo-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.65rem 1.25rem 1.25rem;
  color: var(--cs-muted);
  font-size: 0.78rem;
}

.cs-demo-bar button {
  appearance: none;
  border: 1px solid var(--cs-border);
  background: #1a222d;
  color: var(--cs-text);
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  cursor: pointer;
}

.cs-demo-bar button:hover {
  border-color: var(--cs-accent);
}

.cs-demo-bar code {
  font-family: var(--cs-mono);
  font-size: 0.72rem;
  color: var(--cs-accent);
  background: #121820;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
}

@media (max-width: 900px) {
  .cs-strip {
    width: 104px;
    min-height: 520px;
  }
}

/* --- Formal-spec additions (screen / zh hooks / eq legend) --- */
.cs-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.3rem 0.2rem;
  background: #06090e;
  border: 1px solid #243041;
  border-radius: 4px;
  min-height: 2.4rem;
  justify-content: center;
}

.cs-screen-en {
  font-family: var(--cs-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--cs-accent);
}

.cs-screen-zh {
  font-size: 0.58rem;
  color: var(--cs-muted);
}

.cs-object-id {
  display: block;
  text-align: center;
  font-family: var(--cs-mono);
  font-size: 0.52rem;
  color: #5a6a7c;
  letter-spacing: 0.02em;
}

.cs-unit {
  font-size: 0.5rem;
  color: #5a6a7c;
  letter-spacing: 0.04em;
}

.cs-eq-legend {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 0.5rem;
  font-family: var(--cs-mono);
  padding: 0 0.15rem;
}
.cs-eq-legend .lm { color: #6eb5ff; }
.cs-eq-legend .md { color: #ffd166; }
.cs-eq-legend .hm { color: #ff7b72; }

.cs-sound .cs-fader-block {
  margin-top: 0.15rem;
}

.cs-pan-block.task-flash,
.cs-rotary-block.task-flash,
.cs-strip.task-flash {
  animation: cs-task-flash 0.45s ease-in-out 3;
  border-radius: 6px;
}


/* shell embed — Tab2 mounts into #slot-channel-strip without breaking shell layout */
.slot--channel-strip.cs-console,
#slot-channel-strip.cs-console {
  padding: 0.5rem 0.35rem 0.75rem;
  min-height: 360px;
  max-width: 100%;
  overflow-x: auto;
  background: transparent;
}
.slot--channel-strip .cs-strips,
#slot-channel-strip .cs-strips {
  min-width: min-content;
}
.slot--channel-strip .cs-eq-block.task-flash,
.slot--channel-strip .cs-lowcut-row.task-flash {
  animation: cs-task-flash 0.45s ease-in-out 3;
}
