/* 小提琴练琴助手 · 测试版样式
   视觉起点：最新 A. 谱架纸白（含调音准区打磨）。
   从 demo/styles.css 抽取共用控件与 theme-A，不含 B/C 与 demo 切换外壳。 */

/* ---- from demo/styles.css lines 1-23 ---- */
/* 小提琴练琴助手 · 参考样式 Demo（personal） */
:root {
  --serif: "Noto Serif CJK SC", "Noto Serif", "Source Serif Pro", "Instrument Serif", ui-serif, Georgia, "Songti SC", "STSong", serif;
  --sans: "Noto Sans CJK SC", "Noto Sans", Inter, system-ui, -apple-system, "PingFang SC", "Noto Sans SC", sans-serif;
  --mono: "Noto Sans Mono CJK SC", ui-monospace, Menlo, monospace;
  --page: #efede8;
  --page-ink: #1c1916;
  --page-muted: #6a645c;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--page);
  color: var(--page-ink);
  min-height: 100vh;
}
button { font-family: inherit; cursor: pointer; }
button:focus-visible, [data-theme]:focus-visible, [data-screen]:focus-visible {
  outline: 2px solid #3a3a3a;
  outline-offset: 2px;
}

/* ---- from demo/styles.css lines 128-280 ---- */
/* ---------- shared frame ---------- */
.frame {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.kicker {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: none;
}
h1 { margin: 0; }
.lead { margin: 8px 0 0; }
.act, .pill, .step {
  border: 0;
  background: transparent;
  font: inherit;
}
.act {
  border: 1px solid currentColor;
  padding: 8px 16px;
  font-size: 13px;
  letter-spacing: 0.04em;
  background: transparent;
  color: inherit;
}
.act-primary { font-weight: 600; }
.ctrl-label {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  margin-bottom: 6px;
  opacity: 0.7;
}
.stepper {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-variant-numeric: tabular-nums;
}
.stepper strong { font-size: 16px; font-weight: 600; }
.step {
  width: 22px;
  height: 22px;
  border: 1px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.65;
  font-size: 13px;
  padding: 0;
}
.pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  font-size: 12.5px;
  border: 1px solid currentColor;
  opacity: 0.45;
}
.pill.is-on { opacity: 1; }
.toggles, .actions, .metro-row, .ctrl-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.controls, .a-foot, .c-dock, .b-controls {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.vol { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; opacity: 0.75; }
.vol-trk {
  display: inline-block;
  width: 72px;
  height: 3px;
  background: currentColor;
  opacity: 0.25;
  position: relative;
}
.vol-fill {
  display: block;
  height: 100%;
  background: currentColor;
  opacity: 1;
}
.cents { background: transparent; }
.cents-kicker {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  opacity: 0.65;
  margin-bottom: 4px;
}
.cents-value { font-variant-numeric: tabular-nums; }
.cents-mute { font-size: 15px; letter-spacing: 0.04em; }
.side-note { margin: 8px 0 0; font-size: 12.5px; line-height: 1.5; opacity: 0.75; }
.staff-host { width: 100%; display: flex; justify-content: center; }
.staff-svg { display: block; max-width: 100%; }

/* strings */
.string-list { display: flex; flex-direction: column; gap: 18px; }
.string {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 18px;
  align-items: center;
  opacity: 0.68;
}
.string.is-current { opacity: 1; }
.string-letter {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 600;
  line-height: 1;
}
.string-meter {
  position: relative;
  height: 8px;
  background: currentColor;
  opacity: 1;
}
.string-meter { background: color-mix(in srgb, currentColor 16%, transparent); }
.string-meter .zone {
  position: absolute;
  left: 46%;
  width: 8%;
  top: -3px;
  height: 14px;
  background: currentColor;
  opacity: 0.22;
}
.string-meter .needle-tick {
  position: absolute;
  top: -6px;
  width: 2px;
  height: 20px;
  background: currentColor;
  transform: translateX(-50%);
}
.string-read { text-align: right; min-width: 120px; }
.string-cents { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.string-now, .string-sub { display: block; font-size: 11px; margin-top: 2px; letter-spacing: 0.08em; }
.string.is-current .string-now { font-weight: 600; }
.string.is-high .needle-tick { background: #8A5340; }
.string.is-low .needle-tick { background: #4A5C68; }
.string.is-in .needle-tick { background: currentColor; }


/* ---- from demo/styles.css lines 281-469 ---- */
/* =========================================================
   A. 谱架纸白
   ========================================================= */
.theme-A {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,250,240,0.65), transparent 55%),
    repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(80,50,20,0.012) 4px),
    #F3EBDC;
  color: #1C1712;
}
.theme-A .kicker { color: #8B7F70; font-family: var(--sans); }
.theme-A h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 30px;
  letter-spacing: 0.01em;
  color: #1C1712;
}
.theme-A .lead { color: #5C534A; font-family: var(--serif); font-size: 15px; }
.theme-A .act {
  border: 0;
  border-bottom: 1px solid rgba(28,23,18,0.45);
  padding: 4px 0;
  border-radius: 0;
  letter-spacing: 0.08em;
  font-size: 13.5px;
  color: #3A342E;
}
.theme-A .act-primary {
  border-bottom-width: 1.5px;
  border-bottom-color: #1C1712;
  color: #1C1712;
}
.theme-A .pill {
  border: 0;
  border-bottom: 1px solid transparent;
  padding: 2px 0;
  border-radius: 0;
  color: #8B7F70;
  opacity: 1;
}
.theme-A .pill.is-on {
  border-bottom-color: rgba(28,23,18,0.45);
  color: #1C1712;
}
.theme-A .step {
  border-color: rgba(28,23,18,0.25);
  color: #5C534A;
  border-radius: 0;
}
.theme-A .ctrl-label { color: #8B7F70; font-family: var(--sans); }
.theme-A .cents-value {
  font-family: var(--serif);
  font-style: italic;
  font-size: 28px;
  font-weight: 500;
  color: #3F3428;
}
.theme-A .cents.is-high .cents-value { color: #8A5340; }
.theme-A .cents.is-low .cents-value { color: #4A5C68; }
.theme-A .cents-mute {
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  color: #6B5A45;
}
.theme-A .cents-kicker { color: #8B7F70; }
.theme-A .side-note { font-family: var(--serif); font-style: italic; color: #6B5A45; opacity: 1; }

.frame-A { padding: 56px 56px 40px; }
.frame-A .a-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: end;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(28,23,18,0.16);
}
.frame-A .a-status {
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  color: #3F3428;
  padding-bottom: 4px;
}
.frame-A .a-tempo {
  font-family: var(--serif);
  font-size: 20px;
  color: #1C1712;
  padding-bottom: 4px;
}
.frame-A .a-staff-well {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 0 12px;
}
.frame-A .a-foot {
  border-top: 1px solid rgba(28,23,18,0.16);
  padding-top: 18px;
  color: #3A342E;
}
.frame-A .a-foot .ctrl-group { gap: 28px; }
.frame-A.is-tuning { padding: 72px 96px 56px; }
.frame-A.is-tuning .tune-head { max-width: 720px; }
.frame-A.is-tuning .tune-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 64px;
  align-items: center;
  padding: 36px 0;
}
.frame-A.is-tuning .string-list { gap: 30px; }
.frame-A.is-tuning .string-letter { font-size: 42px; }
.frame-A.is-tuning .string { opacity: 1; }
.frame-A.is-tuning .string:not(.is-current) .string-letter,
.frame-A.is-tuning .string:not(.is-current) .string-read { opacity: 0.68; }
.frame-A.is-tuning .string-meter { height: 2px; background: rgba(28,23,18,0.18); }
.frame-A.is-tuning .string-meter .zone {
  left: 45%;
  width: 10%;
  height: 9px;
  top: -3.5px;
  background: rgba(28,23,18,0.28);
  opacity: 1;
}
.frame-A.is-tuning .string-meter .zone-bracket {
  position: absolute;
  top: -7px;
  width: 5px;
  height: 16px;
  box-sizing: border-box;
  border-color: rgba(28,23,18,0.52);
  border-style: solid;
  pointer-events: none;
}
.frame-A.is-tuning .string-meter .zone-bracket-l {
  left: 45%;
  border-width: 1px 0 1px 1px;
}
.frame-A.is-tuning .string-meter .zone-bracket-r {
  left: 55%;
  transform: translateX(-100%);
  border-width: 1px 1px 1px 0;
}
.frame-A.is-tuning .string-meter .zone-label {
  position: absolute;
  left: 50%;
  top: -20px;
  transform: translateX(-50%);
  font-family: var(--serif);
  font-style: italic;
  font-size: 11px;
  line-height: 1;
  color: rgba(28,23,18,0.5);
  letter-spacing: 0.14em;
  pointer-events: none;
}
.frame-A.is-tuning .string.is-current .string-meter { background: rgba(28,23,18,0.28); }
.frame-A.is-tuning .string.is-current .string-meter .zone { background: rgba(28,23,18,0.4); }
.frame-A.is-tuning .string.is-current .string-meter .zone-bracket { border-color: rgba(28,23,18,0.72); }
.frame-A.is-tuning .string.is-current .string-meter .zone-label { color: rgba(28,23,18,0.72); }
.frame-A.is-tuning .string.is-current {
  outline: none;
  padding: 10px 0 8px;
  border-top: 1px solid rgba(28,23,18,0.12);
  border-bottom: 1px solid rgba(28,23,18,0.12);
}
.frame-A.is-tuning .a440 { align-self: end; margin-bottom: 8px; }
.frame-A.is-tuning .tune-foot { border-top: 1px solid rgba(28,23,18,0.16); padding-top: 22px; }

/* A phone */
.theme-A.is-phone .frame-A { padding: 28px 16px 18px; }
.theme-A.is-phone h1 { font-size: 18px; }
.theme-A.is-phone .a-head {
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding-bottom: 10px;
}
.theme-A.is-phone .a-tempo { display: none; }
.theme-A.is-phone .a-status { font-size: 15px; grid-column: 2; }
.theme-A.is-phone .cents-value { font-size: 22px; }
.theme-A.is-phone .a-foot { gap: 10px; padding-top: 12px; }
.theme-A.is-phone .ctrl-group { width: 100%; justify-content: space-between; }
.theme-A.is-phone.is-tuning,
.frame-A.is-tuning.is-phone { padding: 32px 20px 24px; }
.frame-A.is-tuning.is-phone .tune-body { grid-template-columns: 1fr; gap: 24px; padding: 20px 0; }

/* ---- from demo/styles.css lines 800-807 ---- */
/* phone tuning shared */
.is-phone.is-tuning h1 { font-size: 26px; }

/* unstable hint */
.cents.is-unstable .cents-value { opacity: 0.92; }

/* hide volume row label crowding */
.vol em { font-style: normal; font-size: 10.5px; }

/* ---------- 测试版应用壳（在最新 A. 谱架纸白之上） ---------- */
html, body, #app {
  min-height: 100%;
  min-height: 100dvh;
}
body {
  background: #F3EBDC;
  color: #1C1712;
}
#app.theme-A {
  min-height: 100vh;
  min-height: 100dvh;
}
#app.theme-A .frame-A {
  min-height: 100vh;
  min-height: 100dvh;
}

.banner {
  padding: 10px 24px;
  font-size: 13px;
  line-height: 1.5;
  background: rgba(138, 83, 64, 0.1);
  color: #5C3A32;
  border-bottom: 1px solid rgba(28, 23, 18, 0.12);
}
.banner-warn strong { font-weight: 600; }

.tune-actions { gap: 28px; }
.tune-foot .side-note { margin: 12px 0 0; }
.text-link {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  letter-spacing: 0.08em;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.beat-lamp {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 1px;
  background: rgba(28, 23, 18, 0.18);
  vertical-align: 1px;
}
.beat-lamp.is-on {
  background: #1C1712;
}
.beat-lamp.is-on.is-accent {
  background: #8A6A38;
}

.string.is-idle .needle-tick { opacity: 0; }
.string.is-idle .string-cents { opacity: 0.45; }

.vol input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 72px;
  height: 3px;
  background: rgba(28, 23, 18, 0.25);
  outline: none;
  padding: 0;
  margin: 0 4px 0 0;
  vertical-align: middle;
  cursor: pointer;
}
.vol input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  background: #1C1712;
  border: 0;
  border-radius: 0;
}
.vol input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  background: #1C1712;
  border: 0;
  border-radius: 0;
}
.vol input[type="range"]:focus-visible {
  outline: 2px solid #3a3a3a;
  outline-offset: 3px;
}

