/* 琴·机 · 浅灰台面上的黑漆琴，配一块克制的硬件面板，橙色只用在指示灯和当前状态上。 */
:root {
	--bg: #e9e8e4;
	--slab: #dad9d4;
	--slab-2: #d1d0ca;
	--ink: #151513;
	--ink-2: #3b3a36;
	--mute: #85837c;
	--line: #c4c2bb;
	--key: #f4f3ef;
	--key-edge: #b9b7af;
	--orange: #ff5a1f;
	--led-off: #c7c5be;
	--sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", system-ui, sans-serif;
	--mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
	--grot: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
	--wk-pill-bg: rgba(21, 21, 19, .9);
	--wk-pill-fg: #f4f3ef;
	--wk-pill-line: rgba(255, 255, 255, .14);
	--wk-pill-accent: #ff5a1f;
	--wk-pill-accent-fg: #151513;
	color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0; min-height: 100svh; color: var(--ink); background: var(--bg);
	font-family: var(--sans); font-size: 15px; line-height: 1.65; -webkit-font-smoothing: antialiased; overflow-x: hidden;
	background-image: radial-gradient(circle at 1px 1px, rgba(21, 21, 19, .07) 1px, transparent 1.4px);
	background-size: 22px 22px;
}
button { font: inherit; color: inherit; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.nojs { position: fixed; inset: auto 16px 80px; padding: 12px; background: var(--orange); }

.page { max-width: 1380px; margin: 0 auto; padding: 22px clamp(16px, 3vw, 44px) 90px; }

/* ---------- 顶部：型号与规格 ---------- */
.top {
	display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; column-gap: clamp(20px, 3vw, 48px);
	padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 16px; }
.brand__name { margin: 0; font-family: "Noto Serif SC", "Songti SC", serif; font-weight: 900; font-size: clamp(40px, 4.6vw, 62px); line-height: 1; letter-spacing: .02em; }
.brand__name i { font-style: normal; color: var(--orange); margin: 0 .06em; }
.brand__model { margin: 0; display: grid; gap: 2px; font: 500 10.5px/1.35 var(--mono); letter-spacing: .08em; color: var(--mute); }
.brand__model b { color: var(--ink); font-weight: 600; font-size: 12px; letter-spacing: .14em; }
.brand__desc { margin: 0; max-width: 34em; font-size: 13.5px; line-height: 1.7; color: var(--ink-2); }
.spec { margin: 0; display: grid; grid-template-columns: repeat(4, auto); gap: 0; border-left: 1px solid var(--line); }
.spec div { padding: 0 14px; border-right: 1px solid var(--line); }
.spec dt { font: 500 9.5px/1.4 var(--mono); letter-spacing: .14em; color: var(--mute); }
.spec dd { margin: 3px 0 0; font: 600 12.5px/1.3 var(--sans); white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.spec .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--led-off); }
.spec .dot.on { background: var(--orange); box-shadow: 0 0 6px var(--orange); }

/* ---------- 主体 ---------- */
.main {
	position: relative; margin-top: 10px;
	display: grid;
	grid-template-columns: minmax(250px, 300px) minmax(0, 1fr) minmax(260px, 300px);
	grid-template-areas: "qin qin qin" "disp seq ctl" "tr seq ctl";
	grid-template-rows: auto auto 1fr;
	column-gap: clamp(20px, 2.4vw, 36px);
}
.qinbox { grid-area: qin; position: relative; height: clamp(250px, calc(100svh - 560px), 340px); min-height: 250px; }
.qinbox canvas { display: block; width: 100%; height: 100%; touch-action: none; outline: none; cursor: crosshair; -webkit-tap-highlight-color: transparent; }
.qinbox canvas:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 10px; }
.hint {
	position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
	display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px 9px 12px;
	font-size: 13px; font-weight: 700; letter-spacing: .04em; color: var(--key);
	background: rgba(21, 21, 19, .82); border: 1px solid rgba(255, 255, 255, .12); border-radius: 999px; cursor: pointer;
	-webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
	transition: opacity .4s, transform .4s;
}
.hint i { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 0 rgba(255, 90, 31, .6); animation: ping 1.8s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(255, 90, 31, .55); } 80%, 100% { box-shadow: 0 0 0 10px rgba(255, 90, 31, 0); } }
.hint.gone { opacity: 0; transform: translate(-50%, -40%); pointer-events: none; }
.hint:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.hover-tip {
	position: absolute; margin: 0; padding: 4px 8px; pointer-events: none; white-space: nowrap;
	font: 600 11px/1.3 var(--sans); color: var(--key); background: rgba(21, 21, 19, .86); border-radius: 4px;
	transform: translate(-50%, -150%); opacity: 0; transition: opacity .12s;
}
.hover-tip.on { opacity: 1; }
.hover-tip b { color: var(--orange); font-weight: 700; }

