:root {
  --ink: #102345;
  --ink-soft: #626f83;
  --green: #259b44;
  --green-dark: #168132;
  --line: #e8eced;
  --mint: #38d39f;
  --mint-dark: #11775d;
  --coral: #ff8d6b;
  --violet: #7667e8;
  --shadow: 0 3px 9px rgba(25, 44, 37, .055);
  color-scheme: light;
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: #f6f8f6; }
body { margin: 0; color: var(--ink); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #124f92; outline-offset: 4px; }
h1, h2, p { margin-top: 0; }
.app-shell { width: min(100%, 580px); min-height: 100dvh; margin: 0 auto; background: #fff; box-shadow: 0 0 45px rgba(25,44,37,.035); }
.app-header { min-height: 76px; padding: 16px 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap; }
.brand__leaf { width: 34px; height: 36px; color: var(--green); stroke-width: 2; }
.brand__name { font-size: 23px; font-weight: 800; letter-spacing: -.8px; }
.brand__tagline { font-size: 13px; font-weight: 600; }
.app-header__actions { display: flex; align-items: center; gap: 16px; }
.line-status { display: flex; align-items: center; gap: 5px; white-space: nowrap; padding: 7px 9px; border: 1px solid #e2eee2; border-radius: 30px; color: var(--green-dark); background: #f1f8f1; font-size: 11px; }
.line-status > span { display: grid; place-items: center; width: 19px; height: 17px; border-radius: 50%; background: var(--green); color: white; font-size: 6px; font-weight: 800; }
.notification { position: relative; width: 24px; height: 28px; color: var(--ink); }
.notification svg { width: 24px; height: 28px; }
.notification > span { position: absolute; width: 6px; height: 6px; top: 0; right: 0; border-radius: 50%; background: #ff4949; }
.app-main { padding: 3px 22px 110px; }
.mode-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 5px 0 20px; }
.mode-heading__title { display: flex; align-items: center; gap: 10px; }
.section-kicker { margin: 0 0 4px; font-size: 10px; font-weight: 650; letter-spacing: 1.1px; color: var(--ink-soft); }
h1 { margin: 0; font-size: 22px; line-height: 1.4; letter-spacing: .4px; }
.wave-icon { display: flex; align-items: center; gap: 3px; height: 28px; color: var(--green); }
.wave-icon i { width: 3px; height: 12px; background: currentColor; border-radius: 3px; }
.wave-icon i:nth-child(2), .wave-icon i:nth-child(4) { height: 22px; }
.wave-icon i:nth-child(3) { height: 30px; }
.agent-chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; font-size: 11px; color: var(--green-dark); background: #eef7ee; border-radius: 20px; white-space: nowrap; }
.agent-chip__dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.prompt-card { display: flex; align-items: center; gap: 11px; padding: 17px 15px; border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(115deg, #f2f8ef, #fff); box-shadow: var(--shadow); }
.prompt-card__icon { flex: 0 0 41px; height: 41px; display: grid; place-items: center; background: #e5f1e5; border-radius: 50%; color: var(--green); }
.prompt-card__icon svg { width: 26px; height: 26px; }
.prompt-card strong { font-size: 16px; }
.prompt-card p { margin: 5px 0 0; font-size: 12px; line-height: 1.6; color: var(--ink-soft); }
.wake-phrase { flex-shrink: 0; margin-left: auto; padding: 5px 8px; border: 1px solid #dfeadd; background: #fff; border-radius: 8px; color: var(--green-dark); font-size: 11px; }
.voice-console { margin-top: 14px; padding: 19px 23px 20px; border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(180deg, #f7faf5 0%, #fff 35%); box-shadow: var(--shadow); }
.voice-console__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.voice-console__head strong, .voice-console__head > div > span { display: block; }
.voice-console__head strong { font-size: 14px; font-weight: 700; }
.voice-console__head > div > span { margin-top: 5px; font-size: 11px; color: var(--ink-soft); }
.voice-console__secure { display: flex; align-items: center; gap: 3px; font-size: 10px; color: #687c6d; }
.voice-console__secure svg { width: 13px; height: 13px; }
.orb-wrap { position: relative; display: grid; place-items: center; width: 224px; height: 224px; margin: 0 auto; }
.voice-ring { position: absolute; border: 1px solid rgba(56,211,159,.2); border-radius: 50%; pointer-events: none; }
.voice-ring--outer { inset: 0; }
.voice-ring--inner { inset: 17px; border-color: rgba(14,158,147,.2); }
.voice-orb { position: relative; isolation: isolate; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; width: 166px; height: 166px; padding: 0; overflow: hidden; color: white; border: 0; border-radius: 50%; background: radial-gradient(circle at 34% 27%, rgba(255,255,255,.7), transparent 13%), conic-gradient(from 210deg, #0c897d, #42daa9, #7bdca0, #ff9a72, #7b6ee7, #0c897d); box-shadow: 0 24px 50px rgba(16,139,116,.3), inset 0 0 34px rgba(255,255,255,.3); transition: transform .2s, box-shadow .2s; }
.voice-orb::after { content: ""; position: absolute; z-index: -1; inset: 7px; border-radius: inherit; background: linear-gradient(145deg, rgba(11,117,101,.8), rgba(28,146,134,.72)); backdrop-filter: blur(10px); }
.voice-orb:hover { transform: translateY(-3px) scale(1.015); }
.voice-orb:active { transform: scale(.98); }
.voice-orb:focus-visible { outline: 4px solid #fff; box-shadow: 0 0 0 7px var(--ink), 0 24px 50px rgba(16,139,116,.3); }
.voice-orb[disabled] { cursor: wait; filter: saturate(.5); }
.voice-orb__shine { position: absolute; inset: 0; background: linear-gradient(125deg, rgba(255,255,255,.24), transparent 42%); }
.voice-orb__mic { width: 39px; stroke-width: 1.8; }
.voice-orb__label { font-size: 13px; font-weight: 720; letter-spacing: .04em; }
.status-block { min-height: 62px; margin-top: 15px; text-align: center; }
.status { display: inline-flex; align-items: center; justify-content: center; gap: 9px; margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.status__dot { flex: 0 0 7px; height: 7px; border-radius: 50%; background: #aeb8b3; }
.timer { margin: 7px 0 0; color: var(--mint-dark); font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 750; letter-spacing: .12em; opacity: 0; }
.wake-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 6px; padding: 17px 15px; border: 1px solid #dce4df; border-radius: 20px; background: #f7faf8; }
.wake-card__copy { display: flex; align-items: center; gap: 11px; min-width: 0; }
.wake-card__copy strong, .wake-card__copy small { display: block; }
.wake-card__copy strong { margin-bottom: 4px; font-size: 14px; color: #17362f; }
.wake-card__copy small { color: #5f6f69; font-size: 12px; line-height: 1.5; }
.wake-card__icon { display: grid; flex: 0 0 auto; place-items: center; width: 38px; height: 38px; border-radius: 13px; color: var(--mint-dark); background: #dcf4e9; }
.wake-card__icon svg { width: 21px; height: 21px; }
.switch { position: relative; flex: 0 0 48px; width: 48px; height: 28px; padding: 0; border: 0; border-radius: 99px; background: #ccd4d0; transition: background .2s; }
.switch::after { content: ""; position: absolute; inset: -8px 0; }
.switch span { position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: white; box-shadow: 0 2px 5px rgba(23,54,47,.22); transition: transform .2s; }
.switch[aria-checked="true"] { background: var(--mint-dark); }
.switch[aria-checked="true"] span { transform: translateX(20px); }
.switch[aria-disabled="true"] { cursor: not-allowed; opacity: .6; }
.privacy-note { display: flex; align-items: flex-start; gap: 7px; margin: 16px 3px 0; color: #667568; }
.privacy-note svg { flex: 0 0 14px; width: 14px; height: 15px; margin-top: 2px; stroke-width: 1.5; }
.privacy-note p { margin: 0; font-size: 10px; line-height: 1.7; }
.result-panel { margin-top: 15px; padding: 20px 17px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); scroll-margin-top: 18px; }
.result-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.result-panel h2 { margin: 0; font-size: 19px; }
.secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 44px; padding: 0 12px; color: var(--green-dark); border: 1px solid #cfe1cc; border-radius: 9px; background: #fff; font-size: 12px; font-weight: 650; }
.secondary-button svg { width: 16px; height: 16px; }
.secondary-button:hover { background: #f2f8ef; }
.conversation { display: flex; align-items: flex-start; gap: 9px; margin-top: 12px; }
.conversation__avatar { display: grid; flex: 0 0 29px; height: 29px; place-items: center; border-radius: 50%; color: var(--green); background: #eef6ed; }
.conversation__avatar svg { width: 19px; height: 19px; }
.conversation__avatar--assistant { color: white; background: var(--green); }
.transcript-card, .assistant-card { min-width: 0; flex: 1; padding: 11px 14px; border-radius: 13px; }
.transcript-card { background: #eef6eb; }
.assistant-card { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.transcript-card > span, .assistant-card > span { color: var(--green-dark); font-size: 11px; font-weight: 650; }
.transcript-card p, .assistant-card p { margin: 5px 0 0; font-size: 14px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.assistant-card small { display: block; margin-top: 9px; color: var(--ink-soft); font-size: 10px; line-height: 1.6; }
.disclaimer { display: flex; gap: 6px; align-items: baseline; margin: 16px 0 0; padding: 9px 11px; color: #586c5a; border-radius: 8px; background: #f2f7f1; font-size: 10px; line-height: 1.7; }
.disclaimer > span { color: var(--green); }
.bottom-nav { position: fixed; z-index: 5; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, 580px); display: flex; justify-content: space-around; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.97); border-top: 1px solid var(--line); backdrop-filter: blur(12px); }
.bottom-nav__item { display: flex; flex: 1; min-height: 51px; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #7b8493; text-decoration: none; font-size: 10px; border-radius: 9px; }
.bottom-nav__item svg { width: 25px; height: 25px; stroke-width: 1.5; }
.bottom-nav__item.is-active { color: var(--green-dark); font-weight: 700; }
.bottom-nav__item.is-active svg { fill: var(--green); stroke: var(--green); }
body[data-voice-state="recording"] .voice-orb { background: conic-gradient(from 0deg, var(--coral), #f44f75, var(--violet), var(--coral)); animation: orb-breathe 1.5s ease-in-out infinite; }
body[data-voice-state="recording"] .voice-ring--inner { animation: ring-pulse 1.5s ease-out infinite; }
body[data-voice-state="recording"] .voice-ring--outer { animation: ring-pulse 1.5s .35s ease-out infinite; }
body[data-voice-state="recording"] .status__dot { background: #ef5f66; box-shadow: 0 0 0 5px rgba(239,95,102,.12); }
body[data-voice-state="recording"] .timer { opacity: 1; }
body[data-voice-state="processing"] .voice-orb { animation: slow-spin 3s linear infinite; }
body[data-voice-state="wake"] .status__dot { background: var(--mint); box-shadow: 0 0 0 5px rgba(56,211,159,.14); }
body[data-voice-state="error"] .status { color: #853e32; }
body[data-voice-state="error"] .status__dot { background: #e66556; }
body[data-voice-state="success"] .status__dot { background: var(--mint-dark); }
@keyframes orb-breathe { 50% { transform: scale(1.045); box-shadow: 0 31px 62px rgba(239,95,102,.28), inset 0 0 34px rgba(255,255,255,.3); } }
@keyframes ring-pulse { 0% { transform: scale(.82); opacity: .1; } 55% { opacity: .6; } 100% { transform: scale(1.12); opacity: 0; } }
@keyframes slow-spin { to { filter: hue-rotate(360deg); } }
@media (max-width: 480px) {
  .app-header { padding: 13px 16px; min-height: 67px; }
  .brand__name { font-size: 21px; }
  .brand__leaf { width: 29px; }
  .brand__tagline { font-size: 11px; }
  .app-header__actions { gap: 10px; }
  .line-status { font-size: 9px; padding: 6px; }
  .line-status > span, .notification { display: none; }
  .app-main { padding: 4px 16px 95px; }
  h1 { font-size: 20px; }
  .section-kicker { font-size: 9px; }
  .agent-chip { font-size: 10px; padding: 5px 7px; }
  .prompt-card { padding: 14px 12px; }
  .wake-phrase { display: none; }
  .voice-console { padding: 18px 16px; }
  .voice-console__head { margin-bottom: 13px; }
  .wake-card { padding: 15px 12px; gap: 10px; }
  .wake-card__copy { gap: 9px; }
  .wake-card__copy small { font-size: 11px; }
  .wake-card__icon { width: 32px; height: 34px; }
}
@media (max-width: 359px) {
  .brand__tagline { display: none; }
  .app-main { padding-inline: 12px; }
  .wake-card__icon { display: none; }
  .agent-chip { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
