/* Yuban workspace UI. All application state and behavior remain in app.js. */
:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --surface: #ffffff;
  --text: #23272f;
  --muted: #68717e;
  --line: #e3e6ea;
  --accent: #2c5cc5;
  --accent-dark: #224a9f;
  --accent-soft: #eef3fc;
  --radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--text);
  font-size: 14px;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.6; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; opacity: .42; }
input:disabled, select:disabled { color: var(--muted); background: #f1f3f5; cursor: not-allowed; }
button, a, input, select, textarea { outline-offset: 3px; }
:is(button, a, input, select, textarea):focus-visible { outline: 2px solid var(--accent); }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.svg-definitions { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.icon { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3, p { margin: 0; }
.site-header { height: 72px; padding: 0 max(32px, calc((100vw - 1240px) / 2)); background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 11px; font-size: 20px; font-weight: 650; letter-spacing: .5px; }
.brand > span:last-child { display: flex; align-items: center; gap: 18px; }
.brand-sub { padding-left: 18px; border-left: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 400; letter-spacing: 0; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 7px; background: var(--accent); color: white; }
.brand-mark .icon { width: 21px; height: 21px; }
.header-right, .local-label { display: flex; align-items: center; gap: 20px; }
.local-label { gap: 7px; color: var(--muted); font-size: 12px; }
.local-label .icon { width: 15px; height: 15px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; color: var(--muted); border-radius: 6px; background: transparent; }
.icon-button:hover { color: var(--text); background: #f0f2f5; }
main { max-width: 1240px; margin: 0 auto; padding: 0 0 48px; }
.steps { display: flex; align-items: stretch; gap: 28px; height: 58px; border-bottom: 1px solid var(--line); }
.step { display: inline-flex; align-items: center; gap: 8px; padding: 0 2px; color: var(--muted); background: transparent; border-bottom: 2px solid transparent; font-size: 14px; font-weight: 500; white-space: nowrap; }
.step .icon { width: 17px; height: 17px; }
.step.active { color: var(--accent); border-bottom-color: var(--accent); }
.step:not(.active):not(:disabled):hover { color: var(--text); }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 30px 0 24px; }
h1 { font-size: 24px; line-height: 1.45; font-weight: 650; letter-spacing: -.4px; }
.page-heading .muted { margin-top: 6px; }
.muted { font-size: 13px; color: var(--muted); line-height: 1.8; }
.workspace-label { font-size: 12px; color: #8a929d; white-space: nowrap; }
.record-workspace { display: grid; grid-template-columns: 288px minmax(0, 1fr); min-height: 426px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.setup-panel { padding: 25px 24px 24px; border-right: 1px solid var(--line); }
.section-label { display: flex; align-items: center; font-size: 13px; font-weight: 600; color: #434c59; line-height: 1.5; }
.field-label { display: block; margin: 21px 0 7px; font-size: 12px; color: #596271; font-weight: 500; }
input:not([type=radio]), select { display: block; width: 100%; min-height: 39px; padding: 8px 10px; border: 1px solid #d8dde4; border-radius: 5px; color: var(--text); background: white; font-size: 13px; }
input:not([type=radio]):hover:not(:disabled), select:hover:not(:disabled) { border-color: #b5bdc9; }
input::placeholder { color: #8a929e; }
select { padding-right: 25px; }
.direction-group { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.direction-option { display: flex; align-items: center; justify-content: space-between; position: relative; padding: 10px 11px; border: 1px solid var(--line); border-radius: 5px; cursor: pointer; }
.direction-option:has(input:checked) { border-color: #92ace0; background: var(--accent-soft); }
.direction-option:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.direction-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.direction-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.direction-option strong { display: block; font-size: 13px; font-weight: 600; }
.direction-option small { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
.radio-dot { width: 12px; height: 12px; flex-shrink: 0; border: 1px solid #b8c0cb; border-radius: 50%; background: white; }
.direction-option:has(input:checked) .radio-dot { border: 4px solid var(--accent); }
.text-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 5px 0; background: transparent; font-size: 13px; line-height: 1.6; color: var(--accent); border-radius: 3px; }
.text-button .icon { width: 16px; height: 16px; }
.text-button:hover:not(:disabled) { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }
.mic-check { margin-top: 8px; }
.mic-check > span, .import-button > span { display: none; }
/* SVG masks also replace glyphs recreated by the unchanged application. */
.mic-check::before, .import-button::before, .history-symbol::before, .history-delete::before { content: ''; display: inline-block; width: 17px; height: 17px; flex-shrink: 0; background: currentColor; mask: var(--icon-mask) center / contain no-repeat; -webkit-mask: var(--icon-mask) center / contain no-repeat; }
.mic-check { --icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='3' width='6' height='12' rx='3'/%3E%3Cpath d='M5 11v1a7 7 0 0 0 14 0v-1M12 19v3m-3 0h6'/%3E%3C/svg%3E"); }
.import-button { --icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V3m-5 5 5-5 5 5M4 16v5h16v-5'/%3E%3C/svg%3E"); }
.setup-note { display: flex; align-items: flex-start; gap: 10px; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 20px; color: var(--muted); }
.setup-note .icon { width: 17px; height: 17px; margin-top: 3px; }
.setup-note p { font-size: 12px; line-height: 1.8; }
.record-stage { padding: 22px 28px 17px; display: flex; flex-direction: column; min-width: 0; }
.stage-top, .stage-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 12px; color: var(--muted); }
.status-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: #55606d; }
.status-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #8993a1; }
.status-pill.recording { color: #b5423b; }
.status-pill.recording::before { background: #ca524b; animation: pulse 1.5s ease-in-out infinite; }
.status-pill.paused { color: #896721; }
.status-pill.paused::before { background: #ae873e; }
.status-pill.saving { color: var(--accent); }
.status-pill.saving::before { background: var(--accent); }
.quiet-label { color: #8a929d; }
.record-center { text-align: center; margin: auto 0; padding: 26px 0 22px; }
.record-time-label { font-size: 12px; color: var(--muted); }
.timer { margin-top: 7px; color: #262d38; font-size: 64px; font-weight: 500; font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; letter-spacing: -2px; line-height: 1.3; }
.timer span { font-size: 28px; color: #99a1ad; letter-spacing: -1px; margin-left: 4px; }
#waveform { display: block; width: 100%; max-width: 590px; height: 58px; margin: 5px auto 6px; filter: grayscale(1); }
.microcopy { color: var(--muted); font-size: 12px; line-height: 1.8; }
.record-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 22px 0 12px; }
.record-live-message { display: none; }
.record-stage:has(#record-state.recording) #mic-message,
.record-stage:has(#record-state.paused) #mic-message { display: none; }
.record-stage:has(#record-state.recording) .record-live-recording,
.record-stage:has(#record-state.paused) .record-live-paused { display: block; }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 9px 17px; border: 1px solid transparent; border-radius: 6px; font-size: 13px; font-weight: 500; line-height: 1.5; transition: background-color .15s, border-color .15s; }
.primary { background: var(--accent); color: white; }
.primary:hover:not(:disabled) { background: var(--accent-dark); }
.secondary { color: #434e5d; background: white; border-color: #d8dde4; }
.secondary:hover:not(:disabled) { background: #f6f7f9; border-color: #bfc7d2; }
.primary.large { min-width: 168px; min-height: 44px; font-size: 14px; }
.primary .icon, .secondary .icon { width: 17px; height: 17px; }
.bottom-note { font-size: 11px; color: #808996; }
.stop-square { width: 10px; height: 10px; background: currentColor; border-radius: 1px; }
.stage-bottom { padding-top: 14px; border-top: 1px solid #eef0f3; font-size: 11px; }
.stage-bottom > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.stage-bottom .icon { width: 14px; height: 14px; }
.stage-bottom > span:last-child { white-space: nowrap; }
.below-record { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 16px 0 34px; }
.gentle-tip { font-size: 12px; color: var(--muted); }
.import-button { white-space: nowrap; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.section-heading h2 { font-size: 15px; font-weight: 600; }
.section-heading h2 span { display: inline-block; margin-left: 5px; font-size: 12px; font-weight: 400; color: #87909c; }
.history-list { border-top: 1px solid #dce1e7; border-bottom: 1px solid var(--line); }
.empty-history { display: flex; align-items: center; justify-content: flex-start; gap: 14px; padding: 24px 18px; color: var(--muted); }
.empty-icon { width: 25px; height: 25px; color: #939da9; }
.empty-history p { font-size: 13px; color: #657080; }
.empty-history small { display: block; margin-top: 2px; color: #838c98; font-size: 12px; }
.history-row { display: flex; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); padding: 16px 12px; }
.history-row:last-child { border-bottom: 0; }
.history-row:hover { background: #eef1f5; }
.history-open { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; padding: 0; background: transparent; text-align: left; color: var(--text); }
.history-symbol { flex-shrink: 0; display: grid; place-items: center; width: 32px; height: 36px; color: #697688; font-size: 0; --icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H5v18h14V8zM14 3v5h5M8 12h8m-8 4h6'/%3E%3C/svg%3E"); }
.history-symbol::before { width: 23px; height: 23px; }
.history-title { display: block; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-meta { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
.history-state { flex-shrink: 0; font-size: 12px; color: #697484; }
.history-delete { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: 5px; color: #858f9c; background: transparent; font-size: 0; --icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M9 6V3h6v3M5 6l1 15h12l1-15M10 10v7m4-7v7'/%3E%3C/svg%3E"); }
.history-delete:hover { color: #ac403b; background: #faeeec; }
.site-footer { max-width: 1240px; margin: 0 auto; padding: 20px 0 28px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 20px; color: #838c98; font-size: 11px; }
.site-footer .text-button { color: var(--muted); font-size: 11px; }
.editor-topbar { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin: -5px 0 17px; }
.editor-topbar .text-button { color: var(--muted); }
.editor-layout { display: grid; grid-template-columns: 276px minmax(0, 1fr); align-items: start; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.playback-panel { align-self: stretch; padding: 25px 22px; border-right: 1px solid var(--line); min-width: 0; }
.playback-panel h2 { font-size: 16px; font-weight: 600; line-height: 1.6; overflow-wrap: anywhere; margin: 13px 0 5px; }
.playback-panel .muted { font-size: 12px; }
.playback-panel audio { display: block; width: 100%; height: 40px; margin: 21px 0 17px; }
.playback-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; color: var(--muted); font-size: 12px; }
.playback-options select { width: 82px; min-height: 32px; padding: 5px 8px; font-size: 12px; }
.full { width: 100%; }
.panel-divider { height: 1px; background: var(--line); margin: 25px 0; }
.transcribe-description { margin: 12px 0 16px; }
.model-note { margin-top: 10px; font-size: 11px; }
.transcript-panel { min-width: 0; }
.transcript-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 28px 18px; }
.transcript-heading h2 { font-size: 16px; font-weight: 600; }
.count-badge { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.editor-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 24px; background: #fafbfc; border-block: 1px solid var(--line); }
.editor-toolbar > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.editor-toolbar .text-button { font-size: 12px; white-space: nowrap; }
#toggle-asr { padding-left: 18px; border-left: 1px solid #dce1e7; }
.transcript-hint { display: flex; align-items: center; gap: 8px; padding: 15px 28px 10px; color: #7a8492; font-size: 12px; }
.transcript-hint .icon { width: 15px; height: 15px; }
#transcript-content { min-height: 350px; padding: 4px 28px 24px; }
.transcript-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 340px; }
.transcript-empty > .icon { width: 34px; height: 34px; color: #a3acb8; stroke-width: 1.25; }
.transcript-empty h3 { margin: 16px 0 7px; font-size: 14px; font-weight: 500; color: #677281; }
.transcript-empty p { font-size: 12px; color: #89929e; line-height: 1.9; }
.transcript-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 16px; padding: 15px 28px; border-top: 1px solid var(--line); color: #818b98; font-size: 11px; }
.segment { display: grid; grid-template-columns: 54px minmax(0, 1fr); align-items: start; gap: 14px; padding: 17px 0; border-bottom: 1px solid #edf0f3; }
.segment:last-child { border-bottom: 0; }
.segment-time { padding: 5px 3px; background: #f1f4f8; color: #64758f; border: 1px solid transparent; border-radius: 4px; font-size: 12px; font-variant-numeric: tabular-nums; }
.segment-time:hover { border-color: #a7b9dc; color: var(--accent); }
.segment-body { min-width: 0; }
.segment textarea { display: block; width: 100%; min-height: 65px; padding: 1px 6px; resize: vertical; border: 1px solid transparent; border-radius: 4px; background: transparent; color: #313a47; font-size: 15px; line-height: 1.9; }
.segment textarea:hover:not(:disabled) { border-color: #dce2eb; }
.segment textarea:focus { border-color: #98afe0; background: #fcfdff; }
.segment textarea[readonly] { background: #f8f9fb; color: #5f6a79; }
/* Reflow long text when the viewport changes; older browsers retain JS sizing. */
@supports (field-sizing: content) {
  .segment textarea { field-sizing: content; height: auto !important; }
}
.transcript-panel:has(textarea[readonly]) .transcript-hint { visibility: hidden; }
.transcript-panel:has(textarea[readonly]) #toggle-asr { font-weight: 600; }
.segment.playing { background: #f2f6fd; box-shadow: -3px 0 var(--accent); }
.segment-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 16px; margin-top: 5px; }
.segment-tools .text-button { color: #72819a; font-size: 11px; }
.progress-box { padding: 14px 0 0; margin-top: 18px; border-top: 1px solid var(--line); }
.progress-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #425774; font-size: 12px; }
.progress-heading .text-button { font-size: 12px; flex-shrink: 0; }
progress { display: block; width: 100%; height: 6px; margin: 12px 0 9px; accent-color: var(--accent); }
.progress-box .microcopy { font-size: 11px; overflow-wrap: anywhere; }
.notice { padding: 14px 16px; margin: 12px 0; border: 1px solid var(--line); border-radius: 6px; background: #f5f7fa; color: #596575; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.notice p { margin: 8px 0 0; }
.error { background: #fcf1f0; border-color: #f0d5d1; color: #a13f36; }
dialog { width: min(520px, calc(100% - 32px)); max-height: calc(100dvh - 40px); padding: 28px; border: 1px solid #d7dce4; border-radius: 10px; color: var(--text); background: white; box-shadow: 0 16px 56px #18233726; }
dialog::backdrop { background: #141d2b66; }
.dialog-close { float: right; margin: -6px -6px 0 12px; }
dialog h2 { font-size: 20px; font-weight: 600; margin-bottom: 5px; }
dialog ol { padding-left: 22px; margin: 22px 0; font-size: 13px; color: var(--muted); }
dialog li { padding-left: 4px; margin: 15px 0; }
dialog li strong { display: block; color: #3f4a5b; font-weight: 600; margin-bottom: 3px; }
dialog .notice { margin-bottom: 22px; }
.toast { position: fixed; z-index: 10; left: 50%; bottom: 28px; transform: translateX(-50%); width: max-content; padding: 11px 20px; border-radius: 6px; background: #273343; color: white; box-shadow: 0 6px 22px #1823371f; font-size: 13px; max-width: calc(100% - 32px); text-align: center; }
@keyframes pulse { 50% { opacity: .4; } }
@media (max-width: 1320px) { main, .site-footer { margin-inline: 32px; } }
@media (max-width: 1000px) {
  .record-workspace { grid-template-columns: 260px minmax(0, 1fr); }
  .setup-panel { padding-inline: 20px; }
  .record-stage { padding-inline: 22px; }
  .stage-bottom { flex-wrap: wrap; gap: 6px; }
  .editor-layout { grid-template-columns: 248px minmax(0, 1fr); }
  .playback-panel { padding-inline: 18px; }
  .editor-toolbar { flex-wrap: wrap; }
  .transcript-heading, .transcript-hint, .transcript-footer { padding-inline: 20px; }
  #transcript-content { padding-inline: 20px; }
  .workspace-label { display: none; }
}
@media (max-width: 760px) {
  .site-header { height: 62px; padding-inline: 20px; }
  .brand-sub { display: none; }
  .header-right { gap: 10px; }
  .local-label { font-size: 11px; }
  .local-label .icon { display: none; }
  main, .site-footer { margin-inline: 20px; }
  main { padding-bottom: 32px; }
  .steps { height: 52px; gap: 25px; }
  .step { font-size: 13px; }
  .page-heading { margin: 24px 0 19px; }
  h1 { font-size: 22px; }
  .page-heading .muted { font-size: 12px; }
  .record-workspace { display: flex; flex-direction: column; }
  .record-stage { order: -1; padding: 18px 20px 15px; border-bottom: 1px solid var(--line); }
  .record-center { padding: 22px 0 19px; }
  .timer { font-size: 58px; }
  .timer span { font-size: 25px; }
  #waveform { height: 50px; }
  .record-actions { margin-top: 19px; }
  .setup-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 14px; padding: 21px 20px; border-right: 0; }
  .setup-panel > .section-label, .setup-panel > .field-label, .setup-panel > input, .setup-panel > select, .direction-group { grid-column: 1 / -1; }
  .field-label { margin-top: 17px; }
  .mic-check { justify-self: start; grid-column: 1 / -1; }
  .setup-note { grid-column: 1 / -1; width: 100%; margin-top: 14px; padding-top: 14px; }
  .setup-note br { display: none; }
  .below-record { flex-wrap: wrap; margin-bottom: 28px; gap: 12px; }
  .import-button { width: 100%; }
  .history-row { gap: 10px; padding-inline: 2px; }
  .history-open { gap: 9px; }
  .history-state { font-size: 11px; }
  .history-meta { font-size: 10px; }
  .history-symbol { width: 24px; }
  .history-title { font-size: 13px; }
  .empty-history { padding-inline: 5px; }
  .section-heading .microcopy { font-size: 11px; }
  .editor-layout { grid-template-columns: 1fr; }
  .playback-panel { border-right: 0; border-bottom: 1px solid var(--line); padding: 22px 20px; }
  .playback-panel audio { max-width: 100%; }
  .transcript-heading { padding-top: 21px; }
  .editor-toolbar { padding-inline: 20px; gap: 8px; }
  .editor-toolbar > div { gap: 5px 14px; }
  #toggle-asr { padding-left: 14px; }
  .segment { grid-template-columns: 46px minmax(0, 1fr); gap: 7px; }
  .segment textarea { font-size: 14px; }
  .segment-tools { gap: 14px; }
  .transcript-empty { min-height: 260px; }
  #transcript-content { min-height: 280px; padding-inline: 15px; }
  .transcript-footer { flex-direction: column; }
  .site-footer { flex-wrap: wrap; gap: 8px 15px; padding-top: 17px; }
  .site-footer > span:nth-child(2) { display: none; }
  dialog { padding: 24px; }
}
@media (max-width: 370px) {
  main, .site-footer { margin-inline: 14px; }
  .site-header { padding-inline: 14px; }
  .stage-bottom > span:last-child { display: none; }
  .editor-toolbar > div { gap: 5px 10px; }
  #toggle-asr { padding-left: 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ===== 参考笔记（口译笔记法）===== */
#notes-dialog { width: min(880px, calc(100% - 32px)); padding: 0; overflow: hidden; }
.notes-shell { display: flex; flex-direction: column; max-height: calc(100dvh - 42px); }
.notes-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 23px 28px 17px; }
.notes-header h2 { font-size: 18px; margin: 0 0 4px; }
.notes-header .muted { font-size: 12px; overflow-wrap: anywhere; }
.notes-header .dialog-close { float: none; flex-shrink: 0; margin: -4px -8px 0 0; }
.notes-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 28px; border-block: 1px solid var(--line); font-size: 12px; color: var(--muted); background: #fafbfc; }
.notes-toolbar label { display: flex; align-items: center; gap: 7px; cursor: pointer; white-space: nowrap; }
.notes-toolbar input[type=checkbox] { appearance: auto; display: inline-block; width: 14px; height: 14px; min-height: 0; margin: 0; padding: 0; accent-color: var(--accent); }
.notes-toolbar label:has(input:disabled) { opacity: .5; cursor: default; }
.notes-scroll { overflow-y: auto; overscroll-behavior: contain; min-height: 100px; padding: 24px 28px; background: #f3f4f6; }
.notes-paper { position: relative; min-height: 340px; padding: 28px 26px 32px 0; border: 1px solid #e2e4e8; background: #fffefb; color: #222831; }
.notes-paper::before { content: ''; position: absolute; top: 24px; bottom: 24px; left: 65px; border-left: 1px solid #dce2eb; }
.note-block { display: grid; position: relative; grid-template-columns: 65px minmax(0, 1fr); padding-block: 0 24px; }
.note-block + .note-block { padding-top: 12px; }
.note-block:last-child { padding-bottom: 0; }
.note-cue { text-align: center; font-family: 'LXGW WenKai', 'Kaiti SC', KaiTi, cursive; font-size: 21px; line-height: 42px; color: #535d6a; }
.note-body { min-width: 0; padding-left: 22px; }
.note-line { padding-left: calc(var(--indent) * 15%); font-family: 'LXGW WenKai', 'Kaiti SC', KaiTi, cursive; font-size: 24px; line-height: 1.8; overflow-wrap: anywhere; }
.note-ink { white-space: pre-wrap; }
.note-emphasis { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 7px; }
.note-glyph { display: inline-block; width: 1.5em; height: 1.5em; vertical-align: -.38em; fill: none; stroke: currentColor; stroke-width: 2.35; stroke-linecap: round; stroke-linejoin: round; }
.note-source { grid-column: 2; margin: 14px 0 0 22px; padding: 12px 14px; border-left: 2px solid #b7c7e8; background: #f5f7fb; font: 12px/1.9 system-ui, sans-serif; color: #576171; overflow-wrap: anywhere; }
.note-source > span { display: block; color: var(--accent); font-size: 11px; margin-bottom: 4px; }
.notes-empty { padding: 70px 30px 70px 90px; color: var(--muted); font-size: 13px; }
.notes-status { margin: 0; padding: 11px 28px; color: var(--accent); background: #f0f4fc; font-size: 12px; line-height: 1.8; }
.notes-status.error { color: #a13f36; background: #fcf1f0; }
.notes-warning { margin: 0 0 16px; font-size: 12px; color: #7a6135; line-height: 1.8; }
.notes-pagination { display: flex; align-items: center; justify-content: center; gap: 22px; padding-top: 17px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.notes-pagination button { min-height: 32px; min-width: 56px; }
.notes-symbols { margin-top: 17px; color: var(--muted); font-size: 12px; }
.notes-symbols summary { cursor: pointer; width: fit-content; }
.notes-legend { display: flex; flex-wrap: wrap; gap: 12px 24px; padding-top: 15px; }
.notes-legend > span { display: inline-flex; align-items: center; gap: 9px; }
.notes-legend .note-glyph { color: #313946; width: 30px; height: 26px; }
.notes-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 28px 8px; border-top: 1px solid var(--line); }
.notes-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.notes-actions .text-button { font-size: 12px; }
.notes-caveat { margin: 0; padding: 0 28px 18px; font-size: 11px; }
@media (max-width: 600px) {
  #notes-dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
  .notes-shell { max-height: calc(100dvh - 18px); }
  .notes-header { padding: 18px 16px 14px; }
  .notes-toolbar { padding: 10px 16px; flex-wrap: wrap; }
  .notes-scroll { padding: 14px 10px; }
  .notes-paper { padding: 20px 14px 24px 0; }
  .notes-paper::before { left: 40px; }
  .note-block { grid-template-columns: 40px minmax(0, 1fr); }
  .note-body { padding-left: 13px; }
  .note-line { font-size: 21px; padding-left: calc(var(--indent) * 12%); }
  .note-cue { font-size: 18px; line-height: 38px; }
  .note-source { margin-left: 13px; padding: 10px; }
  .notes-actions { padding: 12px 16px 8px; flex-wrap: wrap; }
  .notes-caveat { padding: 0 16px 14px; }
  .notes-status { padding: 10px 16px; }
}

/* Symbol-led notes: marginal logic, vertical lists, short handwritten dividers. */
.notes-options { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.notes-options .text-button { font-size: 12px; text-decoration: none; }
.note-cue .note-glyph { height: 1.45em; max-width: 35px; }
.note-line { position: relative; }
.note-parallel::before { content: ''; position: absolute; left: calc(var(--indent) * 15% - 11px); top: 0; height: 100%; border-left: 1px solid #5b616b; transform: rotate(.5deg); }
.note-separator { grid-column: 2; width: 48%; height: 12px; margin: 15px 0 0 22px; fill: none; stroke: #5b616b; stroke-width: 1; }
.note-reading { grid-column: 2; margin: 10px 0 0 22px; padding: 9px 12px; border-left: 2px solid #c8ced6; font: 12px/1.8 system-ui,sans-serif; color: #66717d; background: #f6f7f9; overflow-wrap: anywhere; }
.note-source { margin-top: 8px; }
@media(max-width:600px){.notes-toolbar{align-items:flex-start}.notes-options{gap:8px 14px}.note-parallel::before{left:calc(var(--indent) * 12% - 8px)}.note-reading,.note-separator{margin-left:13px}.note-separator{width:60%}}
