:root {
  color-scheme: dark;
  --page: #0d1113;
  --surface: #151b1e;
  --surface-soft: #1b2327;
  --ink: #f2f5f4;
  --muted: #9da9aa;
  --line: #303a3e;
  --green: #43d3bd;
  --green-soft: #12342f;
  --gold: #f1b84b;
  --gold-soft: #2a2417;
  --red: #f4796b;
  --red-soft: #2d1b1c;
  --blue: #70a7d3;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
body { min-width: 320px; min-height: 100vh; margin: 0; color: var(--ink); background: var(--page); }
button, input, select, summary { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid rgba(67, 211, 189, 0.2); outline-offset: 2px; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 64px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 23, 25, 0.96);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 18px; font-weight: 800; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; color: #07110f; background: var(--green); border-radius: 6px; }
.header-actions, .connection-state { display: flex; align-items: center; gap: 12px; }
.connection-state { color: var(--muted); font-size: 14px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(241, 184, 75, 0.12); }
.status-dot.ready { background: var(--green); box-shadow: 0 0 0 4px rgba(67, 211, 189, 0.12); }
.status-dot.error { background: var(--red); box-shadow: 0 0 0 4px rgba(244, 121, 107, 0.12); }
.quiet-button, .secondary-button, .control-button, .staff-actions button, .feedback-buttons button, .correction-row button, .diagnostic-actions button, .quick-test-buttons button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
}
.quiet-button:hover, .secondary-button:hover, .control-button:hover:not(:disabled), .staff-actions button:hover, .feedback-buttons button:hover, .correction-row button:hover { border-color: var(--green); color: var(--green); }

