:root {
  color-scheme: light;
  --bg: #f5f5ee;
  --paper: #fffefa;
  --ink: #222721;
  --muted: #626b5d;
  --line: #e4e6db;
  --lime: #d7f786;
  --stage: #202a22;
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, select { font: inherit; }
button, select, a, input { -webkit-tap-highlight-color: transparent; }
button:enabled, select:enabled { cursor: pointer; }
button:disabled, select:disabled { opacity: .53; }
:focus-visible { outline: 3px solid #607a35; outline-offset: 3px; }
.shell { width: min(1100px, calc(100% - 56px)); margin-inline: auto; }
.topbar { border-bottom: 1px solid #dce0d3; }
.topbar-inner { height: 66px; display: flex; align-items: center; gap: 17px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 850; color: inherit; text-decoration: none; letter-spacing: -.055em; }
.logo { width: 32px; height: 32px; background: var(--ink); color: var(--lime); border-radius: 10px; display: grid; place-items: center; font-size: 17px; letter-spacing: -.12em; padding-right: 2px; }
.product { border-left: 1px solid #d6dbce; padding-left: 17px; color: var(--muted); font-size: 13px; }
.settings-button { margin-left: auto; white-space: nowrap; }
main { padding: 34px 0 44px; }
.intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(30px, 5.1vw, 52px); line-height: 1.14; letter-spacing: -.06em; font-weight: 850; }
.accent { color: #637d34; margin-left: .06em; }
.intro p { color: var(--muted); margin-top: 12px; font-size: 14px; line-height: 1.6; }
.level { align-self: flex-end; white-space: nowrap; background: #e6ebdb; padding: 7px 12px; border-radius: 30px; margin-bottom: 1px; font-size: 12px; font-weight: 670; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 21px; }
.practice { padding: 18px; min-width: 0; }
.providers { border: 0; padding: 0; min-width: 0; margin: 0 0 14px; }
.providers legend { font-size: 12px; font-weight: 650; color: var(--muted); margin-bottom: 8px; padding: 0; }
.provider-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.provider { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; min-width: 0; cursor: pointer; }
.provider:has(:checked) { background: #f0f5e4; border-color: #81945f; }
.provider:has(:disabled) { cursor: default; }
.provider input { accent-color: #42542d; margin: 0; flex: none; }
.provider-copy { display: grid; gap: 3px; min-width: 0; }
.provider strong { font-size: 13px; }
.provider small { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.stage { position: relative; isolation: isolate; overflow: hidden; display: grid; place-items: center; height: clamp(230px, 32vw, 328px); border-radius: 15px; background: radial-gradient(ellipse at 50% 46%, #394b33, var(--stage) 63%); color: #f7f8f1; }
.stage-top { z-index: 1; position: absolute; top: 15px; left: 15px; right: 15px; display: flex; align-items: center; justify-content: space-between; }
.alex, .stage-state { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.alex { font-weight: 650; }
.timer { font-variant-numeric: tabular-nums; font-size: 12px; color: #dce4d4; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #a0ac9a; }
.stage[data-state="speaking"] .dot, .stage[data-state="listening"] .dot { background: var(--lime); box-shadow: 0 0 10px #d7f78896; }
.avatar { position: relative; display: grid; place-items: center; width: 136px; height: 136px; }
.orbit { position: absolute; border: 1px solid #c2dfab32; border-radius: 50%; }
.orbit-wide { width: 254px; height: 254px; }
.orbit-narrow { width: 195px; height: 195px; }
.face { width: 118px; height: 111px; border-radius: 44% 44% 42% 42%; position: relative; transform: rotate(-7deg); background: linear-gradient(143deg, #eeffaf, #c5ed6a); box-shadow: 0 8px 29px #10191085, inset 0 -6px 11px #63883235; animation: float 5s ease-in-out infinite; }
.eye { display: block; width: 12px; height: 16px; background: #2c3721; border-radius: 50%; position: absolute; top: 43px; left: 35px; animation: blink 5s ease-in-out infinite; }
.eye:nth-child(2) { left: auto; right: 35px; }
.mouth { position: absolute; width: 19px; height: 10px; border-radius: 2px 2px 11px 11px; background: #2c3721; left: 50%; top: 70px; transform: translateX(-50%); }
.stage-state { position: absolute; bottom: 14px; padding: 7px 11px; border-radius: 18px; background: #19221ab8; }
.wave { display: flex; align-items: center; gap: 2px; height: 13px; color: var(--lime); }
.wave i { width: 2px; height: 4px; border-radius: 3px; background: currentColor; opacity: .55; }
.stage[data-state="speaking"] .wave i, .stage[data-state="listening"] .wave i { animation: wave .66s ease-in-out infinite alternate; opacity: 1; }
.wave i:nth-child(even) { animation-delay: -.4s !important; }
.wave i:nth-child(3) { animation-delay: -.23s !important; }
.stage[data-state="speaking"] .mouth { transform: translateX(-50%) scaleY(calc(.7 + var(--voice-level, 0) * 1.4)); transition: transform 50ms linear; border-radius: 50%; }
.stage[data-state="listening"] .orbit-narrow { animation: pulse 1.6s ease-out infinite; }
@keyframes wave { to { height: 12px; } }
@keyframes pulse { to { opacity: 0; transform: scale(1.26); } }
@keyframes float { 50% { transform: translateY(-5px) rotate(-3deg); } }
@keyframes blink { 44%, 50% { transform: scaleY(1); } 47% { transform: scaleY(.1); } }
.controls { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
button { border: 1px solid transparent; border-radius: 9px; padding: 9px 13px; min-height: 42px; font-size: 13px; font-weight: 700; color: inherit; }
.primary { background: var(--lime); border-color: #b9d971; flex: 1; }
.primary:enabled:hover { background: #c9ed77; }
.primary span { font-size: 11px; margin-right: 5px; }
.secondary { background: var(--paper); border-color: #d8ddcf; }
.secondary:enabled:hover { background: #eef2e5; }
.connection { margin: 10px 1px 1px; min-height: 20px; color: var(--muted); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.connection[data-error="true"] { color: #96412b; }
.side { display: grid; grid-template-rows: auto minmax(190px, 1fr); gap: 14px; min-width: 0; }
.script, .captions, .results { padding: 17px; }
h2 { font-weight: 770; font-size: 16px; }
.script ol { list-style: none; counter-reset: step; padding: 0; margin: 12px 0 0; display: grid; gap: 11px; }
.script li { counter-increment: step; display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.script li::before { content: counter(step); display: grid; place-items: center; background: #edf0e4; width: 23px; height: 23px; border-radius: 7px; color: #4b5e37; font-size: 12px; font-weight: 750; flex: none; }
.script strong { display: block; font-size: 13px; }
.script p { margin-top: 3px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.section-title > span { color: var(--muted); font-size: 12px; }
.captions { display: flex; flex-direction: column; min-height: 0; }
.transcript { position: relative; flex: 1; overflow-y: auto; min-height: 120px; max-height: 305px; margin-top: 10px; border-top: 1px solid var(--line); padding: 11px 2px 3px; }
.empty { color: var(--muted); font-size: 13px; line-height: 1.5; }
.bubble { padding: 8px 10px; max-width: 90%; margin: 0 0 8px; background: #f1f2eb; border-radius: 9px; font-size: 13px; overflow-wrap: anywhere; line-height: 1.45; }
.bubble.user { margin-left: auto; background: #edf4dc; }
.bubble b { display: block; font-size: 10px; color: var(--muted); margin-bottom: 3px; }
.results { margin-top: 18px; }
.results-head p, .rubric { color: var(--muted); margin-top: 6px; font-size: 12px; line-height: 1.55; }
table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; margin-top: 12px; table-layout: fixed; }
thead { color: var(--muted); }
th, td { padding: 9px 7px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
th:first-child { width: 17%; }
th:last-child { width: 23%; }
td { font-variant-numeric: tabular-nums; }
td small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
select { border: 1px solid #d8ddcf; border-radius: 7px; background: var(--paper); padding: 5px 3px; color: inherit; font-size: 12px; max-width: 100%; }
.rubric { margin-top: 10px; }
dialog { width: min(430px, calc(100% - 28px)); padding: 20px; border: 1px solid var(--line); border-radius: 17px; color: var(--ink); background: var(--paper); box-shadow: 0 22px 80px #19221b46; }
dialog::backdrop { background: #18231b82; }
.config-field { display: grid; gap: 6px; margin-top: 12px; font-size: 13px; font-weight: 650; }
.config-field input, .config-field select { width: 100%; min-height: 41px; padding: 8px 10px; border: 1px solid #d8ddcf; border-radius: 8px; font: inherit; color: inherit; background: #fff; }
.config-note { color: var(--muted); font-size: 12px; line-height: 1.55; margin-top: 13px; }
#config-status:empty { display: none; }
@media (max-width: 720px) {
  .shell { width: calc(100% - 28px); }
  .workspace { grid-template-columns: 1fr; gap: 12px; }
  main { padding-top: 23px; }
  .topbar-inner { height: 53px; }
  .topbar-inner { gap: 10px; }
  .product { padding-left: 10px; }
  .intro { margin-bottom: 15px; }
  .intro p { margin-top: 7px; }
  .stage { height: 245px; }
  .practice, .script, .captions, .results { padding: 13px; }
  .side { gap: 12px; }
  .transcript { max-height: 215px; }
}
@media (max-width: 380px) {
  .intro { align-items: flex-start; flex-direction: column; gap: 6px; }
  .level { align-self: flex-start; }
  th, td { padding-inline: 4px; }
  .product { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
