/* ==========================================================================
   起名 · 移动端样式
   ========================================================================== */
:root {
  --bg: #f5f2ec;
  --card: #ffffff;
  --ink: #292623;
  --ink2: #6d6760;
  --ink3: #a49d93;
  --line: #ece5da;
  --line2: #f4efe7;
  --brand: #9a3b2f;
  --brand2: #b8503f;
  --brand-soft: #f8edea;
  --gold: #ad8a3a;
  --gold-soft: #f8f1e2;
  --ok: #2e8b57;
  --warn: #c8891f;
  --bad: #b4453a;
  /* 五行 */
  --wx-mu: #2e8b57;
  --wx-huo: #cf5038;
  --wx-tu: #a8722c;
  --wx-jin: #c9a227;
  --wx-shui: #3272b8;
  --radius: 16px;
  --radius-s: 11px;
  --shadow: 0 1px 2px rgba(60, 45, 30, .04), 0 6px 20px -8px rgba(60, 45, 30, .10);
}

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

/* 关键：作者样式里的 display 会覆盖 UA 的 [hidden]{display:none}，必须显式声明 */
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0;
  background: #e9e4da;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.app {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: env(safe-area-inset-bottom);
  overflow-x: hidden;
}

/* ---------------- 顶部栏 ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 8px;
  padding: calc(14px + env(safe-area-inset-top)) 18px 14px;
  background: linear-gradient(170deg, #ac4638 0%, #9a3b2f 62%, #8b3327 100%);
  color: #fff;
}
.tb-back {
  width: 34px; height: 34px; margin-left: -8px;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%;
  background: rgba(255,255,255,.14); color: #fff;
  cursor: pointer; flex: none;
  transition: background .15s;
}
.tb-back:active { background: rgba(255,255,255,.26); }
.tb-title { flex: 1; min-width: 0; }
.tb-title h1 {
  margin: 0; font-size: 21px; font-weight: 600; letter-spacing: .1em;
  font-family: "Songti SC", "SimSun", "Noto Serif SC", serif;
}
.tb-title h1 i { font-style: normal; color: #ffd98a; }
.tb-title p {
  margin: 2px 0 0; font-size: 11.5px; letter-spacing: .06em;
  color: rgba(255,255,255,.74);
}

/* ---------------- 视图 ---------------- */
.view { padding: 16px 14px 40px; animation: fadeUp .28s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px;
  margin-bottom: 14px;
}

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 20px; }
.field:last-of-type { margin-bottom: 14px; }
.lbl {
  display: block; font-size: 13.5px; font-weight: 600;
  color: var(--ink); margin-bottom: 9px; letter-spacing: .02em;
}
.lbl-opt { font-weight: 400; font-size: 11.5px; color: var(--ink3); margin-left: 4px; }

.row { display: flex; gap: 9px; align-items: center; }
.row-date .sel { flex: 2; }
.row-date .sel:nth-child(2) { flex: 1.35; }
.row-date .sel:nth-child(3) { flex: 1.1; }
.row-time { margin-top: 9px; }
.row-time .sel { flex: 1; }

