.instrument-page {
  --case-bg:#e5e4dd;
  --case-ink:#29312f;
  --case-sub:#575e58;
  background:
    repeating-linear-gradient(90deg,#ffffff12 0 3px,#ffffff00 3px 6px),
    linear-gradient(#f4f1e8,var(--case-bg));
  color:var(--case-ink);
}
.instrument-page .wrap { width:min(calc(100% - 52px),1144px); }
.instrument-nav {
  color:#f4f0e7;
  background:linear-gradient(#343a37,#242927);
  border-bottom:2px solid #131615;
  box-shadow:0 2px 5px #191f2228;
}
.instrument-nav .wrap,.instrument-nav div { display:flex; align-items:center; }
.instrument-nav .wrap { justify-content:space-between; flex-wrap:wrap; gap:2px 13px; }
.instrument-nav div { gap:clamp(12px,3vw,38px); }
.instrument-nav a {
  display:grid; align-items:center; min-height:52px;
  color:#d7dad2; font-size:.88rem; white-space:nowrap; text-decoration:none;
}
.instrument-nav a[aria-current] { box-shadow:inset 0 -2px #c0b896; color:white; }
.instrument-nav .return-link { color:white; }
.instrument-title { display:flex; align-items:flex-end; justify-content:space-between; flex-wrap:wrap; gap:12px; padding:48px 0 28px; }
.instrument-title h1 { font-family:"Songti SC","Noto Serif CJK SC",serif; font-size:clamp(3.4rem,7vw,6.7rem); font-weight:850; line-height:.99; letter-spacing:-.07em; }
.instrument-title > a { min-height:44px; display:grid; align-items:center; }
.record-player {
  display:grid; grid-template-columns:minmax(0,1.5fr) minmax(280px,1fr);
  padding:12px; gap:12px; border:1px solid #b1afa4; border-radius:16px;
  background:linear-gradient(155deg,#eeece3,#d3d1c7); box-shadow:inset 0 1px #ffffffec,0 3px 8px #252b2435,0 24px 41px #32372a20;
}
.record-deck {
  display:flex; flex-direction:column; justify-content:space-between; min-width:0;
  position:relative; overflow:hidden; color:#e1e1d4; border-radius:11px; border:1px solid #131719;
  background:repeating-linear-gradient(93deg,#f6f6f605 0 1px,transparent 1px 3px),linear-gradient(155deg,#364142,#1d282b 67%,#273234);
  box-shadow:inset 0 1px #fcfff74d,inset 0 -3px 7px #13191a,0 1px #fff9;
}
.deck-header {
  display:flex; justify-content:space-between; align-items:center; gap:12px; padding:15px clamp(13px,2.7vw,27px);
  font:600 .71rem/1.2 ui-monospace,monospace; letter-spacing:.13em;
}
.deck-lamp { display:flex; align-items:center; gap:7px; font-size:.73rem;font-weight:500; letter-spacing:.04em; }
.deck-lamp::before { content:""; width:7px; height:7px; border-radius:50%; background:#6f816f; box-shadow:0 0 0 2px #151e1a; }
.is-playing .deck-lamp::before { background:#d4ecc0; box-shadow:0 0 0 2px #2b4330,0 0 9px #c5eca2; }
.record-well { position:relative; width:min(84%,417px); margin:4px auto clamp(17px,4vw,40px); }
.record {
  width:90%; max-width:365px; aspect-ratio:1; margin:auto; display:grid; place-items:center; border-radius:50%;
  background:
    conic-gradient(from 32deg,#111416 4%,#3a4448 16%,#1f272a 20%,#111416 37%,#2e373b 53%,#3a484a 62%,#1a2022 70%,#101416 100%);
  border:1px solid #101314; box-shadow:0 1px #c6d2d966,0 15px 19px #0008,inset 0 0 0 5px #080a0b7a;
  position:relative;
  animation:turntable 7s linear infinite paused;
}
.record::before {
  position:absolute; content:""; inset:6%; border-radius:50%;
  background:repeating-radial-gradient(circle,#05070633 0 1px,#96a0a122 1px 2px,transparent 2px 4px);
  border:1px solid #ffffff20;
}
.record-center {
  z-index:1; width:36%; aspect-ratio:1; border-radius:50%; display:grid; place-items:center;
  background:radial-gradient(circle at 35% 23%,#fff6,transparent 48%),var(--record-color,#8eaaa7);
  box-shadow:0 0 0 3px #141917,0 0 0 4px #88928b45,inset 0 0 0 8px #2436301b;
}
.record-center::before { content:"余响"; position:absolute; transform:translateY(-102%); font-family:"Songti SC",serif; color:#202826; font-weight:850; }
.record-center span { width:11%; aspect-ratio:1; border-radius:50%; background:linear-gradient(#ebece2,#878a80); box-shadow:0 1px 3px #15231d,inset 0 1px #fff9; }
.is-playing .record { animation-play-state:running; }
@keyframes turntable { to { transform:rotate(360deg); } }
.tonearm {
  position:absolute; z-index:2; right:1%; top:7%; width:11%; aspect-ratio:1; border-radius:50%;
  background:radial-gradient(circle at 38% 31%,#eceee7,#929c94 38%,#404b48 49%,#131b1d 70%); box-shadow:0 3px 8px #111c;
}
.tonearm::after {
  content:""; display:block; position:absolute; width:21%; height:400%; top:37%; left:39%; border-radius:5px;
  background:linear-gradient(90deg,#4e5853,#e2e3d4 26%,#acb0a1 59%,#434b46 100%);
  transform-origin:50% 6%; transform:rotate(14deg); box-shadow:2px 2px 5px #121a;
  transition:transform .38s ease;
}
.is-playing .tonearm::after { transform:rotate(28deg); }
.player-console {
  padding:clamp(21px,4vw,47px) clamp(18px,3.6vw,40px);
  display:flex; flex-direction:column; justify-content:center; gap:clamp(13px,2.8vw,29px); min-width:0;
  border-radius:10px; border:1px solid #c1beb2; background:linear-gradient(135deg,#fcfaf4,#dfddd1);
  box-shadow:inset 0 1px white;
}
.now-playing h2 { font-size:clamp(1.65rem,4.4vw,3.4rem); text-wrap:wrap; }
.now-playing p { margin-top:8px; color:#52594f; font-size:.89rem; }
.track-meter input,.player-settings input,.trial-range input { accent-color:#4b776c; cursor:pointer; min-width:0; margin:0; }
.track-meter input { width:100%; min-height:32px; }
.track-meter > div { display:flex; justify-content:space-between; color:#505b53; font:500 .82rem ui-monospace,monospace; }
.transport { display:flex; align-items:center; justify-content:center; gap:clamp(13px,3vw,29px); }
.dial-button {
  display:grid; place-items:center; width:49px; aspect-ratio:1; border-radius:50%; color:#26322e; border:1px solid #a5a79c;
  background:linear-gradient(#fefcf5,#d4d6cc); box-shadow:inset 0 2px white,0 2px 3px #201f2336,0 0 0 3px #c2c3ba;
  font-size:.76rem;
}
.dial-button:hover { border-color:#5a6f65; }
.dial-button:active { background:linear-gradient(#bfc9bc,#e5e8dc); box-shadow:inset 0 3px 5px #282e3a40,0 0 0 3px #bdc6ba; }
.transport-play {
  width:clamp(65px,6vw,84px); font-size:1.44rem; color:#eef8ef; border-color:#2c4e42;
  background:linear-gradient(#5f897a,#2f594a);
  box-shadow:inset 0 1px #aad0bd,0 2px 4px #262d2c5a,0 0 0 3px #b7c1b6;
}
.transport-play:active { background:linear-gradient(#285044,#477565); }
.player-settings { display:flex; align-items:center; flex-wrap:wrap; gap:10px 13px; font-size:.86rem; }
.player-settings input { flex:1; min-width:65px; }
.player-settings .control { min-height:42px; padding-inline:10px; color:#344037; }
.player-settings .control[aria-pressed="true"] { background:#d8e6dd; box-shadow:inset 0 2px 3px #3c51404a; }
#player-notice { color:#942a28; }
.record-queue,.state-deck { margin-top:34px; }
.record-queue header,.state-deck header,.sample-drawer header { display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin-bottom:13px; }
.record-queue h2,.state-deck h2,.sample-drawer h2 { font-size:clamp(1.3rem,2.4vw,1.75rem); }
.record-queue header span,.sample-drawer header span { color:var(--case-sub); font-size:.85rem; }
.record-queue ol,.sample-drawer ul { margin:0; padding:0; list-style:none; }
.record-queue ol { overflow:hidden; border:1px solid #c0beb1; border-radius:10px; box-shadow:0 3px 9px #1e252010; }
.record-queue li + li { border-top:1px solid #d9d9cf; }
.record-queue button {
  display:grid; grid-template-columns:22px minmax(0,1.7fr) minmax(0,1fr) auto;
  align-items:center; gap:12px; width:100%; min-height:53px; padding:8px 14px; border:0; text-align:start;
  background:linear-gradient(#fbfaf6,#f1f0e8); color:#333e37;
}
.record-queue button:hover { background:#f2f5ed; }
.record-queue button[aria-current="true"] { background:#e0e8df; box-shadow:inset 3px 0 #527b6a; }
.record-queue button:focus-visible,.sample-drawer button:focus-visible { outline-offset:-3px; }
.record-queue button > span:not(.queue-mark),.record-queue time { color:#4e5e53; font-size:.85rem; white-space:nowrap; }
.queue-mark { width:14px; height:14px; border-radius:50%; background:radial-gradient(var(--track-color) 0 33%,#303a36 35%); box-shadow:0 0 0 1px #63756d; }
.instrument-footer {
  display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px 15px; margin-top:36px; padding:18px 0 30px;
  border-top:1px solid #c1c6ba; font-size:.89rem;
}

.cabinet-page { --case-bg:#deddd6; }
[data-color="dark"] .cabinet-page { --case-ink:#f0eee6; --case-sub:#c9cec4; background:linear-gradient(#2d3535,#22292a); }
.cabinet-workbench { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(275px,1fr); gap:clamp(15px,3vw,28px); align-items:start; }
.specimen-board,.sample-drawer {
  min-width:0; border:1px solid var(--line); border-radius:12px; background:var(--panel);
  box-shadow:inset 0 1px #ffffff4a,0 9px 22px #292c2c18;
}
.specimen-board { padding:12px; }
.specimen-mount {
  display:grid; place-items:center; min-height:clamp(215px,35vw,430px); overflow:hidden;
  border:1px solid var(--line); border-radius:7px;
  background:linear-gradient(160deg,#ffffff22,transparent 75%),var(--canvas);
  box-shadow:inset 0 1px 4px #1b26231f;
}
.specimen-mount.is-tiled { background:var(--sample-tile) repeat; background-size:var(--sample-tile-size) auto; }
.specimen-mount img { display:block; width:100%; max-width:78%; height:clamp(174px,28vw,350px); object-fit:contain; }
.specimen-info { display:flex; align-items:end; flex-wrap:wrap; justify-content:space-between; gap:8px 12px; padding:16px 3px 3px; }
.specimen-info h2 { font-size:clamp(1.4rem,2.9vw,2.4rem); }
.specimen-info p { margin-top:6px; font-size:.84rem; color:var(--case-sub); }
.specimen-actions { display:flex; flex-wrap:wrap; gap:6px; }
.specimen-actions a { display:inline-flex; align-items:center; text-decoration:none; }
.specimen-actions [aria-pressed="true"],.drawer-filters [aria-pressed="true"] { background:var(--cool); box-shadow:inset 0 1px 3px #263b3326; }
.sample-drawer { padding:17px 14px 14px; }
.drawer-tools { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-bottom:13px; }
.drawer-filters { display:flex; gap:4px; }
.drawer-filters .control { min-height:37px; padding-inline:8px; }
.drawer-tools input { flex:1; min-width:92px; min-height:39px; width:100%; padding:6px 8px; border:1px solid var(--line); border-radius:5px; background:var(--canvas); color:var(--ink); box-shadow:inset 0 1px 3px #30352f17; }
.sample-drawer ul { overflow:hidden; border:1px solid var(--line); border-radius:6px; }
.sample-drawer ul:empty { display:none; }
.sample-drawer li + li { border-top:1px solid var(--line); }
.sample-drawer li button { display:grid; grid-template-columns:36px minmax(0,1fr) 14px; gap:9px; align-items:center; min-height:46px; width:100%; text-align:start; padding:6px 10px; border:0; background:var(--panel); color:var(--case-ink); }
.sample-drawer li button:hover { background:var(--canvas); }
.sample-drawer li button[aria-current="true"] { background:var(--cool); box-shadow:inset 3px 0 var(--brand); }
.sample-drawer li button img { width:36px; height:28px; object-fit:contain; padding:1px; border:1px solid var(--line); border-radius:4px; background:var(--canvas); }
.sample-drawer li button span { color:var(--case-sub); }
#sample-empty { color:var(--case-sub); padding:10px 0; }
.state-controls {
  display:flex; flex-wrap:wrap; align-items:center; gap:10px 18px; padding:16px; border-radius:9px; border:1px solid var(--line); background:var(--panel);
  box-shadow:inset 0 1px #ffffff50;
}
.state-controls label { display:flex; align-items:center; gap:8px; }
#trial-switch { appearance:none; margin:0; width:43px; height:27px; border:1px solid #8b958a; border-radius:20px; background:#c8cfc5; position:relative; box-shadow:inset 0 2px 3px #29382e4a; cursor:pointer; }
#trial-switch::before { content:""; position:absolute; top:3px; left:3px; width:19px; height:19px; border-radius:50%; background:linear-gradient(#fafbf4,#ced7cc); box-shadow:0 1px 3px #29382e6a; }
#trial-switch:checked { background:#4d7f6a; }
#trial-switch:checked::before { left:19px; }
#trial-output { color:var(--case-sub); min-width:3em; }
@media (max-width:720px) {
  .instrument-page .wrap { width:min(calc(100% - 28px),1144px); }
  .instrument-title { padding:31px 0 20px; }
  .record-player,.cabinet-workbench { grid-template-columns:minmax(0,1fr); }
  .record-player { padding:8px; gap:8px; }
  .record-well { width:min(80%,340px); }
  .player-console { padding:20px 16px; }
  .instrument-nav div { gap:11px; }
  .instrument-nav a { min-height:46px; }
}
@media (prefers-reduced-motion:reduce) {
  .record { animation:none; }
  .tonearm::after { transition:none; }
}
