/* ============================================================
   揆初度而锡嘉名 · 日式侘寂 Japandi（全站统一）
   —— 生成色米白 / 苔绿墨 / 陶土赭；字重克制、留白充足、装饰极弱

   设计原则：
   1. 字体全部无衬线（Windows 上不存在好看的宋体，衬线＝糊）
   2. 标题走 --sans-light（雅黑 Light），正文走 --sans，两套栈不可混用
   3. 品牌色只用在一处强调（主按钮 / 当前导航 / 关键数据）
   4. 层级靠「留白 + 字重 + 1px 边框」区分，不靠颜色和阴影
   5. 圆角小（10-12px），阴影短而淡且偏暖，不用渐变堆质感
   6. 中文字距 .04~.26em 分档放开，英文不会被撑散

   类名与既有 HTML / JS 完全兼容，仅换装视觉。
   ============================================================ */

:root {
  /* ============================================================
     色板：日式侘寂 Japandi（全站统一）
     生成色米白 + 苔绿墨 + 陶土赭；字重克制、留白充足、装饰极弱。
     对比度（对 --bg #F5F1E9）：ink 15.5 / ink-2 7.0 / muted 5.4 / brand 6.9 / accent 5.7。
     ============================================================ */
  /* ---- 中性色阶 ---- */
  --bg:        #F5F1E9;   /* 页面底（生成色米白） */
  --surface:   #FCFAF5;   /* 卡片 */
  --surface-2: #F0ECE2;   /* 浅底区块 */
  --surface-3: #EAE5D9;   /* 表头 / 轨道 */
  --ink:       #1B1A17;   /* 主文字 */
  --ink-2:     #54514A;   /* 次文字 */
  --muted:     #66625A;   /* 辅助说明（对比度 ≥ 4.5） */
  --dim:       #8A8579;   /* 时间戳等弱信息 */
  --line:      #E4DFD4;   /* 分隔线 */
  --line-2:    #D6D0C2;   /* 控件描边 */

  /* ---- 品牌色：苔绿墨（克制，不抢戏） ---- */
  --brand:      #49564B;
  --brand-2:    #37443A;
  --brand-soft: rgba(73, 86, 75, .09);
  --brand-line: #D8D2C6;

  /* ---- 点睛：陶土赭（只给干支 / 评分 / 标题强调用） ---- */
  --accent:      #9C6B4F;
  --accent-soft: #F3EDE3;
  --accent-line: #C4B3A3;

  /* ---- 语义 ---- */
  --ok:         #4F6B4A;  --ok-soft: #EDF2EA;  --ok-line: #CDDCC8;
  --warn:       #8E6B33;  --warn-soft: #F6F0E4; --warn-line: #E2D2B4;
  --bad:        #A65B45;  --bad-soft: #F7EDE8;  --bad-line: #E3C6BB;
  --info:       #4A5A66;  --info-soft: #EFF2F4;
  --flat:       #8A8579;  --flat-soft: #EFEBE1;

  /* ---- 阴影：暖调、短而淡 ---- */
  --shadow-xs: 0 1px 2px rgba(30, 32, 26, .05);
  --shadow-sm: 0 1px 3px rgba(30, 32, 26, .08), 0 1px 2px rgba(30, 32, 26, .04);
  --shadow-md: 0 4px 14px rgba(30, 32, 26, .08), 0 1px 3px rgba(30, 32, 26, .04);
  --shadow-lg: 0 14px 32px rgba(30, 32, 26, .10), 0 2px 6px rgba(30, 32, 26, .04);

  /* ---- 圆角 / 缓动 ---- */
  --radius:     12px;
  --radius-sm:  8px;
  --ease:       cubic-bezier(.22, .61, .21, 1);
  --spring:     cubic-bezier(.34, 1.32, .64, 1);

  /* ---- 字体：纯无衬线，Windows 优先雅黑 ---- */
  /* 正文栈：不含 Light —— 一旦栈里出现「Microsoft YaHei Light」，正文 400 也会命中 Light 而发虚 */
  --sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI",
          "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC",
          "Segoe UI", system-ui, -apple-system, sans-serif;
  /* 标题专用栈：显式第一个写死 Light 变体。
     不这么写的话，Windows 上请求 font-weight:300 也拿不到雅黑 Light（只有 Light/Regular/Bold 三档），
     会静默回退成 Regular，标题依旧显「实」。macOS 上自动落到 PingFang SC Light。 */
  --sans-light: "Microsoft YaHei Light", "PingFang SC", "HarmonyOS Sans SC",
                "Microsoft YaHei", "Noto Sans SC", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}

.mono { font-family: var(--mono); }

::selection { background: var(--brand); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--surface-3); }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--dim); }

/* ============================================================
   顶栏
   ============================================================ */
.hero {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 14px clamp(16px, 4vw, 44px);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.hero-inner {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.brand-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
/* 品牌标记：简洁方块，品牌蓝，无装饰 */
.seal {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: var(--brand);
  border-radius: var(--radius-sm);
  user-select: none;
}
.logo {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--ink);
  white-space: nowrap;
}
.slogan {
  margin: 0;
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--muted);
  white-space: nowrap;
  padding-left: 4px;
  border-left: 1px solid var(--line);
}

.nav { margin-left: auto; display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  letter-spacing: .01em;
  position: relative;
  transition: color .16s, background .16s;
}
.nav a:hover { color: var(--ink-2); background: var(--surface-2); }
.nav a.active {
  color: var(--brand);
  font-weight: 600;
  background: var(--brand-soft);
}
.nav a .ic { font-size: 15px; opacity: .7; }
.nav a:hover .ic, .nav a.active .ic { opacity: 1; }

/* ============================================================
   版心 + 面板
   ============================================================ */
main {
  max-width: 1160px;
  margin: 0 auto;
  padding: 32px clamp(16px, 4vw, 44px) 40px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px clamp(18px, 2.6vw, 28px);
  margin-bottom: 24px;
  box-shadow: var(--shadow-xs);
}
.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .01em;
}
.panel-title::before {
  content: "";
  flex: 0 0 auto;
  width: 3px;
  height: 16px;
  border-radius: 99px;
  background: var(--brand);
}
.panel-title::after { display: none; }
.panel-title .ic { font-size: 17px; color: var(--brand); }

/* ============================================================
   表单控件
   ============================================================ */
.controls, .bazi-inputs, .ck-inputs, .yn-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
/* 说明文字与图标、控件横向同排（竖排会把图标挤到第二行，显得散） */
.controls label, .bazi-inputs label, .ck-inputs label, .yn-row label {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: .01em;
}
/* 横向排布后输入框不再被 flex 压缩，宽度按各自设定保留 */
.controls label > input, .controls label > select,
.bazi-inputs label > input, .bazi-inputs label > select,
.ck-inputs label > input, .ck-inputs label > select,
.yn-row label > input, .yn-row label > select { flex: 0 0 auto; }
.controls input, .controls select,
.bazi-inputs input, .bazi-inputs select,
.ck-inputs input, .ck-inputs select,
.yn-row input, .yn-row select {
  font-family: inherit;
  font-size: 14px;
  padding: 9px 11px;
  min-height: 40px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  box-shadow: var(--shadow-xs);
  font-variant-numeric: tabular-nums;
  transition: border-color .15s, box-shadow .15s;
}
.controls input:focus, .controls select:focus,
.bazi-inputs input:focus, .bazi-inputs select:focus,
.ck-inputs input:focus, .ck-inputs select:focus,
.yn-row input:focus, .yn-row select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47, 107, 158, .12);
}
.controls select, .bazi-inputs select, .ck-inputs select, .yn-row select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  cursor: pointer;
}
.controls select option, .bazi-inputs select option,
.ck-inputs select option, .yn-row select option { background: #fff; color: var(--ink); }

.ck-inputs input#ckName { width: 170px; }
/* 姻缘合名：双方姓名（选填） */
.yn-row input#ymName, .yn-row input#yfName { width: 130px; }
.ck-inputs input:disabled { background: var(--surface-3); color: var(--dim); cursor: not-allowed; }

.min90-label {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 14px;
  cursor: pointer;
  letter-spacing: 0;
  user-select: none;
  padding-bottom: 10px;
}
.min90-label input { width: 16px; height: 16px; accent-color: var(--brand); padding: 0; }

.libhint { margin: 0 0 18px; font-size: 12.5px; color: var(--muted); }

button { font-family: inherit; cursor: pointer; }

/* ---- 按钮 ---- */
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  background: var(--brand);
  color: #fff;
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 10px 24px;
  min-height: 42px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .01em;
  text-indent: 0;
  box-shadow: var(--shadow-sm);
  transition: background .16s, transform .16s, box-shadow .16s;
}
.primary:hover { background: var(--brand-2); border-color: var(--brand-2); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.primary:active { transform: translateY(0); box-shadow: var(--shadow-xs); }
.primary .ic { font-size: 1.05em; }
.primary:hover .ic { transform: translateX(2px); transition: transform .2s var(--ease); }

.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  background: var(--surface);
  color: var(--brand);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 9px 20px;
  min-height: 40px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .01em;
  text-indent: 0;
  box-shadow: var(--shadow-xs);
  transition: border-color .16s, color .16s, background .16s;
}
.ghost:hover { border-color: var(--brand-line); color: var(--brand-2); background: var(--brand-soft); }
.ghost .ic { font-size: 1.05em; }