/* ---------------- 姓氏录入 ---------------- */
.sur-row { display: flex; gap: 9px; align-items: center; }
.surname-input {
  flex: 1; min-width: 0; height: 52px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-s);
  background: #fdfbf8;
  font-size: 24px; font-weight: 500; color: var(--ink);
  text-align: center; letter-spacing: .12em;
  font-family: "Songti SC", "SimSun", serif;
  outline: none;
  transition: border-color .16s, box-shadow .16s;
}
.sur-clear {
  flex: none; width: 44px; height: 44px;
  border: 1.5px solid var(--line); border-radius: 50%;
  background: #fdfbf8; color: var(--ink3);
  font-size: 15px; cursor: pointer; line-height: 1;
  transition: all .15s;
}
.sur-clear:active { background: var(--brand-soft); color: var(--brand); border-color: #e8d6d0; }

.sur-group { margin-top: 11px; }
.sur-group-title {
  font-size: 11px; color: var(--ink3); letter-spacing: .08em;
  margin-bottom: 6px; padding-left: 2px;
}
.quick-surnames {
  display: flex; gap: 6px;
  overflow-x: auto; overflow-y: hidden;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.quick-surnames::-webkit-scrollbar { display: none; }
.quick-surnames .qs { flex: none; }
.qs {
  border: 0; background: #f4f0e9; color: var(--ink2);
  font-size: 13.5px; padding: 7px 12px; border-radius: 8px;
  cursor: pointer; font-family: inherit; transition: all .14s;
}
.qs:active, .qs.on { background: var(--brand-soft); color: var(--brand); }
.quick-surnames.compound .qs { padding: 7px 10px; font-size: 13px; }

/* 笔画修正 */
.stroke-fix {
  margin-top: 11px; padding: 11px 12px;
  background: #fbf7f0; border: 1px solid var(--line);
  border-radius: var(--radius-s);
}
.sf-lbl { display: block; font-size: 12px; color: var(--ink2); margin-bottom: 7px; }
.sf-input {
  width: 100%; height: 42px; padding: 0 12px;
  border: 1.5px solid var(--line); border-radius: 9px;
  background: #fff; font-size: 15px; color: var(--ink);
  font-family: inherit; outline: none;
  font-variant-numeric: tabular-nums;
}
.sf-input:focus { border-color: var(--brand2); box-shadow: 0 0 0 3px var(--brand-soft); }
.stroke-fix .hint { margin: 7px 0 0; }
.hint-warn { color: var(--warn); }
.hint-fix {
  color: var(--brand); cursor: pointer;
  border-bottom: 1px dashed currentColor; padding-bottom: 1px;
}

.sel {
  height: 46px; padding: 0 26px 0 12px;
  border: 1.5px solid var(--line); border-radius: var(--radius-s);
  background: #fdfbf8 url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23a49d93' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 6px center/16px;
  font-size: 15px; color: var(--ink); font-family: inherit;
  -webkit-appearance: none; appearance: none; outline: none;
  transition: border-color .16s;
}
.sel:focus { border-color: var(--brand2); }

/* 分段控件 */
.seg {
  display: flex; gap: 4px; padding: 3px;
  background: #f2eee7; border-radius: 11px;
}
.seg-btn {
  flex: 1; border: 0; background: transparent;
  padding: 10px 6px; border-radius: 9px;
  font-size: 14.5px; font-weight: 500; color: var(--ink2);
  font-family: inherit; cursor: pointer;
  transition: all .18s ease;
}
.seg-btn.active {
  background: var(--card); color: var(--brand);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(60,45,30,.10);
}
.seg-mini .seg-btn { font-size: 13.5px; padding: 8px 6px; }

/* 五行 chips */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  border: 1.5px solid var(--line); background: #fdfbf8; color: var(--ink2);
  padding: 8px 15px; border-radius: 20px;
  font-size: 14px; font-family: inherit; cursor: pointer;
  transition: all .16s;
}
.chip.on { color: #fff; border-color: transparent; font-weight: 500; }
.chip[data-wx="0"].on { background: var(--wx-mu); }
.chip[data-wx="1"].on { background: var(--wx-huo); }
.chip[data-wx="2"].on { background: var(--wx-tu); }
.chip[data-wx="3"].on { background: var(--wx-jin); }
.chip[data-wx="4"].on { background: var(--wx-shui); }
.chip[data-wx="-1"].on { background: var(--ink2); }

.hint {
  margin: 9px 0 0; font-size: 12px; color: var(--ink3); line-height: 1.5;
}
.hint.center { text-align: center; }
.hint b { color: var(--brand); font-weight: 600; }

.submit {
  width: 100%; height: 53px; margin-top: 8px;
  border: 0; border-radius: 14px;
  background: linear-gradient(135deg, #a8433a 0%, #8e3328 100%);
  color: #fff; font-size: 17px; font-weight: 600; letter-spacing: .22em;
  font-family: inherit; cursor: pointer;
  box-shadow: 0 6px 18px -6px rgba(154,59,47,.55);
  transition: transform .12s, box-shadow .16s;
}
.submit:active { transform: translateY(1px) scale(.995); box-shadow: 0 3px 10px -5px rgba(154,59,47,.5); }
.submit:disabled { opacity: .55; }

/* ---------------- 生辰卡片 ---------------- */
.bazi-card { padding: 16px 16px 14px; }
.bazi-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding-bottom: 13px; border-bottom: 1px dashed var(--line);
}
.bazi-title {
  font-size: 19px; font-weight: 600; letter-spacing: .04em;
  font-family: "Songti SC", "SimSun", serif;
  color: var(--ink);
}
.bazi-meta { margin-top: 4px; font-size: 12.5px; color: var(--ink2); }
.zodiac-badge {
  flex: none; width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 600;
  font-family: "Songti SC", "SimSun", serif;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid #f0dcd7;
}

.pillars { display: flex; gap: 8px; margin-top: 14px; }
.pillar {
  flex: 1; text-align: center;
  padding: 10px 4px 11px;
  border-radius: var(--radius-s);
  background: #faf7f2;
  border: 1px solid var(--line2);
}
.pillar .p-name { font-size: 11px; color: var(--ink3); letter-spacing: .04em; }
.pillar .p-char {
  margin: 6px 0 5px;
  font-size: 25px; font-weight: 500; line-height: 1.15;
  font-family: "Songti SC", "SimSun", "Noto Serif SC", serif;
  letter-spacing: .04em;
}
.pillar .p-wx { font-size: 11px; font-weight: 500; }
.pillar.dm { background: var(--gold-soft); border-color: #eddfc4; }
.pillar.dm .p-name { color: var(--gold); font-weight: 600; }

.nayin {
  margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line);
  font-size: 12px; color: var(--ink2); line-height: 1.75;
}
.nayin span { display: inline-block; margin-right: 12px; }

/* 生辰简评（结果页生辰卡内、纳音之下） */
.bazi-brief {
  margin-top: 12px; padding: 11px 12px;
  background: #faf7f1; border-radius: 11px;
  font-size: 12.5px; color: var(--ink2); line-height: 1.78;
  border-left: 3px solid var(--gold);
}
.bazi-brief b { color: var(--ink); }
.bazi-brief .bb-key { color: var(--brand); font-weight: 600; }
.bazi-brief .bb-note {
  display: block; margin-top: 6px;
  font-size: 11px; color: var(--ink3);
}

/* ---------------- 五行卡片 ---------------- */
.card-title {
  font-size: 14.5px; font-weight: 600; margin-bottom: 14px;
  display: flex; align-items: center; gap: 7px;
}
.card-title::before {
  content: ''; width: 3px; height: 14px; border-radius: 2px;
  background: var(--brand); display: block;
}

.wx-bars { display: flex; gap: 9px; align-items: flex-end; height: 108px; padding: 0 2px; }
.wx-bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.wx-bar .bar {
  width: 100%; max-width: 34px; border-radius: 6px 6px 3px 3px;
  min-height: 4px; transition: height .5s cubic-bezier(.22,1,.36,1);
  position: relative;
}
.wx-bar .bar-val {
  font-size: 11px; color: var(--ink2); margin-bottom: 4px; font-variant-numeric: tabular-nums;
}
.wx-bar .bar-name { font-size: 12px; margin-top: 6px; font-weight: 500; }
.wx-bar .bar-cnt { font-size: 10px; color: var(--ink3); }

.wx-summary {
  margin-top: 15px; padding-top: 13px; border-top: 1px dashed var(--line);
  font-size: 13px; color: var(--ink2); line-height: 1.85;
}
.wx-summary .kv { display: flex; gap: 8px; }
.wx-summary .k { color: var(--ink3); flex: none; width: 62px; }
.wx-summary .v { flex: 1; color: var(--ink); }
.wx-tag {
  display: inline-block; padding: 1px 8px; border-radius: 6px;
  font-size: 12.5px; font-weight: 600; margin-right: 4px;
}
.wx-tag.mu { background: #e7f3ec; color: var(--wx-mu); }
.wx-tag.huo { background: #fbe9e5; color: var(--wx-huo); }
.wx-tag.tu { background: #f8f0e0; color: var(--wx-tu); }
.wx-tag.jin { background: #f7f1dd; color: var(--wx-jin); }
.wx-tag.shui { background: #e7eff9; color: var(--wx-shui); }
.wx-tag.miss { background: var(--brand-soft); color: var(--brand); }

.wx-advice {
  margin-top: 12px; padding: 11px 12px;
  background: #faf7f1; border-radius: 11px;
  font-size: 12.5px; color: var(--ink2); line-height: 1.7;
  border-left: 3px solid var(--gold);
}

/* ---------------- 名字列表 ---------------- */
.list-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 22px 4px 12px;
  font-size: 14.5px; font-weight: 600;
}
.list-count { font-size: 12px; font-weight: 400; color: var(--ink3); }

.name-list { display: flex; flex-direction: column; gap: 11px; }

.name-item {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 15px 15px 13px;
  cursor: pointer;
  transition: transform .14s, box-shadow .18s;
  border: 1px solid transparent;
}
.name-item:active { transform: scale(.988); }
.name-item.top { border-color: #efdcc8; }

.ni-top { display: flex; align-items: center; gap: 11px; }
.ni-rank {
  flex: none; width: 25px; height: 25px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--ink3);
  background: #f5f1ea;
  font-variant-numeric: tabular-nums;
}
.name-item.top .ni-rank { background: var(--brand-soft); color: var(--brand); }
.ni-name {
  flex: 1; min-width: 0;
  font-size: 27px; font-weight: 500; letter-spacing: .09em;
  font-family: "Songti SC", "SimSun", "Noto Serif SC", serif;
  color: var(--ink); line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ni-name .given { color: var(--brand); }
.ni-score { flex: none; text-align: right; }
.ni-score .num {
  font-size: 20px; font-weight: 700; color: var(--brand);
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.ni-score .num small { font-size: 11px; font-weight: 500; color: var(--ink3); margin-left: 1px; }
.ni-score .lvl { font-size: 10.5px; color: var(--ink3); margin-top: -1px; }

.ni-py {
  margin: 7px 0 0 36px;
  font-size: 12px; color: var(--ink3); letter-spacing: .03em;
}

.ni-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 11px 0 0 36px; }
.tag {
  font-size: 11.5px; padding: 3px 8px; border-radius: 6px;
  background: #f5f1ea; color: var(--ink2); white-space: nowrap;
}
.tag.wx { color: #fff; font-weight: 500; }
.tag.wx.mu { background: var(--wx-mu); }
.tag.wx.huo { background: var(--wx-huo); }
.tag.wx.tu { background: var(--wx-tu); }
.tag.wx.jin { background: var(--wx-jin); }
.tag.wx.shui { background: var(--wx-shui); }
.tag.good { background: #e7f3ec; color: var(--ok); }
.tag.mid { background: #f8f1e2; color: var(--warn); }
.tag.poor { background: #fbeae7; color: var(--bad); }

.list-end {
  text-align: center; font-size: 12px; color: var(--ink3);
  padding: 20px 0 6px;
}

/* ---------------- 加载 ---------------- */
.loading {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(38,32,26,.34);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
}
.loading-box {
  background: var(--card); border-radius: var(--radius);
  padding: 26px 30px; text-align: center;
  box-shadow: 0 18px 50px -14px rgba(40,30,20,.4);
  min-width: 172px;
}
.loading-box p { margin: 14px 0 0; font-size: 13.5px; color: var(--ink2); }
.spinner {
  width: 30px; height: 30px; margin: 0 auto;
  border: 2.5px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 详情弹层 ---------------- */
.sheet-mask {
  position: fixed; inset: 0; z-index: 95;
  background: rgba(38,32,26,.4);
  animation: fadeIn .2s both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  position: fixed; left: 50%; bottom: 0; z-index: 96;
  width: 100%; max-width: 480px;
  transform: translateX(-50%);
  max-height: 88vh;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 40px -10px rgba(40,30,20,.32);
  animation: sheetUp .3s cubic-bezier(.22,1,.36,1) both;
  display: flex; flex-direction: column;
}
@keyframes sheetUp { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }

.sheet-grab {
  flex: none; width: 38px; height: 4px; border-radius: 3px;
  background: #ddd5c8; margin: 9px auto 0;
}
.sheet-body {
  overflow-y: auto; padding: 14px 16px calc(26px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}

.sheet-name {
  text-align: center; padding: 6px 0 16px;
  border-bottom: 1px dashed var(--line); margin-bottom: 16px;
}
.sheet-name .big {
  font-size: 40px; font-weight: 500; letter-spacing: .1em;
  font-family: "Songti SC", "SimSun", "Noto Serif SC", serif;
  color: var(--ink);
}
.sheet-name .big em { font-style: normal; color: var(--brand); }
.sheet-name .py { margin-top: 6px; font-size: 13px; color: var(--ink3); letter-spacing: .06em; }
.sheet-name .sc {
  margin-top: 11px; display: inline-flex; align-items: baseline; gap: 5px;
  padding: 6px 17px; border-radius: 20px; background: var(--brand-soft);
}
.sheet-name .sc b { font-size: 22px; color: var(--brand); font-variant-numeric: tabular-nums; }
.sheet-name .sc span { font-size: 12px; color: var(--brand); opacity: .8; }

.sec-title {
  font-size: 13.5px; font-weight: 600; margin: 18px 0 10px;
  display: flex; align-items: center; gap: 7px; color: var(--ink);
}
.sec-title::before {
  content: ''; width: 3px; height: 13px; border-radius: 2px; background: var(--brand);
}
.sec-title:first-child { margin-top: 0; }

.ge-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ge-table th {
  text-align: left; font-weight: 500; color: var(--ink3);
  font-size: 11.5px; padding: 0 0 8px; border-bottom: 1px solid var(--line);
}
.ge-table td { padding: 9px 0; border-bottom: 1px solid var(--line2); }
.ge-table tr:last-child td { border-bottom: 0; }
.ge-table .ge-num {
  font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--ink); margin-right: 7px;
}
.ge-table .ge-role { font-size: 11px; color: var(--ink3); }
.ge-table .ge-axis { color: var(--ink2); font-size: 12.5px; }
.grade-tag {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.grade-tag.g1 { background: #e7f3ec; color: var(--ok); }
.grade-tag.g2 { background: #f8f1e2; color: var(--warn); }
.grade-tag.g0 { background: #fbeae7; color: var(--bad); }

.reason-box {
  background: var(--card); border-radius: var(--radius-s);
  padding: 13px 14px; font-size: 12.8px; color: var(--ink2); line-height: 1.85;
  box-shadow: var(--shadow);
}
.reason-box b { color: var(--brand); font-weight: 600; }

.char-grid { display: flex; flex-direction: column; gap: 9px; }
.char-row {
  display: flex; gap: 11px; align-items: flex-start;
  background: var(--card); border-radius: var(--radius-s);
  padding: 12px 13px; box-shadow: var(--shadow);
}
.char-row .c-char {
  flex: none; width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 23px; font-weight: 500; color: #fff;
  font-family: "Songti SC", "SimSun", serif;
}
.char-row .c-body { flex: 1; min-width: 0; }
.char-row .c-line1 { font-size: 12.5px; color: var(--ink3); margin-bottom: 3px; }
.char-row .c-line1 b { color: var(--ink); font-weight: 600; font-size: 13.5px; }
.char-row .c-desc { font-size: 12.5px; color: var(--ink2); line-height: 1.6; }

/* 字义详解（训诂引证） */
.gloss-box {
  margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed var(--line);
  display: flex; flex-direction: column; gap: 5px;
}
.gloss-box .g-row { display: flex; gap: 7px; align-items: flex-start; }
.gloss-box .g-k {
  flex: none; width: 40px; text-align: center;
  font-size: 11px; line-height: 17px; height: 17px;
  color: var(--ink3); background: var(--line2);
  border-radius: 5px; letter-spacing: .5px;
}
.gloss-box .g-v { flex: 1; min-width: 0; font-size: 12.5px; color: var(--ink2); line-height: 1.62; }
.gloss-box .g-xun .g-k { color: #8a6a34; background: var(--gold-soft); }
.gloss-box .g-xun .g-v { color: var(--ink); }

.bp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bp-item {
  flex: 1; background: var(--card); border-radius: var(--radius-s);
  padding: 10px 4px; text-align: center; box-shadow: var(--shadow);
}
.bp-item .bp-v { font-size: 16px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.bp-item .bp-k { font-size: 10.5px; color: var(--ink3); margin-top: 3px; }

.wx-yi { display: flex; flex-wrap: wrap; gap: 6px; }
.wx-yi .tag { font-size: 12px; padding: 4px 10px; }

@media (min-width: 481px) {
  .app { box-shadow: 0 0 60px -20px rgba(60,45,30,.3); }
  body { background: #ddd7cc; }
}

/* ==========================================================================
 * 以下为「典籍取名」相关样式
 * ========================================================================== */

/* ---------------- 卖点横幅 ---------------- */
.hero {
  margin: 0 0 14px;
  padding: 15px 17px 16px;
  border-radius: var(--radius);
  background: linear-gradient(150deg, #fdf7f0 0%, #f9eee1 100%);
  border: 1px solid #f0e1d0;
}
.hero-line {
  font-family: "Songti SC", "SimSun", "Noto Serif SC", serif;
  font-size: 16.5px; font-weight: 600; color: #8a3a2c;
  letter-spacing: .04em;
}
.hero-line::before { content: "「"; opacity: .45; }
.hero-line::after { content: "」"; opacity: .45; }
.hero-stats {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-top: 10px; font-size: 11.5px; color: #8a7a68;
}
.hero-stats .hs b { font-size: 14px; color: var(--brand); font-weight: 600; margin: 0 1px; }
.hero-stats .hs-div { width: 1px; height: 11px; background: #e4d5c2; }

/* ---------------- 列表分组标题 ---------------- */
.group-head { margin: 20px 2px 10px; }
.group-head:first-child { margin-top: 6px; }
.gh-main { display: flex; align-items: center; gap: 8px; }
.gh-title {
  font-family: "Songti SC", "SimSun", serif;
  font-size: 16px; font-weight: 600; color: var(--ink);
  letter-spacing: .06em;
}
.gh-title::before {
  content: ""; display: inline-block;
  width: 3px; height: 14px; margin-right: 7px;
  background: var(--brand); border-radius: 2px;
  vertical-align: -1px;
}
.gh-badge {
  font-size: 11px; color: var(--brand);
  background: var(--brand-soft); padding: 2px 8px; border-radius: 20px;
}
.gh-sub { margin: 5px 0 0 10px; font-size: 11.5px; color: var(--ink3); }

/* ---------------- 名字卡里的出处 ---------------- */
.ni-origin {
  margin: 11px 0 0 36px;
  padding: 9px 11px 10px;
  background: linear-gradient(180deg, #fdf9f3, #fbf5ec);
  border-left: 3px solid #e3c99a;
  border-radius: 0 9px 9px 0;
}
.oi-head { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.oi-src {
  flex: none; font-size: 10.5px; color: #fff;
  background: var(--gold); padding: 1.5px 7px; border-radius: 4px;
}
.oi-ref { font-size: 11.5px; color: #9a7c46; }
.oi-line {
  font-family: "Songti SC", "SimSun", "Noto Serif SC", serif;
  font-size: 12.5px; line-height: 1.65; color: #6b5c46;
}
.oi-line em { font-style: normal; color: var(--brand); font-weight: 600; }

/* ---------------- 详情：出处典故 ---------------- */
.origin-card {
  padding: 15px 16px 16px;
  border-radius: var(--radius-s);
  background: linear-gradient(160deg, #fdf9f2 0%, #faf3e8 100%);
  border: 1px solid #efe0c9;
}
.oc-ref {
  display: inline-block; font-size: 12px; color: #8a6a34;
  background: #f7edd9; padding: 3px 10px; border-radius: 20px;
  margin-bottom: 11px;
}
.oc-line {
  font-family: "Songti SC", "SimSun", "Noto Serif SC", serif;
  font-size: 15px; line-height: 1.9; color: #4a4038;
  letter-spacing: .02em;
}
.oc-line em {
  font-style: normal; color: var(--brand); font-weight: 600;
  background: linear-gradient(180deg, transparent 60%, #f7e0d1 60%);
  padding: 0 1px;
}
.oc-word {
  margin-top: 12px; padding-top: 11px;
  border-top: 1px dashed #e9dac1;
  font-size: 12.5px; color: var(--ink2); line-height: 1.75;
}
.oc-word b { color: var(--brand); font-size: 14px; letter-spacing: .04em; }
.oc-tag {
  display: inline-block; margin-left: 7px; padding: 1px 7px;
  font-size: 10.5px; color: #8a6a34; background: #f0e3cb;
  border-radius: 20px; vertical-align: 1px;
}
.oc-mean { color: var(--ink3); }

.sheet-name .sn-badge {
  margin-top: 10px; display: inline-block;
  font-size: 11.5px; color: #8a6a34;
  background: #f7eeda; padding: 4px 12px; border-radius: 20px;
}

/* ==========================================================================
   第三次迭代：双套餐 / 筛查 / 长图报告
   ========================================================================== */

/* ---------------- 套餐选择 ---------------- */
.plans { display: grid; grid-template-columns: 1fr; gap: 9px; }
.plan-btn {
  display: flex; flex-direction: column; gap: 6px;
  padding: 13px 14px; text-align: left; cursor: pointer;
  background: var(--line2); border: 1.5px solid transparent;
  border-radius: var(--radius-s); font-family: inherit;
  transition: background .18s, border-color .18s;
}
.plan-btn b { font-size: 14.5px; color: var(--ink2); font-weight: 600; }
/* 说明为整段正文，字号降至 11.5px 时正文色必须够深（ink3/brand2 对比度低于 AA 4.5:1） */
.plan-btn small { font-size: 11.5px; color: var(--ink2); line-height: 1.62; }
.plan-btn.on { background: var(--brand-soft); border-color: var(--brand); }
.plan-btn.on b { color: var(--brand); }
.plan-btn.on small { color: var(--brand); }

.plan-feats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.plan-feats .pf {
  font-size: 11px; color: var(--ink2); background: #f7f3ec;
  padding: 4px 9px; border-radius: 20px; line-height: 1.45;
}

/* ---------------- 文本输入 ---------------- */
.text-input {
  width: 100%; height: 46px; padding: 0 14px; font-family: inherit;
  font-size: 14.5px; color: var(--ink); background: var(--line2);
  border: 1.5px solid transparent; border-radius: var(--radius-s);
  outline: none; transition: border-color .18s, background .18s;
}
.text-input::placeholder { color: var(--ink3); font-size: 13px; }
.text-input:focus { background: #fff; border-color: var(--brand); }
.text-input.disabled { opacity: .55; background: #f2efe9; }

/* ---------------- 指定典籍 ---------------- */
.chips-src .chip { font-size: 12.5px; }
.chips-src .chip.on { background: var(--gold-soft); color: #836427; border-color: #dcc79a; }

/* 指定典籍：按经史子集四部 + 蒙学 + 现代 分组陈列 */
.chips-src { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
.chips-src .chip-group { display: block; }
.chips-src .cg-head {
  display: flex; align-items: baseline; gap: 7px;
  font-size: 11.5px; color: var(--ink3); letter-spacing: .5px;
  margin-bottom: 7px; padding-left: 2px;
}
.chips-src .cg-head b { color: var(--gold); font-weight: 600; font-size: 12.5px; letter-spacing: 2px; }
.chips-src .cg-head span { font-size: 11px; color: var(--ink3); }
.chips-src .chip-row { display: flex; flex-wrap: wrap; gap: 7px; }

/* ---------------- 分段控件禁用 ---------------- */
.seg-btn.disabled { opacity: .38; cursor: not-allowed; }

/* ---------------- 结果页：方案头 ---------------- */
.result-head {
  display: flex; align-items: center; gap: 10px;
  padding: 0 2px 12px;
}
.rh-plan { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.rh-plan b { font-size: 15px; color: var(--brand); }
.rh-plan span { font-size: 11.5px; color: var(--ink3); }
.rh-sum { font-size: 11.5px; color: var(--ink3); text-align: right; line-height: 1.5; }
.rh-export {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  padding: 9px 13px; font-family: inherit; font-size: 12.5px; font-weight: 600;
  color: #fff; background: var(--brand); border: none; border-radius: 20px;
  cursor: pointer; box-shadow: 0 4px 12px -4px rgba(154, 59, 47, .5);
}
.rh-export:disabled { opacity: .6; }
.rh-export:active { transform: translateY(1px); }

.submit.ghost {
  background: transparent; color: var(--brand);
  border: 1.5px solid var(--brand); margin-top: 18px;
  box-shadow: none;
}
.submit.ghost:active { background: var(--brand-soft); }

/* ---------------- 筛查说明卡片 ---------------- */
.screen-card { margin-bottom: 18px; }
.screen-rows { display: flex; flex-direction: column; gap: 9px; margin-top: 11px; }
.screen-rows .sr { display: flex; gap: 10px; font-size: 12.5px; line-height: 1.62; }
.screen-rows .sr-k {
  flex: 0 0 62px; color: var(--ink3);
}
.screen-rows .sr-v { flex: 1; color: var(--ink2); }
.sr-note {
  margin: 4px 0 0; padding: 9px 11px; font-size: 11px; line-height: 1.7;
  color: #8a7f70; background: #faf7f1; border-radius: var(--radius-s);
}

/* ---------------- 名字卡：重名 / 避讳状态 ---------------- */
.ni-stat { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.ni-stat .st {
  font-size: 11px; padding: 3px 9px; border-radius: 20px;
  background: #f6f3ed; color: var(--ink2); line-height: 1.5;
}
.ni-stat .st.r-rare { background: #eaf4ee; color: #2b7048; }
.ni-stat .st.r-normal { background: #f7f2e6; color: #8a6a34; }
.ni-stat .st.r-common { background: #fbeeea; color: #a8442f; }
.ni-stat .st.a-ok { background: #eaf4ee; color: #2b7048; }
.ni-stat .st.a-warn { background: #fdf1e2; color: #b8752a; }
.ni-stat .st.a-bad { background: #fbe9e6; color: #b4453a; }

.oi-style {
  font-size: 10.5px; color: #8a6a34; background: #f3e8d2;
  padding: 2px 8px; border-radius: 20px; margin-left: auto;
}

/* ---------------- 详情弹层：核查卡片 ---------------- */
.check-card {
  background: var(--card); border-radius: var(--radius-s);
  padding: 13px 15px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 7px;
}
.check-card .ck-line { font-size: 14px; color: var(--ink); }
.check-card .ck-line b { font-size: 15px; }
.check-card .ck-line b.r-rare, .check-card .ck-line b.a-ok { color: #2b7048; }
.check-card .ck-line b.r-normal, .check-card .ck-line b.a-warn { color: #a97c22; }
.check-card .ck-line b.r-common, .check-card .ck-line b.a-bad { color: #b4453a; }
.check-card .ck-line b.c-gold { color: #8a6a34; }
.check-card .ck-sub { font-size: 12.5px; color: var(--ink2); line-height: 1.66; }
.check-card .ck-note {
  font-size: 11px; color: var(--ink3); line-height: 1.7;
  padding-top: 7px; border-top: 1px dashed var(--line);
}

/* ---------------- 空结果 ---------------- */
.empty-tip {
  padding: 34px 22px; text-align: center;
  font-size: 13px; line-height: 1.9; color: var(--ink3);
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------------- 长图报告预览 ---------------- */
.rep-mask {
  position: fixed; inset: 0; background: rgba(30, 24, 18, .58);
  z-index: 60; backdrop-filter: blur(2px);
}
.rep-wrap {
  position: fixed; inset: 0; z-index: 61;
  display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0px) + 52px) 0 calc(env(safe-area-inset-bottom, 0px) + 8px);
  pointer-events: none;
}
.rep-bar {
  position: absolute; top: 0; left: 0; right: 0; height: 52px;
  display: flex; align-items: center; gap: 10px; padding: 0 14px;
  pointer-events: auto;
}
.rep-close {
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: rgba(255, 255, 255, .18); color: #fff; font-size: 15px;
  cursor: pointer; flex-shrink: 0; line-height: 1;
}
.rep-title {
  flex: 1; font-size: 13.5px; color: #fff; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rep-save {
  padding: 8px 16px; border: none; border-radius: 20px;
  background: #fff; color: var(--brand); font-size: 13px; font-weight: 600;
  font-family: inherit; cursor: pointer; flex-shrink: 0;
}
.rep-save:disabled { opacity: .55; }
.rep-scroll {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 0 14px; pointer-events: auto;
}
.rep-img {
  display: block; width: 100%; height: auto;
  border-radius: 10px; background: #fff;
  box-shadow: 0 12px 40px -12px rgba(0, 0, 0, .5);
}
.rep-tip {
  margin: 10px 14px 0; font-size: 11px; color: rgba(255, 255, 255, .72);
  text-align: center; line-height: 1.6; pointer-events: auto;
}

/* ---------------- 名字卡 · 分享按钮 ---------------- */
.ni-share {
  margin-left: auto; flex: none;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border: 1px solid var(--line); border-radius: 20px;
  background: #fff; color: var(--brand);
  font-size: 11.5px; font-weight: 600; font-family: inherit; line-height: 1;
  cursor: pointer;
}
.ni-share:active { background: var(--brand-soft); }
.ni-share svg { display: block; }

/* ---------------- 分享弹层 ---------------- */
.share-mask {
  position: fixed; inset: 0; background: rgba(30, 24, 18, .6);
  z-index: 70; backdrop-filter: blur(2px);
}
.share-wrap {
  position: fixed; inset: 0; z-index: 71;
  display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0px) + 52px) 0 calc(env(safe-area-inset-bottom, 0px) + 8px);
  pointer-events: none;
}
.share-bar {
  position: absolute; top: 0; left: 0; right: 0; height: 52px;
  display: flex; align-items: center; gap: 10px; padding: 0 14px;
  pointer-events: auto;
}
.share-close {
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: rgba(255, 255, 255, .18); color: #fff; font-size: 15px;
  cursor: pointer; flex-shrink: 0; line-height: 1;
}
.share-title {
  flex: 1; font-size: 13.5px; color: #fff; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.share-scroll {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 0 14px; pointer-events: auto;
  display: flex; align-items: flex-start; justify-content: center;
}
.share-img {
  display: block; width: 100%; max-width: 380px; height: auto;
  border-radius: 12px; background: #fff;
  box-shadow: 0 12px 40px -12px rgba(0, 0, 0, .5);
}
.share-acts { display: flex; gap: 10px; padding: 12px 14px 0; pointer-events: auto; }
.share-act {
  flex: 1; padding: 12px 8px; border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 12px; background: rgba(255, 255, 255, .14); color: #fff;
  font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer;
}
.share-act.primary { background: #fff; color: var(--brand); border-color: #fff; }
.share-act:disabled { opacity: .6; }
.share-tip {
  margin: 10px 14px 0; font-size: 11px; color: rgba(255, 255, 255, .72);
  text-align: center; line-height: 1.6; pointer-events: auto;
}

/* ==========================================================================
   商业化 · 付费墙与锁定态
   ========================================================================== */

/* 锁定态的状态标签（替代「重名热度」等付费信息） */
.st-lock { background: var(--gold-soft); color: #8a7642; }

/* 名字卡内的出处锁定占位 */
.ni-origin-locked {
  background: var(--gold-soft); border: 1px dashed rgba(173, 138, 58, .5);
  border-radius: 10px; padding: 10px 12px;
}
.oil-txt { font-size: 12px; color: #8a7642; }

/* 典籍雅名示例卡（免费层尝鲜：露出出处，制造转化动机） */
.teaser-card {
  position: relative; background: var(--card);
  border: 1px dashed rgba(173, 138, 58, .6); border-radius: var(--radius);
  padding: 15px 15px 13px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.tc-badge {
  position: absolute; top: -9px; right: 14px; background: var(--gold); color: #fff;
  font-size: 11px; padding: 2px 9px; border-radius: 20px; letter-spacing: .04em;
}

/* 解锁卡 */
.lock-card {
  background: #fffdf8; border: 1px solid rgba(173, 138, 58, .34);
  border-radius: var(--radius); padding: 20px 17px 17px; margin: 2px 0 14px;
  text-align: center; box-shadow: var(--shadow);
}
.sheet-lock { margin-top: 14px; }
.lk-head { font-size: 16.5px; font-weight: 600; color: var(--ink); letter-spacing: .02em; }
.lk-head::after {
  content: ''; display: block; width: 34px; height: 2px; margin: 9px auto 0;
  background: var(--gold); border-radius: 2px;
}
.lk-list { list-style: none; margin: 15px 0 16px; padding: 0; text-align: left; }
.lk-list li {
  position: relative; padding-left: 20px; font-size: 12.5px; line-height: 2; color: var(--ink2);
}
.lk-list li::before {
  content: ''; position: absolute; left: 5px; top: 11px; width: 5px; height: 5px;
  border-radius: 50%; background: var(--gold);
}
.lk-price { font-size: 27px; font-weight: 600; color: var(--brand); line-height: 1.2; margin-bottom: 14px; }
.lk-price-suf {
  display: block; font-size: 11.5px; font-weight: 400; color: var(--ink3); margin-top: 5px;
}
.lk-btn {
  display: block; width: 100%; padding: 14px; border: 0; border-radius: 12px;
  background: var(--brand); color: #fff; font-size: 15.5px; font-weight: 600;
  font-family: inherit; cursor: pointer; letter-spacing: .04em;
}
.lk-btn:active { background: var(--brand2); }
.lk-btn:disabled { opacity: .6; }
.lk-note { margin-top: 11px; font-size: 11px; color: var(--ink3); line-height: 1.65; }

/* 训诂锁定行 */
.g-locked .g-k { color: var(--gold); }
.g-locked .g-v { color: #8a7642; }
