:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --card: #ffffff;
  --ink: #172033;
  --muted: #647085;
  --line: #dde5f1;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --shadow: 0 22px 80px rgba(24, 39, 75, 0.12);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 32rem),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
  color: var(--ink);
}

.shell {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 28px 16px 48px;
}

.card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(221, 229, 241, 0.9);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: clamp(20px, 4vw, 36px);
}

.hidden { display: none !important; }

.eyebrow {
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1, h2 {
  margin: 10px 0 12px;
  line-height: 1.15;
}

h1 { font-size: clamp(34px, 6vw, 64px); }
h2 { font-size: clamp(24px, 4vw, 38px); }

.lead {
  max-width: 780px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.flow-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 24px 0;
}

.flow-grid div {
  min-height: 96px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f8fbff;
}

.flow-grid strong {
  display: block;
  width: 30px;
  height: 30px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  text-align: center;
  line-height: 30px;
}

.flow-grid span { color: var(--muted); line-height: 1.5; }

.question-preview {
  margin: 24px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.preview-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.preview-head h2 {
  margin: 6px 0 0;
  font-size: clamp(22px, 4vw, 32px);
}

.preview-head p {
  max-width: 360px;
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}

.preview-list {
  display: grid;
  gap: 10px;
}

.preview-list article {
  padding: 15px;
  border: 1px solid #e4ebf5;
  border-radius: 16px;
  background: #fff;
}

.preview-list article span {
  display: inline-flex;
  margin-bottom: 7px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.preview-list article strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 16px;
}

.preview-list article p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.notice {
  padding: 14px 16px;
  border: 1px solid #bfdbfe;
  border-radius: 16px;
  background: #eff6ff;
  color: #1e3a8a;
  line-height: 1.6;
}

.auth-panel {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
}

.auth-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.auth-head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.auth-head h2 { margin: 6px 0 10px; font-size: clamp(22px, 4vw, 32px); }
.auth-status { margin: 0 0 14px; color: var(--muted); line-height: 1.7; }

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.auth-grid label { display: grid; gap: 7px; }
.auth-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.auth-grid input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 12px;
  font: inherit;
}

.result-card {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #bfdbfe;
  border-radius: 16px;
  background: #eff6ff;
  color: #1e3a8a;
  line-height: 1.6;
}

.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.consent input { margin-top: 5px; }

.actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 22px;
}

.actions.split { justify-content: space-between; }

button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

button:hover:not(:disabled) { transform: translateY(-1px); }
button:disabled { cursor: not-allowed; opacity: 0.48; }

.primary { background: var(--primary); color: #fff; }
.primary:hover:not(:disabled) { background: var(--primary-dark); }
.secondary { background: #e8eef8; color: #24324a; }
.ghost { background: #eef4ff; color: var(--primary); padding: 9px 14px; }

.hint { color: var(--muted); font-size: 13px; }

.interview-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.status-pill {
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.status-pill.recording { background: #fee2e2; color: var(--danger); }
.status-pill.done { background: #dcfce7; color: var(--success); }

.progress {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 18px 0;
}

.progress span {
  height: 8px;
  border-radius: 999px;
  background: #dbe4f0;
}
.progress span.active { background: var(--primary); }
.progress span.done { background: var(--success); }

.video-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: #0f172a;
  aspect-ratio: 16 / 9;
}

video {
  width: 100%;
  max-height: 62vh;
  background: #0f172a;
  border-radius: 20px;
}

#liveVideo {
  height: 100%;
  object-fit: cover;
}

.video-overlay {
  position: absolute;
  inset: auto 16px 16px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.74);
  color: #fff;
  font-weight: 700;
}

.question-box {
  margin: 18px 0 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #f8fbff;
}

.question-box p {
  margin: 0 0 16px;
  font-size: clamp(18px, 3vw, 24px);
  line-height: 1.7;
  font-weight: 700;
}

.timer-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.timer {
  font-variant-numeric: tabular-nums;
  font-size: 34px;
  font-weight: 900;
  color: var(--primary);
}

.timer-sub {
  margin-left: 10px;
  color: var(--muted);
}

.debug-panel {
  margin-top: 18px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
  color: var(--muted);
}

pre {
  overflow: auto;
  padding: 14px;
  border-radius: 14px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.55;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 18px 0;
}

.summary-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.summary-grid strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}

@media (max-width: 720px) {
  .shell { padding: 12px; }
  .card { border-radius: 22px; }
  .flow-grid { grid-template-columns: repeat(2, 1fr); }
  .preview-head, .auth-head { flex-direction: column; }
  .auth-grid { grid-template-columns: 1fr; }
  .interview-header, .timer-row, .actions.split { align-items: stretch; flex-direction: column; }
  .summary-grid { grid-template-columns: 1fr; }
  button { width: 100%; }
}
