/* ============================================================
 * node1-h5 样式 —— 复用 miniprogram Design Token（玫瑰金体系）
 * 主色 #B05B68 / 深 #9A4A57 / 浅粉底 #F5E3E6 / 米金 #F7E8D8
 * 移动优先（375px 基准），微信内 H5
 * ============================================================ */

:root {
  --brand: #B05B68;
  --brand-deep: #9A4A57;
  --brand-pink: #F5E3E6;
  --gold: #F7E8D8;
  --gold-deep: #8A6A4F;
  --bg: #F8F4F2;
  --card: #FFFFFF;
  --border: #EFE4E1;
  --text: #3A2E2B;
  --text-sub: #5F4F4A;
  --text-weak: #9A8C87;
  --text-faint: #C8B8B4;
  --r-14: 14px;
  --r-12: 12px;
  --r-99: 99px;
  --pad-page: 16px;
  --shadow: 0 2px 12px rgba(176, 91, 104, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.75;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

#app { max-width: 480px; margin: 0 auto; min-height: 100vh; padding: 0 var(--pad-page) 40px; }

/* ---------- 通用卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--r-14);
  box-shadow: var(--shadow);
  padding: 20px 18px;
  margin-bottom: 14px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-title::before {
  content: "";
  width: 4px; height: 16px;
  border-radius: 2px;
  background: var(--brand);
}

/* ---------- 顶部品牌 ---------- */
.brand-header {
  text-align: center;
  padding: 32px 0 24px;
}
.brand-logo {
  width: 52px; height: 52px;
  margin: 0 auto 10px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(176, 91, 104, 0.3);
}
.brand-name { font-size: 20px; font-weight: 700; color: var(--text); }
.brand-slogan { font-size: 13px; color: var(--text-weak); margin-top: 4px; }

/* ---------- 继续填报卡 ---------- */
.continue-card { text-align: center; }
.continue-title { font-size: 15px; font-weight: 600; }
.continue-sub { font-size: 12px; color: var(--text-weak); margin: 4px 0 12px; }

/* ---------- 模式选择 ---------- */
.mode-grid { display: flex; gap: 10px; margin-bottom: 4px; }
.mode-opt {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: var(--r-12);
  background: var(--card);
  padding: 12px;
  text-align: center;
  font-size: 14px;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.15s;
}
.mode-opt.selected { border-color: var(--brand); color: var(--brand-deep); background: var(--brand-pink); font-weight: 600; }

/* ---------- 顶部返回条 ---------- */
.topbar {
  display: flex; align-items: center;
  padding: 18px 0 6px;
  gap: 8px;
}
.back-btn {
  border: none; background: none;
  font-size: 15px; color: var(--text-sub);
  padding: 4px 8px 4px 0;
  cursor: pointer;
}
.back-btn::before { content: "‹"; font-size: 22px; margin-right: 2px; color: var(--brand); }
.topbar-title { font-size: 17px; font-weight: 600; flex: 1; }
.topbar-note { font-size: 12px; color: var(--text-faint); }

/* ---------- 表单 ---------- */
.field-label {
  font-size: 14px; font-weight: 600; color: var(--text);
  margin: 16px 0 10px;
  display: flex; align-items: center; gap: 6px;
}
.field-label:first-child { margin-top: 0; }
.field-label::before {
  content: "";
  width: 3px; height: 13px;
  border-radius: 2px;
  background: var(--brand);
}
.field-label .req { color: var(--brand); font-weight: 700; }

.field-hint { font-size: 12px; color: var(--text-weak); margin-top: 6px; line-height: 1.6; }

.input, .textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--r-12);
  background: var(--card);
  font-size: 15px;
  color: var(--text);
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}
.input:focus, .textarea:focus { border-color: var(--brand); }
.textarea { min-height: 88px; resize: none; line-height: 1.7; }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }

.input-row { display: flex; gap: 10px; }
.input-row > div { flex: 1; min-width: 0; }

