/* =========================================================
   预约诊断页 · 页面专属样式
   依赖 main.css 设计系统变量与通用组件
   ========================================================= */

/* ========== 页面 Hero（压缩版） ========== */

.diag-hero {
  min-height: auto;
}

.diag-hero-inner {
  position: relative;
  z-index: 3;
  padding: calc(var(--header-h) + 88px) 0 110px;
}

.diag-hero-inner .hero-sub {
  max-width: 640px;
}

/* ========== 维度卡 ========== */

.dim-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 56px;
}

.dim-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 30px 28px;
  box-shadow: var(--shadow-card);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.dim-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}

.dim-card-top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.dim-card-top strong {
  font-family: var(--font-num);
  font-size: 46px;
  font-weight: 700;
  line-height: 1;
  color: var(--brand);
}

.dim-card-top small {
  font-size: 20px;
  margin-left: 2px;
}

.dim-card-top h3 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
}

.dim-card-top span {
  display: block;
  color: var(--muted-2);
  font-family: var(--font-num);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.dim-card ul {
  padding-top: 14px;
}

.dim-card li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 2px;
  border-bottom: 1px dashed var(--line);
  font-size: 14.5px;
}

.dim-card li:last-child {
  border-bottom: 0;
}

.dim-card li em {
  font-style: normal;
  font-family: var(--font-num);
  font-weight: 700;
  color: var(--red);
}

/* ========== 评分规则 ========== */

.rule-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 32px;
}

.rule-card {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 22px 24px;
}

.rule-card h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}

.rule-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
}

.rule-card code {
  font-family: var(--font-num);
  font-size: 12.5px;
  color: var(--red-500);
  background: rgba(234, 77, 24, 0.08);
  padding: 1px 7px;
  border-radius: 6px;
  white-space: nowrap;
}

/* ========== 自测布局 ========== */

.quiz-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 36px;
  align-items: start;
  margin-top: 56px;
}

.quiz-group + .quiz-group {
  margin-top: 52px;
}

.quiz-group-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--line-strong);
}

.quiz-group-head h3 {
  font-size: 21px;
  font-weight: 800;
}

.quiz-group-weight {
  font-family: var(--font-num);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(120deg, var(--blue-500), var(--brand));
  padding: 3px 12px;
  border-radius: 999px;
}

.quiz-group-head p {
  flex-basis: 100%;
  color: var(--muted-2);
  font-size: 12.5px;
  letter-spacing: 0.03em;
}

/* ========== 题卡 ========== */

.q-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 26px 28px;
  margin-top: 20px;
  box-shadow: var(--shadow-card);
}

.q-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.q-no {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(30, 91, 214, 0.09);
  color: var(--brand);
  font-family: var(--font-num);
  font-size: 14px;
  font-weight: 700;
}

.q-head-main h4 {
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.55;
}

.q-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.q-type {
  font-size: 12px;
  font-weight: 700;
  color: var(--red-500);
  background: rgba(234, 77, 24, 0.09);
  padding: 2px 9px;
  border-radius: 999px;
}

