/* ============================================================
 * 传统术数排盘 · 共享样式
 * 视觉参考：shefu.cn —— 浅灰底 / 白色卡片 / 蓝色主色 / 印章红点缀
 * ============================================================ */
:root {
  --bg: #f5f5f5;
  --panel: #ffffff;
  --panel2: #fafafa;
  --ink: #1a1a1a;
  --ink2: #4a4a4a;
  --muted: #8a8a8a;
  --line: #ececec;
  --line2: #e3e3e3;
  --blue: #2d8cf0;
  --blue-dark: #1c7ae0;
  --blue-soft: #eff6ff;
  --blue-line: #d6e8ff;
  --red: #d92b2b;
  --red-soft: #fdf1f0;
  --green: #19a97b;
  --green-soft: #eaf7f2;
  --amber: #c98a12;
  --amber-soft: #fdf6e7;
  --shadow: 0 1px 4px rgba(0, 0, 0, .06);
  --shadow-hover: 0 6px 18px rgba(45, 140, 240, .12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", "Source Han Sans SC", sans-serif;
  font-size: 14px;
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px 40px; }

/* ---- 顶部通栏 ---- */
.topbar {
  background: var(--blue);
  color: #fff;
  font-size: 12.5px;
  text-align: center;
  padding: 6px 16px;
  letter-spacing: .2px;
}
.topbar b { font-weight: 600; }

/* ---- 页头 ---- */
header.site {
  background: #fff;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 50;
}
.hd-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  flex: 0 0 auto;
}
.logo .txt { font-size: 17px; font-weight: 600; letter-spacing: 1px; }
.logo .txt small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 400; letter-spacing: .5px; }

