:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --success: #059669;
  --success-soft: #ecfdf5;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", Roboto, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.page-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 16px 56px;
}

.top-bar {
  margin-bottom: 18px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.progress-track {
  width: 100%;
  height: 7px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2563eb, #3b82f6);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
}

@media (max-width: 600px) {
  .card {
    padding: 20px 16px;
  }
}

h1 {
  font-size: 24px;
  line-height: 1.35;
  margin: 0 0 12px;
  color: #0f172a;
}

h2 {
  font-size: 19px;
  line-height: 1.4;
  margin: 0 0 8px;
  color: #0f172a;
}

h3 {
  font-size: 16px;
  margin: 22px 0 10px;
  color: #0f172a;
}

.subtitle {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 20px;
}

.notice-box {
  background: var(--primary-soft);
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 14px;
  color: #1e3a8a;
  margin: 16px 0;
}

.notice-box.warning {
  background: var(--warning-soft);
  border-color: #fde68a;
  color: #92400e;
}

.notice-box.danger {
  background: var(--danger-soft);
  border-color: #fecaca;
  color: #991b1b;
}

.notice-box.success {
  background: var(--success-soft);
  border-color: #a7f3d0;
  color: #065f46;
}

.q-block {
  padding: 18px 0;
  border-bottom: 1px solid #f1f5f9;
}

.q-block:last-of-type {
  border-bottom: none;
}

.q-title {
  font-size: 15.5px;
  font-weight: 600;
  margin: 0 0 12px;
  color: #0f172a;
}

.q-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 2px 8px;
  border-radius: 999px;
  margin-right: 6px;
  vertical-align: 1px;
}

.option-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.option-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.15s, background-color 0.15s;
  font-size: 14.5px;
  min-height: 44px;
}

.option-item:hover {
  border-color: #93c5fd;
  background: #f8fafc;
}

.option-item.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.option-item input[type="radio"],
.option-item input[type="checkbox"] {
  margin-top: 4px;
  accent-color: var(--primary);
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.likert-wrap {
  margin-top: 8px;
}

.likert-endpoints {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.likert-scale {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.likert-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.likert-btn:hover {
  border-color: #93c5fd;
  background: #f8fafc;
}

.likert-btn.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.scenario-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 16px 18px;
  margin: 14px 0 18px;
}

.scenario-context {
  font-size: 14.5px;
  color: #334155;
  margin: 0 0 10px;
}

.scenario-quote {
  font-size: 16.5px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.7;
  margin: 0;
}

.blank-slot {
  display: inline-block;
  min-width: 56px;
  padding: 0 8px;
  margin: 0 3px;
  border-bottom: 2.5px solid var(--primary);
  color: var(--primary);
  text-align: center;
  font-weight: 700;
}

textarea, input[type="text"], input[type="number"], input[type="tel"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s;
}

textarea:focus, input[type="text"]:focus, input[type="number"]:focus, input[type="tel"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.inline-cloze-input {
  display: inline-block !important;
  width: 96px !important;
  padding: 4px 8px !important;
  margin: 0 4px;
  text-align: center;
  font-weight: 600;
  font-size: 15.5px !important;
  border-radius: 8px !important;
}

.char-hint {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 6px;
}

.error-msg {
  color: var(--danger);
  font-size: 13.5px;
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--danger-soft);
  border: 1px solid #fecaca;
  border-radius: 8px;
  display: none;
}

.error-msg.visible {
  display: block;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 46px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-secondary {
  background: #e2e8f0;
  color: #1e293b;
}

.btn-secondary:hover {
  background: #cbd5e1;
}

.code-card {
  background: #f0fdf4;
  border: 2px dashed #10b981;
  border-radius: 14px;
  padding: 22px 18px;
  text-align: center;
  margin: 20px 0;
}

.code-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #065f46;
  margin: 8px 0 14px;
  word-break: break-all;
}

.part5-section-title {
  margin-top: 24px;
  padding: 8px 12px;
  background: #f1f5f9;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #334155;
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  margin-top: 16px;
  cursor: pointer;
  font-size: 14.5px;
}

.consent-row input {
  margin-top: 4px;
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.step-tag {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}
