:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --text: #202b3d;
  --muted: #697586;
  --blue: #2376df;
  --green: #268344;
  --red: #cf2924;
  --line: #dce2ea;
}
* { box-sizing: border-box; }
html { background: var(--bg); scroll-padding-bottom: 190px; }
body { margin: 0; color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid #193f91; outline-offset: 4px; }
[hidden] { display: none !important; }
.shell { width: min(1180px, 100%); margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-right)) 142px max(16px, env(safe-area-inset-left)); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 24px; }
h1 { font-size: clamp(23px, 3vw, 32px); letter-spacing: -.03em; line-height: 1.3; margin: 0; }
.hint { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.total { flex-shrink: 0; border: 1px solid var(--line); border-radius: 30px; background: white; padding: 9px 14px; font-size: 17px; font-weight: 650; }
.total span { font-size: 12px; font-weight: 400; color: var(--muted); }
.board { display: grid; grid-template-columns: 1fr 1.04fr; gap: 18px; align-items: start; }
.panel { border: 1px solid; border-radius: 16px; padding: 20px; }
.vowels { color: var(--blue); border-color: #a9c9f2; background: #eff6ff; }
.cons { color: var(--green); border-color: #afd5b9; background: #f0f8f1; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.section-title h2 { margin: 0; font-size: 23px; letter-spacing: .1em; }
.section-title > span { font-size: 12px; }
.divider { border-top: 1px solid #cbdff8; padding-top: 22px; margin-top: 24px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ipa { display: flex; align-items: center; justify-content: center; width: 100%; height: 70px; padding: 0; border: 1px solid #d6dde6; border-radius: 9px; background: white; color: var(--red); font-family: "Times New Roman", "Charis SIL", "Doulos SIL", serif; font-size: 32px; line-height: 1; box-shadow: 0 2px 2px #23364d04; transition: border-color .12s, background .12s, transform .12s; }
.ipa:active { transform: scale(.97); }
.ipa.selected { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); background: #e7f1ff; }
.ipa.playing { box-shadow: inset 0 0 0 2px var(--blue), 0 0 0 3px #2376df1a; }
.footnote { color: var(--muted); font-size: 12px; text-align: center; line-height: 1.8; margin: 20px 0 0; }
.footnote span { margin: 0 6px; }
.controls { position: fixed; z-index: 10; left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: 210px minmax(0, 1fr) 140px 126px; align-items: center; gap: 22px; max-width: 1148px; margin: 0 auto; padding: 16px 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 8px 36px #243d6117; }
.now { min-width: 0; display: flex; align-items: center; gap: 14px; }
.current-symbol { color: var(--blue); font-family: "Times New Roman", serif; font-size: 32px; min-width: 60px; text-align: center; }
.now-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.now-copy strong { font-size: 13px; font-weight: 600; }
#status { color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
#status.error, .error { color: #b4211b; }
.transport { display: grid; grid-template-columns: 48px minmax(30px, 1fr) 94px; gap: 12px; align-items: center; }
.playbtn { display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 50%; color: white; background: var(--blue); }
.playbtn svg { width: 24px; height: 24px; fill: currentColor; }
input[type="range"] { appearance: none; -webkit-appearance: none; width: 100%; min-width: 0; height: 32px; margin: 0; background: transparent; accent-color: var(--blue); cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 5px; border-radius: 99px; background: #dce4ef; }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6.5px; background: var(--blue); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 1px 4px #1e407b33; }
input[type="range"]::-moz-range-track { height: 5px; border-radius: 99px; background: #dce4ef; }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border: 2px solid #fff; border-radius: 50%; background: var(--blue); }
input:disabled { opacity: .5; cursor: default; }
.time { color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.volume { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.volume span { flex-shrink: 0; }
.repeat { display: flex; align-items: center; justify-content: center; gap: 6px; height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 9px; background: #f8faff; color: #33465f; font-size: 14px; white-space: nowrap; }
.repeat svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .ipa:hover { border-color: var(--blue); background: #f4f8ff; } .repeat:hover { background: #ecf3ff; } }
@media (max-width: 1050px) { .controls { grid-template-columns: 180px minmax(0, 1fr) 120px; gap: 16px; } .volume { display: none; } }
@media (min-width: 740px) and (max-width: 900px) { .panel { padding: 16px 12px; } .board { gap: 12px; } .grid4 { gap: 8px; } .ipa { height: 62px; font-size: 29px; } }
@media (max-width: 739px) {
  .shell { padding-top: 20px; padding-bottom: calc(182px + env(safe-area-inset-bottom)); }
  .topbar { margin-bottom: 20px; }
  .total { padding: 7px 10px; }
  .board { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .panel { padding: 18px 14px; }
  .ipa { height: 64px; }
  .section-title h2 { font-size: 22px; }
  .controls { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; padding: 12px 14px; border-radius: 14px; }
  .now { gap: 8px; }
  .current-symbol { min-width: 52px; font-size: 29px; }
  .repeat { grid-column: 2; grid-row: 1; height: 44px; padding: 0 10px; font-size: 13px; }
  .transport { grid-column: 1 / -1; grid-row: 2; grid-template-columns: 44px minmax(20px, 1fr) 94px; }
  .playbtn { width: 44px; height: 44px; }
  .footnote { margin: 16px 12px 0; }
}
@media (max-width: 350px) { .total span { display: none; } .grid4 { gap: 8px; } .panel { padding: 16px 10px; } .ipa { font-size: 28px; height: 58px; } }
@media (max-height: 480px) and (orientation: landscape) {
  .controls { position: static; margin: 0 16px 16px; max-width: none; }
  .shell { padding-bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) { .ipa { transition: none; } }
