:root {
  color-scheme: light;
  --background: #f5f6f0;
  --surface: #fffefa;
  --ink: #173027;
  --muted: #58675d;
  --line: #dfe5db;
  --green: #194b39;
  --lime: #d2ef9b;
  --cream: #f3f2ea;
  --ui-font: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--ink); font-family: var(--ui-font); }
button, select { color: inherit; font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .46; }
a { color: inherit; }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 3px solid #77993f; outline-offset: 3px; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.icon { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
[hidden] { display: none !important; }

.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner { width: min(1336px, 100%); padding: 0 42px; min-height: 70px; display: flex; align-items: center; justify-content: space-between; margin: auto; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-size: 23px; font-weight: 790; letter-spacing: -.035em; white-space: nowrap; }
.brand-en { margin-left: 4px; font-size: 14px; font-weight: 640; color: #58685d; letter-spacing: -.015em; }
.tuning { display: inline-flex; align-items: center; gap: 8px; color: var(--green); background: #eff4e9; padding: 7px 12px; border-radius: 99px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.tuning-dot { width: 6px; height: 6px; border-radius: 50%; background: #5c8c40; }
.tuning-notes { border-left: 1px solid #d5dfd0; padding-left: 8px; font: 650 11px ui-monospace, monospace; word-spacing: 1px; }

.layout { width: min(1336px, 100%); padding: 42px 42px 32px; margin: auto; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; }
.sidebar h2 { font-size: 15px; margin: 9px 0 17px; }
#lesson-list { display: grid; gap: 8px; }
.lesson-link { width: 100%; min-height: 64px; display: grid; grid-template-columns: 34px minmax(0, 1fr) 16px; gap: 9px; align-items: center; padding: 10px; border: 1px solid transparent; background: transparent; border-radius: 11px; text-align: left; }
.lesson-link:hover { background: #edf0e7; }
.lesson-link[aria-current] { background: #e8f0de; border-color: #d8e4cb; }
.lesson-icon { display: grid; place-items: center; width: 34px; height: 34px; background: #eaf0e7; border: 1px solid #dfe7da; color: #426354; border-radius: 8px; }
.lesson-link[aria-current] .lesson-icon { border-color: #1f503d; background: #1f503d; color: #e6f3d4; }
.lesson-icon .icon { width: 17px; height: 17px; }
.lesson-arrow { color: #607667; width: 15px; height: 15px; }
.lesson-name { display: block; font-size: 13px; font-weight: 740; line-height: 1.4; }
.lesson-meta { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.sidebar-help { padding: 17px 2px 0; margin-top: 27px; border-top: 1px solid var(--line); }
.sidebar-help h3 { margin: 0 0 12px; font-size: 12px; font-weight: 690; }
.sidebar-help dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 8px; margin: 0; }
.sidebar-help dl div { display: flex; align-items: center; gap: 7px; }
.sidebar-help dt { display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; border: 1px solid #d7e1d1; background: #edf2e8; font: 700 10px ui-monospace, monospace; }
.sidebar-help dd { margin: 0; color: var(--muted); font-size: 11px; }

.lesson-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin: 0 0 22px; }
.lesson-heading h1 { font-size: clamp(29px, 3.3vw, 43px); line-height: 1.12; letter-spacing: -.055em; margin: 0 0 10px; font-weight: 800; overflow-wrap: anywhere; }
.lesson-heading p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
.mode-control { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 3px; padding: 4px; background: #eaeee5; border: 1px solid #e0e6da; border-radius: 10px; }
.mode-control button { min-height: 32px; min-width: 55px; border: 0; border-radius: 6px; background: transparent; color: #526257; font-size: 12px; font-weight: 680; }
.mode-control button[aria-pressed="true"] { background: var(--surface); color: var(--green); box-shadow: 0 1px 3px #253e2524; }
.mode-control button:hover { color: var(--green); }

.part-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin: -8px 0 12px; }
.part-toolbar .mode-control button { padding-inline: 8px; }
.original-link { color: var(--green); font-size: 12px; font-weight: 650; text-underline-offset: 3px; }
.original-link:focus-visible { outline-offset: 4px; }
.part-tools { display: flex; align-items: center; gap: 8px; }
.current-harmony { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.current-harmony strong, .measure-chord { min-width: 27px; text-align: center; border-radius: 4px; padding: 2px 4px; background: #e5efe0; color: #2f5d45; font-weight: 750; }
#part-toolbar .toggle span { display: inline; }

.practice-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 12px 36px #273c270b; overflow: hidden; }
.practice-header { min-height: 79px; padding: 14px 23px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cue { display: flex; align-items: center; gap: 11px; min-width: 0; }
.cue-icon { width: 40px; height: 40px; border-radius: 10px; background: #eaf1e3; color: var(--green); display: grid; place-items: center; flex-shrink: 0; }
.cue-label { color: var(--muted); font-size: 11px; line-height: 1.35; margin-bottom: 3px; }
.cue-text { font-size: 17px; font-weight: 770; line-height: 1.3; }
.position { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; gap: 8px; color: var(--muted); font-size: 11px; }
.beat-dots { display: flex; gap: 5px; }
.beat-dots span { display: block; width: 7px; height: 7px; border: 1px solid #cdd8c8; background: #ecf1e8; border-radius: 50%; }
.beat-dots span.current { background: #2c624a; border-color: #2c624a; }
.beat-dots span.strong.current { box-shadow: 0 0 0 2px #e3edda; }

.instrument { display: grid; grid-template-columns: minmax(0, 2.22fr) minmax(0, 1fr); background: #17372e; color: #faf8ec; padding: 19px 22px 17px; border-block: 1px solid #27483c; }
.neck-panel { min-width: 0; padding-right: 15px; }
.pick-panel { min-width: 0; padding-left: 17px; border-left: 1px solid #406054; }
.panel-label { display: flex; gap: 8px; align-items: center; min-height: 25px; }
.panel-label h2 { font-size: 13px; margin: 0; font-weight: 680; }
.hand { display: inline-block; padding: 3px 6px; border-radius: 4px; font-size: 10px; font-weight: 740; white-space: nowrap; }
.left-hand { color: #e0f3c7; background: #315244; }
.right-hand { color: #f7dfb2; background: #544d36; }
.neck, .pick { width: 100%; display: block; height: clamp(153px, 17.2vw, 224px); overflow: visible; }
.neck text, .pick text { font-family: var(--ui-font); user-select: none; }
.legend { display: flex; flex-wrap: wrap; gap: 7px 14px; color: #d8e2d8; font-size: 10px; min-height: 22px; align-items: center; }
.legend span { white-space: nowrap; display: flex; align-items: center; gap: 5px; }
.legend i { display: inline-grid; place-items: center; font-size: 8px; font-style: normal; width: 10px; height: 10px; border-radius: 50%; }
.legend-solid { background: var(--lime); }
.legend-next { border: 1px dashed var(--lime); }
.legend-open { color: #e5f5d5; border: 1px solid #a6bb9c; }
.pick-caption { color: #f2dfb6; font-size: 11px; font-weight: 650; min-height: 22px; display: flex; align-items: center; justify-content: center; }
.fret-preview { fill: #233c29; stroke: #d6efa5; stroke-width: 1.5; stroke-dasharray: 3.2 2; }
.fret-current { fill: #daf3a4; stroke: #fafbdc; stroke-width: 1; }
.fret-open { fill: #1d392a; stroke: #d6efa5; stroke-width: 1.7; }
.fret-preview-text, .fret-open-text { fill: #eefbd3; }
.fret-current-text { fill: #203b23; }
.pick-glow { filter: drop-shadow(0 0 4px #ffdb82a0); }

.timeline-section { padding: 16px 23px 15px; }
.section-selector { display: inline-flex; gap: 7px; align-items: center; margin-bottom: 10px; color: var(--muted); font-size: 11px; font-weight: 650; }
.section-selector select { min-height: 34px; border: 1px solid #dfe5db; border-radius: 7px; padding: 0 7px; background: #f5f7f0; color: var(--ink); font-size: 12px; cursor: pointer; }

.timeline { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.timeline--score { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: clamp(176px, 27%, 245px); overflow-x: auto; overscroll-behavior-inline: contain; padding-bottom: 6px; scrollbar-width: thin; scrollbar-color: #b9c8b4 #f0f3eb; }
#timeline.timeline--score .measure { min-width: 0; }
#timeline.timeline--score .beat-content { font-size: clamp(9px, 1.1vw, 12px); }
.timeline--pickup { grid-template-columns: clamp(58px, 9.5%, 84px); }
.measure-label { display: flex; justify-content: space-between; align-items: baseline; min-height: 18px; margin-bottom: 6px; font-size: 10px; line-height: 12px; font-weight: 650; color: var(--muted); }
.measure-grid { display: grid; grid-template-columns: repeat(var(--measure-steps, 4), minmax(0, 1fr)); gap: 5px; }
.timeline--dense { grid-auto-columns: clamp(255px, 33%, 318px); }
.measure--busy .measure-grid { column-gap: 2px; }
.beat-tile { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 43px; padding: 4px 1px; gap: 3px; white-space: nowrap; border: 1px solid #e5e8df; border-radius: 7px; background: #f8f9f5; }
.beat-tile:hover { background: #edf3e7; }
.beat-tile[aria-current] { border-color: #9bb58d; background: #e9f2df; }
.beat-tile[aria-current]::after { content: ""; position: absolute; inset: auto 28% 0; height: 2px; border-radius: 2px 2px 0 0; background: #588445; }
.beat-index { color: var(--muted); font: 600 10px ui-monospace, monospace; }
.beat-content { color: #304d3e; font: 700 12px var(--ui-font); line-height: 1; }

.transport { display: flex; align-items: center; justify-content: space-between; gap: 11px; flex-wrap: wrap; border-top: 1px solid #e7ebe3; padding: 14px 23px; }
.transport-main, .transport-settings { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.icon-button, .toggle, .tempo-control { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; gap: 6px; background: #f6f7f1; border: 1px solid #e1e7dd; border-radius: 8px; }
.icon-button { width: 38px; color: #3e5e50; padding: 0; }
.icon-button:hover:not(:disabled), .toggle:hover, .tempo-control:hover { background: #edf2e8; }
.play-button { background: var(--green); color: white; display: inline-flex; min-height: 40px; min-width: 119px; justify-content: center; align-items: center; gap: 5px; border: 1px solid var(--green); border-radius: 8px; padding: 0 13px; font-size: 13px; font-weight: 710; white-space: nowrap; }
.play-button:hover { background: #246349; }
.toggle { padding: 0 8px; min-width: 38px; color: #54635a; font-size: 11px; white-space: nowrap; font-weight: 650; }
.toggle .icon { width: 15px; height: 15px; }
.toggle[aria-pressed="true"] { background: #edf3e7; border-color: #d8e5d3; color: #2f5d45; }
.tempo-control { padding: 0 5px 0 8px; font-size: 11px; color: var(--muted); font-weight: 650; }
.tempo-control select { border: 0; background: transparent; min-height: 34px; padding: 0 3px; color: var(--ink); font: 740 12px ui-monospace, monospace; cursor: pointer; }
.practice-footer { display: flex; justify-content: space-between; gap: 12px; padding: 13px 2px 0; font-size: 11px; color: var(--muted); line-height: 1.5; }
.key-hint { white-space: nowrap; }
kbd { font: inherit; background: #f0f2e9; border: 1px solid #dce2d6; border-radius: 4px; padding: 1px 4px; margin-right: 3px; }
.audio-notice { font-size: 12px; padding: 0 23px 13px; color: #795017; }

@media (max-width: 1100px) {
  .top-inner { padding-inline: 30px; }
  .layout { padding: 32px 30px; gap: 23px; grid-template-columns: 192px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .top-inner { padding-inline: 22px; }
  .layout { grid-template-columns: minmax(0, 1fr); padding: 25px 22px; gap: 21px; }
  #lesson-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .sidebar h2 { margin: 0 0 8px; font-size: 12px; }
  .sidebar-help { display: none; }
  .lesson-link { min-height: 51px; padding: 6px; gap: 7px; grid-template-columns: 28px minmax(0, 1fr) 13px; }
  .lesson-icon { width: 28px; height: 28px; border-radius: 6px; }
  .lesson-heading { margin-bottom: 15px; }
  .part-toolbar { margin-top: 0; }
}
@media (max-width: 620px) {
  .top-inner { padding-inline: 13px; min-height: 55px; }
  .brand { font-size: 19px; gap: 7px; }
  .brand img { width: 31px; height: 31px; }
  .brand-en { font-size: 12px; margin-left: 1px; }
  .tuning { font-size: 10px; padding: 6px 8px; gap: 5px; }
  .tuning-notes { font-size: 9px; padding-left: 5px; word-spacing: 0; }
  .layout { padding: 16px 12px 23px; gap: 15px; }
  .lesson-link { grid-template-columns: minmax(0, 1fr); padding: 4px 6px; text-align: center; }
  .lesson-icon, .lesson-arrow { display: none; }
  .lesson-name { font-size: 11px; }
  .lesson-meta { font-size: 10px; }
  .lesson-heading { flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
  .lesson-heading h1 { margin-bottom: 4px; }
  .lesson-heading p { font-size: 12px; }
  .mode-control { padding: 2px; }
  .mode-control button { min-width: 48px; min-height: 30px; }
  .part-toolbar { margin-bottom: 8px; }
  .practice-card { border-radius: 13px; }
  .practice-header { min-height: 60px; padding: 8px 11px; }
  .cue-icon { width: 32px; height: 32px; }
  .cue { gap: 7px; }
  .cue-text { font-size: 14px; }
  .position { font-size: 10px; gap: 5px; }
  .instrument { padding: 9px 9px 7px; grid-template-columns: minmax(0, 1.95fr) minmax(0, 1fr); }
  .neck-panel { padding-right: 6px; }
  .pick-panel { padding-left: 6px; }
  .panel-label { gap: 4px; }
  .panel-label h2 { font-size: 11px; }
  .hand { font-size: 9px; padding: 2px 4px; }
  .neck { height: clamp(89px, 25vw, 142px); }
  .pick { height: clamp(89px, 25vw, 142px); }
  .legend { gap: 4px 6px; font-size: 9px; min-height: 22px; }
  .legend span { gap: 3px; }
  .legend i { width: 8px; height: 8px; font-size: 7px; }
  .pick-caption { font-size: 9px; min-height: 22px; text-align: center; }
  .timeline-section { padding: 9px 11px; }
  .timeline { gap: 8px; }
  .measure-grid { gap: 3px; }
  .beat-tile { min-height: 41px; }
  .beat-content { font-size: 10px; }
  .transport { padding: 9px 11px; gap: 7px; }
  .transport-main, .transport-settings { gap: 5px; }
  .toggle { padding-inline: 5px; min-width: 31px; font-size: 10px; }
  .tempo-control { padding-inline: 5px 3px; }
  .audio-notice { padding: 0 11px 8px; }
  .practice-footer { padding-top: 8px; }
  .key-hint { display: none; }
}
@media (max-width: 365px) {
  .toggle span { display: none; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .top-inner { min-height: 44px; }
  .brand img { width: 29px; height: 29px; }
  .layout { grid-template-columns: 142px minmax(0, 1fr); padding: 12px 14px; gap: 12px; }
  #lesson-list { display: grid; grid-template-columns: 1fr; }
  .sidebar-help { display: none; }
  .lesson-heading { margin-bottom: 9px; }
  .lesson-heading h1 { margin-bottom: 3px; font-size: 27px; }
  .lesson-heading p { font-size: 11px; }
  .practice-header { min-height: 49px; padding: 5px 10px; }
  .cue-icon { width: 31px; height: 31px; }
  .instrument { padding: 6px 10px; }
  .neck, .pick { height: clamp(82px, 26vh, 126px); }
  .timeline-section { padding: 5px 10px; }
  .beat-tile { min-height: 34px; }
  .transport { padding: 6px 10px; }
  .practice-footer { padding-top: 5px; }
  .key-hint { display: none; }
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.loop-scope { display: inline-flex; align-items: center; min-height: 38px; background: #f6f7f1; border: 1px solid #e1e7dd; border-radius: 8px; padding: 0 4px; }
.loop-scope select { font-size: 11px; min-height: 34px; border: 0; background: transparent; cursor: pointer; }

.audio-credit { display: inline-block; color: var(--muted); font-size: 10px; margin: 7px 2px 0; }

#playback-touch { font-family: inherit; }