/* ---------- 自定义下拉 ---------- */
.select { position: relative; width: 100%; cursor: pointer; }
.select-trigger {
  border: 1.5px solid var(--border);
  border-radius: var(--r-12);
  background: var(--card);
  font-size: 15px;
  color: var(--text);
  padding: 12px 14px;
  transition: border-color 0.15s;
}
.select-trigger:empty::before, .select-trigger[data-ph] { color: var(--text-faint); }
.select-options {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-12);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  z-index: 20;
  overflow: hidden;
}
.select-options.open { display: block; }
.select-options div[data-val] {
  padding: 12px 14px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.select-options div[data-val]:last-child { border-bottom: none; }
.select-options div[data-val]:active { background: var(--brand-pink); }

/* ---------- 单选/多选宫格 ---------- */
.opt-row { display: flex; gap: 10px; }
.opt-item {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: var(--r-12);
  background: var(--card);
  padding: 12px;
  text-align: center;
  font-size: 14px;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.15s;
}
.opt-item.selected { border-color: var(--brand); color: var(--brand-deep); background: var(--brand-pink); font-weight: 600; }

.tag-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-item {
  border: 1.5px solid var(--border);
  border-radius: var(--r-99);
  background: var(--card);
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.tag-item.selected { border-color: var(--brand); color: var(--brand-deep); background: var(--brand-pink); font-weight: 600; }

/* 选科宫格 */
.sub-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sub-item {
  border: 1.5px solid var(--border);
  border-radius: var(--r-12);
  background: var(--card);
  padding: 12px 6px;
  text-align: center;
  font-size: 14px;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.sub-item .sub-icon { font-size: 18px; display: block; margin-bottom: 4px; }
.sub-item.selected { border-color: var(--brand); color: var(--brand-deep); background: var(--brand-pink); font-weight: 600; }

/* 选科类别徽标 */
.cat-badge {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: var(--r-12);
  font-size: 13px;
  text-align: center;
  color: var(--text-weak);
  background: var(--bg);
}
.cat-badge.physics { color: var(--brand-deep); background: var(--brand-pink); font-weight: 600; }
.cat-badge.history { color: #6E8FA8; background: #EAF0F5; font-weight: 600; }
.cat-badge.warn { color: #A94438; background: #FBEEEC; }

/* 稳定性 slider */
.stability-row { display: flex; align-items: center; gap: 10px; }
.stability-row input[type="range"] { flex: 1; accent-color: var(--brand); }
.stab-label { font-size: 12px; color: var(--text-weak); white-space: nowrap; }
.stab-value { text-align: center; font-size: 13px; color: var(--brand-deep); margin-top: 6px; }

/* 身份展示 */
.info-row {
  display: flex; justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
}
.info-row:last-child { border-bottom: none; }
.info-row span { color: var(--text-weak); }
.info-row b { font-weight: 600; }

/* ---------- 访谈题 ---------- */
.intro-hint {
  font-size: 13px;
  color: var(--text-sub);
  background: var(--gold);
  border-radius: var(--r-12);
  padding: 10px 14px;
  margin: 10px 0 14px;
}

.sec-head { padding: 6px 0 4px; }
.sec-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--brand-deep);
  display: flex; align-items: center; gap: 6px;
}
.sec-title::before { content: "❖"; font-size: 14px; }
.sec-sub { font-size: 12px; color: var(--text-weak); margin-top: 2px; }

.q-card {
  background: var(--card);
  border-radius: var(--r-14);
  box-shadow: var(--shadow);
  padding: 18px 16px;
  margin-bottom: 14px;
}
.q-title { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.6; }
.q-type {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  color: var(--brand-deep);
  background: var(--brand-pink);
  border-radius: var(--r-99);
  padding: 1px 8px;
  vertical-align: 2px;
  margin-left: 4px;
}
.q-hint {
  font-size: 12px;
  color: var(--text-weak);
  background: var(--bg);
  border-left: 3px solid var(--gold-deep);
  border-radius: 4px;
  padding: 8px 10px;
  margin: 10px 0 12px;
  line-height: 1.7;
}
.q-options { display: flex; flex-direction: column; gap: 8px; }
.q-opt {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-12);
  background: var(--card);
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.6;
}
.q-opt:active { transform: scale(0.99); }
.q-opt.selected {
  border-color: var(--brand);
  color: var(--brand-deep);
  background: var(--brand-pink);
  font-weight: 500;
}
.q-cb { flex: 0 0 auto; font-size: 16px; line-height: 1.5; color: var(--text-faint); }
.q-opt.selected .q-cb { color: var(--brand); }
.q-label { flex: 1; }
.q-note {
  font-size: 12px;
  color: #A94438;
  background: #FBEEEC;
  border-radius: 8px;
  padding: 6px 10px;
  margin-top: -2px;
  line-height: 1.6;
}

/* ---------- 打分维度 ---------- */
.dim { margin-top: 12px; }
.dim:first-of-type { margin-top: 0; }
.dim-label { font-size: 14px; font-weight: 600; color: var(--text); }
.dim-anchor { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-faint); margin: 2px 0 8px; }
.dot-row { display: flex; justify-content: space-between; gap: 8px; }
.dot {
  flex: 1;
  height: 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-12);
  background: var(--card);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.15s;
}
.dot.on { border-color: var(--brand); background: var(--brand-pink); color: var(--brand-deep); font-weight: 700; }
.dim-hint { font-size: 11px; color: var(--text-faint); margin-top: 10px; }

