/* ===== 基础 ===== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f5f7fa;
  color: #1f2937;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.page { max-width: 720px; margin: 0 auto; padding: 24px 16px 80px; }
.hidden { display: none !important; }

/* ===== 卡片 ===== */
.card {
  background: #ffffff;
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
}
h1 { font-size: 22px; margin: 0 0 8px; color: #111827; }
h2 { font-size: 18px; margin: 0 0 4px; color: #111827; }
.lead { color: #4b5563; margin: 0 0 20px; }
.dim { color: #6b7280; }
.small { font-size: 13px; }

/* ===== 表单 ===== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; color: #374151; font-weight: 500; }
.req { color: #ef4444; }
input[type="text"], input[type="tel"], input[type="date"], input[type="password"] {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .grid-2 { grid-template-columns: 1fr; } }

/* ===== 题目 ===== */
.question {
  padding: 16px 0;
  border-bottom: 1px solid #f1f5f9;
}
.question:last-child { border-bottom: none; }
.q-title { font-size: 15px; color: #1f2937; margin: 0 0 10px; font-weight: 500; }
.q-index { color: #2563eb; font-weight: 600; margin-right: 6px; }
.options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
@media (max-width: 480px) { .options { grid-template-columns: repeat(5, 1fr); gap: 6px; } }
.opt {
  position: relative;
  text-align: center;
  padding: 10px 4px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  background: #ffffff;
  transition: all 0.15s;
  user-select: none;
}
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt:hover { border-color: #93c5fd; background: #eff6ff; }
.opt.selected { border-color: #2563eb; background: #2563eb; color: #ffffff; font-weight: 600; }
.opt .opt-num { display: block; font-size: 16px; font-weight: 600; }
.opt .opt-label { display: block; font-size: 11px; margin-top: 2px; opacity: 0.85; }

/* ===== 按钮 ===== */
.btn-primary {
  font: inherit;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s;
}
.btn-primary:hover { background: #1d4ed8; }
.btn-primary:disabled { background: #9ca3af; cursor: not-allowed; }
.btn-large { padding: 14px 32px; font-size: 16px; }
.gate-form { display: flex; flex-direction: column; gap: 12px; max-width: 360px; }
.error { color: #ef4444; font-size: 14px; margin: 4px 0 0; }

.actions { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 12px; }

/* ===== 完成页 ===== */
.done-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: #10b981;
  color: #ffffff;
  font-size: 36px;
  line-height: 72px;
  text-align: center;
  margin: 8px auto 16px;
}

/* ===== 遮罩 ===== */
.overlay {
  position: fixed; inset: 0;
  background: rgba(17, 24, 39, 0.45);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px;
  z-index: 999;
  color: #ffffff;
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
