:root {
  --ink: #18221f;
  --muted: #6f7c77;
  --paper: #f4f2ec;
  --card: #fffefb;
  --line: #dedfd8;
  --green: #155e4b;
  --green-2: #237761;
  --green-soft: #e7f0eb;
  --gold: #ba8542;
  --gold-soft: #f5ecdf;
  --red: #b94c45;
  --blue: #376f86;
  --shadow: 0 18px 48px rgba(29, 47, 40, .07);
  --radius: 20px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 9% 2%, rgba(186,133,66,.10), transparent 24rem),
    radial-gradient(circle at 96% 20%, rgba(21,94,75,.08), transparent 28rem),
    var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, select, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
.boot, .denied {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.boot { color: var(--muted); text-align: center; }
.boot-mark, .brand-mark {
  display: grid;
  place-items: center;
  background: var(--green);
  color: #fff;
  font-family: Georgia, serif;
  letter-spacing: -.06em;
}
.boot-mark { width: 54px; height: 54px; margin: auto; border-radius: 16px; font-size: 22px; }
.boot p { font-size: 13px; margin-top: 16px; }
.denied-card {
  width: min(100%, 520px);
  padding: 42px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  text-align: center;
}
.denied-card h1 { margin: 12px 0; font-size: 27px; }
.denied-card p { color: var(--muted); line-height: 1.8; }
.denied-actions { display: flex; justify-content: center; gap: 10px; margin-top: 24px; }
.topbar {
  height: 68px;
  padding: 0 max(22px, calc((100vw - 1440px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255,254,251,.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(21,94,75,.10);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; font-size: 15px; }
.brand b { display: block; font-size: 14px; letter-spacing: .04em; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; letter-spacing: .15em; }
.top-actions { display: flex; align-items: center; gap: 19px; font-size: 12px; color: var(--muted); }
.top-actions a:hover { color: var(--green); }
.private-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-weight: 650; }
.private-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--green-2); box-shadow: 0 0 0 4px rgba(35,119,97,.10); }
.page { width: min(1440px, calc(100% - 44px)); margin: 0 auto; }
.hero {
  min-height: 210px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  padding: 40px 6px 30px;
}
.eyebrow { display: block; color: var(--gold); font-size: 10px; font-weight: 750; letter-spacing: .18em; }
.hero h1 { margin: 10px 0 0; font-family: "Songti SC", "STSong", Georgia, serif; font-size: clamp(42px, 5vw, 68px); font-weight: 600; letter-spacing: .06em; line-height: 1.08; }
.hero-sub { margin: 12px 0 0; color: var(--green); font-size: 12px; font-weight: 700; letter-spacing: .16em; }
.hero-desc { max-width: 620px; margin: 17px 0 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.hero-stats { display: flex; gap: 10px; }
.hero-stats div { width: 112px; padding: 22px 12px; background: rgba(255,254,251,.62); border: 1px solid rgba(21,94,75,.10); border-radius: 16px; text-align: center; }
.hero-stats b { display: block; font-family: Georgia, serif; color: var(--green); font-size: 31px; font-weight: 500; }
.hero-stats span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.method-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr)) 1.6fr;
  gap: 1px;
  overflow: hidden;
  margin-bottom: 18px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.method, .method-note { background: rgba(255,254,251,.90); }
