/* 明眸档案 H5 —— 暖白底 + 深金点缀，三色压暗 */
:root {
  --paper: #faf7f1;
  --card: #ffffff;
  --ink: #2c2620;
  --ink-2: #6b6157;
  --line: #e9e2d5;
  --gold: #8a6d1f;
  --gold-2: #c9a44c;
  --gold-bg: #f6efe0;
  --red: #a94438;      /* 压暗不刺眼 */
  --orange: #b97a26;
  --green: #3d7a52;
  --red-bg: #f7ece9;
  --orange-bg: #f8f0e1;
  --green-bg: #e9f2ec;
  --serif: "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  --sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

/* ---- 顶栏 ---- */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px;
  background: rgba(250, 247, 241, .92);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10; backdrop-filter: blur(8px);
}
.brand { font-family: var(--serif); font-size: 20px; font-weight: 700; color: var(--ink); cursor: pointer; letter-spacing: 2px; }
.brand span { font-size: 12px; color: var(--gold); margin-left: 4px; letter-spacing: 0; }
.topbar nav { display: flex; gap: 4px; flex-shrink: 0; }
.topbar nav a {
  padding: 6px 10px; font-size: 14px; color: var(--ink-2); cursor: pointer;
  border-radius: 6px; white-space: nowrap;
}
.topbar nav a:active { background: var(--gold-bg); }
.acct { display: flex; align-items: center; min-width: 0; font-size: 13px; }
.acct-mail { color: var(--ink-2); max-width: 110px; overflow: hidden; cursor: pointer; text-overflow: ellipsis; white-space: nowrap; }
.acct-in { color: var(--gold); cursor: pointer; padding: 4px 8px; white-space: nowrap; }
@media (max-width: 480px) {
  .brand span { display: none; }
  .topbar nav a { padding: 6px 6px; font-size: 13px; }
}

main { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 18px 16px 48px; }

