* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --ink: #1f2937;
  --muted: #6b7280;
  --bg: #f3f4f6;
  --card: #ffffff;
  --border: #e5e7eb;
  --green: #059669;
  --amber: #b45309;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

.screen { display: none; max-width: 1100px; margin: 0 auto; padding: 24px 16px 64px; }
.screen.active { display: block; }
.hidden { display: none !important; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 36px;
  max-width: 820px;
  margin: 32px auto;
}
.card.center { text-align: center; }

h1 { font-size: 26px; margin-bottom: 16px; }
h2 { font-size: 18px; margin: 18px 0 8px; }

/* language switching: only the selected language is visible */
body.lang-en .zh { display: none !important; }
body.lang-zh .en { display: none !important; }
.lang-switch { float: right; display: flex; gap: 6px; }
.btn-pill { border-radius: 999px; padding: 6px 16px; font-size: 13.5px; }
body.lang-en #btn-lang-en, body.lang-zh #btn-lang-zh {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.lead { font-size: 17px; margin-bottom: 8px; }
.note { color: var(--muted); font-size: 14px; margin-top: 12px; }
ul { padding-left: 22px; margin: 8px 0 12px; }
li { margin: 6px 0; }

.form-row { margin: 20px 0 16px; }
.form-row label { display: block; font-weight: 600; margin-bottom: 6px; }
.form-row input {
  width: 100%; max-width: 380px; padding: 10px 12px; font-size: 16px;
  border: 1px solid var(--border); border-radius: 8px;
}
.form-row input:focus { outline: 2px solid var(--accent); border-color: transparent; }

.btn {
  display: inline-block; border: none; border-radius: 8px; cursor: pointer;
  font-size: 15px; font-weight: 600; padding: 10px 18px;
  background: #e5e7eb; color: var(--ink);
}
.btn:hover { filter: brightness(0.96); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); filter: none; }
.btn-lg { font-size: 17px; padding: 13px 30px; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--ink); }

.status-line { margin-top: 10px; color: var(--muted); min-height: 1.4em; }
.resume-box {
  border: 1px solid #bfdbfe; background: #eff6ff; border-radius: 10px;
  padding: 16px 18px; margin-bottom: 22px;
}
.resume-box .btn { margin: 10px 8px 0 0; }

/* ---------- trial ---------- */
.trial-header { max-width: 1060px; margin: 0 auto 14px; }
.progress-track { height: 8px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.trial-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 6px; color: var(--muted); font-size: 14px;
}
.sync-badge { font-size: 13px; color: var(--amber); }

.prompt-box {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 18px; max-width: 1060px; margin: 0 auto 14px;
}
.prompt-caption { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 4px; }
.prompt-text { font-size: 19px; font-weight: 600; min-height: 1.4em; }

.video-row {
  display: flex; gap: 14px; justify-content: center; max-width: 1060px; margin: 0 auto;
}
.video-cell {
  flex: 1 1 0; min-width: 0; background: #111; border-radius: 10px; overflow: hidden;
  position: relative;
}
.video-cell video { width: 100%; max-height: 430px; display: block; background: #111; }
.video-label {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  padding: 3px 12px; border-radius: 999px; font-weight: 700; font-size: 14px; color: #fff;
}
.label-a { background: #7c3aed; }
.label-b { background: #ea580c; }
.video-err {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fca5a5; background: #111; font-weight: 600; z-index: 1;
}
.video-tools { max-width: 1060px; margin: 8px auto 4px; text-align: center; }

.questions { max-width: 1060px; margin: 10px auto 0; }
.q-row {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 16px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 16px;
}
.q-text { flex: 1 1 auto; font-weight: 600; }
.q-btns { display: flex; gap: 8px; flex: 0 0 auto; }
.q-btn {
  min-width: 108px; padding: 10px 14px; border-radius: 8px; cursor: pointer;
  border: 2px solid var(--border); background: #fff; font-size: 15px; font-weight: 600;
}
.q-btn:hover { border-color: #9ca3af; }
.q-btn.sel-a { border-color: #7c3aed; background: #f3e8ff; color: #6d28d9; }
.q-btn.sel-b { border-color: #ea580c; background: #ffedd5; color: #c2410c; }

.trial-footer { max-width: 1060px; margin: 16px auto 0; text-align: center; }
.trial-footer .hint { color: var(--muted); font-size: 13.5px; margin-top: 8px; }

code {
  background: #eef2ff; border: 1px solid #c7d2fe; border-radius: 6px;
  padding: 2px 8px; font-size: 15px;
}

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  .screen { padding: 10px 8px 48px; }
  .card { padding: 20px 16px; margin: 12px auto; }
  h1 { font-size: 22px; }
  .lang-switch { float: none; justify-content: flex-end; margin-bottom: 10px; }

  /* keep the two videos side by side — comparison needs both at once */
  .video-row { gap: 6px; }
  .video-cell video { max-height: 38vh; }
  .video-label { font-size: 12px; padding: 2px 9px; top: 6px; left: 6px; }
  .prompt-box { padding: 10px 12px; }
  .prompt-text { font-size: 16px; }

  .q-row { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px; }
  .q-text { font-size: 14.5px; }
  .q-btns { justify-content: stretch; }
  .q-btn { flex: 1 1 0; min-width: 0; padding: 13px 8px; }
  .trial-footer .btn-lg { width: 100%; }
  .kbd { display: none; }
}
