:root {
  color-scheme: light;
  --page: #f5f4ef;
  --paper: #fffefa;
  --ink: #172822;
  --muted: #52645a;
  --line: #dedfd4;
  --accent: #c4e885;
  --green: #385b43;
  --band: 29%;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--page);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; }
h1, h2, p, ol, fieldset { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button, select, summary, .file-button { cursor: pointer; }
button:disabled, select:disabled, input:disabled { cursor: default; }
:focus-visible { outline: 2px solid #508735; outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.header-inner, .workspace { width: min(1220px, calc(100% - 80px)); margin-inline: auto; }
.header-inner { height: 67px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 11px; font-size: 20px; font-weight: 780; letter-spacing: .04em; white-space: nowrap; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; background: var(--ink); display: flex; align-items: center; justify-content: center; gap: 4px; }
.brand-mark i { width: 3px; height: 18px; border-radius: 4px; background: var(--accent); transform: rotate(25deg); }
.brand-mark i:first-child { height: 10px; }
.brand-mark i:last-child { height: 13px; }
.brand-detail { border-left: 1px solid var(--line); margin-left: 15px; padding-left: 15px; color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0; }
.privacy { display: flex; align-items: center; gap: 7px; white-space: nowrap; color: var(--muted); font-size: 12px; }
.privacy > span { width: 7px; height: 7px; border-radius: 50%; background: #6a994b; }

.workspace { padding-block: 32px 44px; }
.protocol-warning { display: none; margin: 0 0 14px; padding: 12px 14px; border: 1px solid #d69b79; border-radius: 9px; background: #fff0e7; color: #703c27; font-size: 14px; line-height: 1.55; }
.protocol-warning code { font-size: .95em; font-weight: 700; }
html[data-local-file] .protocol-warning { display: block; }
html[data-local-file] .editor { pointer-events: none; opacity: .5; }
.workspace-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 23px; }
h1 { font-size: clamp(27px, 3.5vw, 43px); line-height: 1.16; letter-spacing: -.045em; font-weight: 790; }
.workspace-head p { font-size: 14px; color: var(--muted); margin-top: 10px; line-height: 1.6; }
.button, .file-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 9px; min-height: 40px; padding: 8px 14px; font-size: 14px; font-weight: 710; line-height: 1.25; text-decoration: none; white-space: nowrap; }
.secondary { background: var(--paper); border: 1px solid #d4d9c9; color: var(--ink); }
.secondary:hover, .file-button:hover { background: #f0f1e7; }
.primary { background: var(--accent); border: 1px solid #b8db79; color: #1e321c; }
.primary:hover:not(:disabled) { background: #d1ef9d; }
.button:disabled { background: #e7e9df; border-color: #e1e4d9; color: #526357; }
.button.secondary:disabled { color: var(--muted); }
.message { margin: 0 0 14px; padding: 10px 14px; border-radius: 9px; background: #e9eedf; color: #2c4733; font-size: 14px; }
.message[data-error="true"] { background: #f7e9e0; color: #783c26; }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 340px); align-items: start; gap: 19px; }
.card { border: 1px solid var(--line); border-radius: 14px; background: var(--paper); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; min-height: 54px; gap: 10px; padding: 12px 16px; }
.card-title { display: flex; align-items: center; flex-wrap: wrap; column-gap: 8px; row-gap: 3px; }
.card-title > span { color: var(--muted); font-size: 12px; }
h2 { font-size: 16px; font-weight: 760; line-height: 1.4; }
.format { padding: 2px; border: 1px solid #e2e4d8; background: #f1f2e9; border-radius: 8px; display: flex; white-space: nowrap; }
.format label { position: relative; display: block; cursor: pointer; }
.format input { position: absolute; opacity: 0; width: 1px; }
.format label span { display: block; color: var(--muted); font-size: 12px; padding: 5px 8px; border-radius: 6px; }
.format input:checked + span { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px #1a32221b; font-weight: 680; }
.format input:focus-visible + span { outline: 2px solid #508735; }
.stage { margin-inline: 14px; padding: 0; border-radius: 9px; background: #1a2620; overflow: hidden; }
.composition { position: relative; background: #101a16; aspect-ratio: 16 / 9; width: 100%; margin: auto; overflow: hidden; display: grid; grid-template-rows: calc(100% - var(--band)) var(--band); container-type: inline-size; }
.composition[data-portrait="true"] { --band: 23%; aspect-ratio: 9 / 16; width: min(100%, 300px); }
.performance { position: relative; background: #101a16; min-height: 0; min-width: 0; }
.performance video { display: block; width: 100%; height: 100%; object-fit: contain; background: #101a16; }
.video-placeholder { position: absolute; inset: 0; display: grid; justify-items: center; align-items: center; isolation: isolate; color: #f0f4e8; background: radial-gradient(ellipse at 50% 35%, #294138, #182722 70%); }
.fret-pattern { position: absolute; inset: 13% 0; opacity: .35; z-index: -1; mask-image: radial-gradient(ellipse, #0000 16%, #000 95%); background:
  repeating-linear-gradient(90deg, transparent 0 calc(12.5% - 1px), #73937b66 calc(12.5% - 1px) 12.5%),
  repeating-linear-gradient(0deg, transparent 0 calc(16.666% - 1px), #9bb28466 calc(16.666% - 1px) 16.666%); }
.stage-upload { display: grid; justify-items: center; gap: 12px; padding: 12px; font-size: 14px; font-weight: 690; background: transparent; border: 0; color: inherit; }
.stage-symbol { position: relative; display: grid; place-items: center; width: clamp(34px, 10cqw, 60px); aspect-ratio: 1; border: 1px solid #8fa78e80; border-radius: 15px; background: #30473d; color: #d3efa7; }
.stage-symbol::before { content: ""; display: block; width: 42%; height: 34%; border: 1.5px solid currentColor; border-radius: 4px; }
.stage-symbol::after { content: "▶"; position: absolute; font-size: 9px; }
.stage-upload:hover .stage-symbol { background: #3e574a; }
.score-strip { background: #fff; display: grid; place-items: center; min-height: 0; position: relative; }
.has-video .performance, .has-video .score-strip { position: absolute; }
.score-strip img { display: block; width: 100%; height: 100%; user-select: none; touch-action: manipulation; }
.score-strip img { cursor: crosshair; }
#page-turn { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.composition:has(#page-turn:not([hidden])) .score-strip { opacity: 0; }
.score-cursor { pointer-events: none; top: 0; bottom: 0; position: absolute; z-index: 2; min-height: 0; width: 18px; padding: 0; transform: translateX(-50%); border: 0; border-radius: 0; background: transparent; }
.score-cursor::before { content: ""; position: absolute; top: 0; bottom: 0; left: 8px; width: 2px; background: #e65339; box-shadow: 0 0 2px #fff; }
.score-cursor::after { content: ""; position: absolute; top: -5px; left: 5px; width: 8px; height: 8px; border: 2px solid #fff; border-radius: 50%; background: #e65339; box-shadow: 0 0 2px #7c1f17; }
.score-cursor:hover::before { width: 3px; left: 7px; }
#score-placeholder { display: flex; gap: 8px; align-items: center; font-size: clamp(10px, 2.8cqw, 13px); color: #53635a; text-align: center; }
#score-placeholder span { font-size: 1.4em; color: #6c875d; }
.transport { display: flex; align-items: center; padding: 13px 16px 11px; gap: 12px; }
.play-button { border: 0; width: 42px; height: 42px; border-radius: 10px; flex: 0 0 auto; background: #253d31; color: #f0f4e7; }
.play-button:disabled { background: #edf0e7; color: #66796e; }
.play-button span { display: block; font-size: 14px; }
.playback-speed { display: flex; flex: 0 0 auto; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; }
.playback-speed select { min-height: 32px; padding-inline: 5px; font-size: 12px; }
.scrub { flex: 1; min-width: 0; }
.scrub-line { display: flex; position: relative; }
#seek { width: 100%; height: 24px; margin: 0; accent-color: #486b4c; min-width: 0; }
#seek:disabled { opacity: .55; }
#cue-track { position: relative; margin: -2px 8px 2px; }
.marker-lane { position: relative; height: 22px; }
.marker-lane:empty { display: none; }
#cue-track button { position: absolute; width: 22px; height: 20px; top: 1px; transform: translateX(-50%); border: 0; padding: 0; background: transparent; }
#cue-track .row-point::after, #cue-track .note-point::after { content: ""; display: block; margin: auto; width: 6px; height: 8px; background: #568348; border-radius: 1px; }
#cue-track .note-point::after { height: 5px; border-radius: 50%; background: #cf583e; }
#cue-track .marker-group { width: 29px; border-radius: 6px; font-size: 11px; line-height: 18px; font-weight: 700; color: #315c3c; background: #e1ecd9; }
#cue-track .note-group { color: #97442f; background: #f7e5db; border-radius: 12px; }
#cue-track button:focus-visible { z-index: 1; }
#timeline-tools { margin-top: 7px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 3px 8px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
#timeline-tools button { min-width: 24px; min-height: 24px; margin-left: 2px; padding: 1px 4px; background: transparent; border: 1px solid var(--line); border-radius: 5px; }
#timeline-tools button:disabled { opacity: .45; }
.clock { display: flex; justify-content: space-between; font-size: 11px; font-variant-numeric: tabular-nums; color: var(--muted); }
.row-tools { display: flex; align-items: center; gap: 12px; }
select { background: #fbfcf7; border: 1px solid #dbdfd3; border-radius: 7px; min-height: 35px; padding: 4px 5px; max-width: 100%; }
select:disabled { color: var(--muted); }

.side { display: grid; gap: 13px; min-width: 0; }
.material-list { padding: 0 14px 12px; display: grid; gap: 7px; }
.material { position: relative; display: grid; align-items: center; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 8px; background: #f2f3eb; border-radius: 8px; min-height: 58px; padding: 7px 8px; }
.material-icon { width: 33px; height: 36px; border-radius: 7px; background: #e5ecdb; display: grid; position: relative; place-items: center; color: #416047; }
.material-icon::before, .material-icon::after { content: ""; display: block; }
.video-icon::before { width: 16px; height: 12px; border: 1.5px solid currentColor; border-radius: 3px; }
.video-icon::after { content: "▶"; position: absolute; font-size: 6px; }
.sheet-icon::before { width: 13px; height: 16px; border: 1.5px solid currentColor; border-radius: 2px; }
.sheet-icon::after { width: 6px; height: 4px; position: absolute; border-block: 1px solid currentColor; }
.material-info { display: grid; gap: 4px; }
.material-info strong { font-size: 13px; font-weight: 720; }
.material-info > span { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-button { padding: 5px 8px; min-height: 32px; border: 1px solid #dbe0d1; background: var(--paper); font-size: 12px; }
.material:has(.file-input:focus-visible) .file-button { outline: 2px solid #508735; outline-offset: 2px; }
.file-button[aria-disabled="true"] { cursor: default; opacity: .55; pointer-events: none; }
.text-button { border: 0; background: transparent; color: #375b3f; font-size: 13px; padding: 4px 1px; font-weight: 690; }
.text-button:hover:not(:disabled) { text-decoration: underline; }
.text-button:disabled { color: #627268; }
.empty { color: var(--muted); font-size: 12px; line-height: 1.65; padding: 0 16px 15px; }
.item-list { list-style: none; padding: 0; max-height: 248px; overflow: auto; }
.item-list > li { display: flex; align-items: center; gap: 7px; padding: 8px 12px; border-top: 1px solid #eeeee6; min-height: 44px; }
.item-list .is-active { background: #f0f5e7; }
.row-list img { display: block; width: 100%; height: auto; border-radius: 3px; }
.row-pick { flex: 1; min-width: 0; display: grid; gap: 4px; border: 0; background: transparent; text-align: left; user-select: none; touch-action: manipulation; }
#batch-panel { margin: 0 12px 12px; font-size: 12px; }
#batch-panel summary { color: var(--green); cursor: pointer; padding: 8px 0; }
#batch-form { display: grid; gap: 8px; }
#batch-form p, #batch-status { color: var(--muted); line-height: 1.5; }
#batch-form label { display: grid; gap: 4px; }
#batch-form input { padding: 5px 7px; width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 5px; }
.batch-times { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row-list .row-label { flex: 1; min-width: 0; font-size: 12px; }
.icon-button { flex: 0 0 auto; background: transparent; color: var(--muted); border: 0; width: 32px; height: 32px; border-radius: 6px; font-size: 18px; }
.icon-button:hover { background: #e8eee0; color: var(--ink); }
.export-panel { padding: 12px; border-radius: 13px; background: #243b30; color: #f0f4e9; }
.export-button { width: 100%; }
.export-button:disabled { background: #3e5749; border-color: #496455; color: #f0f4e9; }
.export-panel p { color: #dce7da; font-size: 11px; text-align: center; margin: 9px 0 1px; line-height: 1.55; }
.export-progress, .export-result { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 9px; }
.export-progress { flex-wrap: wrap; }
.export-progress progress { width: 100%; height: 10px; accent-color: var(--accent); }
.export-progress > span { min-width: 0; color: #f0f4e9; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.export-progress button { color: #f0f4e9; flex: 0 0 auto; }
.export-result .button { min-height: 33px; font-size: 12px; }

dialog { width: min(820px, calc(100vw - 28px)); padding: 0; max-height: 90vh; max-height: 90dvh; border-radius: 15px; border: 1px solid var(--line); color: var(--ink); background: var(--paper); }
dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: #14241bc2; }
.dialog-head, .dialog-foot, .crop-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; }
.dialog-head { border-bottom: 1px solid var(--line); }
.dialog-head p, .dialog-foot span, .crop-toolbar label { font-size: 12px; color: var(--muted); line-height: 1.5; }
.crop-toolbar { flex-wrap: wrap; }
#crop-pages { display: flex; align-items: center; gap: 8px; max-width: 100%; }
#crop-page { min-width: 0; max-width: min(185px, 36vw); font-size: 12px; text-overflow: ellipsis; }
#crop-pages button { white-space: nowrap; }
.crop-toolbar label { display: flex; align-items: center; gap: 5px; }
.crop-toolbar [aria-pressed="true"] { background: #e6eedc; border-radius: 6px; padding-inline: 5px; }
.crop-scroll { overflow: auto; overscroll-behavior: contain; background: #e2e6da; min-height: 0; }
.crop-surface { position: relative; width: 100%; touch-action: none; user-select: none; cursor: crosshair; }
.crop-surface.is-panning { touch-action: none; cursor: grab; }
.crop-surface.is-panning.is-dragging { cursor: grabbing; }
.crop-surface > canvas { display: block; width: 100%; height: auto; pointer-events: none; }
.crop-overlay { position: absolute; inset: 0; pointer-events: none; }
.crop-box { position: absolute; border: 2px solid #45824e; background: #76aa4928; color: #163d23; }
.crop-box span { display: inline-block; vertical-align: top; padding: 1px 4px; border-radius: 0 0 3px 0; color: #fff; background: #35623e; font-size: 11px; }
.crop-box.pending { border: 2px dashed #ae750a; background: #f4c94d38; }
.dialog-foot { border-top: 1px solid var(--line); }

@media (max-width: 920px) {
  .header-inner, .workspace { width: calc(100% - 36px); }
  .editor { gap: 13px; grid-template-columns: minmax(0, 1fr) minmax(265px, 310px); }
}
@media (max-width: 700px) {
  .editor { grid-template-columns: 1fr; }
  .header-inner { height: 54px; }
  .header-inner, .workspace { width: calc(100% - 24px); }
  .brand-detail { display: none; }
  .workspace { padding-top: 22px; }
  .workspace-head { gap: 8px; margin-bottom: 15px; align-items: start; }
  .workspace-head p { font-size: 13px; margin-top: 6px; }
  .workspace-head .button { font-size: 12px; padding-inline: 8px; min-height: 34px; }
  .stage { margin-inline: 9px; }
  .card-head { padding-inline: 11px; flex-wrap: wrap; }
  .composition[data-portrait="true"] { width: min(100%, 258px); }
  .item-list { max-height: 210px; }
}
.release-nav, .member-actions { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.release-nav a, .release-nav button { color:var(--green); background:transparent; border:0; text-decoration:none; font:inherit; font-size:13px; cursor:pointer; }
.release-dialog { max-width:460px; }
.dialog-body { padding:18px; overflow:auto; display:grid; gap:16px; }
.dialog-body form, .dialog-body label, #member { display:grid; gap:9px; }
.dialog-body input { width:100%; padding:8px; border:1px solid var(--line); border-radius:6px; background:white; }
.dialog-body p { font-size:13px; line-height:1.6; overflow-wrap:anywhere; }
.dialog-body summary { cursor:pointer; font-size:13px; }
.saved-project { display:flex; gap:8px; border-top:1px solid var(--line); align-items:center; padding:6px 0; }
.saved-project button:first-child { flex:1; text-align:left; overflow-wrap:anywhere; }
#payment-code { display:block; width:min(200px,100%); margin:auto; }
#recovery-result { padding:10px; background:#edf2df; user-select:all; }
.release-footer { display:flex; flex-wrap:wrap; gap:8px 16px; justify-content:center; color:var(--muted); font-size:12px; padding:0 16px 20px; }