nav.tabs { display: flex; gap: 4px; flex: 1 1 auto; flex-wrap: wrap; }
nav.tabs a {
  padding: 6px 14px;
  border-radius: 6px;
  color: var(--ink2);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
  transition: all .15s;
}
nav.tabs a:hover { color: var(--blue); background: var(--blue-soft); }
nav.tabs a.active { color: #fff; background: var(--blue); }

.hd-right { margin-left: auto; display: flex; gap: 10px; align-items: center; flex: 0 0 auto; }
.hd-right .ghost-link {
  font-size: 13px; color: var(--muted); text-decoration: none;
  border: 1px solid var(--line2); border-radius: 6px; padding: 5px 12px;
}

/* ---- 首页 ---- */
.hero {
  background: linear-gradient(120deg, #ffffff 0%, #f7fbff 100%);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 34px 30px;
  margin: 22px 0 20px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "☰ ☱ ☲ ☳ ☴ ☵ ☶ ☷";
  position: absolute;
  right: 26px; bottom: 14px;
  font-size: 26px;
  letter-spacing: 12px;
  color: rgba(45, 140, 240, .12);
  font-family: serif;
}
.hero h1 {
  font-size: 27px;
  font-weight: 600;
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.hero h1 em { font-style: normal; color: var(--red); }
.hero p { color: var(--muted); font-size: 13.5px; max-width: 660px; }
.hero .chips { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.hero .chips span {
  font-size: 12px; color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid var(--blue-line);
  border-radius: 4px;
  padding: 2px 9px;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 900px) { .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .home-grid { grid-template-columns: 1fr; } }
.home-card {
  display: block;
  background: var(--panel);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 24px 20px 20px;
  text-decoration: none;
  color: var(--ink);
  transition: all .18s;
  border: 1px solid transparent;
}
.home-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: var(--blue-line); }
.home-card .glyph {
  font-size: 30px;
  color: var(--blue);
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
  line-height: 1.2;
}
.home-card h2 { font-size: 17px; font-weight: 600; margin: 8px 0 6px; letter-spacing: 1px; }
.home-card p { color: var(--muted); font-size: 12.5px; line-height: 1.8; }
.home-card .go { margin-top: 14px; font-size: 12.5px; color: var(--blue); }

/* ---- 面板 ---- */
.panel {
  background: var(--panel);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.panel h3 {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 14px;
  padding-left: 10px;
  border-left: 3px solid var(--blue);
  line-height: 1.3;
}
.panel h3 small { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 8px; }

/* ---- 表单 ---- */
.form-grid { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 12.5px; color: var(--muted); }
.field input, .field select {
  border: 1px solid var(--line2);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 7px 10px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.field input:focus, .field select:focus { border-color: var(--blue); }
.radio-row { display: flex; gap: 14px; align-items: center; font-size: 13.5px; padding: 7px 0; flex-wrap: wrap; }
.radio-row label { cursor: pointer; display: flex; align-items: center; gap: 5px; color: var(--ink2); }
.radio-row input[type=radio], .radio-row input[type=checkbox] { accent-color: var(--blue); }
.btn {
  border: none;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  padding: 8px 22px;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.btn:hover { background: var(--blue-dark); }
.btn.ghost { background: #fff; border: 1px solid var(--line2); color: var(--ink2); }
.btn.ghost:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.hint { color: var(--muted); font-size: 12.5px; }
.req-tip { color: var(--red); font-size: 12.5px; margin-top: 8px; display: none; }
.req-err input, .req-err select { border-color: var(--red) !important; background: var(--red-soft) !important; }
.req-err label { color: var(--red) !important; }

/* ---- 综合解读 ---- */
.synth {
  background: linear-gradient(180deg, #fff 0%, var(--blue-soft) 100%);
  border: 1px solid var(--blue-line);
  border-left: 3px solid var(--blue);
  border-radius: 8px;
  padding: 12px 15px;
  margin-top: 12px;
  font-size: 13.5px;
  line-height: 2;
  color: var(--ink2);
}
.synth h4 {
  font-size: 13px;
  color: var(--blue-dark);
  margin-bottom: 5px;
  font-weight: 600;
}
.synth b { color: var(--ink); }
.synth .tag { margin-bottom: 0; }

/* ---- 信息条 ---- */
.info-line {
  background: var(--blue-soft);
  border: 1px solid var(--blue-line);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--ink2);
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  line-height: 1.9;
}
.info-line b { color: var(--blue-dark); font-weight: 600; }

.tag {
  display: inline-block;
  font-size: 11.5px;
  line-height: 1.6;
  padding: 0 7px;
  border-radius: 4px;
  border: 1px solid var(--line2);
  background: #fff;
  color: var(--ink2);
  margin: 0 3px 3px 0;
  white-space: nowrap;
}
.tag.red { border-color: #f6cdc9; background: var(--red-soft); color: var(--red); }
.tag.blue { border-color: var(--blue-line); background: var(--blue-soft); color: var(--blue-dark); }
.tag.green { border-color: #c6e8db; background: var(--green-soft); color: var(--green); }
.tag.amber { border-color: #f0dcb4; background: var(--amber-soft); color: var(--amber); }

/* ---- 八字 ---- */
.bazi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.pillar {
  background: var(--panel);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 14px 8px 12px;
  text-align: center;
  border: 1px solid transparent;
}
.pillar.day { border-color: #f6cdc9; background: linear-gradient(180deg, #fff 55%, var(--red-soft)); }
.pillar .p-title { font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.pillar .p-shishen { font-size: 12.5px; color: var(--blue-dark); min-height: 21px; }
.pillar.day .p-shishen { color: var(--red); }
.pillar .p-gz {
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
  font-size: 30px;
  letter-spacing: 3px;
  text-indent: 3px;
  margin: 3px 0;
  color: var(--ink);
}
.pillar.day .p-gz { color: var(--red); }
.pillar .p-nayin { font-size: 12px; color: var(--muted); }
.pillar .p-cang {
  font-size: 12px;
  color: var(--ink2);
  border-top: 1px dashed var(--line);
  margin-top: 8px;
  padding-top: 8px;
  min-height: 56px;
  line-height: 1.9;
}
.pillar .p-cang i { font-style: normal; color: var(--muted); font-size: 11px; }
.pillar .p-shensha { margin-top: 6px; min-height: 22px; }

.wuxing-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; margin-bottom: 12px; }
.wx-item {
  flex: 1 1 110px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  color: var(--ink2);
}
.wx-item b { font-size: 16px; color: var(--ink); margin-right: 4px; }
.wx-item .bar { height: 4px; border-radius: 2px; background: var(--line); margin-top: 6px; overflow: hidden; }
.wx-item .bar i { display: block; height: 100%; background: var(--blue); border-radius: 2px; }
.wx-item.mu .bar i { background: #4caf82; }
.wx-item.huo .bar i { background: #e8613c; }
.wx-item.tu .bar i { background: #c9a227; }
.wx-item.jin .bar i { background: #9aa4b0; }
.wx-item.shui .bar i { background: #2d8cf0; }

.dayun-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; }
.dayun {
  flex: 0 0 auto;
  width: 82px;
  text-align: center;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 4px;
}
.dayun .d-age { font-size: 11.5px; color: var(--muted); }
.dayun .d-gz {
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
  font-size: 18px;
  letter-spacing: 2px;
  margin: 2px 0;
}
.dayun .d-ss { font-size: 11.5px; color: var(--blue-dark); }

/* ---- 六爻 ---- */
.gua-pair { display: flex; align-items: flex-start; gap: 18px; }
.gua-col { flex: 1 1 0; min-width: 0; }
.gua-col > h3 { margin-top: 0; }
.gua-col .gua-title { min-height: 42px; align-items: flex-start; }
@media (max-width: 780px) {
  .gua-pair { gap: 10px; overflow-x: auto; padding-bottom: 6px; }
  .gua-col { flex: 0 0 min(78vw, 330px); }
}
.liuyao-box { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr)); gap: 16px; }
.hex-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.hex-table th {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 400;
  text-align: left;
  padding: 3px 4px 6px;
  border-bottom: 1px solid var(--line2);
  white-space: nowrap;
}
.hex-table td { padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.hex-table tr:last-child td { border-bottom: none; }
.hex-table tr.shi-yao td { background: #f4f9ff; }
.hex-table tr.ying-yao td { background: #f2fbf7; }
.hex-table tr.yong-yao td { background: #fff8f7; }
.hex-table tr.yong-yao td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.hex-table tr.fu-yong-row td { background: #fffbf2; }
.hex-table tr.fu-yong-row td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.hex-table .beast { color: var(--blue-dark); font-size: 11.5px; width: 38px; }
.hex-table .fu { color: var(--amber); font-size: 11px; width: 56px; }
.hex-table .liuqin { color: var(--ink2); width: 40px; }
.hex-table .najia {
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
  font-size: 14px;
  width: 54px;
  white-space: nowrap;
}
.hex-table .glyph-cell { white-space: nowrap; width: 60px; }
.hex-table .yb {
  display: inline-block;
  width: 40px;
  height: 6px;
  border-radius: 1px;
  background: var(--ink);
  vertical-align: middle;
}
.hex-table .yb.n { background: linear-gradient(90deg, var(--ink) 0 16px, transparent 16px 24px, var(--ink) 24px 40px); }
.hex-table .ym { font-style: normal; color: var(--red); font-size: 12px; margin-left: 3px; vertical-align: middle; }
.hex-table .pos { color: var(--muted); font-size: 11.5px; width: 78px; text-align: right; white-space: nowrap; line-height: 1.65; }
.hex-table.compact .pos { width: 56px; }
.hex-table .pos .sv { color: var(--blue); font-weight: 600; }
.hex-table .pos .yv { color: var(--green); font-weight: 600; }
.hex-table .pos .sv, .hex-table .pos .yv { margin-right: 4px; }
.hex-table .pos .mk { color: var(--red); font-size: 10.5px; margin-right: 4px; }
.hex-table .pos .mk.yong { background: var(--red); color: #fff; border-radius: 3px; padding: 0 4px; font-weight: 600; }
.hex-table .mk-sub { display: block; margin-top: 1px; }
.hex-table .mk2 { color: var(--blue-dark); font-size: 9.5px; margin-left: 3px; }
.hex-table .mk2.b { color: #12805c; }
.hex-table .mk2.r { color: var(--red); }
.hex-table .yao-pos {
  width: 30px;
  text-align: center;
  color: var(--ink2);
  font-size: 12px;
  white-space: nowrap;
  line-height: 1.35;
}
.hex-table .wg {
  display: block;
  font-style: normal;
  font-size: 9px;
  line-height: 1.3;
  border-radius: 2px;
  margin-top: 1px;
}
.hex-table .wg.wang { background: #eaf7f2; color: #12805c; }
.hex-table .wg.xiang { background: var(--blue-soft); color: var(--blue-dark); }
.hex-table .wg.xiu { background: #f2f2f2; color: #7a7a7a; }
.hex-table .wg.qiu { background: var(--amber-soft); color: var(--amber); }
.hex-table .wg.si { background: var(--red-soft); color: var(--red); }
.hex-table .najia .wx { font-size: 11px; color: var(--muted); margin-left: 1px; }
.hex-table tr.chg-row td { background: #fffdf6; }

.rl {
  display: inline-block;
  font-style: normal;
  font-size: 9.5px;
  line-height: 1.55;
  padding: 0 3px;
  border-radius: 3px;
  margin-left: 2px;
  border: 1px solid transparent;
  vertical-align: 1px;
}
.rl.yuan { background: var(--amber-soft); border-color: #f0dcb4; color: var(--amber); }
.rl.ji { background: var(--red-soft); border-color: #f6cdc9; color: var(--red); }
.rl.chou { background: #f2f2f2; border-color: #e6e6e6; color: #787878; }
.rl.xie { background: var(--blue-soft); border-color: var(--blue-line); color: #7a90a8; }
.hex-table .fu .fu-y {
  font-style: normal;
  background: var(--red);
  color: #fff;
  border-radius: 3px;
  padding: 0 3px;
  font-size: 9.5px;
  margin-right: 2px;
}

/* ---- 用神分析 ---- */
.ys-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ys-head .ys-lb { font-size: 12px; color: var(--muted); }
.ys-head b { font-family: "Noto Serif SC", "Songti SC", "SimSun", serif; font-size: 21px; color: var(--red); line-height: 1.2; }
.ys-head .ys-src { font-size: 12px; color: var(--muted); margin-left: auto; }
.ys-why { font-size: 13px; color: var(--ink2); margin: 6px 0 8px; }
.ys-line { font-size: 13px; color: var(--ink2); line-height: 1.95; margin: 8px 0; }
.ys-score { display: flex; align-items: center; gap: 10px; margin: 10px 0 8px; }
.ys-lb2 { color: var(--muted); font-size: 12px; flex: 0 0 auto; }
.ys-bar { flex: 1 1 120px; max-width: 340px; height: 7px; border-radius: 4px; background: var(--line); overflow: hidden; }
.ys-bar i { display: block; height: 100%; border-radius: 4px; }
.ys-bar i.g { background: var(--green); }
.ys-bar i.b { background: var(--blue); }
.ys-bar i.r { background: var(--red); }
.ys-score b { font-size: 15px; flex: 0 0 auto; }
.ys-score em { font-style: normal; color: var(--muted); font-size: 11.5px; flex: 0 0 auto; }
.ys-fac { display: flex; flex-wrap: wrap; gap: 5px 7px; font-size: 12px; margin-bottom: 12px; }
.ys-fac span {
  border: 1px solid var(--line);
  background: var(--panel2);
  border-radius: 5px;
  padding: 1px 8px;
  color: var(--ink2);
}
.ys-fac span.up { border-color: #c6e8db; background: var(--green-soft); color: #12805c; }
.ys-fac span.dn { border-color: #f6cdc9; background: var(--red-soft); color: var(--red); }
.ys-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 8px; margin: 10px 0; }
.ys-roles > div {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 12.5px;
  color: var(--ink2);
}
.ys-roles b { margin-right: 4px; }
.ys-roles .tip { color: var(--muted); font-size: 11.5px; }
.ys-roles em { display: block; font-style: normal; margin-top: 3px; color: var(--ink); }
.ys-roles .rl { font-size: 11px; padding: 0 5px; }
.ys-yq {
  margin-top: 10px;
  border-top: 1px dashed var(--line);
  padding-top: 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 12.5px;
  color: var(--ink2);
}
.ys-yq b { color: var(--ink); }

.key-grid { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 13px; line-height: 2.1; }
.key-grid .full { flex: 1 1 100%; }
.hl-red { color: var(--red); font-weight: 600; }

.gua-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.gua-title .nm { font-family: "Noto Serif SC", "Songti SC", "SimSun", serif; font-size: 19px; }
.gua-title small { color: var(--muted); font-size: 12px; font-weight: 400; }

.toss-row { display: flex; align-items: center; gap: 9px; padding: 3px 0; flex-wrap: wrap; }
.toss-row .t-name { width: 42px; color: var(--muted); font-size: 12.5px; }
.toss-row select {
  border: 1px solid var(--line2);
  border-radius: 6px;
  background: #fff;
  padding: 5px 8px;
  font-size: 13.5px;
  font-family: inherit;
}
.coin {
  display: inline-block;
  width: 24px; height: 24px;
  line-height: 22px;
  border-radius: 50%;
  border: 1.5px solid #c9a227;
  color: #a9821d;
  text-align: center;
  font-size: 11px;
  margin-right: 3px;
  background: #fffdf5;
}
.coin.y { border-color: var(--red); color: var(--red); background: var(--red-soft); }

/* ---- 梅花 ---- */
.meihua-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.mg-card {
  background: var(--panel);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 16px 14px;
  text-align: center;
  min-width: 0;
  overflow: hidden;
}
.mg-card .mg-label { font-size: 12.5px; color: var(--muted); letter-spacing: 2px; }
.mg-card .mg-name {
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  margin: 4px 0 10px;
}
.mg-lines { display: flex; flex-direction: column; align-items: center; gap: 7px; margin-bottom: 10px; }
.mg-line { display: block; height: 8px; width: 106px; border-radius: 2px; background: var(--ink); }
.mg-line.yin {
  background: linear-gradient(90deg, var(--ink) 0 46px, transparent 46px 60px, var(--ink) 60px 106px);
}
.mg-line.move { background-color: var(--red); }
.mg-line.yin.move { background: linear-gradient(90deg, var(--red) 0 46px, transparent 46px 60px, var(--red) 60px 106px); }
.mg-sub { font-size: 12px; color: var(--muted); line-height: 1.9; word-break: break-word; }
.mg-sub b { color: var(--ink2); font-weight: 600; }
.mg-tiyong {
  display: inline-block; margin-top: 8px; font-size: 12px;
  border-radius: 4px; padding: 1px 8px;
}
.mg-tiyong.ti { color: var(--red); background: var(--red-soft); border: 1px solid #f6cdc9; }
.mg-tiyong.yong { color: var(--blue-dark); background: var(--blue-soft); border: 1px solid var(--blue-line); }

/* ---- 奇门 ---- */
.qimen-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.qg {
  background: var(--panel);
  border-radius: 10px;
  box-shadow: var(--shadow);
  border: 1px solid transparent;
  padding: 10px 11px 22px;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  position: relative;
  min-width: 0;
}
.qg .q-palace { position: absolute; top: 8px; right: 10px; font-size: 11px; color: var(--muted); }
.qg .q-god { font-size: 12.5px; color: var(--blue-dark); min-height: 19px; }
.qg .q-star {
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
  font-size: 15px;
  color: var(--ink);
  margin: 1px 0;
}
.qg .q-star .tian { color: var(--red); font-weight: 600; }
.qg .q-star .ji {
  font-size: 10px; color: var(--amber); border: 1px solid #f0dcb4;
  border-radius: 3px; padding: 0 3px; margin-left: 2px; vertical-align: 2px;
  font-family: inherit;
}
.qg .q-door { font-size: 13.5px; color: var(--ink2); }
.qg .q-door .wh { font-size: 11px; color: var(--muted); margin-left: 3px; }
.qg .q-rel { font-size: 11px; color: var(--muted); line-height: 1.75; margin-top: 3px; }
.qg .q-rel em { font-style: normal; color: var(--amber); }
.qg .q-ground {
  margin-top: auto;
  border-top: 1px dashed var(--line);
  padding-top: 5px;
  font-size: 12.5px;
  color: var(--muted);
}
.qg .q-ground b { color: var(--ink); font-weight: 600; font-size: 14px; }
.qg.mark-kong { border-color: #c6e8db; background: linear-gradient(180deg, #fff 55%, var(--green-soft)); }
.qg.mark-ma { border-color: #f6cdc9; background: linear-gradient(180deg, #fff 58%, var(--red-soft)); }
.qg.mark-xing { border-color: #f0dcb4; background: linear-gradient(180deg, #fff 58%, var(--amber-soft)); }
.qg .q-tags { position: absolute; bottom: 6px; right: 8px; font-size: 10.5px; }
.qg .q-tags span {
  background: var(--green); color: #fff; border-radius: 3px; padding: 0 4px; margin-left: 3px;
}
.qg .q-tags span.ma { background: var(--red); }
.qg .q-tags span.other { background: var(--amber); }
.qg .q-tags span.ri { background: #9aa4b0; }

/* ---- 白话解读 ---- */
.read {
  background: var(--panel);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 16px;
  border-left: 4px solid var(--blue);
}
.read h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.read h3 .badge {
  font-size: 11px;
  font-weight: 400;
  color: var(--blue-dark);
  background: var(--blue-soft);
  border: 1px solid var(--blue-line);
  border-radius: 4px;
  padding: 1px 7px;
}
.read p { font-size: 13.5px; color: var(--ink2); line-height: 2; margin-bottom: 8px; }
.read p:last-child { margin-bottom: 0; }
.read b { color: var(--ink); }
.read .hl { color: var(--red); font-weight: 600; }
.read .hl2 { color: var(--blue-dark); font-weight: 600; }
.read ul { margin: 0 0 8px 18px; font-size: 13px; color: var(--ink2); line-height: 2; }
.read li::marker { color: var(--blue); }

.tips {
  background: var(--green-soft);
  border: 1px solid #c6e8db;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12.5px;
  color: #147a58;
  margin-bottom: 16px;
  line-height: 1.9;
}

/* ---- 页脚 ---- */
footer.site {
  margin-top: 24px;
  padding: 18px 16px 10px;
  border-top: 1px solid var(--line2);
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 2;
}
footer.site a { color: var(--blue); text-decoration: none; }

/* ---- 大六壬 ---- */
.liuren-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .liuren-wrap { grid-template-columns: 1fr; } }
.pan-card { background: var(--panel); border-radius: 10px; box-shadow: var(--shadow); padding: 10px 12px 6px; }
.pan-card svg { display: block; width: 100%; height: auto; }
.pan-cap { text-align: center; font-size: 11.5px; color: var(--muted); padding: 2px 0 8px; }
.ke-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ke-col { border: 1px solid var(--line); border-radius: 8px; padding: 6px 0 7px; text-align: center; background: #fff; }
.ke-col .k-label { font-size: 10.5px; color: var(--muted); }
.ke-col .k-up { font-family: "Noto Serif SC", "Songti SC", "SimSun", serif; font-size: 19px; color: var(--red); line-height: 1.35; }
.ke-col .k-down { font-family: "Noto Serif SC", "Songti SC", "SimSun", serif; font-size: 16px; color: var(--ink2); line-height: 1.35; }
.ke-col .k-down small { font-family: inherit; font-size: 10.5px; color: var(--muted); }
.chuan-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.chuan { border: 1px solid var(--line); border-radius: 8px; padding: 8px 6px; text-align: center; background: #fff; }
.chuan .c-label { font-size: 10.5px; color: var(--muted); letter-spacing: 2px; }
.chuan .c-gz { font-family: "Noto Serif SC", "Songti SC", "SimSun", serif; font-size: 20px; line-height: 1.4; }
.chuan .c-meta { font-size: 11.5px; color: var(--ink2); line-height: 1.85; }
.chuan .c-meta i { font-style: normal; color: var(--muted); }

/* ---- 塔罗牌 ---- */
.tarot-grid { display: grid; gap: 12px; justify-content: center; }
.tarot-grid.n1 { grid-template-columns: minmax(0, 200px); }
.tarot-grid.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tarot-grid.n5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 900px) { .tarot-grid.n5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .tarot-grid.n3, .tarot-grid.n5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tarot-grid.n1 { grid-template-columns: minmax(0, 168px); }
}
.tcard {
  position: relative;
  background: #fff;
  border: 1px solid var(--line2);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 9px 9px 8px;
  text-align: center;
  min-width: 0;
}
.tcard .t-pos {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .5px;
  margin-bottom: 6px;
  min-height: 16px;
  line-height: 1.4;
}
.tcard .t-frame { margin: 0 auto 7px; }
.tcard .t-frame svg { display: block; width: 100%; height: auto; border-radius: 8px; }
.tcard.rev .t-frame svg { transform: rotate(180deg); }
.tcard .t-orient { display: inline-block; font-size: 10.5px; line-height: 1.7; border-radius: 4px; padding: 0 7px; }
.tcard .t-orient.up { background: var(--blue-soft); color: var(--blue-dark); border: 1px solid var(--blue-line); }
.tcard .t-orient.rev { background: var(--red-soft); color: var(--red); border: 1px solid #f6cdc9; }
.tcard .t-fallback { padding: 40px 0; font-size: 18px; color: var(--ink2); }
.tarot-detail { display: grid; gap: 10px; }
.trow { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fff; }
.trow .th { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.trow .th b { font-size: 14px; }
.trow .th span { font-size: 11.5px; color: var(--muted); }
.trow p { font-size: 13px; color: var(--ink2); line-height: 1.9; }
.trow p em { font-style: normal; color: var(--red); }

/* ============================================================
 * 响应式
 * ============================================================ */

@media (max-width: 1000px) {
  .hd-inner { gap: 12px; }
  .logo .txt { font-size: 15.5px; }
  nav.tabs a { padding: 6px 10px; font-size: 13px; }
}

@media (max-width: 780px) {
  .wrap { padding: 0 12px 30px; }

  /* 页头：品牌一行 + 可横向滑动的导航条 */
  .hd-inner { display: block; height: auto; padding: 9px 12px 0; }
  .logo .txt { font-size: 15px; }
  .logo .txt small { display: none; }
  .hd-right { display: none; }
  nav.tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding: 7px 12px 9px;
    margin: 0 -12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  nav.tabs::-webkit-scrollbar { display: none; }
  nav.tabs a { padding: 5px 12px; font-size: 13px; background: #f4f4f4; border-radius: 15px; }
  nav.tabs a:hover { background: var(--blue-soft); }

  /* 通用 */
  .panel { padding: 14px 13px; margin-bottom: 12px; }
  .panel h3 { font-size: 14.5px; margin-bottom: 11px; }
  .read { padding: 15px 14px; }
  .read h3 { font-size: 14.5px; }
  .read p { font-size: 13px; line-height: 1.95; }
  .read ul { font-size: 12.5px; }
  .info-line { font-size: 12.5px; padding: 9px 11px; gap: 3px 12px; line-height: 1.85; }
  .tips { font-size: 12px; padding: 9px 12px; }
  footer.site { font-size: 12px; padding: 14px 12px 8px; }
  .form-grid { gap: 10px 14px; }
  .field { flex: 1 1 100%; }
  .field input, .field select { width: 100%; font-size: 15px; }
  .btn { width: 100%; padding: 10px 18px; font-size: 15px; }

  /* 首页 */
  .hero { padding: 20px 17px; margin: 14px 0 14px; }
  .hero h1 { font-size: 20px; letter-spacing: 1px; }
  .hero p { font-size: 12.5px; }
  .hero::after { display: none; }
  .hero .chips span { font-size: 11.5px; }
  .home-grid { gap: 12px; }
  .home-card { padding: 16px 15px 14px; }
  .home-card .glyph { font-size: 26px; }
  .home-card h2 { font-size: 16px; margin: 6px 0 4px; }

  /* 八字 */
  .bazi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .pillar { padding: 11px 5px 9px; }
  .pillar .p-gz { font-size: 25px; letter-spacing: 2px; }
  .pillar .p-cang { min-height: 0; font-size: 11.5px; padding-top: 6px; margin-top: 6px; }
  .pillar .p-shishen { font-size: 11.5px; min-height: 18px; }
  .pillar .p-nayin { font-size: 11px; }
  .wuxing-bar { gap: 8px; }
  .wx-item { flex: 1 1 88px; padding: 7px 10px; font-size: 12px; }
  .dayun { width: 72px; }

  /* 六爻 */
  .hex-table { font-size: 12.5px; }
  .hex-table th { font-size: 11px; padding: 3px 3px 5px; }
  .hex-table td { padding: 5px 3px; }
  .hex-table .beast { width: 34px; font-size: 11px; }
  .hex-table .fu { width: auto; font-size: 10.5px; }
  .hex-table .liuqin { width: auto; white-space: nowrap; }
  .hex-table .najia { width: auto; font-size: 13px; }
  .hex-table .pos { width: 66px; font-size: 10.5px; }
  .hex-table.compact .pos { width: 50px; }
  .hex-table .yao-pos { width: 26px; font-size: 11px; }
  .hex-table .wg { font-size: 8px; }
  .hex-table .mk2 { font-size: 9px; margin-left: 2px; }
  .hex-table .glyph-cell { width: 48px; }
  .hex-table .yb { width: 32px; height: 5px; }
  .hex-table .yb.n { background: linear-gradient(90deg, var(--ink) 0 13px, transparent 13px 19px, var(--ink) 19px 32px); }
  .hex-table .ym { font-size: 11px; margin-left: 2px; }
  .hex-table .rl { font-size: 9px; padding: 0 2px; margin-left: 1px; }

  /* 用神分析 */
  .ys-head b { font-size: 18px; }
  .ys-head .ys-src { margin-left: 0; flex: 1 1 100%; }
  .ys-bar { max-width: none; }
  .ys-fac { font-size: 11.5px; gap: 4px 6px; }
  .ys-roles { gap: 6px; }
  .ys-yq { gap: 3px 14px; font-size: 12px; }
  .ys-line { font-size: 12.5px; }

  /* 梅花 */
  .mg-line { width: 92px; }
  .mg-line.yin { background: linear-gradient(90deg, var(--ink) 0 40px, transparent 40px 52px, var(--ink) 52px 92px); }
  .mg-line.yin.move { background: linear-gradient(90deg, var(--red) 0 40px, transparent 40px 52px, var(--red) 52px 92px); }

  /* 奇门：始终保留三列，九宫方位不能打乱 */
  .qimen-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .qg { min-height: 0; padding: 8px 7px 18px; }
  .qg .q-palace { font-size: 10px; top: 6px; right: 6px; }
  .qg .q-god { font-size: 11.5px; min-height: 16px; }
  .qg .q-star { font-size: 13px; }
  .qg .q-star .ji { font-size: 9px; padding: 0 2px; }
  .qg .q-door { font-size: 12px; }
  .qg .q-door .wh { font-size: 10px; margin-left: 2px; }
  .qg .q-rel { font-size: 10px; line-height: 1.6; }
  .qg .q-ground { font-size: 11px; padding-top: 4px; }
  .qg .q-ground b { font-size: 12.5px; }
  .qg .q-tags { font-size: 9.5px; bottom: 5px; right: 5px; }

  /* 六壬 */
  .pan-card { padding: 6px 6px 2px; }
  .pan-card svg { max-width: 480px; margin: 0 auto; }
  .ke-col { padding: 5px 0 6px; }
  .ke-col .k-up { font-size: 17px; }
  .ke-col .k-down { font-size: 14px; }
  .chuan .c-gz { font-size: 18px; }
  .chuan .c-meta { font-size: 11px; }

  /* 塔罗 */
  .tcard { padding: 7px 7px 6px; }
  .tcard .t-pos { font-size: 10.5px; margin-bottom: 5px; min-height: 15px; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 10px 26px; }
  .hero h1 { font-size: 18.5px; }
  .bazi-grid { gap: 8px; }
  .pillar .p-gz { font-size: 22px; }
  .qimen-grid { gap: 5px; }
  .qg { padding: 7px 6px 17px; }
  .qg .q-god { font-size: 11px; }
  .qg .q-star { font-size: 12.5px; }
  .qg .q-door { font-size: 11.5px; }
  .qg .q-tags { font-size: 9px; }
  .tarot-grid { gap: 8px; }
  .tcard .t-pos { font-size: 10px; }
  .ke-grid { gap: 5px; }
  .ke-col .k-up { font-size: 15px; }
  .chuan-row { gap: 5px; }
  .chuan { padding: 6px 3px; }
  .chuan .c-gz { font-size: 16px; }
  .chuan .c-meta { font-size: 10.5px; }
}
