:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1e222b;
  --text: #e8eaed;
  --text-dim: #9aa0aa;
  --accent: #4f8cff;
  --accent-soft: #2a3550;
  --border: #2a2f3a;
  --danger: #ff6b6b;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 22px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { font-weight: 600; font-size: 15px; min-width: 0; }
.lang-switch { display: flex; gap: 6px; flex: 0 0 auto; }
.lang-btn {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
}
.lang-btn.active { color: #fff; background: var(--accent-soft); border-color: var(--accent); }
.lang-btn:hover { color: #fff; }

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

.screen { animation: fade .25s ease; }
.hidden { display: none !important; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

h1 { font-size: 22px; margin: 0 0 16px; }
.greeting { font-weight: 600; }
.intro { color: var(--text); }
.consent-items { padding-left: 22px; color: var(--text); }
.consent-items li { margin: 6px 0; }
.confirm { color: var(--text-dim); font-size: 14px; margin-top: 16px; }

.btn-primary {
  display: inline-block;
  padding: 11px 28px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  cursor: pointer;
  transition: background .15s;
}
.btn-primary:hover { background: #3d7ceb; }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.progress { margin-bottom: 20px; }
.progress-bar {
  height: 6px;
  background: var(--panel-2);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width .3s;
}
.progress-text { color: var(--text-dim); font-size: 13px; margin-top: 6px; }

.module-title {
  margin: 28px 0 14px;
  padding: 10px 14px;
  background: var(--panel);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  font-weight: 600;
  font-size: 15px;
}

.question { margin-bottom: 26px; padding: 16px 18px; background: var(--panel); border-radius: var(--radius); }
.q-title { font-size: 15px; font-weight: 500; margin-bottom: 12px; }
.q-num { color: var(--accent); font-weight: 700; }
.q-hint { color: var(--text-dim); font-size: 12px; margin-left: 6px; font-weight: 400; }

.options { display: flex; flex-direction: column; gap: 8px; }
.options.likert { flex-direction: row; flex-wrap: wrap; gap: 10px; }

.option {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.option:hover { border-color: var(--accent); background: var(--panel-2); }
.option input[type="radio"],
.option input[type="checkbox"] { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }
/* basis 设为 0 而非 auto：长选项不会先整块换行，而是在同一行内收窄换行 */
.opt-text { font-size: 14px; flex: 1 1 0%; min-width: 0; }

/* 量表数值徽标（1–5），对齐 Word 原量表写法 */
.scale-num {
  flex: 0 0 auto;
  min-width: 18px;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-align: center;
}

.other-input {
  flex: 1 1 100%;
  margin-left: 26px;
  padding: 6px 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
}
.other-input:focus { outline: none; border-color: var(--accent); }

.limit-tip {
  color: var(--danger);
  font-size: 12px;
  margin-top: 6px;
  opacity: 0;
  transition: opacity .2s;
}
.limit-tip.show { opacity: 1; }

.survey-actions { margin-top: 30px; text-align: center; }
.error { color: var(--danger); font-size: 14px; margin-top: 12px; }

.data-statement {
  margin-top: 24px;
  padding: 12px 16px;
  background: var(--panel);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 13px;
}

@media (max-width: 600px) {
  main { padding: 16px 14px 60px; }
  .options.likert { flex-direction: column; }
  .brand { font-size: 13px; }
}

.preview-note {
  margin: 0 0 22px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text-dim);
  font-size: 0.875rem;
}
#consent-screen h1 { font-size: clamp(1.4rem, 3.5vw, 2rem); line-height: 1.3; }
.q-title { font-size: 1rem; }
.lang-btn, .q-hint { font-size: 0.875rem; }
.btn-primary { background: #305cca; }
.btn-primary:hover { background: #284da8; }
:focus-visible { outline: 2px solid #9ab9ff; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
