@font-face {
  font-family: "Shengpu Noto Sans SC";
  src: url("/fonts/NotoSansSC-Regular.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Shengpu Noto Serif SC";
  src: url("/fonts/NotoSerifSC-Regular.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #fbfaf7;
  --surface: #ffffff;
  --surface-soft: #f5f4f0;
  --surface-blue: #f1f5ff;
  --ink: #1e2430;
  --ink-secondary: #626a78;
  --ink-tertiary: #9299a5;
  --hairline: #e4e5e8;
  --hairline-strong: #d3d6dc;
  --accent: #315fdd;
  --accent-dark: #244bb8;
  --accent-soft: #dfe8ff;
  --success: #187a53;
  --warning: #9a6511;
  --danger: #b33b45;
  --shadow-card: 0 1px 2px rgba(20, 28, 45, .05), 0 12px 32px rgba(20, 28, 45, .05);
  --shadow-float: 0 18px 60px rgba(20, 28, 45, .16), 0 2px 8px rgba(20, 28, 45, .08);
  --radius: 14px;
  --radius-small: 9px;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  font: 100%/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { min-width: 0; background: var(--paper); }
button, a, input, select, textarea { -webkit-font-smoothing: antialiased; }
.ui-icon { width: 1.05em; height: 1.05em; flex: 0 0 auto; display: inline-block; vertical-align: -0.16em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.button.icon .ui-icon { width: 18px; height: 18px; }
.dropzone-icon { display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto; border-radius: 13px; color: var(--accent); background: var(--accent-soft); }
.dropzone-icon .ui-icon { width: 24px; height: 24px; }
button, input, select { font: inherit; }
button { color: inherit; }
button, a, [role="button"] { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgba(49, 95, 221, .25);
  outline-offset: 2px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 68px;
  display: grid;
  grid-template-columns: minmax(220px, .75fr) minmax(180px, .5fr) minmax(600px, 1.75fr);
  align-items: center;
  gap: 24px;
  padding: 0 28px;
  background: rgba(251, 250, 247, .88);
  backdrop-filter: blur(20px) saturate(150%);
  border-bottom: 1px solid rgba(211, 214, 220, .72);
}

.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; width: max-content; }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px;
  border-radius: 11px; color: white; background: linear-gradient(145deg, #4a7af1, #234dbf);
  font-weight: 800; box-shadow: 0 5px 14px rgba(49, 95, 221, .24);
}
.brand strong { display: block; font-size: 16px; line-height: 1.1; letter-spacing: -.01em; }
.brand small { display: block; margin-top: 4px; color: var(--ink-tertiary); font-size: 10px; letter-spacing: .06em; }
.header-center { display: flex; justify-content: center; min-width: 0; }
.header-actions { display: flex; min-width: 0; justify-content: flex-end; align-items: center; gap: 6px; white-space: nowrap; }
.header-actions > * { flex: 0 0 auto; }
.header-actions .button { min-height: 36px; padding-inline: 10px; font-size: 12px; white-space: nowrap; }
.export-menu { position: relative; }
.export-menu summary { list-style: none; }
.export-menu summary::-webkit-details-marker { display: none; }
.export-menu-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 40;
  min-width: 208px; padding: 6px; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--hairline-strong);
  border-radius: 12px; box-shadow: var(--shadow-float);
}
.export-menu-panel a {
  display: block; padding: 9px 12px; border-radius: 8px;
  color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 600;
}
.export-menu-panel a:hover { background: var(--surface-soft); }

.button {
  min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 0 14px; border: 1px solid var(--hairline-strong); border-radius: 10px;
  background: rgba(255,255,255,.86); cursor: pointer; font-weight: 650; font-size: 13px;
  transition: transform 120ms var(--ease-out), background-color 160ms ease, border-color 160ms ease;
}
.button:active { transform: scale(.97); }
.button:hover { background: var(--surface-soft); }
.button.primary { color: white; background: var(--accent); border-color: var(--accent); }
.button.primary:hover { background: var(--accent-dark); }
.button.danger { color: var(--danger); }
.button.ghost { background: transparent; border-color: transparent; }
.button.icon { width: 38px; padding: 0; font-size: 17px; }
.button:disabled { cursor: not-allowed; opacity: .42; transform: none; }

.search {
  position: relative; width: min(100%, 460px);
}
.search > .ui-icon { position: absolute; z-index: 1; left: 13px; top: 12px; width: 15px; height: 15px; color: var(--ink-tertiary); pointer-events: none; }
.search input {
  width: 100%; height: 40px; padding: 0 16px 0 39px; border: 1px solid transparent;
  border-radius: 11px; background: #efeeea; color: var(--ink);
}
.search input:focus { background: white; border-color: var(--hairline-strong); }

.library-layout { display: grid; grid-template-columns: 224px 1fr; min-height: calc(100vh - 68px); }
.library-sidebar { padding: 28px 18px; border-right: 1px solid var(--hairline); background: rgba(255,255,255,.44); }
.nav-item {
  width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 10px 12px;
  border: 0; border-radius: 10px; background: transparent; cursor: pointer; color: var(--ink-secondary); text-align: left;
}
.nav-item.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; }
.sidebar-label { margin: 26px 12px 8px; color: var(--ink-tertiary); font-size: 11px; font-weight: 700; letter-spacing: .1em; }
.library-main { padding: 38px 42px 80px; overflow: hidden; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-heading h1 { margin: 0; font-size: 27px; line-height: 1.1; letter-spacing: -.035em; }
.page-heading p { margin: 8px 0 0; color: var(--ink-secondary); font-size: 13px; }
.filter-row { display: flex; gap: 8px; }
.select {
  height: 38px; padding: 0 34px 0 12px; border: 1px solid var(--hairline-strong);
  border-radius: 10px; background: white; color: var(--ink-secondary); font-size: 13px;
}

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 20px; align-items: stretch; }
.new-card, .project-card {
  min-height: 310px; border: 1px solid var(--hairline); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; box-shadow: var(--shadow-card);
}
.new-card { border-style: dashed; display: grid; place-items: center; cursor: pointer; color: var(--ink-secondary); }
.new-card:hover { border-color: var(--accent); color: var(--accent); background: var(--surface-blue); }
.new-card-inner { text-align: center; }
.new-card-plus { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 14px; border: 1px solid currentColor; border-radius: 50%; font-size: 27px; font-weight: 300; }
.new-card strong { display: block; color: var(--ink); }
.new-card small { display: block; margin-top: 6px; }
.project-card { cursor: pointer; position: relative; }
.project-card:active { transform: scale(.992); }
.score-thumb { height: 220px; padding: 22px 18px; background: #f7f6f2; border-bottom: 1px solid var(--hairline); }
.mini-paper { height: 100%; padding: 23px 18px; background: white; box-shadow: 0 2px 10px rgba(20,28,45,.08); }
.mini-title { text-align: center; font-family: Georgia, "Songti SC", serif; font-size: 10px; margin-bottom: 18px; color: #343944; }
.mini-score { display: flex; flex-wrap: wrap; gap: 11px 8px; align-content: flex-start; color: #315fdd; font-family: Georgia, serif; font-size: 11px; }
.mini-score span:nth-child(7n) { margin-right: 10px; }
.card-info { padding: 15px 16px 17px; }
.card-title { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.card-meta { display: flex; gap: 8px; margin-top: 7px; color: var(--ink-tertiary); font-size: 11px; }
.status-badge { position: absolute; top: 12px; right: 12px; padding: 4px 8px; border-radius: 999px; background: rgba(255,255,255,.9); font-size: 10px; font-weight: 700; }
.status-badge.processing { color: var(--accent); }
.status-badge.error { color: var(--danger); }
.progress-line { height: 3px; background: var(--hairline); overflow: hidden; }
.progress-line > span { display: block; height: 100%; background: var(--accent); transition: transform 200ms var(--ease-out); transform-origin: left; }

.empty-state { grid-column: 1 / -1; padding: 70px; text-align: center; color: var(--ink-secondary); }
.page-enter > * { animation: page-enter .48s var(--ease-out) both; }
.page-enter > *:nth-child(2) { animation-delay: 50ms; }
.page-enter > *:nth-child(3) { animation-delay: 90ms; }
@keyframes page-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: rgba(18, 24, 36, .28); backdrop-filter: blur(5px);
}
.modal {
  position:relative; width: min(620px, calc(100vw - 40px)); max-height:calc(100vh - 36px); overflow:auto;
  padding: 24px; border: 1px solid rgba(255,255,255,.7);
  border-radius: 18px; background: rgba(255,255,255,.96); box-shadow: var(--shadow-float);
  animation: modal-in 180ms var(--ease-out);
}
@keyframes modal-in { from { opacity: 0; transform: scale(.97) translateY(8px); } }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.modal h2 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
.modal p { color: var(--ink-secondary); }
.dropzone {
  min-height: 190px; display: grid; place-items: center; padding: 28px; border: 1.5px dashed var(--hairline-strong);
  border-radius: 14px; background: var(--surface-soft); text-align: center; cursor: pointer;
}
.dropzone.dragging { border-color: var(--accent); background: var(--surface-blue); }
.dropzone strong { display: block; margin-top: 12px; }
.dropzone small { display: block; margin-top: 5px; color: var(--ink-tertiary); }
.form-field { display: grid; gap: 7px; margin-top: 16px; }
.form-field label { font-size: 12px; font-weight: 700; color: var(--ink-secondary); }
.field-heading { display:flex; justify-content:space-between; gap:12px; align-items:center; }
.field-heading span,.form-field > small { color:var(--ink-tertiary); font-size:11px; }
.lyrics-upload-field textarea { min-height:150px; resize:vertical; line-height:1.75; padding:13px 14px; font-family:inherit; }
.upload-submit-overlay { position:absolute; inset:0; z-index:3; display:grid; place-items:center; padding:28px; border-radius:inherit; background:rgba(255,255,255,.94); backdrop-filter:blur(7px); }
.upload-submit-card { width:min(390px,100%); padding:24px; border:1px solid var(--hairline); border-radius:14px; background:white; box-shadow:var(--shadow-card); }
.upload-submit-card > span,.upload-submit-card > strong { display:block; }
.upload-submit-card > strong { margin-top:8px; color:var(--accent); font-size:24px; font-variant-numeric:tabular-nums; }
.upload-submit-card > small { display:block; margin-top:14px; color:var(--ink-tertiary); line-height:1.6; }
.input { width: 100%; height: 40px; padding: 0 11px; border: 1px solid var(--hairline-strong); border-radius: 9px; background: white; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.rhythm-modal { width: min(560px, calc(100vw - 40px)); }
.rhythm-change-preview {
  display: grid; grid-template-columns: auto auto auto 1fr; align-items: baseline; gap: 8px;
  margin-bottom: 15px; padding: 12px 14px; border-radius: 11px; background: var(--surface-soft);
  font-variant-numeric: tabular-nums;
}
.rhythm-change-preview b { color: var(--ink-tertiary); }
.rhythm-change-preview strong { color: var(--accent-dark); font-size: 18px; }
.rhythm-change-preview small { justify-self: end; color: var(--ink-tertiary); }
.rhythm-strategy-list { display: grid; gap: 9px; }
.rhythm-strategy {
  display: grid; gap: 5px; width: 100%; padding: 14px 15px; border: 1px solid var(--hairline-strong);
  border-radius: 12px; background: white; color: var(--ink); cursor: pointer; text-align: left;
}
.rhythm-strategy:hover { border-color: var(--accent); background: var(--accent-soft); }
.rhythm-strategy:active { transform: scale(.995); }
.rhythm-strategy strong { font-size: 13px; }
.rhythm-strategy small { color: var(--ink-secondary); line-height: 1.55; }
.rhythm-strategy em { margin-left: 5px; color: var(--accent); font-size: 10px; font-style: normal; }
.rhythm-strategy.recommended { border-color: rgba(49,95,221,.42); }
.rhythm-strategy:disabled { opacity: .45; cursor: not-allowed; background: var(--surface-soft); }
.rhythm-rest-summary { margin-top: 11px; }
.rhythm-template-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 12px; }
.rhythm-template-toolbar select { min-width: 0; }
.rhythm-template-notes { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.rhythm-template-note {
  display: grid; place-items: center; min-width: 50px; padding: 8px 10px;
  border: 1px solid var(--hairline); border-radius: 10px; background: var(--surface-soft);
}
.rhythm-template-note strong { font-size: 19px; line-height: 1; }
.rhythm-template-note small { min-height: 17px; color: var(--ink-secondary); }
.rhythm-template-arrow { color: var(--ink-tertiary); }
.rhythm-template-pattern { grid-template-columns: minmax(110px, .75fr) minmax(0, 1.25fr); align-items: center; }
.rhythm-template-pattern .rhythm-pattern-preview { font-variant-numeric: tabular-nums; color: var(--accent-dark); }
.score-selection-marquee { position: fixed; z-index: 1000; pointer-events: none; border: 1.5px solid #2563eb; background: rgba(37,99,235,.11); border-radius: 5px; }
.custom-rhythm-controls { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.custom-rhythm-controls label { color: var(--ink-secondary); font-size: 12px; }
.custom-rhythm-controls select { min-width: 120px; }
.custom-rhythm-track { position: relative; height: 108px; margin: 16px 0 12px; border: 1px solid var(--hairline); border-radius: 12px; overflow: hidden; background-color: #f8fafc; background-image: linear-gradient(to right, rgba(49,95,221,.16) 1px, transparent 1px); }
.custom-rhythm-block { position: absolute; top: 24px; height: 56px; min-width: 20px; display: grid; place-items: center; border: 1.5px solid #2563eb; border-radius: 8px; background: rgba(219,234,254,.96); color: #173b91; cursor: grab; user-select: none; touch-action: none; }
.custom-rhythm-block:active { cursor: grabbing; }
.custom-rhythm-block strong { font-size: 17px; }
.custom-rhythm-block small { font-size: 10px; }
.custom-rhythm-resize { position: absolute; inset: 0 0 0 auto; width: 10px; border-left: 1px solid rgba(37,99,235,.38); cursor: ew-resize; }
.custom-rhythm-grid-label { position: absolute; top: 4px; color: var(--ink-tertiary); font-size: 10px; transform: translateX(-50%); }
.custom-rhythm-table { display: grid; gap: 6px; }
.custom-rhythm-row { display: grid; grid-template-columns: minmax(72px,1fr) 90px 90px; gap: 8px; align-items: center; font-size: 12px; }
.custom-rhythm-row input { width: 100%; }
.custom-rhythm-row.header { color: var(--ink-tertiary); font-size: 10px; text-align: center; }
.custom-rhythm-row.header span:first-child { text-align: left; }
.custom-rhythm-status.ok { color: #147a49; }
.custom-rhythm-status.error { color: #b42318; }
.virtual-rest-hit { cursor: pointer; }
.mode-title { margin: 2px 0 8px; color: var(--ink-secondary); font-size: 12px; font-weight: 700; }
.mode-options { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.mode-options input { position: absolute; opacity: 0; pointer-events: none; }
.mode-card { display: grid; gap: 5px; padding: 13px 14px; border: 1px solid var(--hairline-strong); border-radius: 11px; background: white; cursor: pointer; }
.mode-card strong { font-size: 13px; }
.mode-card small { color: var(--ink-tertiary); font-size: 11px; line-height: 1.4; }
.mode-options input:checked + .mode-card { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.mode-warning { margin-top: 9px; padding: 9px 11px; border-radius: 8px; background: #fff6df; color: #77500c; font-size: 11px; line-height: 1.5; }
.mode-warning.compact { margin-top: 10px; }

.editor-shell { height: calc(100vh - 68px); display: grid; grid-template-rows: 54px minmax(280px, 1fr) 330px; overflow: hidden; }
.editor-shell.review-mutation-busy .editor-toolbar,
.editor-shell.review-mutation-busy .score-pane,
.editor-shell.review-mutation-busy .roll-pane { pointer-events: none; opacity: .62; }
.editor-toolbar {
  display: flex; align-items: center; gap: 8px; padding: 7px 18px; border-bottom: 1px solid var(--hairline);
  background: rgba(255,255,255,.82); backdrop-filter: blur(16px); overflow-x: auto;
}
.editor-toolbar > * { flex-shrink: 0; white-space: nowrap; }
.toolbar-title { min-width: 210px; max-width: 330px; border: 0; background: transparent; font-size: 15px; font-weight: 750; padding: 7px 8px; }
.toolbar-credit { width: 82px; border: 0; border-left: 1px solid var(--hairline); background: transparent; font-size: 11px; padding: 7px 8px; }
.toolbar-separator { width: 1px; height: 24px; background: var(--hairline); margin: 0 4px; }
.meta-pill { display: inline-flex; align-items: center; height: 35px; border: 1px solid var(--hairline); border-radius: 9px; background: white; overflow: hidden; }
.meta-pill label { padding-left: 10px; color: var(--ink-tertiary); font-size: 11px; }
.meta-pill input, .meta-pill select { height: 33px; border: 0; background: transparent; padding: 0 9px 0 5px; font-size: 12px; }
.save-state { margin-left: auto; min-width: 64px; color: var(--ink-tertiary); font-size: 11px; text-align: right; }

.editor-main { display: grid; grid-template-columns: minmax(0, 1fr) 286px; min-height: 0; }
.score-pane { overflow: auto; padding: 30px 36px 52px; background: #e9e9e5; }
.score-paper { width: min(1100px, 100%); min-height: 100%; margin: 0 auto; }
.professional-score-editor { display: block; width: 100%; height: auto; background: white; box-shadow: 0 3px 18px rgba(20,28,45,.10); }
.editor-score-title { font: 700 44px "Noto Serif CJK SC","Songti SC",serif; letter-spacing: 7px; fill: #171717; }
.editor-score-meta { font: 23px "Microsoft YaHei",sans-serif; fill: #292929; }
.editor-score-tempo { font: 20px "Microsoft YaHei",sans-serif; fill: #333; }
.editor-score-credit { font: 18px "Microsoft YaHei",sans-serif; fill: #3b3b3b; }
.editor-measure-number { font: 14px "Microsoft YaHei",sans-serif; fill: #999; }
.editor-barline { stroke: #222; stroke-width: 2; }
.editor-barline.light, .editor-barline.repeat-thin, .editor-barline.final-thin { stroke-width: 1.2; }
.editor-barline.repeat-thick, .editor-barline.final-thick { stroke-width: 4; }
.editor-repeat-dot { fill: #222; }
.editor-score-note { cursor: pointer; outline: none; }
.editor-score-note .editor-note-number { font: 650 29px Arial,"Microsoft YaHei",sans-serif; fill: #111; }
.editor-score-note:hover .editor-note-number { fill: var(--accent); }
.editor-score-note.selected .editor-note-number { fill: #fff; }
.editor-score-note.selected::selection { fill: transparent; }
.editor-score-note.selected .editor-note-number { paint-order: stroke; stroke: var(--accent); stroke-width: 15px; stroke-linejoin: round; }
.editor-score-note.low-confidence .editor-note-number { fill: #a96d12; }
.editor-score-note.lyric-gap-review .editor-note-number { fill: #b66712; }
.editor-score-note.suggestion-review.split .editor-note-number { fill: #2e7d32; }
.editor-score-note.suggestion-review.merge .editor-note-number { fill: #1565c0; }
.editor-lyric-gap-marker { fill: #ee8a1f; stroke: white; stroke-width: 1.2; }
.editor-accidental { font: 18px "Arial Unicode MS",sans-serif; fill: #111; }
.editor-note-dot { fill: #111; }
.editor-duration-line { stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.editor-duration-line.joined { stroke-width: 2.5; pointer-events: none; }
.editor-duration-line-hit { fill: transparent; pointer-events: all; cursor: pointer; }
.editor-underline-add { font: 600 20px Arial,"Microsoft YaHei",sans-serif; fill: var(--accent); cursor: pointer; }
.editor-underline-add:hover { text-decoration: underline; }
.editor-sustain { font: 27px Arial,sans-serif; fill: #111; }
.editor-lyric { font: 500 22px/1.25 "Noto Serif CJK SC","SimSun",serif; fill: #222; letter-spacing: 0; }
.editor-lyric-melisma { stroke: #555; stroke-width: 1.4; }
.editor-tie, .editor-slur, .editor-grace-slur { fill: none; stroke: #222; stroke-width: 1.8; stroke-linecap: round; }
.editor-tuplet-bracket { fill: none; stroke: #222; stroke-width: 1.35; }
.editor-tuplet-number { font: 600 12px Arial,sans-serif; fill: #222; }
.editor-ornament-marker { font: 10px "Microsoft YaHei",sans-serif; fill: #777; }
.editor-meter-change { font: 600 13px Arial,sans-serif; fill: #333; }
.editor-slur { stroke-width: 1.55; }
.editor-grace-note { font: 600 17px Arial,"Microsoft YaHei",sans-serif; fill: #111; }
.editor-grace-accidental { font: 12px "Arial Unicode MS",sans-serif; fill: #111; }
.editor-breath-mark { font: 21px "Noto Serif CJK SC","SimSun",serif; fill: #222; }
.editor-volta-bracket { fill: none; stroke: #222; stroke-width: 1.5; }
.editor-volta-label { font: 16px Arial,sans-serif; fill: #222; }
.score-header { text-align: center; margin-bottom: 30px; }
.score-header h1 { margin: 0; font: 700 24px/1.2 Georgia, "Songti SC", serif; letter-spacing: .04em; }
.score-header .score-meta { display: flex; justify-content: center; gap: 22px; margin-top: 10px; color: var(--ink-secondary); font-size: 12px; }
.score-system { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); margin-bottom: 27px; }
.measure { min-height: 82px; position: relative; display: flex; align-items: center; gap: 7px; padding: 16px 11px 10px; border-right: 1px solid #555; }
.measure:first-child { border-left: 1px solid #555; }
.measure-number { position: absolute; top: -7px; left: 7px; color: var(--ink-tertiary); font-size: 9px; }
.score-note {
  min-width: 25px; position: relative; padding: 6px 4px 8px; border: 0; border-radius: 6px;
  background: transparent; cursor: pointer; text-align: center; font: 650 20px/1 Georgia, serif;
}
.score-note:hover { background: var(--surface-blue); }
.score-note.selected { background: var(--accent-soft); color: var(--accent-dark); }
.score-note.low-confidence::after { content: ""; position: absolute; left: 5px; right: 5px; bottom: 1px; height: 2px; background: #d99b2b; border-radius: 2px; }
.score-note .octave-above, .score-note .octave-below { position: absolute; left: 50%; transform: translateX(-50%); font-size: 12px; }
.score-note .octave-above { top: -5px; }
.score-note .octave-below { bottom: -6px; }
.score-note .accidental { font-size: 11px; vertical-align: 8px; margin-right: -2px; }
.score-note .tie-mark { position: absolute; right: -5px; top: -3px; font-size: 12px; font-weight: 400; }
.score-note.eighth .degree { border-bottom: 1.5px solid currentColor; }
.score-note.sixteenth .degree { border-bottom: 4px double currentColor; }
.score-note.thirtysecond .degree { border-bottom: 6px double currentColor; }
.score-note.playing { color: var(--accent); }

.inspector { min-height: 0; border-left: 1px solid var(--hairline); background: white; overflow: auto; }
.inspector-tabs { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: repeat(5, 1fr); padding: 8px; background: rgba(255,255,255,.92); backdrop-filter: blur(14px); }
.tab { height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-secondary); cursor: pointer; font-size: 12px; }
.tab.active { background: var(--surface-soft); color: var(--ink); font-weight: 700; }
.tab-badge { display: inline-block; min-width: 16px; height: 16px; margin-left: 4px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: white; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; vertical-align: 1px; }
.inspector-section { padding: 18px; border-top: 1px solid var(--hairline); }
.inspector-section:first-of-type { border-top: 0; }
.inspector-section h3 { margin: 0 0 13px; font-size: 13px; }
.inspector-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.inspector-field { display: grid; gap: 5px; }
.inspector-field.full { grid-column: 1 / -1; }
.inspector-field label { color: var(--ink-tertiary); font-size: 10px; font-weight: 700; }
.inspector-field input, .inspector-field select { width: 100%; height: 34px; padding: 0 8px; border: 1px solid var(--hairline); border-radius: 7px; background: white; font-size: 12px; }
.professional-engraving-panel { background: linear-gradient(180deg, #f7f9ff 0, #fff 100%); }
.professional-engraving-panel h3::after {
  content: "非破坏性"; margin-left: 7px; padding: 2px 6px; border-radius: 999px;
  color: var(--accent-dark); background: var(--accent-soft); font-size: 9px; font-weight: 800;
}
.engraving-grid { margin-top: 12px; }
.engraving-symbol-editor {
  margin-top: 12px; padding: 10px; border: 1px solid var(--hairline);
  border-radius: 9px; background: rgba(255,255,255,.76);
}
.engraving-symbol-editor summary {
  cursor: pointer; color: var(--ink); font-size: 12px; font-weight: 750;
}
.engraving-symbol-editor[open] summary { margin-bottom: 9px; }
.engraving-symbol-editor > .inspector-field { margin: 10px 0 0; }
.engraving-symbol-editor .hint { margin-top: 0; }
.lyrics-editor-field { margin-top: 14px; }
.lyrics-editor-field textarea {
  width: 100%; min-height: 150px; resize: vertical; padding: 9px 10px;
  border: 1px solid var(--hairline); border-radius: 8px; background: white;
  color: var(--ink); font: 12px/1.75 "Microsoft YaHei", sans-serif;
}
.lyrics-editor-field textarea[readonly] { min-height: 105px; background: var(--surface-soft); color: var(--ink-secondary); }
.lyric-shift-scope { display: grid; gap: 7px; margin-top: 12px; color: var(--ink-secondary); font-size: 13px; }
.lyric-shift-scope select { width: 100%; min-height: 38px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; background: var(--surface); color: var(--ink); }
.lyric-shift-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.lyric-shift-actions .button { min-height: 42px; white-space: normal; line-height: 1.35; }
.lyric-anchor-card { display: grid; gap: 7px; margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-subtle, #f8fafc); }
.lyric-anchor-card strong { color: var(--ink); font-size: 14px; }
.lyric-anchor-card span { color: var(--ink-secondary); font-size: 12px; line-height: 1.55; }
.lyric-anchor-card.active { border-color: #2563eb; background: #eff6ff; box-shadow: 0 0 0 2px rgba(37,99,235,.12); }
.lyric-anchor-actions { display: flex; gap: 8px; margin-top: 3px; }
.lyric-anchor-actions .button { width: 100%; min-height: 40px; white-space: normal; }
.external-lyric[data-lyric-note-id], .editor-lyric[data-lyric-note-id] { cursor: pointer; }
.lyric-anchor-card.active ~ .lyric-shift-actions { opacity: .45; pointer-events: none; }
.confidence { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--ink-secondary); }
.confidence-bar { flex: 1; height: 5px; border-radius: 5px; background: var(--hairline); overflow: hidden; }
.confidence-bar span { display: block; height: 100%; background: var(--success); }
.review-actions { display: grid; gap: 7px; margin-top: 13px; }
.hint { padding: 11px; border-radius: 9px; background: var(--surface-soft); color: var(--ink-secondary); font-size: 11px; line-height: 1.6; }
.suggestion-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; font-size: 11px; line-height: 1.5; border-bottom: 1px solid var(--hairline); }
.suggestion-row:last-child { border-bottom: none; }
.suggestion-row .button { flex-shrink: 0; }

/* 逐项审核面板 */
.review-counter { margin-left: 6px; color: var(--ink-tertiary); font-size: 11px; font-weight: 400; }
.review-counter strong { color: var(--accent); font-weight: 700; }
.review-list { display: grid; gap: 6px; }
.review-row {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 8px; width: 100%;
  padding: 8px 9px; border: 1px solid var(--hairline); border-radius: 9px; background: white; cursor: pointer;
  text-align: left; transition: border-color .14s var(--ease-out), background .14s var(--ease-out);
}
.review-row:hover { border-color: var(--accent); background: var(--surface-blue); }
.review-row.active { border-color: var(--accent); background: var(--accent-soft); }
.review-priority { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 18px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.review-priority.critical { color: #fff; background: var(--danger); }
.review-priority.high { color: #8a4b06; background: #ffe6c2; }
.review-priority.medium { color: #205c8c; background: #dceeff; }
.review-priority.low { color: var(--ink-secondary); background: var(--surface-soft); }
.review-row-main { display: grid; gap: 2px; min-width: 0; }
.review-row-main strong { font-size: 11px; color: var(--ink); }
.review-row-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-tertiary); font-size: 10px; }
.review-row-time { color: var(--ink-tertiary); font-size: 10px; font-variant-numeric: tabular-nums; }
.review-row.conflict { border-color: #f1c0c0; background: #fff3f3; cursor: default; }
.review-row.conflict:hover { border-color: #f1c0c0; background: #fff3f3; }
.review-detail-head { display: flex; align-items: center; gap: 8px; }
.review-detail-head strong { font-size: 13px; }
.review-detail-index { margin-left: auto; color: var(--ink-tertiary); font-size: 11px; }
.review-message { margin: 10px 0 6px; font-size: 12px; line-height: 1.6; color: var(--ink); }
.review-time { margin-bottom: 6px; color: var(--ink-secondary); font-size: 11px; font-variant-numeric: tabular-nums; }
.review-evidence { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.review-evidence span { padding: 3px 7px; border-radius: 6px; background: var(--surface-soft); color: var(--ink-secondary); font-size: 10px; line-height: 1.5; word-break: break-all; }
.review-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.review-decide { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 7px; }
.review-decide .button, .review-nav .button { padding: 0 8px; }
.review-location { margin: 10px 0; color: var(--ink); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.review-context-grid { display: grid; gap: 7px; margin: 10px 0; }
.review-context-grid > div { display: grid; gap: 3px; padding: 8px 9px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--surface-soft); }
.review-context-grid label, .short-rest-partition > label { color: var(--ink-tertiary); font-size: 10px; font-weight: 700; }
.review-context-grid span { color: var(--ink-secondary); font-size: 11px; line-height: 1.55; font-variant-numeric: tabular-nums; word-break: break-word; }
.short-rest-actions { display: grid; gap: 8px; margin-top: 12px; }
.short-rest-actions > .button { min-height: 38px; text-align: left; }
.short-rest-partition { display: grid; gap: 7px; padding: 10px; border: 1px solid var(--hairline); border-radius: 9px; background: #fff; }
.short-rest-partition > div { display: grid; grid-template-columns: auto 1fr auto auto 1fr; align-items: center; gap: 6px; }
.short-rest-partition > div > label { color: var(--ink-secondary); font-size: 10px; white-space: nowrap; }
.short-rest-partition input { min-width: 0; height: 34px; padding: 0 8px; border: 1px solid var(--hairline); border-radius: 7px; font-size: 12px; font-variant-numeric: tabular-nums; }
.short-rest-partition small { color: var(--ink-secondary); font-size: 10px; line-height: 1.5; }

.roll-pane { min-height: 0; display: grid; grid-template-rows: 44px 1fr; border-top: 1px solid var(--hairline-strong); background: white; }
.transport { display: flex; align-items: center; gap: 9px; padding: 6px 14px; border-bottom: 1px solid var(--hairline); }
.time-readout { min-width: 92px; color: var(--ink-secondary); font-variant-numeric: tabular-nums; font-size: 12px; }
.transport audio { width: min(540px, 45vw); height: 31px; }
.roll-zoom { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--ink-tertiary); font-size: 11px; }
.roll-zoom input { width: 110px; }
.roll-scroll { position: relative; overflow: auto; background: #fbfbfa; }
.piano-roll { position: relative; min-height: 882px; user-select: none; }
.pitch-labels { position: sticky; left: 0; z-index: 4; width: 52px; height: 882px; background: rgba(248,248,246,.94); border-right: 1px solid var(--hairline-strong); pointer-events: none; }
.pitch-label { position: absolute; left: 0; width: 52px; height: 18px; padding: 2px 6px; color: var(--ink-tertiary); font-size: 9px; border-bottom: 1px solid rgba(40,48,65,.05); }
.roll-note { position: absolute; height: 15px; min-width: 8px; border: 1px solid #315fdd; border-radius: 5px; background: #dfe8ff; color: #244bb8; cursor: grab; font-size: 9px; line-height: 13px; text-align: center; overflow: visible; touch-action: none; }
.roll-note:active { cursor: grabbing; }
.roll-note.selected { background: var(--accent); color: white; box-shadow: 0 0 0 2px rgba(49,95,221,.18); }
.roll-note.low-confidence { border-color: #c48119; background: #fff0cf; color: #8a5a10; }
.resize-handle { position: absolute; right: -3px; top: -1px; width: 7px; height: 15px; cursor: ew-resize; }
.playhead { position: absolute; top: 0; bottom: 0; z-index: 5; width: 1px; background: #dc4858; pointer-events: none; }

.processing-view { min-height: calc(100vh - 68px); display: grid; place-items: center; padding: 40px; }
.processing-card { width: min(620px, 100%); padding: 32px; border: 1px solid var(--hairline); border-radius: 18px; background: white; box-shadow: var(--shadow-card); }
.processing-card h2 { margin: 0; font-size: 22px; }
.processing-title { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; }
.processing-title span { color:var(--ink-tertiary); font-size:12px; }
.processing-title strong { color:var(--accent); font-size:20px; font-variant-numeric:tabular-nums; }
.processing-progress { height:5px; margin-top:18px; overflow:hidden; border-radius:999px; background:var(--hairline); }
.processing-progress span { display:block; height:100%; border-radius:inherit; background:var(--accent); transition:width 260ms var(--ease-out); }
.provided-lyrics-badge { margin-top:14px; padding:9px 11px; border-radius:8px; color:#205c3b; background:#ebf8f0; font-size:12px; }
.provided-lyrics-badge.muted { color:var(--ink-secondary); background:var(--surface-muted); }
.stage-list { display: grid; gap: 12px; margin-top: 24px; }
.stage { display: grid; grid-template-columns: 28px 1fr 70px; align-items: center; gap: 10px; }
.stage-dot { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--hairline-strong); border-radius: 50%; color: var(--ink-tertiary); font-size: 11px; }
.stage.done .stage-dot { color: white; background: var(--success); border-color: var(--success); }
.stage.running .stage-dot { border-color: var(--accent); color: var(--accent); }
.stage.running .stage-dot { animation: stage-pulse 1.1s ease-in-out infinite; }
@keyframes stage-pulse { 50% { box-shadow: 0 0 0 5px rgba(49,95,221,.10); } }
.stage small { text-align: right; color: var(--ink-tertiary); }

.toast-root { position: fixed; z-index: 200; right: 20px; bottom: 20px; display: grid; gap: 8px; }
.toast { min-width: 240px; max-width: 380px; padding: 12px 14px; border: 1px solid var(--hairline); border-radius: 11px; background: rgba(255,255,255,.94); backdrop-filter: blur(16px); box-shadow: var(--shadow-float); font-size: 12px; transition: opacity 160ms ease, transform 160ms var(--ease-out); }
.toast.error { border-color: rgba(179,59,69,.25); color: var(--danger); }
.loading { padding: 70px; text-align: center; color: var(--ink-secondary); }

@media (max-width: 1200px) {
  .app-header { grid-template-columns: 260px 1fr auto; padding-inline: 18px; }
  .editor-main { grid-template-columns: minmax(0, 1fr) 260px; }
  .score-pane { padding-inline: 20px; }
  .score-paper { padding-inline: 30px; }
}

.confirmation-view { display: flex; justify-content: center; padding: 48px 24px 72px; }
.confirmation-card { width: 760px; max-width: 100%; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 28px 30px 32px; }
.confirmation-title { position: relative; padding-right: 96px; margin-bottom: 18px; }
.confirmation-title h1 { margin: 4px 0 6px; font-size: 22px; letter-spacing: .2px; }
.confirmation-title p { margin: 0; color: var(--ink-secondary); font-size: 12px; line-height: 1.6; }
.confirmation-title .status-badge { position: absolute; top: 0; right: 0; }
.status-badge.awaiting_context_confirmation { color: var(--warning); }
.confirmation-audio { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.audio-track { display: flex; align-items: center; gap: 14px; }
.audio-track > span { width: 44px; color: var(--ink-secondary); font-size: 12px; flex-shrink: 0; }
.audio-track audio { flex: 1; height: 40px; }
.confirmation-fields { display: flex; flex-direction: column; gap: 20px; }
.confirmation-field { display: flex; flex-direction: column; gap: 8px; }
.confirmation-controls { display: flex; align-items: center; gap: 10px; }
.confirmation-controls .select { flex: 1; }
.confirmation-controls .input { flex: 1; }
.confirmation-controls .meta-pill { flex-shrink: 0; }
.candidate-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid var(--hairline-strong); border-radius: 999px; background: white; color: var(--ink); font-size: 12px; cursor: pointer; transition: border-color .14s var(--ease-out), background .14s var(--ease-out); }
.chip:hover { border-color: var(--accent); background: var(--accent-soft); }
.chip strong { font-weight: 700; }
.chip span { color: var(--ink-tertiary); font-size: 11px; }
.chip-active { border-color: var(--accent); background: var(--accent-soft); }
.confirmation-actions { display: flex; align-items: center; gap: 14px; margin-top: 26px; }
.confirmation-actions .button { min-width: 150px; }
.confirmation-actions .hint { flex: 1; margin: 0; }

/* 统一简谱工作台：三栏编辑区 + 可调高度底部工作区 */
.editor-shell {
  --dock-height: 280px;
  grid-template-rows: 54px 42px 48px minmax(160px, 1fr) var(--dock-height);
}
.quality-status-strip {
  display: flex; align-items: stretch; min-width: 0; overflow-x: auto;
  border-bottom: 1px solid var(--hairline); background: #f7f8fa;
}
.quality-status-item {
  display: grid; grid-template-columns: 8px max-content minmax(120px, 1fr);
  align-items: center; gap: 8px; min-width: 260px; padding: 0 16px;
  border-right: 1px solid var(--hairline); color: var(--ink-secondary);
}
.quality-status-item > span { width: 7px; height: 7px; border-radius: 50%; background: #7b8494; }
.quality-status-item strong { color: var(--ink); font-size: 11px; white-space: nowrap; }
.quality-status-item small { overflow: hidden; color: var(--ink-tertiary); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.quality-status-item.ready > span { background: var(--success); }
.quality-status-item.review > span { background: #c68116; }
.quality-status-item.blocked > span { background: var(--danger); }
.editor-transport {
  min-width: 0;
  background: rgba(255,255,255,.92);
}
.editor-transport audio { width: min(640px, 46vw); }
.transport-spacer { flex: 1; }
.transport-empty { color: var(--ink-tertiary); font-size: 12px; }
.source-kind-badge {
  display: inline-flex; align-items: center; height: 28px; padding: 0 10px;
  border: 1px solid var(--hairline); border-radius: 999px; background: var(--surface-soft);
  color: var(--ink-secondary); font-size: 11px; font-weight: 700;
}
.view-button {
  height: 30px; padding: 0 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink-secondary); cursor: default; font-size: 11px;
}
.view-button.active { background: var(--surface-soft); color: var(--ink); font-weight: 700; }

.editor-main { grid-template-columns: 206px minmax(0, 1fr) 286px; }
.tool-rail {
  min-width: 0; overflow: auto; padding: 10px 9px 18px;
  border-right: 1px solid var(--hairline); background: rgba(255,255,255,.92);
}
.tool-rail-heading { display: flex; align-items: center; justify-content: space-between; min-height: 34px; padding: 0 7px 8px; }
.tool-rail-heading strong { font-size: 12px; }
.panel-toggle {
  width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 auto;
  border: 0; border-radius: 7px; background: transparent; color: var(--ink-tertiary); cursor: pointer;
}
.panel-toggle:hover { background: var(--surface-soft); color: var(--ink); }
.panel-toggle:active { transform: scale(.94); }
.tool-group { display: grid; gap: 3px; padding: 10px 0; border-top: 1px solid var(--hairline); }
.tool-group-label { padding: 0 9px 5px; color: var(--ink-tertiary); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.tool-button {
  position: relative; width: 100%; min-height: 38px; display: flex; align-items: center; gap: 10px;
  padding: 5px 9px; border: 0; border-radius: 8px; background: transparent;
  color: var(--ink-secondary); cursor: pointer; text-align: left; font-size: 12px;
  transition: background-color 140ms ease, color 140ms ease, transform 100ms var(--ease-out);
}
.tool-button:hover { background: var(--surface-soft); color: var(--ink); }
.tool-button:active { transform: scale(.98); }
.tool-button.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; }
.tool-button.danger { color: var(--danger); }
.tool-button b { width: 22px; display: grid; place-items: center; flex: 0 0 22px; font-size: 14px; }
.tool-button em {
  min-width: 18px; height: 18px; margin-left: auto; padding: 0 5px; border-radius: 999px;
  background: var(--accent); color: white; font-size: 10px; font-style: normal; line-height: 18px; text-align: center;
}
.editor-shell.left-collapsed .editor-main { grid-template-columns: 50px minmax(0, 1fr) 286px; }
.editor-shell.left-collapsed .tool-rail { padding-inline: 6px; }
.editor-shell.left-collapsed .tool-rail-heading strong,
.editor-shell.left-collapsed .tool-group-label,
.editor-shell.left-collapsed .tool-button span,
.editor-shell.left-collapsed .tool-button em { display: none; }
.editor-shell.left-collapsed .tool-rail-heading { justify-content: center; padding-inline: 0; }
.editor-shell.left-collapsed .tool-button { justify-content: center; padding-inline: 0; }
.editor-shell.left-collapsed .tool-button b { width: 30px; flex-basis: 30px; }

.score-pane { padding: 26px 30px 46px; }
.inspector-tabs { grid-template-columns: repeat(5, minmax(0,1fr)) 28px; gap: 2px; }
.editor-shell.right-collapsed .editor-main { grid-template-columns: 206px minmax(0, 1fr) 36px; }
.editor-shell.left-collapsed.right-collapsed .editor-main { grid-template-columns: 50px minmax(0, 1fr) 36px; }
.editor-shell.right-collapsed .inspector { overflow: hidden; }
.editor-shell.right-collapsed .inspector-tabs { display: flex; justify-content: center; padding: 8px 4px; }
.editor-shell.right-collapsed .inspector-tabs .tab,
.editor-shell.right-collapsed #inspectorBody { display: none; }

.bottom-dock {
  position: relative; min-height: 0; display: grid; grid-template-rows: 40px minmax(0,1fr);
  border-top: 1px solid var(--hairline-strong); background: white; overflow: hidden;
}
.dock-resizer {
  position: absolute; z-index: 8; top: -5px; left: 0; right: 0; height: 11px;
  display: grid; place-items: center; cursor: ns-resize; touch-action: none;
}
.dock-resizer span { width: 48px; height: 3px; border-radius: 999px; background: var(--hairline-strong); }
.dock-resizer:hover span, .dock-resizer:focus-visible span { background: var(--accent); }
.dock-tabbar { display: flex; align-items: center; gap: 3px; padding: 5px 10px; border-bottom: 1px solid var(--hairline); }
.dock-tab {
  height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent;
  color: var(--ink-secondary); cursor: pointer; font-size: 11px;
}
.dock-tab:hover { background: var(--surface-soft); color: var(--ink); }
.dock-tab:active { transform: scale(.97); }
.dock-tab.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; }
.dock-tabbar .roll-zoom { margin-left: auto; }
.dock-collapse { height: 28px; padding: 0 9px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-tertiary); cursor: pointer; font-size: 11px; }
.dock-collapse:hover { background: var(--surface-soft); color: var(--ink); }
.dock-content { min-height: 0; overflow: hidden; }
.dock-panel { height: 100%; min-height: 0; display: none; overflow: auto; }
.dock-panel.active { display: block; }
.dock-panel[data-dock-panel="roll"] { overflow: hidden; }
.dock-panel .roll-scroll { height: 100%; }
.dock-empty { max-width: 700px; padding: 26px 30px; }
.dock-empty strong { display: block; margin-bottom: 6px; font-size: 14px; }
.dock-empty p { margin: 0 0 16px; color: var(--ink-secondary); font-size: 12px; line-height: 1.7; }
.dock-summary { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 4px 8px; padding: 24px 30px 8px; }
.dock-summary strong { color: var(--accent); font-size: 28px; }
.dock-summary span { font-size: 13px; font-weight: 700; }
.dock-summary small { grid-column: 1 / -1; color: var(--ink-secondary); line-height: 1.6; }
.dock-panel[data-dock-panel="review"] > .button { margin: 8px 30px; }
.audio-audit-panel { display: grid; gap: 10px; }
.audio-audit-panel h3 { margin-bottom: 0; }
.audio-audit-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.audio-audit-metrics span {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding: 7px 9px; border: 1px solid var(--hairline); border-radius: 8px;
  color: var(--ink-secondary); background: var(--surface-soft); font-size: 10px;
}
.audio-audit-metrics strong { color: var(--ink); font-size: 11px; }
.audio-audit-list { max-height: 240px; overflow: auto; border-top: 1px solid var(--hairline); }
.audio-audit-row { width: 100%; }
.automatic-verification-status { border-left: 3px solid #c9513e; }
.automatic-verification-status.ready { border-left-color: #2f8a57; }
.automatic-change-list { display: grid; gap: 7px; }
.automatic-change-list > strong { color: var(--ink-secondary); font-size: 10px; letter-spacing: .04em; }
.automatic-change-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: 9px; width: 100%; padding: 9px; border: 1px solid rgba(47, 138, 87, .22);
  border-radius: 9px; background: rgba(47, 138, 87, .06); cursor: pointer;
}
.automatic-change-row:hover, .automatic-change-row:focus-visible { border-color: rgba(47, 138, 87, .55); outline: none; }
.automatic-change-kind { padding: 3px 6px; border-radius: 6px; color: #246c45; background: rgba(47, 138, 87, .12); font-size: 10px; font-weight: 700; }
.automatic-change-revert { min-height: 28px; padding: 4px 8px; font-size: 10px; }
.verification-reference-audio {
  display: grid; grid-template-columns: auto minmax(180px, 1fr); align-items: center;
  gap: 7px 10px; padding: 10px; border: 1px solid rgba(47, 138, 87, .25);
  border-radius: 9px; background: rgba(47, 138, 87, .06);
}
.verification-reference-audio > strong { color: #246c45; font-size: 11px; }
.verification-reference-audio audio { width: 100%; min-width: 0; height: 32px; }
.verification-reference-audio small { grid-column: 1 / -1; color: var(--ink-secondary); line-height: 1.55; }
.capability-run-list { border: 1px solid var(--hairline); border-radius: 9px; background: var(--surface-soft); }
.capability-run-list > summary { padding: 9px 10px; color: var(--ink-secondary); font-size: 10px; font-weight: 700; cursor: pointer; }
.capability-run-list > div { display: grid; gap: 5px; padding: 0 8px 8px; }
.capability-run {
  display: grid; grid-template-columns: 1.05fr .8fr 1.15fr; gap: 8px;
  padding: 8px; border-radius: 7px; background: var(--surface); font-size: 10px;
}
.capability-run > span { display: grid; gap: 2px; min-width: 0; }
.capability-run strong, .capability-run small { overflow-wrap: anywhere; }
.capability-run small { color: var(--ink-secondary); }
.capability-run.degraded { border-left: 3px solid #c58a27; }
.capability-run.completed { border-left: 3px solid #2f8a57; }
.meta-pill.release-ready { color: #246c45; background: rgba(47, 138, 87, .10); }
.meta-pill.release-blocked { color: #9d392c; background: rgba(201, 81, 62, .10); }
.score-source-preview { min-width: 100%; min-height: 100%; margin: 0; padding: 18px 22px; color: #3e4655; background: #f8f8f6; font: 11px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; tab-size: 2; }
.midi-import-preview { height: 100%; overflow: auto; padding: 18px 22px 28px; background: #f8f8f6; }
.midi-preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.midi-preview-heading strong, .midi-preview-heading span { display: block; }
.midi-preview-heading strong { font-size: 14px; }
.midi-preview-heading div > span { margin-top: 4px; color: var(--ink-secondary); font-size: 11px; }
.evidence-chip { flex: none; padding: 5px 9px; border: 1px solid #b9d8c4; border-radius: 999px; color: #267044; background: #edf8f0; font-size: 11px; font-weight: 700; }
.midi-stream-controls { display: grid; grid-template-columns: minmax(280px, 1fr) auto auto; gap: 10px; margin-bottom: 14px; }
.midi-stream-controls select { min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--ink); }
.midi-quantization-controls { display: flex; align-items: end; flex-wrap: wrap; gap: 10px 14px; margin: -2px 0 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink-secondary); font-size: 11px; }
.midi-quantization-controls label { display: grid; gap: 4px; }
.midi-quantization-controls select { min-width: 130px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--ink); }
.midi-quantization-controls .midi-checkbox { display: flex; align-items: center; gap: 6px; padding-bottom: 7px; }
.midi-quantization-controls > span { margin-left: auto; padding-bottom: 7px; }
.midi-option-preview { margin: -6px 0 14px; padding: 8px 11px; border-left: 3px solid #777; background: #f0f0ed; color: var(--ink-secondary); font-size: 11px; line-height: 1.55; }
.playback-mode-switch { display: inline-flex; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: white; }
.playback-mode-switch button { border: 0; border-right: 1px solid var(--line); padding: 6px 9px; background: transparent; color: var(--ink-secondary); font-size: 11px; cursor: pointer; }
.playback-mode-switch button:last-child { border-right: 0; }
.playback-mode-switch button.active { background: #222; color: white; }
.playback-mode-switch button:disabled { opacity: .4; cursor: default; }
.midi-stream-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.midi-stream-card { display: grid; gap: 3px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.midi-stream-card strong { font-size: 12px; }
.midi-stream-card span, .midi-stream-card small { color: var(--ink-secondary); font-size: 10px; line-height: 1.45; }
.midi-stream-card small { margin-top: 3px; color: var(--accent); font-weight: 700; }
.midi-stream-card.disabled { opacity: .58; }
.midi-import-preview details { margin-top: 14px; }
.midi-import-preview summary { cursor: pointer; color: var(--ink-secondary); font-size: 11px; }
.midi-import-preview details .score-source-preview { max-height: 420px; margin-top: 8px; overflow: auto; border: 1px solid var(--line); }
.editor-shell.dock-collapsed .bottom-dock { grid-template-rows: 40px 0; }
.editor-shell.dock-collapsed .dock-content { display: none; }
.editor-shell.dock-dragging, .editor-shell.dock-dragging * { cursor: ns-resize !important; user-select: none !important; }

/* 曲库使用真实谱面缩略图；未完成项目仍显示轻量占位谱。 */
.project-grid { grid-template-columns: repeat(auto-fill, minmax(218px, 1fr)); gap: 18px; }
.new-card, .project-card { min-height: 300px; }
.score-thumb { height: 214px; padding: 14px; }
.mini-paper { position: relative; padding: 0; overflow: hidden; }
.score-thumbnail-image { width: 100%; height: 100%; display: block; object-fit: cover; object-position: top center; background: white; }
.mini-paper > .mini-title { padding-top: 23px; }
.mini-paper > .mini-score { padding: 0 18px 18px; }
.card-meta { min-width: 0; flex-wrap: wrap; gap: 4px 8px; }
.project-card { transition: border-color 150ms ease, box-shadow 170ms ease, transform 110ms var(--ease-out); }
.project-card:hover { border-color: #c8cfde; box-shadow: 0 8px 28px rgba(20,28,45,.10); transform: translateY(-2px); }

@media (max-width: 1260px) {
  .header-actions .meta-pill, .header-actions .mode-warning { display: none; }
  .editor-main { grid-template-columns: 176px minmax(0,1fr) 260px; }
  .editor-shell.left-collapsed .editor-main { grid-template-columns: 50px minmax(0,1fr) 260px; }
  .editor-shell.right-collapsed .editor-main { grid-template-columns: 176px minmax(0,1fr) 36px; }
  .editor-shell.left-collapsed.right-collapsed .editor-main { grid-template-columns: 50px minmax(0,1fr) 36px; }
  .toolbar-credit { width: 70px; }
  .score-pane { padding-inline: 18px; }
  .editor-transport audio { width: min(480px, 39vw); }
  .quality-status-item { min-width: 230px; }
  .quality-status-item small { display: none; }
}

@media (max-width: 900px) {
  body { min-width: 0; }
  .app-header { grid-template-columns: auto 1fr auto; gap: 12px; padding-inline: 16px; }
  .brand small { display: none; }
  .header-center { justify-content: stretch; }
  .search { width: 100%; }
  .library-layout { grid-template-columns: 1fr; }
  .library-sidebar { display: flex; align-items: center; gap: 6px; overflow-x: auto; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--hairline); }
  .library-sidebar .sidebar-label, .library-sidebar .hint { display: none; }
  .nav-item { width: auto; white-space: nowrap; }
  .library-main { padding: 28px 18px 56px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .app-header, .editor-toolbar, .inspector-tabs, .modal { backdrop-filter: none; background: white; }
}
@media (prefers-contrast: more) {
  :root { --hairline: #b8bcc4; --hairline-strong: #8e949f; }
}

/* 兼容旧版分轨导入样式；默认入口使用完整歌曲工作流。 */
.workflow-modal { width: min(760px, calc(100vw - 36px)); }
.workflow-modal .modal-header p { margin: 6px 0 0; font-size: 12px; }
.workflow-panel { display: none; }
.workflow-panel.active { display: block; }
.required-intro { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; color: var(--ink-secondary); font-size: 12px; }
.required-intro strong { padding: 4px 8px; border-radius: 999px; color: var(--accent-dark); background: var(--accent-soft); font-size: 10px; }
.required-assets { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.asset-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0; }
.asset-picker, .separation-drop { position: relative; display: grid; gap: 6px; padding: 16px; border: 1px dashed #b9c1d1; border-radius: 12px; background: #fbfbfc; cursor: pointer; }
.asset-picker:hover, .separation-drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.asset-picker span { color: var(--accent-dark); font-size: 11px; font-weight: 800; letter-spacing: .05em; }
.required-asset span { display: flex; align-items: center; gap: 7px; }
.required-asset span b, .required-lyrics label b { display: inline-grid; place-items: center; width: 21px; height: 21px; margin-right: 6px; border-radius: 7px; color: white; background: var(--accent); font-size: 11px; }
.asset-picker strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.asset-picker small, .separation-drop small { color: var(--ink-tertiary); line-height: 1.5; }
.required-asset { min-height: 128px; padding-right: 72px; }
.required-asset em { position: absolute; top: 14px; right: 14px; color: var(--ink-tertiary); font-size: 10px; font-style: normal; }
.required-asset.complete { border-style: solid; border-color: rgba(24,122,83,.42); background: #f4fbf7; }
.required-asset.complete em { color: var(--success); font-weight: 700; }
.required-lyrics { padding: 14px; border: 1px solid var(--hairline); border-radius: 12px; background: white; }
.required-lyrics.complete { border-color: rgba(24,122,83,.42); background: #f8fcfa; }
.required-lyrics textarea { min-height: 96px; height: 96px; resize: vertical; padding: 11px 12px; line-height: 1.65; font-family: inherit; }
.optional-materials { margin-top: 12px; border: 1px solid var(--hairline); border-radius: 11px; background: var(--surface-soft); }
.optional-materials summary { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; }
.optional-materials summary::-webkit-details-marker { display: none; }
.optional-materials summary::before { content: '＋'; color: var(--ink-tertiary); }
.optional-materials[open] summary::before { content: '−'; }
.optional-materials summary span { color: var(--accent-dark); font-size: 11px; font-weight: 800; }
.optional-materials summary strong { font-size: 12px; }
.optional-materials summary small { color: var(--ink-tertiary); font-size: 10px; }
.optional-materials-body { padding: 0 14px 14px; border-top: 1px solid var(--hairline); }
.optional-materials-body .form-field { margin-top: 12px; }
.optional-asset-grid { margin-bottom: 0; }
.asset-requirement-status { margin-top: 12px; padding: 10px 12px; border-radius: 9px; color: #77500c; background: #fff6df; font-size: 11px; font-weight: 650; }
.asset-requirement-status.ready { color: var(--success); background: #edf8f2; }
.workflow-actions { align-items: center; justify-content: space-between; }
.workflow-actions #openSeparation { color: var(--ink-secondary); background: transparent; border-color: transparent; }
.workflow-actions #openSeparation:hover { color: var(--accent-dark); background: var(--accent-soft); }
.workflow-back { margin: -4px 0 14px; padding: 0; border: 0; color: var(--accent-dark); background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; }
.separation-capability { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 12px; padding: 12px 14px; border-radius: 10px; background: var(--surface-soft); }
.separation-capability > span { flex: 0 0 auto; width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: var(--ink-tertiary); }
.separation-capability > div { display: grid; gap: 3px; }
.separation-capability strong { font-size: 12px; }
.separation-capability small { color: var(--ink-secondary); line-height: 1.5; }
.separation-capability.available { color: var(--success); background: #edf8f2; }
.separation-capability.available > span { background: var(--success); }
.separation-capability.unavailable { color: var(--danger); background: #fff1f2; }
.separation-capability.unavailable > span { background: var(--danger); }
.workflow-note { margin-top: 12px; padding: 11px 13px; border-radius: 9px; color: var(--ink-secondary); background: var(--surface-soft); font-size: 11px; line-height: 1.6; }
.separation-drop { place-items: center; min-height: 150px; text-align: center; }
.separation-drop > span { color: var(--accent); font-size: 32px; }
.separation-drop.disabled { cursor: not-allowed; opacity: .48; }
.separation-drop.disabled:hover { border-color: #b9c1d1; background: #fbfbfc; }
.separation-progress { margin-top: 16px; padding: 14px; border-radius: 11px; background: var(--surface-soft); }
.separation-progress > div:first-child { display: flex; justify-content: space-between; margin-bottom: 8px; }
.separation-progress small { display: block; margin-top: 8px; color: var(--ink-secondary); }
.separation-downloads { display: flex; gap: 10px; margin-top: 14px; }
.separation-downloads[hidden] { display: none; }
.separation-downloads a { text-decoration: none; }

/* JianpuRender vendor surface.  The vendor engine owns beat-domain notation
   geometry; these rules only provide the editor paper and lyric overlay. */
.score-paper-external {
  width: min(1280px, 100%);
  min-height: 100%;
  padding: 34px 30px 80px;
  background: #fff;
  box-shadow: 0 3px 18px rgba(20,28,45,.10);
}
.external-score-header { margin: 0 auto 20px; text-align: center; }
.external-score-header h1 {
  margin: 0;
  color: #171717;
  font: 700 30px/1.25 "Noto Serif CJK SC", "Songti SC", "SimSun", serif;
  letter-spacing: .08em;
}
.external-score-meta {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 10px;
  color: #4b5563;
  font: 16px/1.4 "Microsoft YaHei", sans-serif;
}
.external-score-credits {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 8px;
  color: #6b7280;
  font: 13px/1.45 "Microsoft YaHei", sans-serif;
}
.external-score-systems {
  display: grid;
  gap: 14px;
  width: 100%;
}
.external-score-system {
  width: 100%;
  padding: 6px 0 10px;
  border-bottom: 1px solid #e5e7eb;
}
.external-score-system:last-child { border-bottom: 0; }
.external-score-measure-label {
  margin: 0 0 5px;
  color: #9ca3af;
  font: 13px/1.3 "Microsoft YaHei", sans-serif;
  letter-spacing: .04em;
  display: grid;
  justify-items: start;
  gap: 5px;
}
.external-score-measure-label strong {
  color: #374151;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
}
.jianpurender-host { width: 100%; height: 205px; overflow: hidden; color: #111827; }
.jianpurender-host > div {
  width: 100%;
  height: 100% !important;
  /* JianpuRender sets overflow-x:auto inline.  Each browser system is
     intentionally a fixed-width vertical page, so never expose a second
     horizontal scrollbar inside the score. */
  overflow-x: hidden !important;
  overflow-y: hidden !important;
}
.jianpurender-host svg {
  display: block;
  width: 100%;
  max-width: 100%;
  font-family: Arial, "Microsoft YaHei", sans-serif;
}
.jianpurender-host g[data-id] { pointer-events: none; }
.external-virtual-hit-layer { pointer-events: all; }
.external-hit-layer { pointer-events: all; }
.external-selection-layer { pointer-events: none; }
.external-semantic-layer { pointer-events: none; }
.external-rest-glyph {
  fill: #111827;
  font: normal 32.4px sans-serif;
  text-anchor: middle;
  dominant-baseline: middle;
}
.external-rest-duration-line { stroke: #111827; stroke-width: 2.1; stroke-linecap: round; }
.external-rhythm-beam { stroke: #111827; stroke-width: 2.1; stroke-linecap: butt; }
.external-editor-slur, .external-editor-tie { fill: none; stroke: #111827; stroke-width: 1.8; stroke-linecap: round; }
.external-system-end-barline { stroke: #111827; stroke-width: 1.35; }
.external-note-hit {
  fill: transparent;
  stroke: transparent;
  stroke-width: 1.5;
  pointer-events: all;
  cursor: pointer;
  transition: fill .12s ease, stroke .12s ease;
}
.external-note-hit:hover { fill: rgba(37,99,235,.08); stroke: rgba(37,99,235,.24); }
.external-note-hit:focus { fill: rgba(37,99,235,.06); stroke: rgba(37,99,235,.28); outline: none; }
.external-note-hit.selected,
.external-note-hit.selected:hover,
.external-note-hit.selected:focus { fill: transparent; stroke: transparent; }
.external-note-hit.rest { stroke-dasharray: 3 3; }
.external-note-selection { fill: transparent; stroke: transparent; stroke-width: 1.5; }
.external-note-selection.selected { fill: rgba(37,99,235,.13); stroke: #2563eb; }
.external-lyrics-layer { pointer-events: none; }
.external-lyric {
  fill: #1f2937;
  font: 500 23px/1.2 "Noto Serif CJK SC", "SimSun", serif;
  text-anchor: middle;
  dominant-baseline: auto;
  pointer-events: none;
}
.external-lyric-melisma { stroke: #4b5563; stroke-width: 1.4; stroke-linecap: round; }
.external-relocated-barline { stroke:#111827; stroke-width:1.15; }
@media (max-width: 760px) {
  .required-assets, .asset-grid { grid-template-columns: 1fr; }
  .workflow-actions { align-items: stretch; flex-direction: column-reverse; }
}
.tempo-choice-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:8px 0 14px; }
.tempo-choice { min-height:112px; padding:18px; border:1px solid #d7dce5; border-radius:14px; background:#fff; color:#172033; text-align:left; cursor:pointer; }
.tempo-choice:hover { border-color:#3568e8; box-shadow:0 6px 18px rgba(37,99,235,.12); }
.tempo-choice.primary { background:#f3f7ff; border-color:#9db8ff; }
.tempo-choice strong,.tempo-choice span { display:block; }
.tempo-choice strong { margin-bottom:8px; font-size:16px; }
.tempo-choice span { color:#667085; line-height:1.55; }
.tempo-lock-option { display:flex; align-items:center; gap:8px; margin:4px 0 12px; color:#344054; }
.tempo-requant-preview { display:flex; flex-direction:column; gap:5px; padding:12px 14px; border-radius:10px; background:#eef5ff; color:#24406f; }
.tempo-requant-preview.warning { background:#fff4e5; color:#8a4b08; }
.tempo-requant-preview span { font-size:12px; }
.tempo-action-button { border:0; border-left:1px solid #d7dce5; background:transparent; color:#667085; padding:0 4px; cursor:pointer; font-weight:700; }
.tempo-action-button:hover { color:#255bd6; }
@media (max-width:720px) { .tempo-choice-grid { grid-template-columns:1fr; } }
