/* ================================
   颐安健康 · 癌症风险评估
   配色:沉静蓝 + 暖白 · 高端感
   ================================ */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Helvetica Neue", "Source Han Sans SC", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: #1f2d3d;
  background: linear-gradient(180deg, #eaf1f8 0%, #f6f8fb 280px, #f6f8fb 100%);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}

:root {
  --primary: #0f4c81;
  --primary-dark: #0a3a63;
  --primary-light: #e3edf7;
  --accent: #c19a5b;        /* 暖金,增加高端感 */
  --accent-light: #f5ecdb;
  --success: #2e7d5b;
  --danger: #c0392b;
  --warn: #d97706;
  --text: #1a2a3a;
  --text-2: #5a6b7d;
  --text-3: #8a99ab;
  --border: #d8e2ec;
  --border-soft: #eef2f6;
  --bg-card: #ffffff;
  --bg-soft: #f6f9fc;
  --radius: 12px;
  --shadow: 0 4px 16px rgba(15, 76, 129, 0.06);
  --shadow-lg: 0 8px 24px rgba(15, 76, 129, 0.10);
}

/* 顶部品牌条 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(135deg, #0f4c81 0%, #0a3a63 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, #c19a5b 0%, #a37e3b 100%);
  border-radius: 10px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 18px;
  letter-spacing: 1px;
  color: #fff;
  box-shadow: 0 2px 6px rgba(193, 154, 91, 0.4);
}
.brand-name { font-size: 16px; font-weight: 600; letter-spacing: 0.5px; }
.brand-sub { font-size: 11.5px; opacity: 0.85; margin-top: 1px; }
.topbar-phone { font-size: 13px; opacity: 0.9; }

/* 步骤条 */
.stepper {
  background: #fff;
  border-bottom: 1px solid var(--border-soft);
  padding: 12px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.stepper ol {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: max-content;
}
.stepper li {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
  font-size: 12px;
  white-space: nowrap;
}
.stepper li .dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--text-3);
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 600;
  border: 1.5px solid var(--border);
}
.stepper li::after {
  content: '';
  width: 14px; height: 1px;
  background: var(--border);
  margin: 0 2px;
}
.stepper li:last-child::after { display: none; }
.stepper li.active { color: var(--primary); font-weight: 600; }
.stepper li.active .dot {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.stepper li.done { color: var(--success); }
.stepper li.done .dot {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.stepper li.done::after { background: var(--success); }
.stepper li.hidden { display: none; }
.stepper li.hidden::after { display: none; }

/* 容器 */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}
.step { display: none; animation: fadeIn 0.3s ease; }
.step.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 卡片 */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-soft);
}
.card.success { text-align: center; }
.step-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.3px;
}
.step-desc {
  margin: 0 0 20px;
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.7;
}

/* Banner 提示 */
.banner-tip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--accent-light);
  border: 1px solid #e7d5a7;
  border-radius: 8px;
  margin-bottom: 18px;
  font-size: 13.5px;
  color: #6b4f1f;
}
.banner-icon {
  display: inline-grid;
  place-items: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-style: italic;
  flex-shrink: 0;
}

/* 表单 */
.form { display: flex; flex-direction: column; gap: 18px; }
.form-row { display: flex; flex-direction: column; gap: 8px; }
.form-row label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.req { color: var(--danger); }
.hint { font-size: 12px; color: var(--text-3); margin-top: 2px; line-height: 1.5; }
input[type="text"],
input[type="password"],
input[type="tel"],
input[type="email"],
input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.12);
}
input::placeholder { color: #b0bcc8; }

/* 出生日期(带按钮) */
.date-input-wrap {
  position: relative;
  display: flex;
  gap: 8px;
}
.date-input-wrap input { flex: 1; }
.date-input-btn {
  width: 46px;
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.date-input-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* 隐藏的原生 date picker,作为日历按钮的代理 */
.date-input-wrap input[type="date"] {
  position: absolute;
  top: 0; left: 0;
  width: 46px; height: 100%;
  opacity: 0;
  pointer-events: none;
}

/* 单选 / 多选 */
.radio-group, .check-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.radio, .checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  user-select: none;
  transition: all 0.15s;
}
.radio input, .checkbox input {
  width: 16px; height: 16px;
  accent-color: var(--primary);
  margin: 0;
}
.radio:hover, .checkbox:hover { border-color: var(--primary); }
.radio:has(input:checked),
.checkbox:has(input:checked) {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
  font-weight: 600;
}

/* 知情同意书 */
.consent-doc {
  max-height: 320px;
  overflow-y: auto;
  padding: 16px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text-2);
  margin-bottom: 16px;
  line-height: 1.75;
}
.consent-doc h3 {
  font-size: 14px;
  color: var(--text);
  margin: 12px 0 4px;
  font-weight: 700;
}
.consent-doc h3:first-child { margin-top: 0; }
.consent-doc p { margin: 4px 0; }
.checkbox {
  border-radius: 8px;
  padding: 12px 14px;
  align-items: flex-start;
  gap: 10px;
  font-weight: normal;
}
.checkbox span { line-height: 1.5; }