main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.readiness { width: min(640px, 100%); min-height: calc(100vh - 116px); margin: 0 auto; padding: 96px 0 64px; }
.readiness h1 { margin: 8px 0 32px; font-size: 40px; }
.readiness-list { border-top: 1px solid var(--line); }
.readiness-list div { min-height: 52px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.readiness-list strong { color: var(--gold); font-size: 14px; }
.readiness-list strong.ready { color: var(--green); }
.readiness-list strong.error { color: var(--red); }
.readiness-result { margin: 24px 0 0; color: var(--muted); }

.hero { min-height: 540px; padding: 88px 0 64px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: 13px; font-weight: 800; }
.hero h1 { margin: 0; font-size: 72px; line-height: 1; }
.hero-subtitle { margin: 16px 0 0; font-size: 28px; font-weight: 700; }
.hero-status { margin: 22px 0 0; display: flex; align-items: center; gap: 10px; color: var(--green); font-weight: 700; }
.hero-copy { margin: 28px 0 0; font-size: 20px; }
.hero-detail { max-width: 620px; margin: 8px 0 0; color: var(--muted); line-height: 1.8; }
.hero-actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 10px; }
.start-button { min-height: 46px; padding: 0 24px; border: 1px solid var(--green); border-radius: 6px; color: #061310; background: var(--green); font: inherit; font-weight: 800; }
.language-line { margin: 24px 0 0; color: var(--muted); font-size: 14px; }

.suggestions { padding: 58px 0 64px; border-bottom: 1px solid var(--line); }
.section-heading, .panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.section-heading h2, .panel-heading h2 { margin: 0; font-size: 28px; }
.section-heading > p, .panel-heading > span { margin: 0; color: var(--muted); font-size: 13px; }
.suggestion-grid { margin-top: 28px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.suggestion-grid article { min-height: 132px; padding: 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.suggestion-grid article:first-child { border-top: 3px solid var(--green); }
.suggestion-grid span { color: var(--green); font-size: 13px; font-weight: 800; }
.suggestion-grid p { margin: 16px 0 0; line-height: 1.65; }

.workspace { margin: 64px 0 28px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.view-switch { display: flex; padding: 0 24px; border-bottom: 1px solid var(--line); }
.view-switch button { min-height: 54px; padding: 0 18px; border: 0; border-bottom: 3px solid transparent; color: var(--muted); background: transparent; }
.view-switch button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--green); font-weight: 800; }
.trial-panel { min-height: 480px; padding: 28px; }

.voice-orbit { width: 100%; height: 150px; position: relative; display: grid; place-items: center; overflow: hidden; background: var(--surface-soft); }
#voiceCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.voice-state { position: relative; z-index: 1; text-align: center; pointer-events: none; }
.voice-state span { display: block; font-size: 20px; font-weight: 800; }
.voice-state small { display: block; margin-top: 6px; color: var(--muted); }
.conversation { min-height: 150px; max-height: 340px; margin-top: 18px; padding: 0 4px; overflow-y: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.message { padding: 16px 2px; }
.message + .message { border-top: 1px solid var(--line); }
.message span { color: var(--green); font-size: 12px; font-weight: 800; }
.message.user-message span { color: var(--gold); }
.message p { margin: 6px 0 0; line-height: 1.65; overflow-wrap: anywhere; }
.pending-transcript { margin-top: 12px; padding: 12px 14px; border-left: 3px solid var(--gold); background: var(--gold-soft); }
.pending-transcript span { color: var(--gold); font-size: 12px; font-weight: 800; }
.pending-transcript p { margin: 5px 0 0; }
.primary-controls { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; }
.interrupt { border-color: rgba(244, 121, 107, 0.55); color: var(--red); }
.text-test { margin-top: 20px; }
.text-test label { display: block; margin-bottom: 8px; font-weight: 700; }
.text-test > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.text-test input, .correction-row input, .correction-row select { min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--surface); }
.text-test button { min-height: 44px; padding: 0 22px; border: 1px solid var(--green); border-radius: 6px; color: #061310; background: var(--green); font: inherit; font-weight: 800; }
.text-test small { display: block; margin-top: 7px; color: var(--muted); }

.staff-sync, .analytics-panel { padding-top: 34px; }
.access-notice { margin: 20px 0 0; padding: 14px 16px; border: 1px solid rgba(212, 177, 106, 0.55); color: var(--gold); background: rgba(212, 177, 106, 0.08); line-height: 1.55; }
.panel-heading.compact { align-items: center; }
.panel-heading h3 { margin: 0; font-size: 20px; }
.demo-badge { padding: 5px 8px; border: 1px solid var(--gold); border-radius: 4px; color: var(--gold); font-size: 12px; font-weight: 800; }
.staff-brief-grid { margin: 24px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
.staff-brief-grid > div { min-height: 66px; padding: 12px 0; border-top: 1px solid var(--line); }
.staff-brief-grid .wide { grid-column: 1 / -1; }
.staff-brief-grid dt { color: var(--muted); font-size: 12px; }
.staff-brief-grid dd { margin: 6px 0 0; line-height: 1.45; overflow-wrap: anywhere; }
#staffConfirmed, #staffChildActions { white-space: pre-line; }
.developer-staff-field { display: none; }
.staff-boundary { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.feedback-section, .history-section { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--line); }
.feedback-buttons, .staff-actions { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.feedback-buttons button[aria-pressed="true"] { color: #061310; border-color: var(--green); background: var(--green); }
.feedback-buttons button[data-feedback="safety"][aria-pressed="true"] { border-color: var(--red); background: var(--red); }
.correction-row { margin-top: 18px; display: grid; grid-template-columns: auto 140px minmax(180px, 1fr) auto; gap: 8px; align-items: center; }
.correction-row label { font-size: 13px; font-weight: 700; }
.feedback-note, .empty-guidance { color: var(--muted); font-size: 12px; }
.history-section h3 { margin: 0; font-size: 18px; }
.history-section ol { margin: 14px 0 0; padding-left: 22px; color: var(--muted); }
.history-section li { padding: 5px 0; line-height: 1.5; }

.analytics-grid { margin-top: 28px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.analytics-grid article { min-height: 112px; padding: 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.analytics-grid span { display: block; color: var(--muted); font-size: 13px; }
.analytics-grid strong { display: block; margin-top: 14px; font-size: 25px; }

.alert { margin: 18px 0 0; padding: 13px 15px; color: var(--red); border: 1px solid rgba(244, 121, 107, 0.55); border-radius: 6px; background: var(--red-soft); }
.trial-notice { margin: 22px 0; padding: 16px 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 18px; color: var(--muted); border-top: 1px solid var(--line); font-size: 12px; line-height: 1.65; }
.trial-notice strong { color: var(--ink); }
.diagnostics { margin: 20px 0 50px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.diagnostics summary { padding: 16px 18px; cursor: pointer; font-weight: 700; }
.diagnostic-grid { padding: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; border-top: 1px solid var(--line); }
.diagnostic-grid dl { margin: 0; }
.diagnostic-grid dl div { min-height: 36px; display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; align-items: center; border-bottom: 1px solid var(--line); }
.diagnostic-grid dt { color: var(--muted); }
.diagnostic-grid dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.diagnostic-actions, .quick-tests, .sandbox { padding: 0 18px 18px; }
.diagnostic-actions { display: flex; gap: 8px; }
.quick-tests, .sandbox { padding-top: 18px; border-top: 1px solid var(--line); }
.quick-test-buttons { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }

.walkthrough-dialog { width: min(520px, calc(100% - 28px)); padding: 28px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); }
.walkthrough-dialog::backdrop { background: rgba(0, 0, 0, 0.72); }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; }
.dialog-heading button { width: 36px; height: 36px; border: 0; color: var(--muted); background: transparent; font-size: 26px; }
.walkthrough-dialog h2 { margin: 8px 0 18px; }
.walkthrough-dialog ol { padding-left: 24px; line-height: 2; }
.walkthrough-dialog .start-button { width: 100%; margin-top: 12px; }
footer { min-height: 52px; padding: 16px; color: var(--muted); text-align: center; border-top: 1px solid var(--line); font-size: 12px; }

@media (max-width: 820px) {
  .app-header { padding: 0 16px; }
  main { width: min(100% - 24px, 1180px); }
  .hero { min-height: 500px; padding-top: 64px; }
  .hero h1 { font-size: 56px; }
  .hero-subtitle { font-size: 23px; }
  .suggestion-grid, .analytics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .correction-row { grid-template-columns: 1fr 1fr; }
  .correction-row label { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .header-actions .connection-state { display: none; }
  .hero { min-height: auto; padding: 54px 0 48px; }
  .hero h1 { font-size: 48px; }
  .suggestions { padding: 42px 0; }
  .section-heading, .panel-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .suggestion-grid, .analytics-grid, .staff-brief-grid, .diagnostic-grid { grid-template-columns: 1fr; }
  .staff-brief-grid .wide { grid-column: auto; }
  .workspace { margin-top: 42px; }
  .view-switch { padding: 0 8px; overflow-x: auto; }
  .view-switch button { padding: 0 12px; white-space: nowrap; }
  .trial-panel { padding: 20px 16px; }
  .primary-controls button { flex: 1 1 42%; }
  .primary-controls .start-button { flex-basis: 100%; }
  .text-test > div, .correction-row { grid-template-columns: 1fr; }
  .correction-row label { grid-column: auto; }
  .trial-notice { grid-template-columns: 1fr; gap: 5px; }
}