/* ---------- 主按钮 ---------- */
.btn-primary {
  display: block;
  width: 100%;
  border: none;
  border-radius: var(--r-99);
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  padding: 14px 20px;
  margin-top: 20px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(176, 91, 104, 0.35);
  transition: transform 0.12s, opacity 0.2s;
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.55; box-shadow: none; }

.btn-ghost {
  display: block;
  width: 100%;
  border: 1.5px solid var(--brand);
  border-radius: var(--r-99);
  background: var(--card);
  color: var(--brand-deep);
  font-size: 15px;
  font-weight: 600;
  padding: 12px 20px;
  margin-top: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-ghost:active { background: var(--brand-pink); }

/* ---------- 轮询中 ---------- */
.polling-row { display: flex; align-items: center; gap: 14px; padding: 6px 0; }
.polling-title { font-size: 16px; font-weight: 600; }
.polling-sub { font-size: 12px; color: var(--text-weak); margin-top: 2px; }

/* ---------- 采集完成（纯入库模式静态完成态） ---------- */
.done-icon {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: #E7F5EC;
  color: #2E9E5B;
  font-size: 18px;
  font-weight: 700;
}

/* ---------- 错误提示 ---------- */
.error-box {
  background: #FBEEEC;
  border: 1px solid #E8C4BE;
  color: #A94438;
  border-radius: var(--r-12);
  padding: 12px 14px;
  font-size: 13px;
  margin: 12px 0;
  line-height: 1.6;
}
.error-box[hidden] { display: none; }

/* ---------- 加载 ---------- */
.loading-row { text-align: center; padding: 24px 0; color: var(--text-weak); font-size: 13px; }
.spinner {
  display: inline-block;
  width: 22px; height: 22px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 确认弹层 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal[hidden] { display: none !important; }
.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.modal-body {
  position: relative;
  background: var(--card);
  border-radius: var(--r-14);
  padding: 22px 20px 18px;
  width: 100%;
  max-width: 360px;
  max-height: 78vh;
  overflow-y: auto;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
.modal-title { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.modal-content { font-size: 14px; color: var(--text-sub); }
.modal-actions { margin-top: 8px; }
.modal-actions .btn-primary { margin-top: 14px; }
.modal-actions .btn-ghost { margin-top: 10px; }

/* 归并命中项 */
.match-item {
  border: 1px solid var(--border);
  border-radius: var(--r-12);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.match-name { font-size: 14px; font-weight: 600; color: var(--text); }
.match-meta { font-size: 12px; color: var(--text-weak); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%; bottom: 80px;
  transform: translateX(-50%);
  background: rgba(58, 46, 43, 0.9);
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: var(--r-99);
  z-index: 99;
  max-width: 80vw;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* 进入动画 */
.view { animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 免责声明 */
.disclaimer {
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
  padding: 18px 10px 8px;
  line-height: 1.7;
}