/* 错误 */
.error-msg {
  padding: 10px 14px;
  background: #fdf2f0;
  border: 1px solid #f5cfc4;
  color: var(--danger);
  border-radius: 8px;
  font-size: 13.5px;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 22px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  min-height: 46px;
  letter-spacing: 0.5px;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(15, 76, 129, 0.25);
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-soft); color: var(--text); }

.actions {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}
.actions .btn { flex: 1; }
.actions.center { justify-content: center; flex-wrap: wrap; }

/* 详情 */
.hint-block {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--bg-soft);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-2);
}
.hint-block summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--primary);
}
.hint-block p { margin: 8px 0 0; }

/* 癌症选项卡片 */
.cancer-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cancer-option {
  display: block;
  cursor: pointer;
}
.cancer-option input { display: none; }
.cancer-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #fff;
  transition: all 0.18s;
  position: relative;
}
.cancer-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}
.cancer-option input:checked + .cancer-card {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: var(--shadow);
}
.cancer-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.cancer-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.cancer-info { flex: 1; text-align: left; }
.cancer-name { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.cancer-desc { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.cancer-check {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.15s;
}
.cancer-option input:checked + .cancer-card .cancer-check {
  background: var(--primary);
  border-color: var(--primary);
}

/* 采血点列表 */
.point-list { display: flex; flex-direction: column; gap: 8px; }
.point-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s;
}
.point-item:hover { border-color: var(--primary); }
.point-item input { margin-top: 3px; accent-color: var(--primary); }
.point-item.selected {
  background: var(--primary-light);
  border-color: var(--primary);
}
.point-item .pname { font-weight: 600; color: var(--text); }
.point-item .pmeta { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* 周历视图 */
.week-calendar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.week-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--bg-soft);
  border-radius: 10px;
  border: 1px solid var(--border-soft);
}
.week-label {
  flex-shrink: 0;
  width: 70px;
  text-align: center;
  font-size: 12px;
  color: var(--text-2);
  font-weight: 600;
  line-height: 1.3;
}
.week-label .week-label-date {
  display: block;
  font-size: 11px;
  color: var(--text-3);
  font-weight: normal;
  margin-top: 2px;
}
.week-pills {
  display: flex;
  gap: 8px;
  flex: 1;
}
.date-pill {
  flex: 1;
  padding: 10px 8px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  font-size: 13px;
  color: var(--text);
  user-select: none;
}
.date-pill:hover { border-color: var(--primary); color: var(--primary); }
.date-pill.selected {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(15, 76, 129, 0.2);
}
.date-pill .pill-dow {
  display: block;
  font-size: 11px;
  color: var(--accent);
  margin-top: 2px;
  font-weight: 600;
}
.date-pill.selected .pill-dow { color: #fff; opacity: 0.9; }

/* 选中的日期高亮（原 CSS 只有 .selected 规则、但没有脚本添加该类，这里用 :has 补上） */
.date-pill:has(input:checked) {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(15, 76, 129, 0.2);
}
.date-pill:has(input:checked) .pill-dow { color: #fff; opacity: 0.9; }

/* 「与健康顾问协商后确定日期与时间」选项 */
.consult-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.5;
  transition: all 0.15s;
}
.consult-pill:hover { border-color: var(--primary); }
.consult-pill:has(input:checked) {
  border-color: var(--primary);
  background: #eaf4ff;
  color: var(--primary);
  font-weight: 600;
}
.consult-pill input { width: 18px; height: 18px; flex: none; margin: 0; }

/* 两种预约方式（协商确定 / 固定日期与时间）纵向排列 */
.mode-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ===== 选中态兜底 =====
   上面这些选中样式原本只靠 CSS :has()，但部分浏览器（如微信安卓 X5 内核）不支持，
   会导致顾客"看不到自己选了什么"。app.js 会在选项变化时给选中项加 .selected 类，
   下面补上与 :has() 等价的样式，保证所有浏览器都有高亮反馈。 */
.radio.selected,
.checkbox.selected {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
  font-weight: 600;
}
.slot.selected {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 600;
}
.consult-pill.selected {
  border-color: var(--primary);
  background: #eaf4ff;
  color: var(--primary);
  font-weight: 600;
}

/* 旧的 .consult-back 样式已随交互改版移除（改用「协商/固定」二选一） */

/* 时间段 */
.slot-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.slot {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  background: #fff;
}
.slot input { display: none; }
.slot:has(input:checked) {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 600;
}

/* 成功页 */
.success-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  font-size: 32px;
  display: grid; place-items: center;
  margin: 0 auto 16px;
  box-shadow: 0 4px 12px rgba(46, 125, 91, 0.3);
}
.summary {
  text-align: left;
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 14px;
  border: 1px solid var(--border-soft);
}
.summary .row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}
.summary .row:last-child { border-bottom: none; }
.summary .row .k { color: var(--text-2); }
.summary .row .v { color: var(--text); font-weight: 600; }
.notice-title {
  text-align: left;
  font-size: 16px;
  margin: 16px 0 10px;
  color: var(--text);
  font-weight: 700;
}
.notice-list {
  text-align: left;
  padding-left: 20px;
  margin: 0 0 20px;
}
.notice-list li {
  font-size: 13.5px;
  color: var(--text-2);
  margin-bottom: 8px;
  line-height: 1.7;
}
.notice-list li b { color: var(--text); }

