:root {
  --page-max: 980px;
  --content-narrow: 680px;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-secondary: #f8f8fa;
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --border-subtle: rgba(0, 0, 0, 0.07);
  --success: #248a3d;
  --danger: #c9342c;
  --radius-large: 24px;
  --radius-control: 15px;
  --shadow-soft: 0 6px 20px rgba(0, 0, 0, 0.035);
}

* { box-sizing: border-box; }
html { min-width: 320px; overflow-x: hidden; background: var(--bg); }
body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--text-primary);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, a { font: inherit; -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
.page-shell {
  width: min(100%, var(--page-max));
  min-height: 100svh;
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}

.app-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 38px; margin-bottom: 42px; }
.product-name { color: var(--text-primary); font-size: 15px; font-weight: 600; letter-spacing: -0.02em; text-decoration: none; }
.connection-status { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); font-size: 12px; font-weight: 500; white-space: nowrap; }
.connection-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.connection-status[data-status="login"] i { background: #ff9f0a; }
.connection-status[data-status="error"] i { background: var(--danger); }

.surface { min-width: 0; border: 1px solid var(--border-subtle); border-radius: var(--radius-large); padding: 24px; background: var(--surface); box-shadow: var(--shadow-soft); }
.hero-copy-block { max-width: 740px; margin: 0 0 36px; }
.job-form-card { max-width: var(--content-narrow); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.028); }
.eyebrow, .card-label { margin: 0 0 9px; color: var(--text-secondary); font-size: 12px; font-weight: 600; letter-spacing: 0.02em; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 720px; margin-bottom: 13px; font-size: clamp(36px, 5vw, 52px); font-weight: 650; letter-spacing: -0.045em; line-height: 1.08; }
h2 { margin-bottom: 10px; font-size: clamp(23px, 6vw, 30px); letter-spacing: -0.03em; }
.hero-copy, .supporting-copy { color: var(--text-secondary); font-size: 17px; line-height: 1.55; }
.hero-copy { max-width: 38rem; margin-bottom: 0; }
.hero-copy { color: #86868b; }

label { display: block; margin-bottom: 10px; color: var(--text-primary); font-size: 14px; font-weight: 600; }
textarea, input { display: block; width: 100%; min-height: 52px; border: 1px solid #d2d2d7; border-radius: var(--radius-control); padding: 14px 15px; color: var(--text-primary); background: #fff; font-size: 16px; line-height: 1.45; outline: none; transition: box-shadow 180ms ease, border-color 180ms ease; }
textarea { min-height: 132px; resize: vertical; }
textarea:focus, input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.16); }