.q-path {
  color: var(--muted-2);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.q-note {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

/* ========== 选项 ========== */

.q-opts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.q-opts-wide {
  grid-template-columns: repeat(3, 1fr);
}

.q-opt {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.q-opt:hover {
  border-color: var(--blue-400);
}

.q-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.opt-mark {
  position: relative;
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin-top: 2px;
  border: 1.5px solid var(--muted-2);
  border-radius: 50%;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.q-opt input[type="checkbox"] + .opt-mark {
  border-radius: 5px;
}

.opt-text {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-2);
}

.q-opt.is-checked {
  border-color: var(--blue-500);
  background: rgba(30, 91, 214, 0.06);
  box-shadow: 0 6px 18px rgba(30, 91, 214, 0.14);
}

.q-opt.is-checked .opt-mark {
  border-color: var(--blue-500);
  background: var(--blue-500);
}

.q-opt.is-checked .opt-mark::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -60%) rotate(45deg);
}

.q-opt.is-checked input[type="radio"] + .opt-mark::after {
  width: 6px;
  height: 6px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
}

.q-opt.is-checked .opt-text {
  color: var(--brand);
  font-weight: 600;
}

/* ========== 数值补充填写 ========== */

.q-extra {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.q-extra-field {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.q-extra-field input {
  width: 120px;
  border: 0;
  border-bottom: 1.5px solid var(--line-strong);
  background: transparent;
  font-family: var(--font-num);
  font-size: 14px;
  text-align: center;
  padding: 3px 4px;
  transition: border-color 0.25s var(--ease);
}

.q-extra-field input:focus {
  outline: none;
  border-bottom-color: var(--blue-500);
}

/* ========== 实时结果面板 ========== */

.result-panel {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  z-index: 10;
  background: var(--blue-900);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 30px 28px;
  box-shadow: var(--shadow-hover);
  overflow: hidden;
}

/* 让 result-panel 的 sticky 定位不被 main.css .section { overflow: hidden } 阻断 */
.section.section-soft {
  overflow: visible;
}

.result-panel::before {
  content: '';
  position: absolute;
  right: -80px;
  top: -80px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(77, 139, 255, 0.22) 0%, rgba(77, 139, 255, 0) 70%);
  pointer-events: none;
}

.result-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.result-progress {
  color: rgba(205, 222, 245, 0.6);
  font-size: 12px;
  font-family: var(--font-num);
  letter-spacing: 0.04em;
}

.result-score {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 18px 0 26px;
}

.result-score strong {
  font-family: var(--font-num);
  font-size: 58px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #fff;
}

.result-unit {
  color: rgba(205, 222, 245, 0.55);
  font-size: 13.5px;
}

.result-dims {
  display: grid;
  gap: 18px;
}

.dim-result-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.dim-result-head span {
  font-size: 13.5px;
  font-weight: 600;
}

.dim-result-head em {
  font-style: normal;
  font-family: var(--font-num);
  font-size: 12.5px;
  color: rgba(205, 222, 245, 0.7);
}

.dim-result-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.dim-result-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--blue-400), var(--red-400));
  transition: width 0.5s var(--ease);
}

.result-tip {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  color: rgba(205, 222, 245, 0.5);
  font-size: 12px;
  line-height: 1.7;
}

/* ========== 预约表单 ========== */

.appt-wrap {
  max-width: 860px;
  margin: 56px auto 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 40px 44px;
  box-shadow: var(--shadow-card);
}

.appt-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px 24px;
}

.appt-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.appt-field label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.appt-field input,
.appt-field select,
.appt-field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  padding: 12px 14px;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.appt-field textarea {
  resize: vertical;
  min-height: 96px;
}

.appt-field input:focus,
.appt-field select:focus,
.appt-field textarea:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(30, 91, 214, 0.12);
}

.appt-field input[readonly] {
  background: var(--bg);
  color: var(--brand);
  font-family: var(--font-num);
  font-weight: 700;
}

.appt-field.is-error input {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(234, 77, 24, 0.12);
}

.appt-field-full {
  grid-column: 1 / -1;
}

.appt-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 4px;
}

.appt-tel {
  color: var(--muted);
  font-size: 13.5px;
}

.appt-tel a {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.appt-success {
  text-align: center;
  padding: 30px 10px;
}

.appt-success strong {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  color: var(--brand);
}

.appt-success strong::before {
  content: '';
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(120deg, var(--blue-500), var(--brand));
  box-shadow: 0 8px 20px rgba(30, 91, 214, 0.35);
}

.appt-success p {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.9;
}

.appt-success a {
  color: var(--brand);
  font-weight: 700;
}

/* ========== 响应式 ========== */

@media (max-width: 1080px) {
  .rule-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .quiz-layout {
    grid-template-columns: 1fr;
  }

  .result-panel {
    position: static;
  }

  .appt-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .dim-grid {
    grid-template-columns: 1fr;
  }

  .diag-hero-inner {
    padding: calc(var(--header-h) + 64px) 0 84px;
  }

  .q-card {
    padding: 22px 20px;
  }

  .q-opts,
  .q-opts-wide {
    grid-template-columns: 1fr;
  }

  .appt-wrap {
    padding: 28px 22px;
  }

  .appt-grid {
    grid-template-columns: 1fr;
  }

  .result-score strong {
    font-size: 46px;
  }
}