.method { display: flex; align-items: center; gap: 12px; padding: 16px 18px; }
.method > span { color: var(--gold); font-family: Georgia, serif; font-size: 22px; }
.method b { display: block; font-size: 13px; }
.method small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.method.active { background: var(--green); color: #fff; }
.method.active > span, .method.active small { color: rgba(255,255,255,.72); }
.method-note { display: flex; align-items: center; padding: 16px 20px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.main-column { min-width: 0; display: grid; gap: 18px; }
.stage-card, .record-card, .guide-card, .side-card {
  background: var(--card);
  border: 1px solid rgba(21,94,75,.11);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.stage-card { padding: 24px 26px 22px; }
.stage-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.phrase-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 11px; }
.section-tag { padding: 5px 9px; background: var(--green-soft); border-radius: 6px; color: var(--green); font-weight: 700; }
.time-code { font-family: Menlo, Consolas, monospace; }
.text-button { padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.text-button:hover { border-color: var(--green); color: var(--green); }
.text-button[aria-pressed="true"] { background: var(--green-soft); border-color: transparent; color: var(--green); }
.audio-status { display: flex; align-items: center; gap: 7px; margin-top: 15px; padding: 9px 11px; background: #f6f5f0; border-radius: 9px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.status-dot { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--gold); }
.audio-status.ready { background: var(--green-soft); color: var(--green); }
.audio-status.ready .status-dot { background: var(--green-2); }
.lyric-stage {
  min-height: 172px;
  display: flex;
  align-content: center;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 5px;
  padding: 28px 4px 15px;
}
.word {
  position: relative;
  min-width: 43px;
  padding: 8px 5px 7px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.word:hover, .word.selected { background: #f2f1eb; }
.word.playing { background: var(--gold-soft); transform: translateY(-2px); }
.word .jp { display: block; min-height: 15px; color: var(--blue); font-family: Menlo, Consolas, monospace; font-size: 12px; line-height: 1.2; }
.word .char { display: block; margin-top: 5px; color: #52605a; font-family: "Songti SC", "STSong", serif; font-size: 30px; font-weight: 600; line-height: 1.2; }
.word.playing .char { color: var(--green); }
.word.entering .char { border-bottom: 2px solid var(--red); }
.word .enter-mark { position: absolute; top: 3px; right: 3px; color: var(--red); font-size: 8px; font-weight: 700; }
.breath-mark { align-self: center; color: var(--gold); font-family: Georgia, serif; font-size: 22px; padding: 0 1px; }
.meaning { min-height: 22px; color: var(--muted); font-size: 12px; line-height: 1.8; text-align: center; }
.meaning b { color: var(--ink); font-weight: 600; }
.line-note { margin: 13px 0 0; padding: 12px 14px; border-left: 3px solid var(--gold); background: var(--gold-soft); border-radius: 0 9px 9px 0; color: #745b38; font-size: 11.5px; line-height: 1.75; }
.word-inspector { display: flex; align-items: center; gap: 13px; min-height: 70px; margin: 15px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfaf6; }
.inspector-char { width: 43px; flex: 0 0 43px; color: var(--green); font-family: "Songti SC", serif; font-size: 34px; text-align: center; }
.inspector-main { min-width: 0; }
.inspector-main > div { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.inspector-main b { color: var(--blue); font-family: Menlo, Consolas, monospace; font-size: 16px; }
.tone-badge { color: var(--muted); font-size: 10px; }
.inspector-main p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.notation-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 17px; }
.notation-head > div:first-child { display: flex; align-items: baseline; flex-wrap: wrap; gap: 9px; }
.notation-head b { font-size: 12px; }
.notation-head span { color: var(--muted); font-size: 10px; }
.staff-box { min-height: 154px; max-height: 285px; overflow: auto; margin-top: 9px; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.staffrow { margin: 0 auto; }
.staves { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.nt.on ellipse, .nt.on text { fill: var(--gold) !important; }
.mode-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.segmented { display: inline-flex; padding: 3px; background: #efeee8; border-radius: 10px; }
.segmented button { padding: 8px 14px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.segmented button.active { background: var(--card); color: var(--green); font-weight: 700; box-shadow: 0 2px 8px rgba(29,47,40,.08); }
.segmented.small button { padding: 6px 9px; font-size: 10px; }
.mode-explain { color: var(--muted); font-size: 10px; text-align: right; }
.transport { display: flex; align-items: center; justify-content: center; gap: 11px; margin-top: 18px; }
.icon-button, .loop-button { border: 1px solid var(--line); background: transparent; cursor: pointer; }
.icon-button { width: 42px; height: 42px; border-radius: 50%; color: var(--green); font-size: 19px; }
.icon-button:hover, .loop-button:hover { border-color: var(--green); }
.play-button { min-width: 154px; height: 46px; display: flex; align-items: center; justify-content: center; gap: 9px; border: 0; border-radius: 999px; background: var(--green); color: #fff; cursor: pointer; box-shadow: 0 8px 20px rgba(21,94,75,.18); }
.play-button:hover { background: var(--green-2); }
.play-button b { font-size: 12px; }
.loop-button { height: 36px; padding: 0 12px; border-radius: 999px; color: var(--muted); font-size: 10px; }
.loop-button.active { background: var(--gold-soft); border-color: var(--gold); color: #8d642f; }
button:disabled { opacity: .42; cursor: not-allowed; }
.progress-track { height: 3px; margin-top: 18px; overflow: hidden; background: #e8e8e2; border-radius: 99px; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--gold); }
.progress-times { display: flex; justify-content: space-between; margin-top: 5px; color: var(--muted); font-family: Menlo, Consolas, monospace; font-size: 9px; }
.settings { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 14px; margin-top: 16px; color: var(--muted); font-size: 10px; }
.settings label { display: flex; align-items: center; gap: 6px; }
.settings select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); font-size: 10px; }
.check-label input { accent-color: var(--green); }
.record-card { padding: 22px 26px; }
.card-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.card-title h2, .side-title h2 { margin: 5px 0 0; font-family: "Songti SC", serif; font-size: 21px; font-weight: 600; }
.local-only { color: var(--muted); font-size: 10px; }
.record-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; align-items: center; margin-top: 19px; }
.record-action { display: flex; align-items: center; gap: 14px; }
.record-button { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 11px 14px; border: 1px solid rgba(185,76,69,.30); border-radius: 10px; background: #fff; color: var(--red); font-size: 11px; cursor: pointer; }
.record-button i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.record-button.recording { background: var(--red); color: #fff; }
.record-button.recording i { background: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.record-action p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.compare-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.compare-actions button { padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--green); font-size: 10px; cursor: pointer; }
.compare-actions button:hover { border-color: var(--green); }
.guide-card { padding: 0 24px; }
.guide-card summary { padding: 20px 0; color: var(--green); font-size: 12px; font-weight: 700; cursor: pointer; }
.tone-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.tone-cell { padding: 12px 6px; background: #f6f5f0; border-radius: 9px; text-align: center; }
.tone-cell b { display: block; color: var(--green); font-family: Georgia, serif; font-size: 20px; }
.tone-cell span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.guide-list { margin: 17px 0; padding-left: 19px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.guide-caution { margin: 0; padding: 13px 0 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.8; }
.side-column { display: grid; gap: 14px; position: sticky; top: 86px; }
.side-card { padding: 20px 17px; }
.side-card.compact { box-shadow: none; }
.side-title { display: flex; justify-content: space-between; align-items: center; }
.side-title > b { color: var(--green); font-family: Georgia, serif; font-size: 23px; font-weight: 500; }
.filter-row { display: flex; gap: 5px; margin: 15px 0 11px; }
.filter-row button { flex: 1; padding: 6px 4px; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--muted); font-size: 10px; cursor: pointer; }
.filter-row button.active { background: var(--green-soft); border-color: transparent; color: var(--green); }
.phrase-list { max-height: 555px; overflow-y: auto; padding-right: 3px; scrollbar-width: thin; scrollbar-color: #c9cec7 transparent; }
.phrase-group { margin: 14px 0 6px; color: var(--gold); font-size: 9px; font-weight: 750; letter-spacing: .12em; }
.phrase-item { width: 100%; display: grid; grid-template-columns: 23px 1fr 15px; gap: 6px; align-items: center; padding: 9px 7px; border: 0; border-radius: 8px; background: transparent; color: #53615b; text-align: left; cursor: pointer; }
.phrase-item:hover { background: #f5f4ef; }
.phrase-item.active { background: var(--green-soft); color: var(--green); }
.phrase-item .n { color: var(--muted); font-family: Menlo, monospace; font-size: 9px; }
.phrase-item .text { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.phrase-item .check { color: var(--green); font-size: 11px; }
.empty-list { padding: 28px 10px; color: var(--muted); font-size: 11px; text-align: center; }
.side-card h3 { margin: 8px 0 14px; font-size: 14px; }
.focus-list { margin: 0; padding: 0; list-style: none; }
.focus-list li { padding: 11px 0; border-top: 1px solid var(--line); }
.focus-list b, .focus-list span { display: block; }
.focus-list b { color: var(--green); font-size: 11px; }
.focus-list span { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.shortcut-card { display: grid; gap: 8px; padding: 8px 15px; color: var(--muted); font-size: 10px; }
.shortcut-card b { color: var(--ink); font-size: 11px; }
kbd { display: inline-block; min-width: 20px; margin-right: 3px; padding: 2px 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--card); color: var(--green); font-family: Menlo, monospace; font-size: 9px; text-align: center; }
.footer { width: min(1440px, calc(100% - 44px)); display: flex; justify-content: space-between; gap: 20px; margin: 24px auto 0; padding: 22px 0 28px; border-top: 1px solid rgba(21,94,75,.10); color: var(--muted); font-size: 10px; line-height: 1.7; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 100; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 999px; background: rgba(24,34,31,.94); color: #fff; font-size: 11px; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.button { display: inline-block; padding: 10px 15px; border: 1px solid var(--line); border-radius: 9px; font-size: 12px; }
.button.primary { background: var(--green); border-color: var(--green); color: #fff; }
@media (max-width: 1120px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 280px; }
  .method-strip { grid-template-columns: repeat(3, 1fr); }
  .method-note { grid-column: 1 / -1; justify-content: center; }
  .hero-stats div { width: 94px; }
  .record-grid { grid-template-columns: 1fr; }
  .compare-actions { justify-content: flex-start; }
}
@media (max-width: 860px) {
  .page { width: min(100% - 26px, 720px); }
  .workspace { grid-template-columns: 1fr; }
  .side-column { position: static; }
  .phrase-list { max-height: 340px; }
  .hero { align-items: flex-start; flex-direction: column; gap: 24px; padding-top: 30px; }
  .hero-stats { width: 100%; }
  .hero-stats div { flex: 1; }
  .topbar { padding: 0 14px; }
  .top-actions { gap: 12px; }
  .private-pill { display: none; }
  .footer { width: calc(100% - 28px); flex-direction: column; gap: 5px; }
}
@media (max-width: 600px) {
  .topbar { height: 60px; }
  .brand b { font-size: 12px; }
  .brand small { font-size: 7px; }
  .top-actions { font-size: 10px; gap: 9px; }
  .top-actions a { white-space: nowrap; }
  .hero { min-height: 0; padding: 26px 2px 22px; }
  .hero h1 { font-size: 43px; }
  .hero-sub { font-size: 10px; letter-spacing: .10em; }
  .hero-desc { font-size: 12px; }
  .hero-stats div { padding: 14px 8px; }
  .hero-stats b { font-size: 25px; }
  .method-strip { grid-template-columns: 1fr; }
  .method-note { grid-column: auto; text-align: center; }
  .method { padding: 12px 15px; }
  .stage-card, .record-card { padding: 17px 14px; border-radius: 16px; }
  .stage-head { align-items: flex-start; }
  .phrase-meta { gap: 7px; }
  .time-code { width: 100%; }
  .lyric-stage { min-height: 155px; gap: 6px 2px; padding-top: 20px; }
  .word { min-width: 37px; padding: 7px 3px 6px; }
  .word .jp { font-size: 10px; }
  .word .char { font-size: 26px; }
  .notation-head, .mode-row { align-items: flex-start; flex-direction: column; }
  .notation-head .segmented { width: 100%; }
  .notation-head .segmented button { flex: 1; padding: 6px 3px; }
  .staff-box { min-height: 135px; }
  .mode-explain { text-align: left; }
  .transport { flex-wrap: wrap; gap: 8px; }
  .play-button { min-width: 135px; }
  .loop-button { width: 100%; margin-top: 4px; }
  .settings { gap: 9px; }
  .card-title { flex-direction: column; gap: 6px; }
  .record-action { align-items: flex-start; flex-direction: column; }
  .tone-grid { grid-template-columns: repeat(3, 1fr); }
  .guide-card { padding: 0 17px; }
  .denied-card { padding: 30px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
