/* 知名字 H5 —— 暖白宣纸底 + 深金点缀 */
:root {
  --paper: #faf7f1;
  --card: #ffffff;
  --ink: #2c2620;
  --ink-2: #6b6157;
  --line: #e9e2d5;
  --gold: #8a6d1f;
  --gold-2: #c9a44c;
  --gold-bg: #f6efe0;
  --red: #b03a2e;
  --green: #1e7a4f;
  --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; }
.topbar nav a {
  padding: 6px 10px; font-size: 14px; color: var(--ink-2); cursor: pointer;
  border-radius: 6px;
}
.topbar nav a:active { background: var(--gold-bg); }

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: 34px; 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);
  display: flex; justify-content: space-between; align-items: baseline;
}
.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; }
.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; }

.eval-form input { margin-bottom: 10px; }
.eval-row { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.eval-row label { font-size: 14px; color: var(--ink-2); display: flex; gap: 4px; align-items: center; }
input[type="radio"] { accent-color: var(--gold); width: auto; }
.eval-row input[type=number] { flex: 1; min-width: 0; margin-bottom: 0; }

.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 5px; }
.field label i { color: var(--red); font-style: normal; }
.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; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; font-size: 13px; color: var(--ink-2);
}
.chip.on { border-color: var(--gold); color: var(--gold); background: var(--gold-bg); }

.adv { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.adv summary { font-size: 14px; color: var(--gold); cursor: pointer; margin-bottom: 12px; }
.adv .fgrid { margin-top: 12px; }

/* ---- 测名结果 ---- */
.score-hero { display: flex; align-items: center; gap: 18px; margin: 6px 0 14px; }
.score-ring {
  width: 92px; height: 92px; border-radius: 50%; flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background:
    radial-gradient(closest-side, #fff 78%, transparent 79% 100%),
    conic-gradient(var(--gold-2) calc(var(--p) * 1%), var(--line) 0);
}
.score-ring b { font-family: var(--serif); font-size: 30px; color: var(--gold); line-height: 1; }
.score-ring span { font-size: 11px; color: var(--ink-2); margin-top: 2px; }
.score-hero .who { font-family: var(--serif); font-size: 26px; letter-spacing: 2px; }
.score-hero .who small { display: block; font-size: 12px; color: var(--ink-2); font-family: var(--sans); letter-spacing: 0; margin-top: 4px; }

.dim-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.dim-table th, .dim-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.dim-table th { color: var(--ink-2); font-weight: 400; white-space: nowrap; width: 72px; }
.dim-table td b.good { color: var(--green); }
.dim-table td b.bad { color: var(--red); }
.risk-pill {
  display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 12px;
}
.risk-pill.high { background: #fdecea; color: var(--red); }
.risk-pill.mid { background: var(--gold-bg); color: var(--gold); }

.cmp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cmp-table th, .cmp-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: center; }
.cmp-table th { color: var(--ink-2); font-weight: 400; font-size: 12px; }
.cmp-table td.name { font-family: var(--serif); font-size: 16px; }
.cmp-table tr.win td { background: var(--gold-bg); }
.cmp-table tr.win td:first-child { border-radius: 6px 0 0 6px; }
.cmp-table tr.win td:last-child { border-radius: 0 6px 6px 0; }

/* ---- 方案卡 ---- */
.pitch-points { list-style: none; margin-top: 14px; font-size: 13px; color: var(--ink-2); }
.pitch-points li { padding: 3px 0; }

/* ---- 套餐 ---- */
.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; }

/* ---- 报告 ---- */
.rep-header { text-align: center; padding: 10px 0 4px; }
.rep-header h2 { font-family: var(--serif); font-size: 24px; border: none; justify-content: center; }
.rep-header p { color: var(--ink-2); font-size: 13px; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.kv { background: var(--gold-bg); border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.kv b { color: var(--gold); font-family: var(--serif); font-size: 15px; }
.kv small { color: var(--ink-2); display: block; font-size: 11px; }

.name-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  margin-bottom: 10px; background: #fff;
}
.name-card .row1 { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.name-card .nm { font-family: var(--serif); font-size: 22px; letter-spacing: 2px; }
.name-card .score { font-family: var(--serif); font-size: 20px; color: var(--gold); font-weight: 700; }
.name-card .score small { font-size: 11px; color: var(--ink-2); font-weight: 400; }
.name-card .meta { font-size: 12.5px; color: var(--ink-2); line-height: 1.9; }
.name-card .meta b { color: var(--ink); font-weight: 600; }
.name-card .warn { margin-top: 6px; font-size: 12px; }
.name-card .poem-src {
  margin-top: 6px; padding: 8px 10px; background: var(--paper);
  border-left: 3px solid var(--gold-2); border-radius: 0 6px 6px 0; font-size: 12.5px;
}
.name-card .poem-src .sent { font-family: var(--serif); font-size: 14px; margin-bottom: 2px; }
.meaning-block { margin-top: 8px; font-size: 13.5px; }
.meaning-block .tags { color: var(--gold); font-size: 12px; margin-bottom: 2px; }
.nick-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.nick { background: var(--gold-bg); border-radius: 6px; padding: 2px 10px; font-size: 13px; }
.twins-pair { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; text-align: center; }
.twins-pair .pair { font-family: var(--serif); font-size: 19px; letter-spacing: 1px; }
.twins-pair .pat { font-size: 12px; color: var(--gold); margin-top: 2px; }

/* ---- 订单列表 ---- */
.order-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 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; }
.order-row .btn { padding: 7px 14px; font-size: 13px; }

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; }

#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;
}
.spin { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 380px) {
  .plans { grid-template-columns: 1fr; }
  .fgrid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 28px; }
}