.reportbtn {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  border-radius: var(--radius-sm);
  padding: 7px 16px;
  min-height: 36px;
  font-size: 13px;
  transition: .16s;
  box-shadow: none;
}
.reportbtn:hover { border-color: var(--brand-line); color: var(--brand); background: var(--brand-soft); }

.favbtn {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  border-radius: var(--radius-sm);
  padding: 7px 16px;
  min-height: 36px;
  font-size: 13px;
  font-weight: 500;
  transition: .16s;
  box-shadow: none;
}
.favbtn:hover { background: var(--accent-soft); }
.favbtn.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.favbtn.on:hover { background: var(--accent); filter: brightness(1.06); }
.favitem .favbtn, .namecard .favbtn { border: none; background: transparent; color: var(--accent); padding: 4px 6px; min-height: auto; box-shadow: none; }
.favitem .favbtn:hover, .namecard .favbtn:hover { background: transparent; }

/* ============================================================
   名字卡片
   ============================================================ */
.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 16px; }
.empty {
  color: var(--muted);
  grid-column: 1 / -1;
  padding: 40px 20px;
  text-align: center;
  letter-spacing: .04em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.empty .ic { font-size: 28px; opacity: .45; }

.namecard {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.namecard:hover {
  transform: translateY(-2px);
  border-color: var(--brand-line);
  box-shadow: var(--shadow-md);
}
.nhead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.nfull {
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .04em;
}
.npinyin { font-size: 11.5px; color: var(--muted); letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.ntag {
  font-size: 11px;
  color: var(--brand);
  border: 1px solid var(--brand-line);
  border-radius: 99px;
  padding: 1px 10px;
  white-space: nowrap;
  letter-spacing: .01em;
  background: var(--brand-soft);
}
.ntag.gender { margin-left: 5px; }
.ntag.gender.male { background: var(--info-soft); color: var(--info); border-color: #d3dfe8; }
.ntag.gender.female { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
.nchars { display: flex; flex-wrap: wrap; gap: 8px; }

.cchip {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  min-width: 60px;
  gap: 1px;
  transition: .16s;
}
.cchip:hover { border-color: var(--brand-line); background: var(--brand-soft); }
.cchip {
  font-size: 21px;
  font-weight: 600;
  color: var(--ink);
}
.cchip i { font-style: normal; font-size: 10px; color: var(--muted); margin-top: 0; letter-spacing: .02em; }
.cchip u {
  text-decoration: none;
  font-size: 9.5px;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-radius: 99px;
  padding: 0 6px;
  letter-spacing: .01em;
  margin-bottom: 2px;
}
.cktag {
  text-decoration: none;
  font-style: normal;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 99px;
  padding: 0 7px;
  margin-bottom: 2px;
}
.cchip em { font-style: normal; font-size: 11px; color: var(--muted); margin-top: 0; }
.nmean { font-size: 13px; color: var(--ink-2); line-height: 1.7; }
.rmean { font-size: 13px; color: var(--ink-2); line-height: 1.7; }
.nbtns { display: flex; gap: 8px; margin-top: 2px; flex-wrap: wrap; }
.rad {
  display: inline-block;
  margin-top: 2px;
  font-size: 9.5px;
  color: var(--muted);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 0 5px;
}
.nfrom {
  font-size: 12.5px;
  color: var(--ink-2);
  background: var(--surface-2);
  border-left: 3px solid var(--brand-line);
  border-radius: 6px;
  padding: 8px 12px;
  line-height: 1.6;
}

/* ============================================================
   收藏 / 留言板
   ============================================================ */
.fav-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.fav-head-btns { display: flex; gap: 8px; }
.badge {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  border-radius: 99px;
  padding: 1px 10px;
  margin-left: 6px;
}
.favlist { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.favitem {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 14px;
  transition: .16s;
}
.favitem:hover { border-color: var(--brand-line); box-shadow: var(--shadow-sm); }
.fname { font-size: 16px; font-weight: 600; letter-spacing: .04em; color: var(--ink); }
.fpy { font-size: 12px; color: var(--muted); }
.favitem .favbtn { border: none; background: transparent; color: var(--accent); padding: 4px 6px; font-size: 15px; min-height: auto; }

.board-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.board-tip { margin: 0 0 18px; font-size: 12.5px; color: var(--muted); }
.board-note { margin: 0 0 14px; font-size: 12.5px; color: var(--muted); }
.board-form {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 22px;
}
.board-form input, .board-form textarea {
  font-family: inherit; font-size: 14px; padding: 9px 11px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  outline: none; min-height: 42px;
}
.board-form input { max-width: 300px; }
.board-form textarea { min-height: 96px; resize: vertical; line-height: 1.7; }
.board-form input:focus, .board-form textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 107, 158, .12); }
.board-form-btns { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.board-count { font-size: 12.5px; color: var(--muted); margin-right: auto; font-variant-numeric: tabular-nums; }
.gb-list { display: flex; flex-direction: column; gap: 10px; }
.gb-empty { color: var(--muted); text-align: center; padding: 24px; font-size: 13px; }
.gb-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.gb-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.gb-name { font-size: 15px; font-weight: 600; letter-spacing: .02em; color: var(--ink); }
.gb-right { display: flex; align-items: baseline; gap: 10px; }
.gb-time { font-size: 11.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
.gb-del { background: none; border: none; color: var(--dim); font-size: 12.5px; cursor: pointer; padding: 4px; }
.gb-del:hover { color: var(--bad); }
.gb-text { font-size: 14px; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; line-height: 1.75; }

/* ============================================================
   底部
   ============================================================ */
.foot {
  text-align: center;
  color: var(--dim);
  font-size: 12.5px;
  padding: 8px 18px 34px;
  border-top: 1px solid var(--line);
}

/* ICP 备案号：class 名含 icp，_i18n_static.js 会跳过它不做中文残留检查 */
.foot .icp { margin-top: 6px; font-size: 12px; color: var(--dim); }

/* ============================================================
   生辰八字
   ============================================================ */
.bazi-block {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 22px;
}
.bazi-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.bazi-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .01em;
  display: flex; align-items: center; gap: 8px;
}
.bazi-title::before {
  content: ""; width: 5px; height: 5px; border-radius: 1px;
  background: var(--brand);
}
.bazi-box { margin-top: 14px; }
.bazi-result { margin-top: 20px; }

.bz-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 6px 24px; }
.bz-grid > div { display: flex; gap: 8px; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.bz-k { font-size: 12.5px; color: var(--muted); min-width: 56px; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.bz-v { font-size: 14px; color: var(--ink-2); font-weight: 500; }
.bz-v.hl { color: var(--brand); font-weight: 600; }
.bz-v.good { color: var(--ok); }
.bz-v.bad { color: var(--bad); }

.bz-sec-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 22px 0 12px;
  display: flex; align-items: center; gap: 8px;
}
.bz-sec-title::before { content: ""; width: 5px; height: 5px; border-radius: 1px; background: var(--brand); }
.bz-pillars { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0; }
.bz-pillar {
  flex: 1 1 120px; min-width: 104px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 8px;
  text-align: center;
}
.bz-pk { display: block; font-size: 11.5px; color: var(--muted); letter-spacing: .08em; }
.bz-pgz {
  display: block;
  font-size: 22px; font-weight: 700;
  color: var(--accent);
  letter-spacing: .04em; margin: 3px 0 2px;
  font-variant-numeric: tabular-nums;
}
.bz-pwx { display: block; font-size: 12.5px; color: var(--muted); }
.bz-notes {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
}
.bz-note { color: var(--ink-2); font-size: 13.5px; line-height: 1.8; margin: 6px 0; }

/* 排盘表：浅底表头，去掉深蓝渐变块 */
.bz-table { margin: 4px 0 6px; overflow-x: auto; }
.bz-table table {
  border-collapse: separate; border-spacing: 0;
  width: 100%; min-width: 440px; table-layout: fixed;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.bz-table th, .bz-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 9px 6px;
  text-align: center; font-size: 14.5px; vertical-align: middle;
}
.bz-table th:last-child, .bz-table td:last-child { border-right: none; }
.bz-table tr:last-child td, .bz-table tr:last-child th { border-bottom: none; }
.bz-table th {
  background: var(--surface-3);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .02em;
}
.bz-table th.bz-qk { width: 13%; color: var(--muted); font-weight: 500; letter-spacing: .08em; }
.bz-table th:not(.bz-qk) { width: 21.75%; }
.bz-table td.bz-th { background: var(--surface-2); color: var(--muted); font-weight: 500; font-size: 12.5px; width: 13%; }
.bz-table td:not(.bz-th) { color: var(--ink); font-weight: 500; }
.bz-table td.bz-dense {
  font-size: 12px; line-height: 1.5; font-weight: 400;
  white-space: normal; word-break: break-all;
  font-variant-numeric: tabular-nums;
}
.bz-table .wx { margin: 0 0 0 4px; vertical-align: middle; letter-spacing: 0; }

/* ---- 命盘 ---- */
.mp-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.mp-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.mp-row:last-child { border-bottom: none; }
.mp-k {
  flex: 0 0 104px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 10px 6px;
  border-right: 1px solid var(--line);
}
.mp-v {
  flex: 1;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--ink);
  display: flex; align-items: center;
  word-break: break-all;
}
.mp-l { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 0 12px; }
.mp-link {
  color: var(--brand);
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
  padding: 3px 8px; border-radius: 6px;
}
.mp-link:hover { color: var(--brand-2); background: var(--brand-soft); text-decoration: none; }
.mp-wrap { display: flex; align-items: stretch; gap: 8px; margin-top: 10px; }
.mp-badge {
  flex: 0 0 26px; width: 26px;
  align-self: flex-start;
  border-radius: 50%;
  color: #fff;
  font-size: 13px; font-weight: 600;
  text-align: center; line-height: 26px;
  margin-top: 9px;
}
.mp-ming { background: var(--accent); }
.mp-yun { background: var(--brand); }
.mp-table {
  border-collapse: separate; border-spacing: 0;
  width: 100%; table-layout: fixed;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.mp-table th, .mp-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 8px 4px; text-align: center; font-size: 13.5px; word-break: break-all;
}
.mp-table th:last-child, .mp-table td:last-child { border-right: none; }
.mp-table tr:last-child td { border-bottom: none; }
.mp-table th {
  background: var(--surface-3);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 12.5px;
}
.mp-table td { color: var(--ink); font-weight: 500; }
.mp-p { margin: 0 0 14px; line-height: 1.85; font-size: 14px; color: var(--ink-2); }
.mp-p b { color: var(--brand); font-weight: 600; }
.mp-sub { color: var(--muted); font-size: 12px; }

/* 五行喜忌弹窗 */
.wx-strip {
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
  background: var(--surface);
}
.wx-strip > div { flex: 1; text-align: center; padding: 10px 4px; border-right: 1px solid var(--line); }
.wx-strip > div:last-child { border-right: none; }
.wx-k { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.wx-v { display: block; font-size: 15px; font-weight: 600; color: var(--ink); }

/* 分项详批卡片 */
.bz-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); gap: 12px; }
.bz-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--surface);
}
.bz-card::before { display: none; }
.bz-card-k {
  font-size: 13.5px; font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.bz-card-v { font-size: 13.5px; line-height: 1.85; color: var(--ink-2); }

.bz-luck {
  display: inline-block;
  min-width: 32px;
  text-align: center;
  padding: 1px 9px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid transparent;
}
.bz-luck-ji { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.bz-luck-xiong { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
.bz-luck-ping { background: var(--flat-soft); color: var(--flat); border-color: var(--line-2); }
.bz-zongping { border-left: 3px solid var(--brand); background: var(--brand-soft); }

/* ---- 五行色标（低饱和五色，白字） ---- */
.wx {
  display: inline-block;
  margin-top: 3px;
  font-style: normal;
  font-size: 10px;
  border-radius: 4px;
  padding: 0 5px;
  color: #fff;
  font-weight: 600;
  letter-spacing: .01em;
}
/* 五行五色：随 Japandi 暖色板降饱和，白字对比度均 ≥ 5:1 */
.wx-jin  { background: #8A6A2F; }
.wx-mu   { background: #4F6B4A; }
.wx-shui { background: #3F6478; }
.wx-huo  { background: #A65B45; }
.wx-tu   { background: #7A6440; }

.wx-dot {
  width: 34px; height: 34px; line-height: 34px;
  border-radius: 50%; padding: 0; margin: 0;
  font-size: 14px; font-weight: 600;
  color: #fff;
}
.bz-table .mp-wxtable { table-layout: fixed; width: 100%; min-width: 0; }
.bz-table .mp-wxtable td { vertical-align: middle; padding: 8px 2px; text-align: center; }
.bz-table .mp-wxtable td:first-child { width: 20%; }
.bz-table .mp-wxtable td:not(:first-child) { width: 16%; }
.bz-table .mp-wxtable .wx-dot { margin: 0; }
.bz-table tr.bz-cur td { background: var(--brand-soft); color: var(--brand-2); font-weight: 600; }

/* ============================================================
   评分
   ============================================================ */
.score {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.scoretotal { font-size: 12.5px; color: var(--muted); text-align: center; line-height: 1; flex: 0 0 auto; }
.scoretotal b {
  font-size: 26px;
  color: var(--accent);
  display: block;
  font-variant-numeric: tabular-nums;
}
.scorebars { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sbar { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.sbar .sl { width: 36px; }
.sbar .strack {
  flex: 1; height: 6px;
  background: var(--surface-3);
  border-radius: 99px;
  overflow: hidden;
}
.sbar .strack i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.sbar .sv { width: 22px; text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sbar.signed .strack i { background: var(--flat); }
.sbar.signed.pos .strack i { background: var(--ok); }
.sbar.signed.neg .strack i { background: var(--bad); }
.sbar.signed .sv { color: var(--muted); }

.ritem { font-size: 13px; }
.ritem.bad { color: var(--bad); }
.ritem.ok { color: var(--ok); }
.fscore { font-size: 13px; color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ============================================================
   姻缘合名
   ============================================================ */
.yinyuan-block {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.yn-row { margin-bottom: 12px; }
.yn-who {
  font-size: 14px; font-weight: 600;
  color: var(--ink);
  align-self: flex-end;
  padding-bottom: 11px;
  display: inline-flex; align-items: center;
  letter-spacing: .02em;
}
.yn-who::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--brand);
  border-radius: 1px;
  margin-right: 7px;
}
.yn-tip { margin: 4px 0 14px; font-size: 12.5px; color: var(--muted); }
.yn-result { margin-top: 6px; }
.yn-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.yn-sum {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 14px;
}
.yn-score { font-size: 14px; color: var(--muted); }
.yn-score b { font-size: 24px; color: var(--accent); font-variant-numeric: tabular-nums; }
.yn-stars { color: var(--accent); letter-spacing: 2px; margin-left: 6px; }
.yn-verdict {
  font-size: 15px; font-weight: 600;
  color: var(--brand);
  letter-spacing: .01em;
}
.yn-people { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; font-size: 13.5px; color: var(--ink-2); }
.yn-p { background: var(--surface-2); border-radius: 6px; padding: 6px 11px; }
.yn-parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); gap: 12px; }
.yn-part {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--surface);
}
.yn-part-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; gap: 8px; }
.yn-part-t { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.yn-part-l { font-size: 11.5px; padding: 2px 9px; border-radius: 99px; font-weight: 500; }
.yn-part-x { font-size: 13px; color: var(--ink-2); line-height: 1.75; margin: 0; }
.lv-good { border-left: 3px solid var(--ok); }
.lv-good .yn-part-l { background: var(--ok-soft); color: var(--ok); }
.lv-mid { border-left: 3px solid var(--warn); }
.lv-mid .yn-part-l { background: var(--warn-soft); color: var(--warn); }
.lv-bad { border-left: 3px solid var(--bad); }
.lv-bad .yn-part-l { background: var(--bad-soft); color: var(--bad); }
.lv-flat { border-left: 3px solid var(--flat); }
.lv-flat .yn-part-l { background: var(--flat-soft); color: var(--flat); }
.yn-disclaim { margin: 14px 0 0; font-size: 12px; color: var(--muted); }

/* ============================================================
   弹窗
   ============================================================ */
.modal { position: fixed; inset: 0; display: none; z-index: 60; }
.modal.show { display: block; }
.modal-mask { position: absolute; inset: 0; background: rgba(16, 24, 40, .38); }
.modal-box {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(680px, 92vw);
  max-height: 86vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.modal-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  border-radius: 6px var(--radius) 0 0;
  position: sticky; top: 0;
  font-size: 15px; font-weight: 600;
  z-index: 2;
}
.modal-bar .primary { box-shadow: none; }
.modal-body { padding: 18px 20px 22px; }

/* ============================================================
   初度测名
   ============================================================ */
.check-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 14px 12px;
  margin-bottom: 10px;
}
.ck-result { display: flex; flex-direction: column; gap: 18px; }
.ck-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.ck-name {
  font-size: 30px; font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink);
  line-height: 1.25;
}
.ck-py { font-size: 12.5px; color: var(--muted); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.ck-verdict {
  font-size: 13.5px; font-weight: 600;
  letter-spacing: .01em;
  padding: 6px 16px;
  border-radius: 99px;
  white-space: nowrap;
}
.ck-verdict.v4 { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-line); }
.ck-verdict.v3 { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-line); }
.ck-verdict.v2 { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); }
.ck-verdict.v1 { background: var(--bad-soft); color: var(--bad); border: 1px solid var(--bad-line); }

.ck-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; align-items: start; }
.ck-sec-title {
  font-size: 15px; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.ck-sec-title::before { content: ""; width: 5px; height: 5px; border-radius: 1px; background: var(--brand); }
.ck-list { display: flex; flex-direction: column; gap: 8px; }
.ck-item {
  display: flex; gap: 11px; align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.ck-item::before { display: none; }
.ck-item.ok { border-left: 3px solid var(--ok); }
.ck-item.warn { border-left: 3px solid var(--warn); }
.ck-item.bad { border-left: 3px solid var(--bad); }
.ck-item.info { border-left: 3px solid var(--info); }
.ck-ico { font-size: 14px; line-height: 1.8; color: var(--muted); }
.ck-t { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.ck-d { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.75; }
.ck-sug {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13px; color: var(--ink-2);
}
.ck-sug b { color: var(--brand); font-weight: 600; }
.ck-sugchips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ck-sugchip {
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 5px 13px;
  font-size: 16px;
  background: var(--surface);
  color: var(--ink);
  letter-spacing: .06em;
  cursor: pointer;
  transition: .16s;
}
.ck-sugchip:hover { border-color: var(--brand-line); color: var(--brand); background: var(--brand-soft); }
.ck-sugchip i { font-style: normal; font-size: 11px; color: var(--muted); margin-left: 5px; }

.sur-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 16px;
  font-size: 13.5px; line-height: 1.85;
  color: var(--ink-2);
}
.sur-name { font-size: 16px; font-weight: 600; color: var(--accent); margin-right: 6px; }
.sur-text { color: var(--ink-2); }
.sur-box.sur-none .sur-text { color: var(--muted); }

/* 注解条 */
.bh {
  margin: 8px 0 0;
  padding: 8px 12px;
  font-size: 12.5px; line-height: 1.75;
  color: var(--ink-2);
  background: var(--surface-2);
  border-left: 3px solid var(--brand-line);
  border-radius: 6px;
}
.bh b { color: var(--brand); font-weight: 600; }
.bz-notes .bh + .bz-note { margin-top: 10px; }
.bz-card .bh { margin-top: 8px; }
.namecard .bh { margin-top: 8px; }
.modal-body .bh { margin-top: 10px; }
.ck-result .bh { margin: 10px 0 0; }
.ck-tip { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }
.ck-tip strong { color: var(--brand); font-weight: 600; }

/* ============================================================
   报告
   ============================================================ */
.rpt h2 { margin: 0 0 4px; font-size: 26px; font-weight: 700; color: var(--ink); }
.rpy { margin: 0 0 16px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.rsec { margin-bottom: 18px; }
.rsec h3 {
  margin: 0 0 8px;
  font-size: 15px; font-weight: 600; color: var(--ink);
  border-left: 3px solid var(--brand);
  padding-left: 8px;
}
.rsec p { margin: 4px 0; font-size: 14px; color: var(--ink-2); }
.rchips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.rchip {
  display: flex; flex-direction: column; align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 14px; min-width: 64px;
}
.rchip b { font-size: 20px; font-weight: 600; color: var(--ink); }
.rchip i { font-style: normal; font-size: 11px; color: var(--brand); margin-top: 1px; }
.rchip em { font-style: normal; font-size: 11px; color: var(--muted); }
.rfoot {
  margin-top: 20px;
  font-size: 12px; color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.rdiv { border: none; border-top: 1px solid var(--line); margin: 20px 0; }
.rptbook h1 { font-size: 23px; font-weight: 700; color: var(--ink); }
.print-area { display: none; }

/* ============================================================
   出生地选择组件（place-picker.js）
   ============================================================ */
/* 横向：说明文字 + 图标 + 控件一行；空间不足时控件自动掉到下一行，不会挤压文字 */
.pp-field {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: .01em;
}
.pp-wrap { position: relative; flex: 0 0 auto; }
.pp-trigger, .pp-input {
  font-family: inherit; font-size: 14px; line-height: 20px;
  padding: 9px 30px 9px 11px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  min-height: 40px;
  outline: none; box-sizing: border-box;
  cursor: pointer; user-select: none;
  box-shadow: var(--shadow-xs);
  font-variant-numeric: tabular-nums;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color .15s, box-shadow .15s;
}
.pp-trigger:hover, .pp-input:hover { border-color: var(--dim); }
.pp-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-trigger .pp-arrow { display: none; }
.pp-wrap.pp-off .pp-trigger { opacity: .55; cursor: not-allowed; background: var(--surface-3); pointer-events: none; }
.pp-input { cursor: text; }

/* 面板 portal 到 body：fixed 定位，不受父容器裁剪 */
.pp-panel, .ss-panel {
  position: fixed; top: 0; left: 0; z-index: 9999;
  box-sizing: border-box;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px 10px;
}
.pp-panel { width: 360px; max-width: calc(100vw - 16px); }
.ss-panel { width: 200px; max-width: calc(100vw - 16px); }

.pp-search, .ss-search {
  width: 100%; box-sizing: border-box;
  font-family: inherit; font-size: 14px;
  padding: 9px 11px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  margin-bottom: 6px; outline: none;
  box-shadow: var(--shadow-xs);
}
.pp-crumb { font-size: 12px; color: var(--muted); padding: 0 2px 6px; }
.pp-cols { display: flex; gap: 6px; overflow-x: auto; }
.pp-col {
  flex: 1 0 120px; min-width: 120px; height: 220px; overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.pp-item {
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
  padding: 7px 10px; font-size: 14px; cursor: pointer;
  border-radius: 6px; color: var(--ink);
  transition: background .12s, color .12s;
  user-select: none; -webkit-user-select: none;
}
.pp-item:hover { background: var(--surface-3); }
.pp-item.active { background: var(--brand-soft); color: var(--brand-2); font-weight: 600; }
.pp-item.active .pp-sub, .pp-item.active .pp-arrow { color: var(--brand); }
.pp-item .pp-arrow { color: var(--muted); font-size: 12px; }
.pp-sub { font-size: 11px; color: var(--muted); text-align: right; }
.pp-empty, .ss-empty { padding: 10px; font-size: 13px; color: var(--muted); }

.pp-input::placeholder { color: var(--dim); font-size: 12.5px; }
.pp-trigger:focus, .pp-input:focus, .pp-search:focus, .ss-search:focus,
.ss-trigger:focus, .ss-trigger:hover {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47, 107, 158, .12);
}
.pp-input:disabled { opacity: .55; cursor: not-allowed; background: var(--surface-3); }
.pp-wrap.pp-off .pp-input { opacity: .55; }
.pp-list { max-height: 300px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.pp-item.on { color: var(--brand-2); font-weight: 600; }
.pp-panel .pp-crumb { padding-bottom: 5px; }

/* 宽度：省份/城市/区县名长给足空间，日期类按位数收窄 */
.pp-field.pp-co .pp-input { width: 150px; }
.pp-field.pp-pv .pp-input,
.pp-field.pp-ct .pp-input,
.pp-field.pp-dz .pp-input { width: 152px; }
.pp-field.pp-yr .pp-input { width: 94px; }
.pp-field.pp-mo .pp-input { width: 66px; }
.pp-field.pp-da .pp-input { width: 66px; }
.pp-field.pp-ho .pp-input { width: 88px; }

/* 时间选择器（时 : 分） */
.tc-body { display: flex; align-items: stretch; gap: 2px; padding: 8px 8px 2px; }
.tc-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.tc-hd { text-align: center; font-size: 11.5px; color: var(--muted); padding-bottom: 4px; }
.tc-list {
  max-height: 168px; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; border: 1px solid var(--line);
  border-radius: 6px; background: var(--surface);
}
.tc-item {
  text-align: center; justify-content: center; padding: 6px 4px;
  font-size: 13.5px; font-variant-numeric: tabular-nums; border-radius: 6px;
}
.tc-sep { align-self: center; padding: 0 2px; color: var(--dim); font-size: 15px; }
.tc-foot { display: flex; justify-content: flex-end; padding: 2px 8px 8px; }
.tc-now {
  font-family: inherit; font-size: 12.5px; cursor: pointer; padding: 5px 12px;
  border-radius: var(--radius-sm);
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  min-height: 32px;
}
.tc-now:hover { background: #e3edf5; }

/* ============================================================
   通用可搜索下拉（searchable-select.js）
   ============================================================ */
.ss-wrap { position: relative; display: inline-block; }
.ss-trigger {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
  font-family: inherit; font-size: 14px; line-height: 20px;
  padding: 9px 30px 9px 11px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  width: 96px; height: 40px; box-sizing: border-box;
  cursor: pointer; user-select: none; outline: none;
  box-shadow: var(--shadow-xs);
  font-variant-numeric: tabular-nums;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.ss-wrap.ss-on .ss-trigger { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 107, 158, .12); }
.ss-wrap.ss-on .ss-trigger::after { display: none; }
select#bzH, select#ckH, select#bh { width: 150px; }
.ss-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-item {
  padding: 7px 10px; font-size: 14px; cursor: pointer;
  border-radius: 6px; color: var(--ink);
  transition: background .12s;
  user-select: none; -webkit-user-select: none;
}
.ss-item:hover { background: var(--surface-3); }
.ss-item.active { background: var(--brand-soft); color: var(--brand-2); font-weight: 600; }
.ss-item.active::before { display: none; }

/* ============================================================
   多语言切换器
   ============================================================ */
.lang-switch {
  position: fixed; top: 12px; right: 14px; z-index: 9999;
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .9);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: 13px; color: var(--ink);
}
.lang-label { font-size: 12px; color: var(--muted); white-space: nowrap; user-select: none; }
.lang-select {
  appearance: none; -webkit-appearance: none; font: inherit; color: var(--ink);
  background-color: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 6px; padding: 5px 26px 5px 10px; cursor: pointer; max-width: 150px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) calc(50% - 1px), calc(100% - 9px) calc(50% - 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.lang-select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 107, 158, .12); }
.lang-select option { color: var(--ink); background: #fff; }
[dir="rtl"] .lang-switch { right: auto; left: 12px; }

/* ============================================================
   Lucide 图标
   ============================================================ */
.ic {
  width: 1em; height: 1em;
  flex: 0 0 auto; display: inline-block;
  vertical-align: -.14em; stroke-width: 1.75;
}

/* ============================================================
   首页首屏（index.html）
   ============================================================ */
.landing-hero {
  min-height: auto;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 30px 20px 26px;
  text-align: center;
}
.eyebrow {
  font-size: 11.5px; letter-spacing: .12em;
  color: var(--brand);
  text-transform: uppercase;
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px;
  font-weight: 500;
}
.eyebrow::before, .eyebrow::after {
  content: ""; width: 22px; height: 1px; background: var(--brand-line);
}
.landing-title {
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: .01em;
  color: var(--ink);
  margin: 0;
}
.landing-title em { font-style: normal; color: var(--brand); font-weight: 700; }
.landing-sub {
  margin: 8px 0 0;
  font-size: 14px;
  letter-spacing: .02em;
  color: var(--muted);
  text-align: center;
}

/* ---- 3D 星盘 ---- */
.stage {
  position: relative;
  width: clamp(180px, 32vmin, 280px);
  height: clamp(180px, 32vmin, 280px);
  margin: 12px 0 6px;
  perspective: 1150px;
  cursor: grab;
  touch-action: none;
}
.stage:active { cursor: grabbing; }
.dial-wrap { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .9s var(--ease); }
.dial { position: absolute; inset: 0; transform-style: preserve-3d; border-radius: 50%; }
.spin { position: absolute; inset: 0; transform-style: preserve-3d; border-radius: 50%; }
.spin-a { animation: spin-a 90s linear infinite; }
.spin-b { animation: spin-b 24s linear infinite; }
.spin-c { animation: spin-c 36s linear infinite; }

.ring-outer {
  position: absolute; inset: 0; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(16, 24, 40, .18) 0deg 0.5deg, transparent 0.5deg 15deg);
  -webkit-mask: radial-gradient(circle, transparent 62%, #000 62% 64.5%, transparent 64.5%);
  mask: radial-gradient(circle, transparent 62%, #000 62% 64.5%, transparent 64.5%);
}
.ring-mid {
  position: absolute; inset: 7.5%; border-radius: 50%;
  border: 1px solid var(--line-2);
}
.ring-inner {
  position: absolute; inset: 18.5%; border-radius: 50%;
  border: 1px solid var(--brand-line);
}
.arc-cyan, .arc-gold { position: absolute; inset: 7.5%; border-radius: 50%; }
.arc-cyan {
  background: conic-gradient(from 8deg, rgba(47, 107, 158, .45) 0deg 4deg, rgba(47, 107, 158, 0) 4deg 100%);
  -webkit-mask: radial-gradient(circle, transparent 67%, #000 67% 68.5%, transparent 68.5%);
  mask: radial-gradient(circle, transparent 67%, #000 67% 68.5%, transparent 68.5%);
}
.arc-gold {
  background: conic-gradient(from 116deg, rgba(169, 123, 43, .5) 0deg 3.4deg, rgba(169, 123, 43, 0) 3.4deg 100%);
  -webkit-mask: radial-gradient(circle, transparent 55%, #000 55% 56.4%, transparent 56.4%);
  mask: radial-gradient(circle, transparent 55%, #000 55% 56.4%, transparent 56.4%);
}
.hub {
  position: absolute; left: 50%; top: 50%;
  width: 32%; aspect-ratio: 1;
  margin: -16% 0 0 -16%;
  border-radius: 50%;
  display: grid; place-items: center;
  transform: translateZ(4px) rotateX(-72deg);
  background: var(--surface);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-md);
  cursor: pointer;
}
.hub::after {
  content: ""; position: absolute; inset: 9%; border-radius: 50%;
  border: 1px dashed var(--line-2);
  animation: spin-b 32s linear infinite;
}
.hub span {
  font-size: clamp(28px, 4.4vmin, 42px);
  font-weight: 700;
  color: var(--accent);
  animation: breathe 3.6s ease-in-out infinite;
}
.orb {
  position: absolute; border-radius: 50%;
  background: var(--brand); opacity: .55;
  animation: flicker 2.8s ease-in-out infinite;
}
.orb-1 { width: 6px; height: 6px; left: 54%; top: 8%; transform: translateZ(34px); animation-delay: .2s; }
.orb-2 { width: 5px; height: 5px; background: var(--accent); left: 82%; top: 34%; transform: translateZ(26px); animation-delay: 1.1s; }
.orb-3 { width: 6px; height: 6px; left: 20%; top: 58%; transform: translateZ(30px); animation-delay: 1.7s; }
.orb-4 { width: 4px; height: 4px; background: var(--accent); left: 66%; top: 86%; transform: translateZ(22px); animation-delay: .7s; }
.orb-5 { width: 5px; height: 5px; left: 8%; top: 22%; transform: translateZ(20px); animation-delay: 2.1s; }

.floaters { position: absolute; inset: -12%; pointer-events: none; }
.floaters i {
  position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: var(--brand); opacity: .3;
}
.floaters i:nth-child(1) { left: 6%; top: 20%; animation: float-y 5.4s ease-in-out infinite; }
.floaters i:nth-child(2) { left: 88%; top: 12%; background: rgba(169, 123, 43, .35); animation: float-y 6.2s ease-in-out infinite reverse; width: 2px; height: 2px; }
.floaters i:nth-child(3) { left: 94%; top: 64%; animation: float-y 4.8s ease-in-out infinite .6s; }
.floaters i:nth-child(4) { left: 2%; top: 70%; background: rgba(169, 123, 43, .35); animation: float-y 5.9s ease-in-out infinite reverse; width: 2px; height: 2px; }
.floaters i:nth-child(5) { left: 46%; top: 100%; animation: float-y 5s ease-in-out infinite 1.2s; }

.hint {
  position: absolute;
  left: 50%; bottom: -12px;
  transform: translateX(-50%);
  font-size: 11.5px; letter-spacing: .08em;
  color: var(--dim);
  white-space: nowrap;
  display: flex; align-items: center; gap: 8px;
}
.hint::before, .hint::after { content: ""; width: 14px; height: 1px; background: var(--line-2); }

.particles { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.p {
  position: absolute; width: 7px; height: 7px;
  margin: -3.5px 0 0 -3.5px; border-radius: 50%;
  opacity: 0;
  transition: transform 1.15s var(--ease), opacity .9s ease;
}
.p.gold { background: var(--accent); }
.p.cyan { background: var(--brand); }
.flash {
  position: absolute; inset: -4%; border-radius: 50%;
  pointer-events: none; opacity: 0;
  background: radial-gradient(circle, rgba(47, 107, 158, .16), transparent 68%);
}

/* ---- 入场动画 ---- */
@keyframes riseUp { from { transform: translateY(16px); } to { transform: translateY(0); } }
.reveal { animation: riseUp .7s var(--ease) backwards; }
.r-title { animation-delay: .22s; }
.r-sub { animation-delay: .34s; }
.r-stage { animation-delay: .5s; }
.r-cta { animation-delay: .72s; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin-a { to { transform: rotateZ(360deg); } }
@keyframes spin-b { to { transform: rotateZ(-360deg); } }
@keyframes spin-c { to { transform: rotateZ(360deg); } }
@keyframes flicker { 0%, 100% { opacity: .85; } 50% { opacity: .28; } }
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: .72; } }
@keyframes float-y { 0%, 100% { transform: translateY(0); opacity: .7; } 50% { transform: translateY(-14px); opacity: .25; } }
@keyframes flash { 0% { opacity: 0; } 22% { opacity: 1; } 100% { opacity: 0; } }
@keyframes pop { 0% { transform: scale(.96); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   焦点环
   ============================================================ */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1060px) {
  /* 避免与顶栏导航抢位，语言切换下沉右下 */
  .lang-switch { top: auto; bottom: 14px; right: 14px; }
}
@media (max-width: 900px) {
  .slogan { display: none; }
  .ck-grid, .bz-cards, .yn-parts { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .hero { position: static; }
  .hero-inner { gap: 12px; }
  .nav {
    width: 100%; margin-left: 0;
    flex-wrap: nowrap; overflow-x: auto;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; flex: 0 0 auto; }
  .logo { font-size: 16px; }
  main { padding: 22px 16px 30px; }
  .panel { padding: 20px 16px; }
  .ck-name { font-size: 26px; }
  .landing-hero { padding: 24px 16px 20px; }
}
@media (max-width: 560px) {
  .seal { width: 28px; height: 28px; font-size: 14px; }
  .namecard { padding: 14px 14px 12px; }
  .results { grid-template-columns: 1fr; }
  .pp-field { flex: 1 1 130px; min-width: 0; }
  .pp-field .pp-wrap { width: 100%; }
  .pp-input, .pp-field.pp-co .pp-input, .pp-field.pp-pv .pp-input,
  .pp-field.pp-ct .pp-input, .pp-field.pp-dz .pp-input, .pp-field.pp-yr .pp-input,
  .pp-field.pp-mo .pp-input, .pp-field.pp-da .pp-input, .pp-field.pp-ho .pp-input { width: 100%; }
  .tc-list { max-height: 132px; }
  .ck-inputs .primary, .board-form-btns .primary,
  .bazi-inputs .primary, .yn-row .primary { width: 100%; }
  .ck-inputs .ghost, .board-form-btns .ghost,
  .bazi-inputs .ghost, .yn-row .ghost { flex: 1 1 auto; }
}

/* ============================================================
   打印（中性纸张）
   ============================================================ */
@media print {
  body { background: #fff; color: #222; }
  body * { visibility: hidden; }
  #printArea, #printArea * { visibility: visible; }
  #printArea {
    position: absolute; left: 0; top: 0; width: 100%;
    display: block; padding: 0 12px;
  }
  #printArea .panel, #printArea .namecard {
    background: #fff; border: 1px solid #ccc; color: #222; box-shadow: none;
  }
  #printArea .panel::before, #printArea .panel-title::before,
  #printArea .namecard::before, #printArea .namecard::after, #printArea .bh { display: none; }
  #printArea .panel-title, #printArea .nfull, #printArea .ck-name,
  #printArea .rpt h2, #printArea .bz-pgz, #printArea .yn-verdict { color: #222; }
  #printArea .nfrom, #printArea .rsec p, #printArea .mp-p,
  #printArea .ck-d, #printArea .bz-note, #printArea .gb-text { color: #444; }
  .no-print { display: none !important; }
  .modal { display: none !important; }
  .panel, .namecard { animation: none; }
}

/* ============================================================
   尊重系统的「减少动态效果」
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal, .rl, .result-foot { opacity: 1; transform: none; animation: none !important; }
  .landing-hero, .stage, .dial-wrap, .hub, .orb, .floaters, .panel, .namecard { animation: none !important; }
  .ic { transition: none !important; }
  .primary:hover .ic, .ghost:hover .ic, .nav a:hover .ic { transform: none; }
}

/* ============================================================
   首页专属微调（html.theme-jade）
   全站色板已在 :root 统一为 Japandi，这里只放「首页独有的版式/字重」，
   不再重复定义颜色令牌（避免两处色值打架）。
   ============================================================ */

/* ---- 顶栏（全站）---- */
.hero {
  background: rgba(246, 242, 233, .92);
  border-bottom-color: var(--line);
}
.seal { background: var(--brand); border-radius: 9px; }
/* 雅黑只有 Light/Regular/Bold，500 会被迫映射到 Bold，所以这里一律用 400 */
.logo { font-size: 18px; font-weight: 400; letter-spacing: .1em; color: var(--ink); }
.slogan { color: var(--muted); border-left-color: var(--line); }
.nav a { color: var(--ink-2); }
.nav a:hover { color: var(--ink); background: rgba(73, 86, 75, .06); }
.nav a.active { color: var(--brand); background: rgba(73, 86, 75, .09); font-weight: 400; }

/* ---- 首屏版式（纯文案 · 居中大留白，字重克制，不摆装饰与按钮）---- */
html.theme-jade .landing-hero { display: block; padding: 96px clamp(16px, 4vw, 44px) 76px; }
html.theme-jade .lh-grid {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

html.theme-jade .eyebrow {
  justify-content: center;
  font-size: 11px;
  letter-spacing: .26em;
  color: var(--accent);
  font-weight: 400;
  margin-bottom: 24px;
}
html.theme-jade .eyebrow::before,
html.theme-jade .eyebrow::after { background: var(--line); }

html.theme-jade .landing-title {
  font-family: var(--sans-light);
  font-size: clamp(2.15rem, 4.7vw, 3.15rem);
  font-weight: 300;            /* Light：细而疏，素雅感来自字重不是颜色 */
  line-height: 1.45;
  letter-spacing: .1em;
  color: var(--ink);
}
html.theme-jade .landing-title em { font-style: normal; color: var(--accent); font-weight: 300; }
html.theme-jade .landing-sub {
  margin: 20px auto 0;
  font-size: 14.5px;
  line-height: 2.05;
  letter-spacing: .06em;
  color: var(--ink-2);
  text-align: center;
  max-width: 32em;
}

/* ---- 面板（全站）---- */
.panel-title { color: var(--ink); }

/* ---- 响应式 ---- */
@media (max-width: 900px) {
  html.theme-jade .landing-hero { padding: 64px clamp(16px, 4vw, 44px) 52px; }
}
@media (max-width: 560px) {
  html.theme-jade .landing-title { letter-spacing: .06em; font-size: clamp(1.8rem, 8vw, 2.1rem); }
  html.theme-jade .landing-hero { padding: 44px 16px 38px; }
}

/* ============================================================
   手机端 Web 适配（Mobile Web）
   ------------------------------------------------------------
   维护约定：本段固定在文件末尾，只做「覆盖」，不回头改前面的桌面规则。
   断点：900（平板竖屏 / 小平板）→ 760（手机）→ 430（小屏手机）
   三个别踩回去的坑：
   1) iOS Safari 对 font-size < 16px 的输入框会强制自动放大页面，
      所以手机端所有输入类控件统一 16px，别再往回收。
   2) 省市区浮层（.pp-panel）和可搜索下拉（.ss-panel）的定位是 JS 写进
      inline style 的，想改成底部抽屉必须 !important 才压得住 inline。
   3) 首页 3D 星盘 .stage 默认 touch-action: none，手机上会把整页竖向
      滚动一起吃掉，必须放宽成 pan-y。
   ============================================================ */

@keyframes sheet-up {
  from { transform: translateY(28px); opacity: .35; }
  to   { transform: none; opacity: 1; }
}

/* ---------- 平板竖屏 / 小平板：先做通用收缩 ---------- */
@media (max-width: 900px) {
  main { padding: 24px 16px 34px; }
  .panel { padding: 22px 18px; margin-bottom: 20px; }
  .ck-grid { grid-template-columns: 1fr; }
  .bz-cards { grid-template-columns: 1fr; }
  .yn-parts { grid-template-columns: 1fr; }
}

/* ---------- 手机：主战场 ---------- */
@media (max-width: 760px) {
  /* ---- 版心 / 面板 ---- */
  body { -webkit-tap-highlight-color: transparent; }
  main { padding: 16px 12px 30px; }
  .panel { padding: 16px 14px; margin-bottom: 16px; border-radius: 12px; }
  .panel-title { font-size: 16.5px; margin: 0 0 16px; gap: 8px; }
  .panel-title .ic { font-size: 16px; }
  .foot {
    padding: 14px 16px calc(26px + env(safe-area-inset-bottom, 0px));
    font-size: 12px;
  }
  .libhint, .ck-tip, .board-tip, .board-note, .yn-tip { font-size: 12.5px; }

  /* ---- 顶栏：品牌一行，导航变横向滑动条（不换行、不撑破视口）---- */
  .hero { padding: 9px 12px; }
  .hero-inner { gap: 8px; }
  .brand-row { flex: 1 1 auto; }
  .seal { width: 28px; height: 28px; font-size: 14px; border-radius: 8px; }
  .logo { font-size: 16px; }
  .slogan { display: none; }
  .nav {
    width: 100%;
    margin-left: 0;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 0;
  }
  .nav::-webkit-scrollbar { display: none; width: 0; height: 0; }
  .nav a {
    flex: 0 0 auto;
    white-space: nowrap;
    min-height: 38px;
    padding: 7px 12px;
    font-size: 13.5px;
  }
  .nav a .ic { font-size: 14px; }

  /* ---- 表单：16px 字号（防 iOS 缩放）+ 44px 触控高度 ---- */
  .controls input, .controls select,
  .bazi-inputs input, .bazi-inputs select,
  .ck-inputs input, .ck-inputs select,
  .yn-row input, .yn-row select,
  .board-form input, .board-form textarea {
    font-size: 16px;
    min-height: 44px;
    width: 100%;
  }
  .ck-inputs input#ckName { width: 100%; }
  .board-form input { max-width: 100%; }
  .pp-input, .pp-search, .ss-search { font-size: 16px; min-height: 44px; }
  .pp-trigger, .ss-trigger { min-height: 44px; font-size: 16px; }

  .controls, .bazi-inputs, .ck-inputs, .yn-row { gap: 12px; align-items: flex-end; }
  /* 默认整行铺满；下面再把「年 / 月 / 日」拉回同一行 */
  .controls label, .bazi-inputs label, .ck-inputs label, .yn-row label,
  .controls > span, .bazi-inputs > span, .ck-inputs > span, .yn-row > span {
    flex: 1 1 100%;
    min-width: 0;
  }
  .pp-field.pp-yr, .pp-field.pp-mo, .pp-field.pp-da { flex: 1 1 0; min-width: 0; }
  .pp-field.pp-ho, .pp-field.pp-co, .pp-field.pp-pv,
  .pp-field.pp-ct, .pp-field.pp-dz { flex: 1 1 100%; }
  .pp-field { flex-wrap: wrap; }
  /* 选择器挂载点（span#xxxPick）默认是 inline、宽度收缩，
     不撑开的话输入框永远只有内容宽——这里强制块级占满整行 */
  .pp-field > span { display: block; flex: 1 1 100%; min-width: 0; }
  .pp-field .pp-wrap { flex: 1 1 auto; width: 100%; }
  .pp-input, .pp-field.pp-co .pp-input, .pp-field.pp-pv .pp-input,
  .pp-field.pp-ct .pp-input, .pp-field.pp-dz .pp-input,
  .pp-field.pp-yr .pp-input, .pp-field.pp-mo .pp-input,
  .pp-field.pp-da .pp-input, .pp-field.pp-ho .pp-input { width: 100%; }
  /* 可搜索下拉的触发器宽度由 JS inline 写死，这里改整行必须 !important */
  .ss-wrap { display: block; flex: 1 1 auto; width: auto; }
  .ss-trigger { width: 100% !important; }

  /* ---- 按钮：主次并排，主按钮占大头 ---- */
  .ck-inputs .primary, .bazi-inputs .primary,
  .yn-row .primary, .board-form-btns .primary { flex: 1 1 58%; width: auto; }
  .ck-inputs .ghost, .bazi-inputs .ghost,
  .yn-row .ghost, .board-form-btns .ghost { flex: 1 1 38%; width: auto; }
  .yinyuan-block > .primary { width: 100%; }
  .primary, .ghost { min-height: 44px; padding: 10px 16px; font-size: 15px; }
  .board-form-btns { flex-wrap: wrap; gap: 10px; }

  /* ---- 结果：名字卡片 / 测名头部 / 评分 ---- */
  .results { grid-template-columns: 1fr; gap: 12px; }
  .namecard { padding: 14px 14px 12px; }
  .nfull { font-size: 20px; }
  .cchip { min-width: 54px; padding: 7px 10px; font-size: 19px; }
  .nbtns { gap: 8px; }
  .nbtns .reportbtn, .nbtns .favbtn { min-height: 38px; font-size: 13px; }
  .ck-head { padding: 14px 16px; gap: 10px; }
  .ck-name { font-size: 26px; }
  .ck-py { font-size: 12px; }
  .ck-verdict { font-size: 13px; padding: 5px 12px; }
  .score { padding: 12px; gap: 10px; }
  .scoretotal b { font-size: 24px; }
  .sbar .sl { width: 32px; }

  /* ---- 八字 / 命盘 ---- */
  .bazi-block, .yinyuan-block, .check-block { padding: 14px 12px; margin-bottom: 16px; }
  .bazi-block { margin-bottom: 16px; }
  .bz-sec-title { margin: 18px 0 10px; font-size: 14.5px; }
  .bz-grid { grid-template-columns: 1fr; gap: 2px 0; }
  .bz-pillars { gap: 8px; }
  .bz-pillar { flex: 1 1 calc(50% - 8px); }
  .bz-pgz { font-size: 20px; }
  .bz-notes { padding: 12px 14px; }
  .bz-note { font-size: 13px; }
  .bz-table table { min-width: 420px; }
  .bz-table th, .bz-table td { font-size: 12px; padding: 7px 4px; }
  .mp-k { flex: 0 0 88px; font-size: 12px; padding: 9px 4px; }
  .mp-v { font-size: 13.5px; padding: 9px 10px; }
  .mp-p { font-size: 13.5px; }
  .yn-card { padding: 14px 14px 16px; }
  .yn-score b { font-size: 22px; }
  .yn-verdict { font-size: 14px; }

  /* ---- 弹窗：改底部抽屉 ---- */
  .modal-box {
    top: auto; bottom: 0; left: 0; right: 0;
    width: 100%; max-width: 100%;
    transform: none;
    max-height: 88vh;
    max-height: 88dvh;
    border-radius: 16px 16px 0 0;
    border-bottom: none;
    box-shadow: 0 -8px 30px rgba(30, 32, 26, .14);
    animation: sheet-up .24s var(--ease);
  }
  .modal-bar {
    padding: 12px 14px;
    font-size: 14.5px;
    gap: 8px;
    flex-wrap: wrap;
    border-radius: 16px 16px 0 0;
  }
  .modal-bar > span:last-child { display: inline-flex; gap: 8px; }
  .modal-bar .primary, .modal-bar .ghost { min-height: 36px; padding: 7px 12px; font-size: 13px; }
  .modal-body { padding: 14px 14px calc(20px + env(safe-area-inset-bottom, 0px)); }
  .rptbook h1 { font-size: 20px; }

  /* ---- 下拉浮层：同样改底部抽屉（JS 写 inline 定位，需 !important）---- */
  .pp-panel, .ss-panel {
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 72vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 16px 16px 0 0;
    border-bottom: none;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 30px rgba(30, 32, 26, .14);
  }
  .pp-panel .pp-list, .ss-panel .ss-list { max-height: 46vh !important; }
  .pp-search, .ss-search { margin-bottom: 8px; }
  .pp-item, .ss-item { padding: 11px 12px; font-size: 15.5px; }
  .pp-cols { gap: 8px; }
  .pp-col { height: 190px; }
  .tc-list { max-height: 148px; }
  .tc-item { padding: 9px 4px; font-size: 15px; }
  .tc-now { min-height: 40px; padding: 8px 16px; }

  /* ---- 首页首屏 + 3D 星盘 ---- */
  .landing-hero { padding: 32px 16px 26px; }
  html.theme-jade .landing-hero { padding: 44px 16px 32px; }
  .landing-title { font-size: clamp(1.6rem, 7.4vw, 2rem); letter-spacing: .06em; }
  html.theme-jade .landing-title { font-size: clamp(1.7rem, 7.6vw, 2.1rem); letter-spacing: .06em; }
  .landing-sub { font-size: 13.5px; line-height: 1.9; }
  .eyebrow { font-size: 11px; gap: 10px; margin-bottom: 10px; }
  .eyebrow::before, .eyebrow::after { width: 16px; }
  .stage {
    width: clamp(160px, 46vw, 240px);
    height: clamp(160px, 46vw, 240px);
    margin: 8px 0 4px;
    touch-action: pan-y;   /* 别把整页竖向滚动吃掉 */
  }
  .floaters { inset: 0; }
  .hint { font-size: 11px; gap: 6px; }

  /* ---- 收藏 / 留言板 ---- */
  .fav-head, .board-head { gap: 8px; }
  .favlist { gap: 8px; }
  .favitem { padding: 10px 12px; gap: 8px; }
  .board-form { padding: 14px; margin-bottom: 16px; }
  .gb-item { padding: 12px 14px; }
  .gb-text { font-size: 13.5px; }

  /* ---- 语言切换：抬高一点，避开 Home 指示条 ---- */
  .lang-switch { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); right: 12px; padding: 5px 7px; }
}

/* ---------- 小屏手机（iPhone SE / 折叠屏外屏）---------- */
@media (max-width: 430px) {
  main { padding: 14px 10px 26px; }
  .panel { padding: 14px 12px; }
  .hero { padding: 8px 10px; }
  .logo { font-size: 15px; letter-spacing: .02em; }
  .nav a { padding: 6px 10px; font-size: 13px; gap: 5px; }
  .ck-name { font-size: 23px; }
  .nfull { font-size: 19px; }
  .cchip { min-width: 50px; padding: 6px 9px; font-size: 18px; }
  .scoretotal b { font-size: 22px; }
  .bz-table table { min-width: 380px; }
  .bz-pgz { font-size: 19px; }
  .modal-bar { font-size: 14px; padding: 10px 12px; }
  .modal-bar .primary, .modal-bar .ghost { padding: 6px 10px; font-size: 12.5px; }
  html.theme-jade .landing-title { font-size: clamp(1.5rem, 8vw, 1.8rem); }
  .fav-head-btns { width: 100%; }
  .fav-head-btns .ghost { flex: 1 1 0; }
}

/* ---------- 横屏矮屏（手机横放）---------- */
@media (max-height: 520px) and (orientation: landscape) {
  .modal-box { max-height: 92vh; max-height: 92dvh; }
  .pp-panel, .ss-panel { max-height: 86vh; }
  .pp-panel .pp-list, .ss-panel .ss-list { max-height: 52vh !important; }
  .tc-list { max-height: 120px; }
  .landing-hero, html.theme-jade .landing-hero { padding: 24px 16px 18px; }
}

/* ---------- 触屏设备：去掉「鼠标悬停」态残留 ---------- */
@media (hover: none) {
  .primary:hover { transform: none; box-shadow: var(--shadow-sm); }
  .namecard:hover { transform: none; }
  .nav a:hover { background: transparent; }
  .nav a.active:hover { background: var(--brand-soft); }
  .favitem:hover, .cchip:hover { box-shadow: none; }
}

/* ---------- FAQ 常见问题折叠块 ---------- */
.faq-block { margin-top: 0; }
.faq-block .panel-title { margin-bottom: 14px; }
.faq-item {
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-bottom: 10px;
  overflow: hidden;
}
.faq-item:last-child { margin-bottom: 0; }
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
  content: "Q";
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.faq-item[open] summary { border-bottom: 1px solid var(--line); }
.faq-item .faq-a {
  padding: 10px 16px 14px 46px;
  color: var(--muted);
  line-height: 1.75;
  margin: 0;
  font-size: 14.5px;
}

/* ============================================================
   静态内容页（隐私政策 / 免责声明 / 关于我们）
   ============================================================ */
.legal-panel h3 {
  margin: 24px 0 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .01em;
}
.legal-panel h3:first-of-type { margin-top: 4px; }
.legal-panel p, .legal-panel li {
  font-size: 14px;
  line-height: 1.85;
  color: var(--ink-2);
}
.legal-panel p { margin: 8px 0; }
.legal-panel ul { margin: 8px 0; padding-left: 22px; }
.legal-panel ul li { margin: 5px 0; }
.legal-panel blockquote {
  margin: 10px 0;
  padding: 12px 18px;
  border-left: 3px solid var(--brand-line);
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 15px;
  color: var(--ink-2);
  font-style: italic;
}
.legal-panel a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.legal-panel a:hover { color: var(--brand-2); }
.privacy-meta { font-size: 12.5px; color: var(--dim); margin-top: -14px !important; margin-bottom: 14px; }
.about-table { width: 100%; border-collapse: collapse; margin: 12px 0 8px; }
.about-table th, .about-table td {
  border: 1px solid var(--line);
  padding: 9px 12px;
  text-align: left;
  font-size: 13.5px;
  color: var(--ink-2);
}
.about-table th { background: var(--surface-3); color: var(--ink); font-weight: 600; }
.about-table tr:nth-child(even) td { background: var(--surface-2); }

/* 页脚入口链接（独立于 data-i18n 元素，避免被语言切换替换） */
.foot-links {
  margin-top: 10px;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.foot-links a { color: var(--muted); text-decoration: none; transition: color .15s ease; }
.foot-links a:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.foot-links .dot { color: var(--line-2); }