.pill {
  cursor: pointer;
  background: transparent;
}
.step, .act, .text-link { touch-action: manipulation; }

.staff-host { min-height: 200px; }
.staff-svg { width: 100%; height: auto; }

/* 手机：保住谱面与当前音分；加大触控但不把细线控件撑成 App 方块 */
@media (max-width: 820px) {
  .frame-A {
    padding: 24px 16px 16px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
  .theme-A h1, .frame-A h1 { font-size: 18px; }
  .frame-A .a-head {
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding-bottom: 10px;
  }
  .frame-A .a-status { font-size: 15px; grid-column: 2; }
  .theme-A .cents-value { font-size: 22px; }
  .theme-A .cents-mute { font-size: 18px; }
  .frame-A .a-staff-well { padding: 16px 0 8px; justify-content: flex-start; }
  .frame-A .a-foot { gap: 8px 12px; padding-top: 10px; }
  .frame-A .a-foot .ctrl-group { width: 100%; justify-content: space-between; gap: 10px 16px; }
  .staff-host { min-height: 0; }

  /* 视觉保持 22px 细线步进与字下划线；扩大可点范围 */
  .step, .pill, .act, .text-link { position: relative; }
  .step {
    min-height: 22px;
    min-width: 22px;
    padding: 0;
  }
  .pill, .act, .text-link {
    min-height: 0;
    min-width: 0;
    padding: 4px 0;
  }
  .step::before,
  .pill::before,
  .act::before,
  .text-link::before {
    content: "";
    position: absolute;
    inset: -11px -8px;
  }

  .frame-A.is-tuning { padding: 28px 18px 20px; }
  .frame-A.is-tuning .tune-body {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 16px 0 8px;
  }
  .frame-A.is-tuning .string-list { gap: 22px; }
  .frame-A.is-tuning .string {
    grid-template-columns: 40px 1fr auto;
    gap: 10px;
  }
  .frame-A.is-tuning .string-letter { font-size: 36px; }
  .frame-A.is-tuning .string-read { min-width: 72px; }
  .frame-A.is-tuning .string-meter .zone {
    left: 42%;
    width: 16%;
  }
  .frame-A.is-tuning .string-meter .zone-bracket-l { left: 42%; }
  .frame-A.is-tuning .string-meter .zone-bracket-r {
    left: 58%;
    transform: translateX(-100%);
  }
  .is-tuning h1 { font-size: 26px; }
  .banner { padding: 10px 16px; }
  .side-note { font-size: 12px; }
  .cents { margin-top: 4px; }
}

@media (max-width: 820px) and (orientation: landscape) {
  .frame-A { padding: 10px 16px 8px; }
  .frame-A .a-staff-well { padding: 6px 0 4px; }
  .frame-A .a-tempo { display: inline-block; font-size: 16px; }
  .frame-A .a-status { font-size: 15px; }
  .theme-A .cents-value { font-size: 20px; }
}

/* ---------- Iris 打磨（对齐已审通 A. 谱架纸白） ---------- */

/* 电脑：把练习界面收成谱架上的一张纸，宽屏不把谱拉得过稀 */
#app.theme-A .frame-A {
  width: 100%;
  max-width: 1366px;
  margin-inline: auto;
}
.frame-A:not(.is-tuning) .staff-host {
  max-width: 1240px;
  width: 100%;
  margin-inline: auto;
}

