/* 微光救援队 · 队员心理自评系统
   黑白灰简洁风格，适配移动端与 PC */

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

:root {
  --bg: #f4f4f4;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #8a8a8a;
  --light: #b5b5b5;
  --border: #e0e0e0;
  --soft: #f0f0f0;
  --black: #000000;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--text);
  text-decoration: none;
}

/* ---------- 顶栏 ---------- */
.header {
  background: var(--black);
  color: #fff;
  padding: 16px 20px;
}

.header-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.header .logo {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
}

.header .slogan {
  font-size: 12px;
  color: #b5b5b5;
  letter-spacing: 1px;
}

.header .nav {
  margin-left: auto;
  font-size: 13px;
}

.header .nav a {
  color: #e5e5e5;
  padding: 4px 10px;
  border: 1px solid #555;
  border-radius: 4px;
  transition: all .2s;
}

.header .nav a:hover {
  background: #fff;
  color: #000;
  border-color: #fff;
}

/* ---------- 布局 ---------- */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  width: 100%;
  flex: 1;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

.text-muted { color: var(--muted); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.input:focus {
  border-color: var(--black);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .08);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .2s;
  width: 100%;
}

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

.btn-primary:hover { background: #333; }
.btn-primary:disabled { background: #999; cursor: not-allowed; }

.btn-outline {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}

.btn-outline:hover { border-color: var(--black); background: var(--soft); }

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
  width: auto;
}

.btn-row {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.btn-row .btn { width: auto; flex: 1; }

/* ---------- 量表卡片 ---------- */
.scale-item {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 12px;
  background: #fff;
  cursor: pointer;
  transition: all .2s;
  display: block;
}

.scale-item:hover { border-color: var(--black); }

.scale-item.selected {
  border-color: var(--black);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .06);
}

.scale-item .scale-name {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.scale-item .scale-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.scale-item .scale-desc {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 填写页 ---------- */
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--soft);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--black);
  transition: width .3s;
}

.progress-text {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.question {
  margin-bottom: 14px;
}

.question .q-head {
  display: flex;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  padding: 14px 14px 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
}

.question .q-num {
  flex-shrink: 0;
  color: var(--black);
  font-weight: 700;
}

.q-options {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 0 0 6px 6px;
  background: #fff;
  overflow: hidden;
}

.q-option {
  flex: 1;
  padding: 12px 4px;
  font-size: 13px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  border-right: 1px solid var(--border);
  transition: all .15s;
  user-select: none;
  -webkit-user-select: none;
}

.q-option:last-child { border-right: none; }

.q-option:hover { background: var(--soft); color: var(--text); }

.q-option.selected {
  background: var(--black);
  color: #fff;
  font-weight: 600;
}

/* 长选项纵向布局（如 BDI） */
.q-options.vertical {
  flex-direction: column;
  border-radius: 0 0 6px 6px;
}

.q-options.vertical .q-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  text-align: left;
  border-right: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.q-options.vertical .q-option:last-child { border-bottom: none; }

.q-options.vertical .q-option .radio-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  transition: all .15s;
}

.q-options.vertical .q-option:hover { background: var(--soft); }

.q-options.vertical .q-option.selected {
  background: var(--soft);
  color: var(--text);
  font-weight: 600;
}

.q-options.vertical .q-option.selected .radio-dot {
  border-color: var(--black);
  background: radial-gradient(circle, var(--black) 0 4px, #fff 4px);
}

@media (max-width: 480px) {
  .q-option { font-size: 12px; padding: 12px 2px; }
}

/* ---------- 结果页 ---------- */
.result-box {
  text-align: center;
  padding: 24px 16px;
}

.result-score {
  font-size: 56px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -1px;
}

.result-level {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 18px;
  background: var(--black);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border-radius: 20px;
  letter-spacing: 1px;
}

.result-level.normal {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--text);
}

.conclusion {
  font-size: 14px;
  line-height: 1.9;
  color: #333;
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  white-space: pre-line;
}

/* 各分数段结果与建议 */
.range-item {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.range-item:last-child { margin-bottom: 0; }

.range-item.current {
  border-color: var(--black);
  background: var(--soft);
}

.range-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.range-score { font-weight: 700; font-size: 14px; }
.range-level { font-size: 13px; color: var(--text); }
.range-tag {
  font-size: 11px;
  background: var(--black);
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
}

.range-conclusion {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
  white-space: pre-line;
}

/* 作答明细 */
.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  border: 1px solid var(--border);
}

.detail-table th {
  background: var(--soft);
  padding: 10px 8px;
  text-align: left;
  font-weight: 600;
}

.detail-table td {
  padding: 10px 8px;
  border-top: 1px solid var(--border);
  vertical-align: top;
}

.detail-table td.score {
  text-align: center;
  white-space: nowrap;
}

/* ---------- 历史记录 ---------- */
.record-item {
  display: block;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: #fff;
  transition: border-color .2s;
}

.record-item:hover { border-color: var(--black); }

.record-item .r-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.record-item .r-name { font-weight: 700; font-size: 14px; }

.record-item .r-badge {
  font-size: 12px;
  padding: 2px 10px;
  border: 1px solid var(--text);
  border-radius: 12px;
  white-space: nowrap;
}

.record-item .r-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- 提示 ---------- */
.notice {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 16px;
}

.notice-line {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 16px;
  font-size: 14px;
}

.hidden { display: none !important; }

/* ---------- 页脚 ---------- */
.footer {
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