/* 面板：一整块铝板 */
.slab {
	grid-row: 2 / 4; grid-column: 1 / -1; margin: 0 calc(clamp(20px, 2.4vw, 36px) * -1); position: relative; z-index: 0;
	background: linear-gradient(180deg, #e2e1dc 0%, var(--slab) 30%, var(--slab-2) 100%);
	border-radius: 16px;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), inset 0 0 0 1px rgba(21, 21, 19, .08), 0 1px 0 rgba(255, 255, 255, .6), 0 18px 40px -24px rgba(40, 34, 28, .45);
}
.screw { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #f2f1ed, #a9a79f); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); }
.screw::after { content: ""; position: absolute; left: 1px; right: 1px; top: 4px; height: 1px; background: rgba(0, 0, 0, .35); transform: rotate(35deg); }
.screw:nth-child(1) { left: 10px; top: 10px; } .screw:nth-child(2) { right: 10px; top: 10px; } .screw:nth-child(3) { left: 10px; bottom: 10px; } .screw:nth-child(4) { right: 10px; bottom: 10px; }

.mod { position: relative; z-index: 1; min-width: 0; }
.mod--disp { grid-area: disp; padding-top: 22px; }
.mod--tr { grid-area: tr; padding: 14px 0 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-content: start; }
.mod--seq { grid-area: seq; padding: 22px 0 24px; }
.mod--ctl { grid-area: ctl; padding: 22px 0 24px; }
.mod__h { display: flex; align-items: baseline; gap: 8px; margin: 0 0 10px; font-size: 12.5px; font-weight: 800; letter-spacing: .08em; }
.mod__h b { font: 600 10px/1 var(--mono); color: var(--orange); letter-spacing: .1em; }
.mod__h em { font: 500 9.5px/1 var(--mono); font-style: normal; color: var(--mute); letter-spacing: .16em; }
.mod__tools { margin-left: auto; display: flex; gap: 6px; }
.tool { padding: 2px 9px; font-size: 11.5px; font-weight: 700; background: transparent; border: 1px solid var(--key-edge); border-radius: 4px; cursor: pointer; color: var(--ink-2); }
.tool:hover { background: var(--key); }
.tool:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.screen { padding: 8px; background: #0d0d0c; border-radius: 9px; box-shadow: 0 0 0 1px #000, 0 0 0 5px #cdcbc4, 0 0 0 6px #b4b2aa, inset 0 0 20px rgba(0, 0, 0, .8); }
.screen canvas { display: block; width: 100%; height: 150px; }

/* 键 */
.key {
	position: relative; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
	min-height: 58px; padding: 9px 11px 8px; text-align: left; cursor: pointer;
	background: linear-gradient(180deg, #faf9f6, var(--key)); border: 1px solid var(--key-edge); border-radius: 7px;
	box-shadow: 0 2px 0 #b3b1a9, inset 0 1px 0 #fff; transition: transform .06s, box-shadow .06s;
	-webkit-tap-highlight-color: transparent;
}
.key:active, .key.is-down { transform: translateY(2px); box-shadow: 0 0 0 #b3b1a9, inset 0 1px 0 #fff; }
.key:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.key .led { width: 7px; height: 7px; border-radius: 50%; background: var(--led-off); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.key[aria-pressed="true"] .led, .key[aria-checked="true"] .led { background: var(--orange); box-shadow: 0 0 7px var(--orange); }
.key__lb { font-size: 12.5px; font-weight: 800; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.key__ic { position: absolute; right: 11px; top: 10px; width: 0; height: 0; border-left: 8px solid var(--ink); border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.key--play[aria-pressed="true"] .key__ic { width: 9px; height: 9px; border: 0; background: var(--ink); }
.key--rec .led { background: #d9a69a; }
.key--rec[aria-pressed="true"] { background: #1a1a19; color: var(--key); border-color: #000; }
.key--rec[aria-pressed="true"] .led { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: .2; } }
.key[disabled] { opacity: .5; cursor: not-allowed; }
.screen { position: relative; }
.dl {
	position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
	display: inline-flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 12px; white-space: nowrap;
	font-size: 12px; font-weight: 800; text-decoration: none; color: var(--ink); background: var(--orange); border-radius: 999px;
	box-shadow: 0 0 0 3px rgba(13, 13, 12, .8);
}
.dl::before { content: "↓"; font: 700 13px var(--mono); }
.dl:hover { filter: brightness(1.08); }
.dl:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

/* 音序 */
.leds, .grid { display: grid; grid-template-columns: 78px repeat(16, minmax(0, 1fr)); column-gap: 5px; }
.leds { margin-bottom: 6px; align-items: center; }
.leds i { justify-self: center; width: 5px; height: 5px; border-radius: 50%; background: var(--led-off); }
.leds i.on { background: var(--orange); box-shadow: 0 0 6px var(--orange); }
.leds span { font: 500 9px var(--mono); color: var(--mute); letter-spacing: .12em; }
.leds i.g, .grid .pad.g { margin-left: 7px; }
.grid { row-gap: 7px; }
.trk {
	display: flex; align-items: center; gap: 7px; padding: 0 8px; min-height: 34px; text-align: left; cursor: pointer;
	background: transparent; border: 1px solid transparent; border-radius: 6px; font-size: 12.5px; font-weight: 800;
}
.trk small { display: block; font: 500 8.5px/1.1 var(--mono); color: var(--mute); letter-spacing: .1em; }
.trk .led { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--led-off); }
.trk[aria-checked="true"] .led { background: var(--orange); box-shadow: 0 0 6px var(--orange); }
.trk[aria-checked="false"] { color: var(--mute); }
.trk:hover { border-color: var(--key-edge); }
.trk:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }
.pad {
	min-width: 0; height: 34px; padding: 0; border-radius: 5px; cursor: pointer;
	background: linear-gradient(180deg, #fbfaf7, #eeede8); border: 1px solid #bdbbb3; box-shadow: 0 2px 0 #bdbbb3;
	transition: background .08s, transform .05s; -webkit-tap-highlight-color: transparent;
}
.pad[aria-pressed="true"] { background: linear-gradient(180deg, #2a2a28, #141413); border-color: #000; box-shadow: 0 2px 0 #000; }
.pad.now { background: #fff; border-color: #8f8d86; }
.pad[aria-pressed="true"].now { background: var(--orange); border-color: #c33e0d; box-shadow: 0 2px 0 #c33e0d, 0 0 12px rgba(255, 90, 31, .55); }
.pad.mute[aria-pressed="true"] { background: #7c7a74; border-color: #5d5b55; box-shadow: 0 2px 0 #5d5b55; }
.pad:active { transform: translateY(1px); }
.pad:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; z-index: 1; }

.seq-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.prog { display: flex; align-items: stretch; gap: 6px; min-width: 0; }
.prog__cap { display: grid; align-content: center; padding-right: 6px; font: 500 9.5px/1.4 var(--mono); letter-spacing: .12em; color: var(--mute); }
.prog__cap b { display: block; font: 800 12px/1.3 var(--sans); letter-spacing: .04em; color: var(--ink-2); }
.prog i {
	display: grid; justify-items: center; align-content: center; width: 52px; height: 44px; font-style: normal; border-radius: 6px;
	background: #191918; color: #d8d5cc; box-shadow: inset 0 0 0 1px #000, 0 0 0 3px #cdcbc4;
}
.prog i b { font: 900 17px/1 "Noto Serif SC", "Songti SC", serif; }
.prog i small { margin-top: 3px; font: 500 9px/1 var(--mono); color: #8f8d86; letter-spacing: .08em; }
.prog i.on { color: var(--orange); }
.prog i.on small { color: var(--orange); }
.knob--sm svg { width: 46px; height: 46px; }
.knob--sm { grid-template-columns: auto auto; column-gap: 8px; align-items: center; }
.knob--sm svg { grid-row: span 2; }
.knob--sm .kv, .knob--sm .kl { justify-self: start; }

/* 控制 */
.knobs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.knob { display: grid; justify-items: center; gap: 2px; cursor: ns-resize; outline: none; -webkit-tap-highlight-color: transparent; touch-action: none; user-select: none; }
.knob svg { width: 58px; height: 58px; display: block; overflow: visible; }
.knob .kv { font: 600 11.5px/1.2 var(--mono); font-variant-numeric: tabular-nums; }
.knob .kl { font-size: 11.5px; font-weight: 800; color: var(--ink-2); }
.knob:focus-visible svg .cap { stroke: var(--orange); stroke-width: 2; }
.modes { margin-top: 16px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.modes button {
	display: grid; justify-items: center; gap: 0; padding: 6px 0 5px; cursor: pointer; line-height: 1.15;
	background: linear-gradient(180deg, #faf9f6, var(--key)); border: 1px solid var(--key-edge); border-radius: 6px; box-shadow: 0 2px 0 #b3b1a9;
	font-family: "Noto Serif SC", "Songti SC", serif; font-size: 16px; font-weight: 900;
}
.modes button small { font: 500 9.5px var(--mono); color: var(--mute); }
.modes button[aria-checked="true"] { background: var(--ink); color: var(--key); border-color: #000; box-shadow: 0 2px 0 #000; }
.modes button[aria-checked="true"] small { color: var(--orange); }
.modes button:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.modes__cap { grid-column: 1 / -1; font: 500 9.5px var(--mono); letter-spacing: .14em; color: var(--mute); margin-bottom: 1px; }
.layers { margin-top: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.sw {
	display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 10px; cursor: pointer; font-size: 12.5px; font-weight: 800;
	background: linear-gradient(180deg, #faf9f6, var(--key)); border: 1px solid var(--key-edge); border-radius: 6px; box-shadow: 0 2px 0 #b3b1a9;
}
.sw .led { width: 7px; height: 7px; border-radius: 50%; background: var(--led-off); }
.sw[aria-checked="true"] .led { background: var(--orange); box-shadow: 0 0 6px var(--orange); }
.sw:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.meter { margin-top: 14px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; }
.meter > span { font-size: 11.5px; font-weight: 800; color: var(--ink-2); line-height: 1.2; }
.meter > span small { display: block; font: 500 8.5px var(--mono); letter-spacing: .12em; color: var(--mute); }
.meter__bar { display: grid; grid-template-columns: repeat(18, minmax(0, 1fr)); gap: 3px; padding: 6px; background: #191918; border-radius: 5px; box-shadow: inset 0 0 0 1px #000, 0 0 0 3px #cdcbc4; }
.meter__bar i { height: 10px; border-radius: 1.5px; background: #34332f; }
.meter__bar i.on { background: #f4f1e8; }
.meter__bar i.hot.on { background: var(--orange); box-shadow: 0 0 6px rgba(255, 90, 31, .7); }

/* ---------- 说明书 ---------- */
.manual { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); }
.manual__h { margin: 0 0 14px; display: flex; align-items: baseline; gap: 10px; font-size: 13px; }
.manual__h b { font-weight: 800; letter-spacing: .1em; }
.manual__h em { font: 500 9.5px var(--mono); font-style: normal; letter-spacing: .16em; color: var(--mute); }
.manual__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; counter-reset: m; border-left: 1px solid var(--line); }
.manual__list li { counter-increment: m; padding: 4px 18px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.manual__list li:nth-child(-n+3) { border-top: 1px solid var(--line); }
.manual__list li::before { content: counter(m, decimal-leading-zero); display: block; margin-top: 10px; font: 600 10px var(--mono); color: var(--orange); letter-spacing: .1em; }
.manual__list b { display: block; margin-top: 2px; font-size: 14px; font-weight: 800; }
.manual__list p { margin: 4px 0 0; font-size: 13px; line-height: 1.75; color: var(--ink-2); }
.manual__note { margin: 14px 0 0; max-width: 62em; font-size: 12px; line-height: 1.8; color: var(--mute); }
.manual__keys { margin: 12px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); }
.manual__keys b { font-weight: 800; }
kbd { display: inline-block; min-width: 20px; padding: 0 5px; font: 600 11px/19px var(--mono); text-align: center; color: var(--ink); background: var(--key); border: 1px solid var(--key-edge); border-radius: 4px; box-shadow: 0 1.5px 0 var(--key-edge); }

/* ---------- 窄屏 ---------- */
@media (max-width: 1100px) {
	.top { grid-template-columns: auto minmax(0, 1fr); row-gap: 12px; }
	.spec { grid-column: 1 / -1; justify-self: start; }
	.main { grid-template-columns: minmax(230px, 270px) minmax(0, 1fr); grid-template-areas: "qin qin" "disp seq" "tr seq" "ctl ctl"; }
	.slab { grid-row: 2 / 5; }
	.mod--ctl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 24px; padding-top: 6px; }
	.mod--ctl .mod__h { grid-column: 1 / -1; }
	.modes { margin-top: 0; }
}
@media (max-width: 760px) {
	.page { padding: 12px 12px 96px; }
	.top { grid-template-columns: 1fr; row-gap: 6px; padding-bottom: 8px; }
	.brand { gap: 12px; }
	.brand__name { font-size: 38px; }
	.brand__desc { font-size: 12.5px; line-height: 1.6; }
	.spec { display: none; }
	.main { grid-template-columns: minmax(0, 1fr); grid-template-areas: "qin" "tr" "disp" "seq" "ctl"; margin-top: 4px; }
	.qinbox { height: clamp(440px, calc(100svh - 282px), 660px); min-height: 0; }
	.slab { display: none; }
	.mod { margin-top: 12px; padding: 14px; background: linear-gradient(180deg, #e2e1dc, var(--slab)); border-radius: 12px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), inset 0 0 0 1px rgba(21, 21, 19, .08); }
	.mod--tr { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 10px; gap: 6px; }
	.key { min-height: 52px; padding: 8px 8px 7px; }
	.key__lb { font-size: 12px; }
	.key__ic { right: 8px; top: 9px; }
	.leds, .grid { grid-template-columns: 50px repeat(8, minmax(0, 1fr)); column-gap: 5px; }
	.leds > span { grid-row: span 2; }
	.leds i.g, .grid .pad.g { margin-left: 0; }
	.leds { row-gap: 4px; }
	.trk { grid-row: span 2; flex-direction: column; justify-content: center; align-items: flex-start; gap: 4px; padding: 0 2px; }
	.pad { height: 32px; }
	.seq-foot { flex-wrap: wrap; }
	.prog i { width: 44px; }
	.mod--ctl { display: block; }
	.modes { margin-top: 14px; }
	.manual__list { grid-template-columns: minmax(0, 1fr); }
	.manual__list li:nth-child(-n+3) { border-top: 0; }
	.manual__list li:first-child { border-top: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) {
	.hint i, .key--rec[aria-pressed="true"] .led { animation: none; }
	.hint, .hover-tip, .key, .pad { transition: none; }
}