/* 标题栏里的「调音」退成与 kicker 同级的细链，不抢曲名 */
.theme-A .kicker .text-link {
  color: inherit;
  letter-spacing: inherit;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: from-font;
  opacity: 0.9;
}
.theme-A .text-link:focus-visible {
  outline: 2px solid #3a3a3a;
  outline-offset: 2px;
}

/* 节拍闪光：纸面石墨小方，不要做成指示灯 */
.beat-lamp {
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 0;
  border: 1px solid rgba(28, 23, 18, 0.35);
  background: transparent;
  vertical-align: 2px;
}
.beat-lamp.is-on {
  background: #1C1712;
  border-color: #1C1712;
}
.beat-lamp.is-on.is-accent {
  background: #8A6A38;
  border-color: #8A6A38;
}

/* 音量：细轨 + 短竖划，避免实心方块滑块 */
.vol input[type="range"] {
  width: 72px;
  height: 2px;
  background: rgba(28, 23, 18, 0.22);
  margin: 0 6px 0 0;
}
.vol input[type="range"]::-webkit-slider-thumb {
  width: 2px;
  height: 11px;
  background: #1C1712;
  border: 0;
  border-radius: 0;
  cursor: pointer;
}
.vol input[type="range"]::-moz-range-thumb {
  width: 2px;
  height: 11px;
  background: #1C1712;
  border: 0;
  border-radius: 0;
  cursor: pointer;
}

/* 调音读数与空弦字母同一纸面语气 */
.theme-A .string-cents {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  color: #3A342E;
}
.theme-A .string-now,
.theme-A .string-sub {
  font-family: var(--sans);
  color: #6B5A45;
}
.theme-A .string.is-current .string-now {
  color: #1C1712;
}
.frame-A.is-tuning .a440 .stepper strong {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* 当前音分与谱的距离，贴近审通稿的留白 */
.frame-A .a-staff-well .cents { margin-top: 8px; }
.frame-A .a-staff-well .side-note { max-width: 46em; }

/* 短屏笔记本：少一点上下留白，优先保住谱 */
@media (min-width: 821px) and (max-height: 860px) {
  .frame-A { padding: 36px 48px 28px; }
  .frame-A.is-tuning { padding: 48px 72px 36px; }
  .frame-A .a-staff-well { padding: 16px 0 8px; }
}

@media (min-width: 821px) and (max-height: 720px) {
  .frame-A { padding: 24px 40px 20px; }
  .frame-A.is-tuning { padding: 32px 56px 24px; }
  .frame-A .a-staff-well { padding: 10px 0 6px; }
  .theme-A h1 { font-size: 26px; }
}
