:root {
  color-scheme: light;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-synthesis: none;
  --brand: #fe5923;
  --brand-soft: #fff1eb;
  --brand-ink: #a9340c;
  --ink: #1e1e1e;
  --muted: #59616c;
  --canvas: #f7f8fa;
  --surface: #ffffff;
  --inset: #f1f3f5;
  --line: #e0e3e8;
  --control-line: #b8bec7;
  --focus: #004da8;
  --success: #237447;
  --warning: #875b0f;
  --error: #b42318;
  --radius: 8px;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 14px; line-height: 1.6; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--control-line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
  transition: background 100ms, border-color 100ms;
}
button:hover:not(:disabled) { background: var(--inset); border-color: var(--muted); }
button.primary { background: var(--brand); color: var(--ink); border-color: var(--brand); }
button.primary:hover:not(:disabled) { background: #f34d17; border-color: #f34d17; }
button.quiet { border-color: transparent; background: transparent; }
button.quiet:hover:not(:disabled) { border-color: var(--line); }
button:disabled { color: #7d8490; background: var(--inset); border-color: var(--line); cursor: not-allowed; }
button.quiet:disabled { background: transparent; border-color: transparent; }
.icon { width: 17px; height: 17px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 500; }
select, input { width: 100%; min-height: 38px; padding: 7px 12px; border: 1px solid var(--control-line); border-radius: 5px; color: var(--ink); background: var(--surface); font-size: 14px; }
select { padding-right: 28px; cursor: pointer; }
select:disabled, input:disabled { color: var(--muted); background: var(--inset); cursor: not-allowed; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 26px; line-height: 1.4; letter-spacing: -.5px; font-weight: 650; }
h2 { font-size: 16px; line-height: 1.5; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
a { color: var(--focus); text-underline-offset: 3px; }
.skip-link { position: absolute; top: -80px; left: 20px; z-index: 10; padding: 10px 16px; background: var(--surface); }
.skip-link:focus { top: 12px; }
.appbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.appbar-inner { max-width: 1336px; min-height: 64px; margin: auto; padding: 0 28px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 20px; min-width: 0; }
.aiworks-logo { display: block; width: 124px; height: auto; flex-shrink: 0; }
.brand-divider { height: 24px; border-left: 1px solid var(--line); }
.product-name { font-weight: 650; font-size: 16px; white-space: nowrap; }
.product-name span { margin-left: 8px; font-size: 12px; font-weight: 400; color: var(--muted); }
.product-type { font-size: 11px; letter-spacing: 1.2px; color: var(--muted); }
main { max-width: 1336px; margin: auto; padding: 28px 28px 20px; }
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 24px; }
.eyebrow { font-size: 10px; font-weight: 650; letter-spacing: 1.5px; color: var(--muted); margin-bottom: 6px; }
.subtitle { color: var(--muted); font-size: 13px; line-height: 1.8; margin-top: 6px; }
.status { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); padding: 7px 11px; border-radius: 5px; background: var(--surface); font-size: 12px; line-height: 1.6; color: var(--muted); max-width: 280px; flex-shrink: 0; }
.status::before { content: ""; width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: currentColor; }
.status[data-state="listening"], .status[data-state="speaking"], .status[data-state="complete"] { color: var(--success); background: #f1f8f4; border-color: #cce4d6; }
.status[data-state="paused"] { color: var(--warning); background: #fff9ed; border-color: #ebd9b4; }
.status[data-state="error"] { color: var(--error); background: #fff4f2; border-color: #f0ccc7; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.setup { padding: 16px 20px; display: flex; align-items: center; flex-wrap: wrap; gap: 20px; }
.topic-selectors { display: grid; grid-template-columns: 1fr 1.2fr 1.2fr .7fr; gap: 16px; flex: 1 1 100%; min-width: 0; }
.topic-selectors label { min-width: 0; }
.provider-note { flex-basis: 100%; margin: -6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.provider-note.error { color: var(--error); }
.review-controls .provider-note { margin: 0; font-size: 11px; }
.session-format { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.session-format > span:nth-child(2) { color: #969da7; }
#auth-label { width: 100%; }
#api-token { max-width: 420px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 20px; margin-top: 20px; }
.session-panel { overflow: hidden; }
.question-section { padding: 22px 24px 24px; }
.question-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.part-label { color: var(--brand-ink); background: var(--brand-soft); font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 4px; }
.question-progress { color: var(--muted); font-size: 12px; white-space: nowrap; }
#progress { color: var(--ink); font: 13px var(--mono); margin-left: 9px; }
#question { font-size: clamp(22px, 2.1vw, 27px); line-height: 1.5; font-weight: 550; letter-spacing: -.5px; min-height: 82px; max-width: 780px; }
#cue-points { color: var(--muted); margin: 14px 0 0; padding-left: 22px; font-size: 14px; line-height: 1.9; }
.session-controls { padding: 16px 24px; border-top: 1px solid var(--line); background: #fcfcfd; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.countdown { width: 128px; margin-left: auto; color: var(--ink); }
.countdown-values { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.countdown-values span { font-size: 11px; color: var(--muted); }
.countdown strong { font: 600 20px var(--mono); font-variant-numeric: tabular-nums; }
.countdown progress { display: block; width: 100%; height: 4px; margin-top: 7px; appearance: none; border: 0; border-radius: 3px; overflow: hidden; background: var(--line); color: var(--brand-ink); accent-color: var(--brand-ink); }
.countdown progress::-webkit-progress-bar { background: var(--line); }
.countdown progress::-webkit-progress-value { background: var(--brand-ink); }
.countdown progress::-moz-progress-bar { background: var(--brand-ink); }
.countdown[data-state="warning"] strong { color: var(--warning); }
.countdown[data-state="urgent"] strong, .countdown[data-state="expired"] strong { color: var(--error); }
.countdown[data-state="urgent"] progress::-webkit-progress-value { background: var(--error); }
#review-countdown { width: 100%; margin: 3px 0; padding: 10px 12px; background: var(--inset); border-radius: 5px; }
.time-limit-note { color: var(--muted); font-size: 11px; line-height: 1.7; margin: 10px 0 0; }
.review-controls .time-limit-note { margin: -3px 0 3px; }
.notice { margin-top: 12px; color: var(--muted); font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.notice.error { color: var(--error); }
.conversation { border-top: 1px solid var(--line); padding: 20px 24px 0; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.section-meta { font-size: 12px; color: var(--muted); }
#transcript { height: 310px; overflow-y: auto; padding: 20px 0; overscroll-behavior: contain; scrollbar-width: thin; }
.empty { height: 100%; min-height: 210px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); }
.conversation-icon { width: 43px; height: 43px; color: #808995; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; margin-bottom: 16px; }
.empty p { font-size: 15px; font-weight: 550; color: var(--ink); margin-bottom: 7px; }
.empty span { font-size: 12px; line-height: 1.9; }
.turn { padding: 12px 14px; background: var(--inset); border-radius: 6px; margin-bottom: 12px; margin-right: 20px; overflow-wrap: anywhere; }
.turn.candidate { margin-right: 0; margin-left: 20px; background: var(--brand-soft); }
.turn strong { font-size: 11px; font-weight: 650; color: var(--muted); letter-spacing: .3px; }
.turn.candidate strong { color: var(--brand-ink); }
.turn p { margin-top: 4px; line-height: 1.8; white-space: pre-wrap; }
.turn.pending p { color: var(--muted); }
.conversation-note { padding: 12px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
#media { display: none; }
#enable-audio { margin-bottom: 12px; }
.guide-panel { padding: 20px; }
.guide-intro { margin-top: 14px; color: var(--muted); font-size: 13px; line-height: 1.85; }
.guide-steps { padding: 0; margin: 20px 0; list-style: none; counter-reset: step; }
.guide-steps li { position: relative; padding-left: 33px; margin-bottom: 20px; counter-increment: step; }
.guide-steps li:last-child { margin-bottom: 0; }
.guide-steps li::before { content: "0" counter(step); position: absolute; left: 0; top: 1px; color: var(--brand-ink); font: 12px/22px var(--mono); }
.guide-steps strong { font-size: 13px; font-weight: 650; }
.guide-steps p { color: var(--muted); font-size: 12px; line-height: 1.8; margin: 4px 0 6px; }
.starter { display: block; font-size: 13px; color: var(--ink); padding: 5px 9px; border-left: 2px solid #d3d8df; background: var(--canvas); line-height: 1.6; }
.vocabulary-block { border-top: 1px solid var(--line); padding-top: 18px; }
.vocabulary-block h3 { margin-bottom: 8px; font-size: 13px; }
.vocab-row { display: flex; flex-direction: column; padding: 8px 0; font-size: 13px; }
.vocab-row + .vocab-row { border-top: 1px solid #eef0f3; }
.vocab-row span:last-child { font-size: 12px; color: var(--muted); margin-top: 2px; }
.guide-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.guide-actions button { font-size: 12px; padding: 7px 10px; }
.preparation { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 10px 12px; border-radius: 5px; color: var(--focus); background: #eef4fc; font-size: 13px; }
.teaching-panel { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--line); scroll-margin-top: 24px; }
.report-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.report-heading h2 { font-size: 23px; }
.report-heading button { flex-shrink: 0; }
.report-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.report-content { padding: 24px; }
#report { overflow-wrap: anywhere; }
.teaching-summary { font-size: 16px; line-height: 1.95; margin-bottom: 24px; }
.teaching-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 24px 0; }
.teaching-block { border-top: 1px solid var(--line); padding-top: 18px; font-size: 14px; line-height: 1.85; }
.teaching-block h3 { margin-bottom: 10px; }
.teaching-block ul, .teaching-block ol { margin: 0; padding-left: 20px; }
.teaching-block li + li { margin-top: 7px; }
.teaching-block li::marker { color: var(--muted); }
.lesson { border: 1px solid var(--line); border-radius: 6px; padding: 16px; margin: 14px 0; font-size: 14px; line-height: 1.8; }
.lesson-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 12px; }
.lesson-label { color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.lesson-quote { white-space: pre-wrap; font-size: 15px; }
.improved { color: var(--brand-ink); }
.sample-answer { font-size: 16px; line-height: 1.9; margin-top: 12px; white-space: pre-wrap; }
.small-note { color: var(--muted); font-size: 12px; line-height: 1.8; }
.sample-block { margin-top: 20px; }
#practice-again { margin-top: 22px; }
.review-companion { position: sticky; top: 20px; padding: 20px; }
.review-heading { display: flex; align-items: center; gap: 12px; }
.coach-mark { display: grid; place-items: center; width: 36px; height: 36px; background: var(--brand-soft); border: 1px solid #ffd7c8; color: var(--brand-ink); border-radius: 6px; font-weight: 650; font-size: 17px; }
.review-heading .section-meta { font-size: 10px; letter-spacing: .7px; }
.review-heading h3 { font-size: 15px; margin-top: 2px; }
.review-description { color: var(--muted); font-size: 13px; line-height: 1.85; margin: 16px 0; }
.review-controls { display: flex; flex-direction: column; gap: 10px; }
.review-session-controls { display: flex; gap: 8px; }
.review-session-controls:has(button[hidden]):not(:has(button:not([hidden]))) { display: none; }
#review-status { color: var(--muted); font-size: 12px; line-height: 1.8; }
#review-status.error { color: var(--error); }
.review-suggestions { display: flex; flex-wrap: wrap; gap: 7px; border-top: 1px solid var(--line); padding-top: 16px; margin: 16px 0; }
.review-suggestions button { font-size: 12px; min-height: 34px; padding: 6px 9px; }
#review-transcript { max-height: 350px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
#review-transcript:empty { display: none; }
#review-transcript .turn { margin-left: 0; margin-right: 0; font-size: 13px; }
#review-audio { margin-top: 12px; }
footer { display: flex; justify-content: space-between; gap: 16px; padding-top: 20px; margin-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.8; }
footer a { margin-left: 8px; text-decoration: none; }
footer a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
@media (max-width: 1100px) {
  .workspace, .report-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }
  .session-format { font-size: 11px; }
  .question-section, .session-controls, .conversation { padding-left: 20px; padding-right: 20px; }
  .toolbar #end { font-size: 12px; padding-left: 8px; padding-right: 8px; }
}
@media (max-width: 850px) {
  .workspace, .report-layout { grid-template-columns: 1fr; }
  .guide-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .guide-steps li { margin: 0; }
  #vocabulary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .vocab-row + .vocab-row { border-top: 0; }
  .review-companion { position: static; grid-row: 1; }
  .session-format { display: none; }
  .topic-selectors { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 14px; }
  .appbar-inner { min-height: 58px; padding: 0 16px; gap: 12px; }
  .brand { gap: 14px; }
  .aiworks-logo { width: 106px; }
  .brand-divider { height: 20px; }
  .product-name { font-size: 15px; }
  .product-name span { font-size: 11px; margin-left: 6px; }
  .product-type { display: none; }
  main { padding: 22px 16px 16px; }
  .page-header { align-items: flex-start; flex-direction: column; gap: 14px; margin-bottom: 18px; }
  h1 { font-size: 24px; }
  .subtitle { font-size: 12px; }
  .status { max-width: 100%; }
  .setup { padding: 14px; gap: 14px; }
  .topic-selectors { display: grid; grid-template-columns: 1fr; gap: 12px; min-width: 0; }
  .topic-selectors label { min-width: 0; font-size: 11px; }
  select { font-size: 13px; padding-left: 8px; padding-right: 4px; }
  input { min-width: 0; }
  button, select, input { min-height: 42px; }
  .workspace { margin-top: 16px; }
  .question-section { padding: 18px; }
  .question-top { margin-bottom: 18px; }
  .part-label, .question-progress { font-size: 11px; }
  #progress { font-size: 12px; margin-left: 4px; }
  #question { font-size: 23px; min-height: 0; }
  #cue-points { font-size: 13px; }
  .session-controls { padding: 14px 16px; }
  .toolbar { gap: 8px; }
  .toolbar #start { flex: 1 0 auto; white-space: nowrap; }
  .toolbar #end { order: 3; padding-left: 0; }
  .toolbar #camera { order: 4; }
  .session-timer { order: 5; }
  .toolbar #pause { min-width: 60px; }
  .notice { font-size: 11px; }
  .conversation { padding: 18px 16px 0; }
  #transcript { height: 280px; }
  .guide-panel, .report-content, .review-companion { padding: 18px; }
  .guide-steps, #vocabulary { display: block; }
  .guide-steps li { margin-bottom: 18px; }
  .vocab-row { flex-direction: row; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
  .vocab-row + .vocab-row { border-top: 1px solid var(--line); }
  .guide-actions { gap: 10px; }
  .guide-actions button { flex: 1; }
  .report-heading { align-items: flex-start; flex-direction: column; gap: 14px; }
  .report-heading h2 { font-size: 22px; }
  .teaching-grid { grid-template-columns: 1fr; gap: 20px; }
  .lesson-comparison { grid-template-columns: 1fr; gap: 12px; }
  .review-suggestions button { min-height: 42px; }
  footer { flex-direction: column; gap: 7px; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