/* ---- Hero ---- */
.hero { padding: 26px 6px 22px; }
.hero-kicker { font-size: 13px; color: var(--gold); letter-spacing: 4px; margin-bottom: 10px; }
.hero h1 { font-family: var(--serif); font-size: 32px; line-height: 1.35; font-weight: 700; letter-spacing: 1px; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero-sub { margin-top: 12px; color: var(--ink-2); font-size: 14px; }

/* ---- 卡片 ---- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 20px 18px; margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(60, 48, 30, .05);
}
.card h2 {
  font-family: var(--serif); font-size: 19px; margin-bottom: 10px;
  padding-bottom: 8px; border-bottom: 2px solid var(--gold-bg);
}
.hint { color: var(--ink-2); font-size: 13px; margin-bottom: 12px; }
.hint.center { text-align: center; margin: 10px 0 0; }
.gold { color: var(--gold); font-weight: 600; }
.req { color: var(--red); font-style: normal; }
.err { color: var(--red); font-size: 13px; margin-top: 8px; min-height: 1em; }
.hide { display: none !important; }

/* ---- 表单 ---- */
input {
  font-family: var(--sans); font-size: 15px; color: var(--ink);
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; width: 100%;
}
input:focus { outline: 2px solid var(--gold-2); border-color: var(--gold-2); }
button { font-family: var(--sans); cursor: pointer; }
.btn { padding: 12px 20px; font-size: 15px; border-radius: 10px; border: none; font-weight: 600; transition: transform .06s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(135deg, #9a7a24, #7c6118); color: #fff; }
.btn.ghost { background: var(--gold-bg); color: var(--gold); }
.btn.block { display: block; width: 100%; margin-top: 8px; }
.btn.sm { padding: 6px 14px; font-size: 13px; }
.eval-form input { margin-bottom: 10px; }
.eval-row { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.eval-row input { flex: 1; min-width: 0; }
.eval-row .btn { margin: 0; white-space: nowrap; }

.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 5px; }
.field small { display: block; color: var(--ink-2); font-size: 11px; margin-top: 3px; }
.field.wide { grid-column: 1 / -1; }

.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { flex: 1; padding: 9px 0; background: #fff; border: none; color: var(--ink-2); font-size: 14px; }
.seg button.on { background: var(--gold); color: #fff; }

/* ---- 眼别输入盒 ---- */
.eye-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
@media (max-width: 420px) { .eye-grid { grid-template-columns: 1fr; } }
.eye-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 4px; background: #fff; }
.eye-box > b { font-size: 13px; color: var(--gold); display: block; margin-bottom: 6px; }
.mrow { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.mrow span { font-size: 12px; color: var(--ink-2); width: 62px; flex: none; }
.mrow input { padding: 7px 9px; font-size: 14px; min-width: 0; }

.step-tag {
  font-size: 13px; font-weight: 700; color: var(--gold);
  letter-spacing: 1px; margin: 14px 0 6px;
}
.divider { display: flex; align-items: center; gap: 10px; margin: 16px 0 4px; color: var(--ink-2); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px dashed var(--line); }

/* ---- 三色徽标 ---- */
.band-pill {
  display: inline-block; padding: 2px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
}
.band-pill.green { background: var(--green-bg); color: var(--green); }
.band-pill.orange { background: var(--orange-bg); color: var(--orange); }
.band-pill.red { background: var(--red-bg); color: var(--red); }
.band-name { color: var(--ink-2); font-size: 13px; }
.band-name.green { color: var(--green); }
.band-name.orange { color: var(--orange); }
.band-name.red { color: var(--red); }

/* ---- 解读结果 ---- */
.interp-eyes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .interp-eyes { grid-template-columns: 1fr; } }
.eye-result { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.eye-result h4 { font-size: 14px; margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
.eye-result ul { list-style: none; font-size: 13px; color: var(--ink); }
.eye-result li { padding: 3px 0; border-bottom: 1px dashed var(--line); }
.eye-result li:last-child { border-bottom: none; }
.advice-box { background: var(--gold-bg); border-radius: 10px; padding: 12px 14px; font-size: 13px; margin-top: 10px; }
.advice-box b { color: var(--gold); }

/* ---- 孩子卡 ---- */
.kid-card {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  margin-bottom: 10px; background: #fff; cursor: pointer;
}
.kid-card:active { background: var(--gold-bg); }
.kid-avatar {
  width: 46px; height: 46px; border-radius: 50%; flex: none;
  background: var(--gold-bg); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 20px; font-weight: 700;
}
.kid-info { flex: 1; min-width: 0; }
.kid-info b { font-family: var(--serif); font-size: 17px; }
.kid-info small { display: block; color: var(--ink-2); font-size: 12px; margin-top: 2px; }
.kid-info .band-pill { margin-left: 8px; vertical-align: 2px; font-size: 11px; padding: 1px 8px; }
.kid-count { font-size: 12px; color: var(--ink-2); text-align: right; margin-bottom: 10px; }

/* ---- 时间线 ---- */
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.exam-item { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; background: #fff; }
.exam-item::before { content: ""; position: absolute; left: -17px; top: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-2); }
.exam-item .head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px; }
.exam-item .head b { font-size: 14.5px; }
.exam-item .head small { color: var(--ink-2); font-size: 12px; }
.exam-item .del { color: var(--ink-2); font-size: 12px; cursor: pointer; padding: 2px 6px; }
.exam-item .del:active { color: var(--red); }
.exam-item .vals { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; line-height: 1.8; }
.exam-item .vals b { color: var(--ink); font-weight: 600; }
.exam-item img { max-width: 100%; max-height: 160px; border-radius: 8px; margin-top: 8px; }
.exam-item .note { font-size: 12px; color: var(--gold); margin-top: 4px; }

/* ---- 曲线 ---- */
.chart-card h2 { display: flex; justify-content: space-between; align-items: baseline; }
.chart-ctrl { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.chart-ctrl .seg { flex: 1; min-width: 120px; }
.chart-ctrl .seg button { font-size: 13px; padding: 7px 0; }
#chart-box { width: 100%; overflow: hidden; }
#chart-box svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.chart-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: 3px; margin-right: 4px; }

/* ---- 预警卡（付费） ---- */
.risk-card { position: relative; }
.risk-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.risk-head .band-pill { font-size: 14px; padding: 4px 16px; }
.risk-eye { border-top: 1px dashed var(--line); padding: 10px 0 6px; font-size: 13.5px; }
.risk-eye b.eye-tag { color: var(--gold); }
.risk-eye .verdict { margin: 2px 0; }
.risk-eye .basis { color: var(--ink-2); font-size: 12px; }
.locked-overlay {
  position: absolute; inset: 0; z-index: 5; border-radius: 14px;
  background: linear-gradient(180deg, rgba(250,247,241,.55), rgba(250,247,241,.96) 70%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; text-align: center;
}
.locked-overlay .btn { margin-top: 12px; }
.locked-overlay p { font-size: 13px; color: var(--ink-2); max-width: 300px; }
.countdown { text-align: center; margin: 6px 0 10px; }
.countdown b { font-family: var(--serif); font-size: 40px; color: var(--gold); }
.countdown small { display: block; color: var(--ink-2); font-size: 12px; }

/* ---- 提醒设置 ---- */
.remind-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.remind-row .seg { flex: 1; min-width: 160px; max-width: 260px; margin: 0; }
.remind-row span { font-size: 13px; color: var(--ink-2); }
.del-link { color: var(--ink-2); font-size: 12px; cursor: pointer; text-decoration: underline dotted; }
.del-link:active { color: var(--red); }

/* ---- 套餐 / 支付 ---- */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.plan { border: 1.5px solid var(--line); border-radius: 12px; padding: 14px; position: relative; cursor: pointer; background: #fff; }
.plan:has(input:checked) { border-color: var(--gold); background: var(--gold-bg); }
.plan input { position: absolute; opacity: 0; }
.plan-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.plan-head b { font-family: var(--serif); font-size: 16px; }
.plan-head .price { font-family: var(--serif); font-size: 20px; color: var(--gold); font-weight: 700; }
.plan ul { list-style: none; font-size: 12.5px; color: var(--ink-2); }
.plan ul li { padding: 2px 0; }
.plan .tag { position: absolute; top: -9px; right: 10px; font-style: normal; background: var(--gold); color: #fff; font-size: 11px; padding: 1px 8px; border-radius: 999px; }
.pay-card { text-align: center; }
.pay-card h2 { justify-content: center; border-bottom: none; }
.pay-qr { width: 210px; height: 210px; margin: 8px auto; border: 1px solid var(--line); border-radius: 10px; display: block; object-fit: contain; }
.pay-amount { font-family: var(--serif); font-size: 34px; color: var(--gold); font-weight: 700; }
.pay-name { font-size: 14px; color: var(--ink-2); margin: 4px 0 12px; }

/* ---- 我的 ---- */
.me-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.me-row:last-child { border-bottom: none; }
.me-row small { color: var(--ink-2); }
.order-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.order-row .st-done { color: var(--green); font-size: 13px; }
.order-row .st-created { color: var(--gold); font-size: 13px; }

/* ---- 首页攻略 ---- */
.faq-teaser a { display: block; padding: 7px 0; font-size: 13.5px; color: var(--ink); border-bottom: 1px dashed var(--line); cursor: pointer; }
.faq-teaser a:last-child { border-bottom: none; }

.pitch-points { list-style: none; margin-top: 14px; font-size: 13px; color: var(--ink-2); }
.pitch-points li { padding: 3px 0; }
.result-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.result-bar .btn { margin: 0; white-space: nowrap; }

footer { padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); text-align: center; }
footer p { font-size: 11.5px; color: var(--ink-2); max-width: 600px; margin: 0 auto 4px; }

/* ---- 图片全屏浮层 ---- */
.card-overlay {
  display: none; position: fixed; inset: 0; z-index: 120;
  background: rgba(24, 20, 16, .88);
  flex-direction: column; align-items: center; justify-content: center;
  padding: 20px; gap: 14px;
}
.card-overlay.show { display: flex; }
.card-overlay img { max-width: min(88vw, 560px); max-height: 72vh; border-radius: 10px; }
.card-overlay p { color: #fff; font-size: 13.5px; margin: 0; }

#toast {
  position: fixed; left: 50%; bottom: 12%; transform: translateX(-50%);
  background: rgba(44, 38, 32, .92); color: #fff; font-size: 13.5px;
  padding: 9px 18px; border-radius: 999px; z-index: 99; max-width: 86vw;
}

@media (max-width: 380px) {
  .plans { grid-template-columns: 1fr; }
  .fgrid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 27px; }
}