.primary-button, .secondary-button, .text-button { display: inline-flex; min-height: 50px; align-items: center; justify-content: center; border: 0; border-radius: 999px; padding: 0 20px; font-weight: 600; cursor: pointer; text-decoration: none; transition: opacity 180ms ease, transform 180ms ease, background 180ms ease; }
.primary-button { width: 100%; margin-top: 16px; color: #fff; background: var(--accent); }
.primary-button:hover { background: var(--accent-hover); }
.secondary-button { width: 100%; margin-top: 12px; color: var(--accent); background: rgba(0, 113, 227, 0.09); }
.text-button { min-height: auto; margin-top: 16px; padding: 4px 0; color: var(--accent); background: transparent; }
.primary-button:active, .secondary-button:active, .text-button:active { transform: scale(0.98); }
.primary-button:disabled, .secondary-button:disabled { cursor: wait; opacity: 0.55; }

.access-panel, .progress-panel, .auth-panel, .failure-panel { animation: panel-in 220ms ease-out both; }
.access-panel, .auth-panel { max-width: var(--content-narrow); margin-inline: auto; }
.progress-panel, .failure-panel { max-width: 760px; }
.progress-list { position: relative; display: grid; gap: 8px; margin: 32px 0 2px; padding: 0; list-style: none; }
.progress-list::before { position: absolute; top: 28px; bottom: 28px; left: 6px; width: 1px; background: #d2d2d7; content: ""; }
.progress-list li { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 12px; min-height: 62px; color: #98989d; font-size: 17px; transition: color 180ms ease, opacity 180ms ease; }
.stage-marker { z-index: 1; width: 13px; height: 13px; border: 1.5px solid currentColor; border-radius: 50%; background: var(--surface); }
.progress-list li[data-state="active"] { color: var(--text-primary); font-weight: 600; }
.progress-list li[data-state="active"] .stage-marker { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 5px rgba(0, 113, 227, 0.13); animation: pulse 1.5s ease-in-out infinite; }
.progress-list li[data-state="done"] { color: #5d7764; }
.progress-list li[data-state="done"] .stage-marker { border-color: var(--success); background: var(--success); }

.auth-step { margin-top: 26px; padding-top: 26px; border-top: 1px solid var(--border-subtle); }
#auth-qr { display: block; width: min(100%, 300px); aspect-ratio: 1; margin: 0 auto 22px; border: 8px solid #fff; border-radius: 18px; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.09); image-rendering: pixelated; }
.qr-instructions { margin: 0 0 8px; color: var(--text-primary); font-size: 16px; font-weight: 600; line-height: 1.55; text-align: center; }
#qr-panel .supporting-copy { margin-bottom: 0; text-align: center; font-size: 15px; }
#auth-refresh { display: flex; width: auto; margin-inline: auto; min-height: 44px; font-size: 14px; }
#sms-input { min-height: 58px; font-size: 22px; letter-spacing: 0.28em; text-align: center; }
.message { margin: 16px 0 0; line-height: 1.5; }
.error-message { color: var(--danger); }
.failure-panel { border-color: rgba(201, 52, 44, 0.18); }

.results-panel { max-width: 800px; }
.completion-heading { padding: 4px 2px 26px; }
.result-grid { display: grid; gap: 24px; }
.result-card { display: flex; flex-direction: column; width: 100%; align-self: start; justify-self: start; gap: 15px; }
.card-label { margin-bottom: 0; color: var(--text-primary); }
video, audio { display: block; width: 100%; max-width: 100%; }
video { max-height: 66vh; border-radius: 16px; background: #1d1d1f; object-fit: contain; }
audio { min-height: 46px; }
.audio-card { max-width: none; padding-block: 22px; }
.download-button { width: auto; min-width: 132px; align-self: flex-start; margin-top: 0; min-height: 48px; padding-inline: 20px; font-size: 15px; }
#audio-download, #transcript-download { color: var(--accent); background: rgba(0, 113, 227, 0.09); }
#audio-download:hover, #transcript-download:hover { background: rgba(0, 113, 227, 0.14); }
.transcript-preview { display: grid; gap: 22px; max-height: 460px; overflow: auto; border-radius: 16px; padding: 4px 0; -webkit-overflow-scrolling: touch; }
.transcript-segment { padding-bottom: 22px; border-bottom: 1px solid var(--border-subtle); }
.transcript-segment:last-child { padding-bottom: 0; border-bottom: 0; }
.transcript-timestamp { margin-bottom: 10px; color: #86868b; font-size: 12px; font-weight: 500; letter-spacing: 0.01em; }
.transcript-zh { margin-bottom: 8px; color: var(--text-primary); font-size: 16px; line-height: 1.6; }
.transcript-en { margin-bottom: 0; color: #86868b; font-size: 15px; line-height: 1.55; }

.technical-details { max-width: var(--content-narrow); margin-top: 30px; padding: 12px 2px 0; color: var(--text-secondary); }
.technical-details summary { color: var(--text-secondary); cursor: pointer; font-size: 13px; font-weight: 500; }
.technical-details dl { display: grid; grid-template-columns: minmax(110px, 0.45fr) 1fr; gap: 8px 16px; margin: 16px 0 0; font-size: 13px; line-height: 1.45; }
.technical-details dt { color: var(--text-secondary); }
.technical-details dd { min-width: 0; margin: 0; overflow-wrap: anywhere; color: var(--text-primary); }
[hidden] { display: none !important; }
button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible, summary:focus-visible, .transcript-preview:focus-visible { outline: 3px solid rgba(0, 113, 227, 0.45); outline-offset: 3px; }

@media (min-width: 700px) {
  .page-shell { padding: 26px 42px 40px; }
  .app-header { margin-bottom: 72px; }
  .surface { padding: 32px; }
  .hero-copy-block { margin-bottom: 48px; }
  .hero-copy { font-size: 19px; }
  .job-form-card { padding: 30px 32px; }
  .primary-button, .secondary-button { width: auto; min-width: 158px; }
  .result-grid { grid-template-columns: minmax(0, 1fr); }
  .video-card, .transcript-card { grid-column: 1 / -1; }
  .video-card, .transcript-card { max-width: 800px; }
  .video-card { align-items: center; }
  .video-card .card-label { align-self: stretch; }
  .video-card #video-player { width: min(100%, 360px); }
  .video-card .download-button { align-self: center; }
  .audio-card { width: 62.5%; max-width: 500px; }
  .transcript-preview { max-width: 690px; }
  .transcript-zh { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
@keyframes panel-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { transform: scale(0.92); } 50% { transform: scale(1.08); } }