/* 凭证画布 */
.receipt-tip {
  font-size: 13px;
  color: var(--text-2);
  margin: 0 0 12px;
  text-align: left;
}
.receipt-canvas-wrap {
  width: 100%;
  max-width: 360px;
  margin: 0 auto 16px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: #fff;
}
.receipt-canvas-wrap img,
.receipt-canvas-wrap canvas {
  width: 100%;
  height: auto;
  display: block;
  /* 让图片本身可长按保存（微信内置浏览器长按 img 可弹出「保存图片」） */
  -webkit-touch-callout: default;
  -webkit-user-select: auto;
  user-select: auto;
}

/* 页脚 */
.footer {
  text-align: center;
  padding: 20px 16px 32px;
  color: var(--text-3);
  font-size: 12px;
}
.footer-sub { margin-top: 4px; font-size: 11px; }

.footer-beian { margin-top: 6px; }
.footer-beian a { color: var(--text-3); text-decoration: none; }
.footer-beian a:hover { text-decoration: underline; }

.footer-contact {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.6;
  word-break: break-all;
}
.footer-contact b { font-weight: 600; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 30%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.78);
  color: #fff;
  padding: 10px 18px;
  border-radius: 22px;
  font-size: 14px;
  z-index: 200;
  animation: toastIn 0.2s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* 响应式 */
@media (min-width: 600px) {
  .container { padding: 32px 24px 60px; }
  .card { padding: 32px 32px; }
  .step-title { font-size: 22px; }
  .slot-list { grid-template-columns: repeat(4, 1fr); }
  .cancer-options { flex-direction: row; }
  .cancer-option { flex: 1; }
}
@media (max-width: 380px) {
  .brand-sub { display: none; }
  .stepper { padding: 10px 8px; }
  .stepper li { font-size: 11px; }
  .stepper li::after { width: 8px; }
  .week-label { width: 56px; }
  .date-pill { font-size: 12px; padding: 8px 4px; }
}
