:root {
  color-scheme: light;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f7f8f4; color: #172d26;
  --green: #124938; --muted: #596a61; --paper: #f7f8f4;
}
* { box-sizing: border-box; }
body { margin: 0; }
.page { max-width: 34rem; margin: auto; padding: 0 clamp(16px,5vw,28px); }
header, .brand, .languages, .phase-top, .status-tag, .record-head, .entry-meta, button {
  display: flex; align-items: center;
}
header { padding: max(23px, env(safe-area-inset-top)) 0 18px; border-bottom: 1px solid #d9e0d7; justify-content: space-between; }
.brand { gap: 10px; font-size: 21px; font-weight: 750; letter-spacing: .03em; }
.languages { gap: 8px; color: #486055; font-size: 13px; font-weight: 550; }
.languages span { color: #759283; font-size: 17px; }
h1,h2,p { margin: 0; }
main { padding: clamp(24px,4vh,37px) 0 calc(115px + env(safe-area-inset-bottom)); }
h1 { font-size: clamp(28px,7.4vw,38px); letter-spacing: -.04em; line-height: 1.25; font-weight: 735; }
.intro { margin: 9px 0 22px; font-size: 14px; color: var(--muted); line-height: 1.65; }
#phase { background: radial-gradient(ellipse at 55% 0%, #245848 0, transparent 72%), #12382e;
  color: #f6fff7; position: relative; overflow: hidden; border-radius: 23px; padding: 19px 20px 21px; }
.phase-top,.record-head { justify-content: space-between; }
.status-tag { gap: 7px; font-size: 12px; letter-spacing: .03em; color: #deeee2; }
.status-tag i { width: 7px; height: 7px; border-radius: 50%; background: #9db7ab; }
[data-state=listening] i { background: #99efa5; box-shadow: 0 0 0 4px #9cefaf21; }
[data-state=translating] i,[data-state=speaking] i { background: #ffc981; }
[data-state=error] i { background: #ffa68b; }
#timer { color: #bdd5c8; font: 12px/1.2 "IBM Plex Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.wave { height: clamp(70px,13vh,112px); margin: 8px -1px; }
canvas { display: block; width: 100%; height: 100%; }
.phase-copy h2 { font-size: 25px; line-height: 1.3; letter-spacing: -.025em; }
.phase-copy p { color: #c3d7cb; font-size: 13px; margin-top: 5px; line-height: 1.6; overflow-wrap: anywhere; }
.records { margin-top: 27px; }
.record-head { margin-bottom: 13px; }
.record-head h2 { font-size: 19px; letter-spacing: -.02em; }
#count { font-size: 12px; color: var(--muted); }
#history { list-style: none; margin: 0; padding: 0; }
#empty, .entry { border-radius: 17px; border: 1px solid #dce3d8; }
#empty { display: grid; justify-items: center; align-content: center; gap: 10px; min-height: 110px; color: #63756a; background: #f1f4ed; }
#empty p { text-align: center; font-size: 13px; }
.empty-icon { display: block; height: 17px; width: 24px; position: relative; border: 1.7px solid #829b8d; border-radius: 6px; }
.empty-icon:after { content: "···"; line-height: 9px; width: 100%; text-align: center; position: absolute; font-weight: 700; letter-spacing: 1.5px; }
.entry { padding: 15px 16px; background: #fff; margin-bottom: 11px; overflow-wrap: anywhere; }
.entry-meta { justify-content: space-between; color: #596e61; font-size: 12px; margin-bottom: 10px; }
.entry-meta time { font-variant-numeric: tabular-nums; }
.pair { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: baseline; }
.pair + .pair { margin-top: 8px; border-top: 1px solid #e8ede6; padding-top: 8px; }
.pair span { color: #63776b; font-size: 11px; font-weight: 600; }
.pair p { font-size: 15px; line-height: 1.55; white-space: pre-wrap; }
.pair:last-child p { font-weight: 575; color: #154c36; }
footer { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 34rem;
  padding: 12px clamp(16px,5vw,28px) max(16px,env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid #d9e0d7; z-index: 2; }
button { width: 100%; min-height: 53px; justify-content: center; gap: 11px; color: #fff; background: var(--green); border: 0; border-radius: 16px; font: inherit; font-size: 17px; font-weight: 650; cursor: pointer; }
button:active { transform: scale(.99); } button:focus-visible { outline: 3px solid #d89a3c; outline-offset: 2px; }
#stop { background: #e4eae1; color: #253e32; }
[hidden] { display: none !important; }
.mic-icon { width: 14px; height: 13px; border: 1.7px solid currentColor; border-top: none; border-radius: 0 0 9px 9px; position: relative; margin-top: 1px; }
.mic-icon:before { content: ""; position: absolute; left: 2px; top: -4px; height: 12px; width: 7px; border-radius: 6px; background: currentColor; }
.mic-icon:after { content: ""; position: absolute; top: 12px; left: 5px; height: 4px; width: 2px; background: currentColor; }
.stop-icon { height: 12px; width: 12px; border-radius: 3px; background: currentColor; }
