/* 戏子星象 — 全新东方国风命理视觉体系（2026-11 雅致重构版）
 * 视觉哲学：【天演玄机 · 玄青丹砂泥金】
 * 调色基调：古卷宣纸底（Warm Paper）+ 玄青墨黛（Deep Teal/Ink）+ 古法朱砂（Cinnabar Seal）+ 泥金经卷（Gold Accent）
 * 纯静态自包含：零外部网络依赖，所有图腾纹样纯 CSS / 内联 SVG 渲染。
 */

:root {
  /* ---------- 核心东方调色板 ---------- */
  --bg-page: #f5f3ec;             /* 古卷宣纸纯色底 */
  --bg-surface: #fcfbf7;          /* 卡片润白宣纸底 */
  --bg-surface-trans: #fcfbf7;    /* 纯色平涂 */
  --bg-card: #fdfdfb;             /* 卡片底色 */
  --bg-soft: #ece8dc;             /* 浅米灰/淡古宣 */
  --bg-alt: #f0ece1;              /* 斑马纹/交替底 */

  /* 墨色层级 */
  --ink: #162224;                 /* 焦墨正文 */
  --ink-2: #36484a;               /* 浓墨副文本 */
  --ink-3: #6b7c7e;               /* 浅墨提示文 */
  --ink-faint: #8e9e9f;           /* 极淡墨辅助 */
  --ink-soft: #36484a;            /* 兼容别名 */

  /* 品牌玄青 */
  --brand: #174248;               /* 苍松墨青 */
  --brand-deep: #0f2c30;          /* 极深玄青 */
  --teal: #174248;                /* 兼容别名 */
  --teal-deep: #0f2c30;           /* 兼容别名 */
  --teal-soft: #e5edea;           /* 浅青软底 */

  /* 朱砂印泥（命理精气神） */
  --cinnabar: #b8332a;            /* 古法朱砂印色 */
  --cinnabar-hover: #cf3d33;      /* 朱砂高亮 */
  --cinnabar-soft: #fcf0ef;       /* 朱砂浅晕 */
  --verdict-seal: #b8332a;

  /* 泥金经卷（金石尊荣） */
  --gold: #b38838;                /* 泥金描线/装饰 */
  --gold-ink: #855e1a;            /* 深金文字（保证对比度） */
  --gold-soft: #faf4e6;           /* 金色软底 */
  --sand: #b38838;                /* 兼容别名 */
  --sand-deep: #855e1a;           /* 兼容别名 */

  /* 五行经典色调体系 */
  --wx-jin: #b08226;              /* 金（赤金/黄铜） */
  --wx-mu: #2c7744;               /* 木（翠竹/古松） */
  --wx-shui: #1b639e;             /* 水（沧海/天青） */
  --wx-huo: #b8332a;              /* 火（朱雀/烈火） */
  --wx-tu: #7a5a38;               /* 土（厚土/琥珀） */

  /* 边框与框线 */
  --line: rgba(23, 66, 72, 0.16);
  --line-gold: rgba(179, 136, 56, 0.32);
  --line-soft: rgba(23, 66, 72, 0.08);
  --glass-border: rgba(255, 255, 255, 0.85);
  --glass-brd: rgba(179, 136, 56, 0.24);

  /* 阴影体系：古籍立面纸质微影 */
  --sh-sm: 0 1px 3px rgba(15, 44, 48, 0.05), 0 3px 8px rgba(15, 44, 48, 0.04);
  --sh-md: 0 3px 6px rgba(15, 44, 48, 0.06), 0 10px 24px rgba(15, 44, 48, 0.06);
  --sh-lg: 0 6px 12px rgba(15, 44, 48, 0.07), 0 20px 42px rgba(15, 44, 48, 0.09);
  --sh-gold: 0 4px 18px rgba(179, 136, 56, 0.18);
  --glass-shadow: var(--sh-md);
  --glass-shadow-sm: var(--sh-sm);
  --glass-shadow-hover: var(--sh-lg);
  --glass-blur: blur(20px);
  --glass-blur-sm: blur(12px);

  /* 间距与尺寸 */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius: 20px;
  --radius-xl: 28px;
  --maxw: 1120px;

  /* 字体栈：100% 离线自包含，优先中式典雅衬线与高端正文字体 */
  --font-display: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", "FangSong", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
  --font-kai: "Kaiti SC", "STKaiti", "KaiTi", serif;
}

/* ---------- 基础样式重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  background-color: var(--bg-page);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--brand); text-decoration: none; transition: color 0.18s ease; }
a:hover { color: var(--cinnabar); text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
  color: var(--brand-deep);
  letter-spacing: 0.04em;
}

/* ---------- 顶栏（古卷浮空书案） ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 244, 236, 0.88);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line-gold);
  box-shadow: 0 2px 10px rgba(15, 44, 48, 0.04);
  transition: all 0.2s ease;
}

.site-header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 900;
  letter-spacing: 0.2em;
  color: var(--brand-deep);
  text-decoration: none;
}

.brand::before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--brand);
  border: 1px solid var(--line-gold);
}

.brand small {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--gold-ink);
  margin-left: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(179, 136, 56, 0.1);
  border: 1px solid rgba(179, 136, 56, 0.2);
}

.main-nav { display: flex; gap: 6px; }
.main-nav a {
  padding: 6px 14px;
  border-radius: 20px;
  color: var(--ink-2);
  font-size: 14.5px;
  letter-spacing: 0.08em;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.18s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--brand-deep);
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--line-gold);
  box-shadow: 0 2px 6px rgba(15, 44, 48, 0.05);
}

/* ---------- 主页面容器 ---------- */
.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px 60px;
  flex: 1;
  width: 100%;
}

/* 面包屑导航 */
.crumb {
  margin: 16px 0 8px;
  font-size: 13px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}
.crumb a { color: var(--ink-2); }
.crumb a:hover { color: var(--cinnabar); }
.crumb span { margin: 0 6px; color: var(--line); }

/* ---------- Hero 区域 ---------- */
.hero, .tool-hero {
  text-align: center;
  padding: 38px 16px 26px;
  position: relative;
}

.hero__eyebrow, .eyebrow {
  display: inline-block;
  font-size: 12.5px;
  letter-spacing: 0.42em;
  color: var(--gold-ink);
  margin-bottom: 12px;
  text-transform: uppercase;
  font-weight: 600;
  position: relative;
  padding: 0 12px;
}

.hero__eyebrow::before, .hero__eyebrow::after,
.eyebrow::before, .eyebrow::after {
  content: "✦";
  font-size: 9px;
  color: var(--gold);
  margin: 0 8px;
  vertical-align: middle;
}

.hero h1, .tool-hero h1 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 900;
  letter-spacing: 0.18em;
  color: var(--brand-deep);
  margin: 0 0 12px;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.hero__tagline, .tool-hero p {
  font-family: var(--font-display);
  font-size: clamp(16px, 2.5vw, 21px);
  letter-spacing: 0.08em;
  color: var(--ink-2);
  margin: 0 auto;
  max-width: 680px;
  line-height: 1.5;
}

.hero__today {
  margin-top: 26px;
  font-size: 13.5px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}
.hero__today strong { color: var(--brand-deep); font-weight: 600; }

/* ---------- 首页三角浑天仪按钮 ---------- */
.home .site-header .site-header__inner { justify-content: center; }
.home .page { width: 100%; }

.tri {
  margin: 32px 0 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.tri__row {
  display: flex;
  justify-content: center;
  gap: 22px;
}

.tri__btn {
  position: relative;
  width: 126px;
  height: 126px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  background: #ffffff;
  border: 1px solid var(--line-gold);
  box-shadow: var(--sh-sm);
  transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2), box-shadow 0.25s ease;
}

.tri__btn:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--sh-md);
  border-color: var(--brand);
  text-decoration: none;
}
.tri__btn:active { transform: scale(0.97); }

.tri__btn--spin-a {
  width: 156px;
  height: 156px;
  border: 1.5px solid var(--line-gold);
}

.tri__btn::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  pointer-events: none;
  background: transparent;
  border: 1.5px solid var(--gold);
}

@keyframes tri-spin { to { transform: rotate(360deg); } }
.tri__btn--spin-a::before { animation-duration: 9s; animation-delay: var(--spin-delay, -1.8s); }
.tri__btn--spin-b::before { animation-duration: 11s; animation-delay: var(--spin-delay, -3.2s); }
.tri__btn--spin-c::before { animation-duration: 13s; animation-delay: var(--spin-delay, -5.6s); }

.tri__label {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  color: var(--brand-deep);
  line-height: 1.2;
}
.tri__btn--spin-a .tri__label { font-size: 25px; color: var(--brand-deep); }

.tri__sub {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  color: var(--gold-ink);
  font-weight: 600;
  margin-top: 4px;
}

/* ---------- 统一卡片系统（古籍纸卷装裱） ---------- */
.card, .page .card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--line-gold);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--sh-md),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 0 20px rgba(179, 136, 56, 0.02);
  margin-bottom: 24px;
}

/* 古典内花角纹修饰 */
.card::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 6px;
  width: 12px;
  height: 12px;
  border-top: 2px solid var(--gold);
  border-left: 2px solid var(--gold);
  opacity: 0.45;
  pointer-events: none;
}
.card::after {
  content: "";
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 12px;
  height: 12px;
  border-bottom: 2px solid var(--gold);
  border-right: 2px solid var(--gold);
  opacity: 0.45;
  pointer-events: none;
}

/* 标题规范 */
.sec-t, .section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--brand-deep);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line-gold);
}
.sec-t::before, .section-title::before {
  content: "";
  width: 5px;
  height: 18px;
  border-radius: 2px;
  background: var(--cinnabar);
  flex-shrink: 0;
}

.sec-sub { font-size: 14px; color: var(--ink-3); margin-top: -10px; margin-bottom: 16px; }

/* ---------- 工具卡片网格 ---------- */
.tools, .learn {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 24px;
}

.tool-card, .learn-card {
  position: relative;
  display: block;
  background: var(--bg-surface);
  border: 1px solid var(--line-gold);
  border-radius: var(--radius-md);
  padding: 22px 22px 18px;
  box-shadow: var(--sh-sm), inset 0 1px 0 #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
}

.tool-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gold);
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.tool-card:hover, .learn-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-lg), 0 0 20px rgba(179, 136, 56, 0.12);
  border-color: rgba(179, 136, 56, 0.5);
  text-decoration: none;
}
.tool-card:hover::before { opacity: 1; }

.tool-card__name, .learn-card__name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--brand-deep);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tool-card__desc, .learn-card__desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
}

.tool-card__foot {
  margin-top: 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--cinnabar);
  display: flex;
  align-items: center;
  gap: 4px;
}

#utils .tools { grid-template-columns: repeat(4, 1fr); }

/* ---------- 表单控件（东方金石排版） ---------- */
@media (min-width: 861px) {
  .page .card.form-card { max-width: 680px; margin-left: auto; margin-right: auto; }
}

.field { margin-bottom: 18px; }
.field > label, .form-grid label {
  display: block;
  margin: 0 0 7px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}

.field input[type="text"],
.field input[type="number"],
.field input[type="date"],
.field input[type="time"],
.field input[type="datetime-local"],
.field input[type="search"],
.field select,
.field textarea,
.page .field input,
.page .field select,
.page .field textarea {
  width: 100%;
  height: 48px !important;
  min-height: 48px !important;
  padding: 0 12px !important;
  font-size: 16px !important; /* 严格保证 >=16px，彻底根治 iOS Safari 聚焦放大视口缺陷 */
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line-gold) !important;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 3px rgba(15, 44, 48, 0.04);
  transition: all 0.2s ease;
  font-family: inherit;
  box-sizing: border-box;
}

.field textarea, .page .field textarea {
  height: auto !important;
  min-height: 96px !important;
  padding: 12px 14px !important;
  line-height: 1.6;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23, 66, 72, 0.12), inset 0 1px 2px rgba(15, 44, 48, 0.02);
}

.field .hint {
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 6px;
  line-height: 1.5;
}

/* 分段选择器（公历/农历、性别） */
.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 20px;
  background: var(--bg-soft);
  border: 1px solid var(--line-gold);
  flex: none;
}

.seg label {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 12px;
  border-radius: 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.seg label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.seg label:has(input:checked) {
  background: #ffffff;
  color: var(--cinnabar);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(15, 44, 48, 0.1);
}

.seg-cal { height: 34px; min-width: 130px; }
.seg-gender { height: 46px; min-width: 140px; }
.seg-gender label { font-size: 15px; }

.date-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.date-head > label { margin: 0; }

.date-row { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 10px; }
.row-gender-time { display: grid; grid-template-columns: 140px 1fr; gap: 12px; align-items: end; }
.time-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.location-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lon-row { display: grid; grid-template-columns: 1fr 70px; gap: 10px; align-items: center; }
.lon-wrap { position: relative; }
.lon-wrap input { padding-right: 32px; }
.lon-unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--ink-3); pointer-events: none; }

.lon-btn {
  height: 48px;
  border: 1px solid var(--line-gold);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--brand-deep);
  cursor: pointer;
  transition: all 0.18s ease;
}
.lon-btn:hover { background: #fff; border-color: var(--brand); color: var(--cinnabar); }

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
}
.check-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; }

/* 按钮体系 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: 24px;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: #174248;
  color: #f8faf9;
  border: 1px solid rgba(179, 136, 56, 0.4);
  box-shadow: 0 4px 14px rgba(17, 54, 60, 0.25);
}
.btn--primary:hover {
  background: #103338;
  box-shadow: 0 6px 18px rgba(17, 54, 60, 0.35);
  color: #ffffff;
}

.btn--ghost {
  border-color: var(--line-gold);
  color: var(--brand-deep);
  background: rgba(255, 255, 255, 0.7);
}
.btn--ghost:hover { background: #fff; border-color: var(--brand); color: var(--cinnabar); }

.form-actions .btn--primary {
  width: 100%;
  height: 52px;
  margin-top: 24px;
  font-size: 17.5px;
  font-family: var(--font-display);
  letter-spacing: 0.16em;
  text-indent: 0.16em;
}

.form-error {
  color: var(--cinnabar);
  font-size: 14px;
  margin-top: 10px;
  text-align: center;
  font-weight: 500;
}

/* ---------- 排盘结果统一页头与印章 ---------- */
.result-head {
  text-align: center;
  padding: 16px 12px 24px;
  border-bottom: 2px solid var(--line-gold);
  margin-bottom: 24px;
  position: relative;
}

.result-head h2 {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: var(--brand-deep);
  margin-bottom: 8px;
}

.result-head .muted {
  font-size: 14.5px;
  color: var(--ink-2);
  line-height: 1.6;
}

/* 判语徽章印记 */
.stamp, .v-ok, .v-mid, .v-warn, .v-bad {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  border: 1px solid currentColor;
}
.v-ok { color: var(--wx-mu); background: rgba(44, 119, 68, 0.08); }
.v-mid { color: var(--wx-jin); background: rgba(176, 130, 38, 0.08); }
.v-warn { color: #d97706; background: rgba(217, 119, 6, 0.08); }
.v-bad { color: var(--cinnabar); background: var(--cinnabar-soft); }

/* ---------- 紫微斗数 4×4 命盘 ---------- */
.chart-wrap {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  grid-template-rows: repeat(4, minmax(135px, auto));
  gap: 8px;
  width: 100%;
  min-width: 560px;
  background: var(--bg-soft);
  padding: 10px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--line-gold);
  box-shadow: inset 0 0 16px rgba(15, 44, 48, 0.05);
}

.palace {
  background: #ffffff;
  border: 1px solid var(--line-gold);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--sh-sm);
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  min-height: 135px;
}
.palace:hover {
  transform: scale(1.015);
  box-shadow: 0 4px 14px rgba(179, 136, 56, 0.22);
  z-index: 2;
  border-color: var(--gold);
}

.pal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 4px;
  margin-bottom: 4px;
}
.pal-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  color: var(--brand-deep);
}
.pal-ganzhi {
  font-size: 12px;
  color: var(--gold-ink);
  font-weight: 600;
}
.pal-daxian {
  font-size: 11px;
  color: var(--ink-3);
}

.pal-stars {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-bottom: 6px;
}

.star {
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}
.star.major { font-size: 14px; font-weight: 800; color: var(--brand-deep); }
.star.sha { color: var(--cinnabar); }
.star.lucky { color: var(--wx-mu); }
.star.minor { color: var(--ink-2); font-weight: 500; font-size: 12px; }

.st-br {
  font-size: 10px;
  margin-left: 2px;
  padding: 0 2px;
  border-radius: 2px;
}
.st-br.bright { color: #fff; background: var(--cinnabar); }
.st-br.dim { color: var(--ink-3); background: #eee; }

.st-hua, .hua-tag {
  font-size: 10.5px;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 700;
  margin-left: 3px;
  color: #fff;
  background: var(--cinnabar);
}

.pal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto;
}
.pal-tag {
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 700;
  border: 1px solid currentColor;
}
.tag-ming { color: var(--cinnabar); border-color: var(--cinnabar); background: var(--cinnabar-soft); }
.tag-shen { color: var(--wx-jin); border-color: var(--wx-jin); background: var(--gold-soft); }
.tag-daxian { color: var(--brand); border-color: var(--brand); background: var(--teal-soft); }

/* 紫微中宫天极紫微垣 */
.chart-center {
  background: #ffffff;
  border: 2px solid var(--line-gold);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  box-shadow: inset 0 0 16px rgba(179, 136, 56, 0.05);
}
.chart-center h3 {
  font-size: 21px;
  color: var(--brand-deep);
  margin-bottom: 6px;
  letter-spacing: 0.12em;
}
.chart-center .cc-sub {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.6;
}
.chart-center .cc-row {
  margin-top: 8px;
  display: flex;
  gap: 8px 14px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 13px;
  color: var(--gold-ink);
  font-weight: 600;
}

/* 解读与主题 Tab */
.topic-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-gold);
}
.topic-tab {
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--line-gold);
  background: #ffffff;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.18s ease;
}
.topic-tab:hover { border-color: var(--brand); color: var(--brand-deep); }
.topic-tab.active {
  background: var(--brand-deep);
  color: #fff;
  border-color: var(--brand-deep);
  box-shadow: 0 2px 8px rgba(15, 44, 48, 0.2);
}

.topic-body {
  font-size: 15px;
  line-height: 1.85;
  color: var(--ink);
}
.topic-body p { margin: 0 0 1em; }

/* ---------- 八字四柱排盘台 ---------- */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 16px 0 24px;
}

.pillar {
  background: #ffffff;
  border: 1.5px solid var(--line-gold);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  text-align: center;
  box-shadow: var(--sh-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.pillar::before {
  content: "";
  position: absolute;
  top: 0; left: 15%; right: 15%;
  height: 2px;
  background: var(--gold);
}

.pillar-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-ink);
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}

.pillar-gz {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  color: var(--brand-deep);
  letter-spacing: 0.12em;
  margin: 4px 0 8px;
  line-height: 1.1;
}

.pillar-sub {
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.6;
  margin-top: 2px;
}

.ov-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin: 16px 0;
  padding: 14px;
  background: var(--bg-soft);
  border-radius: var(--radius-md);
}
.ov-grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ov-k { font-size: 12px; color: var(--ink-3); }
.ov-v { font-size: 15px; font-weight: 700; color: var(--brand-deep); }

/* 五行强弱能量条 */
.wx-rows { margin: 16px 0; display: flex; flex-direction: column; gap: 10px; }
.wx-row { display: grid; grid-template-columns: 50px 1fr 60px; gap: 12px; align-items: center; }
.wx-name { font-weight: 700; font-size: 14px; }
.wx-bar {
  height: 12px;
  background: var(--line);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.wx-bar > div {
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s ease;
}
.wx-bar-jin { background: var(--wx-jin); }
.wx-bar-mu { background: var(--wx-mu); }
.wx-bar-shui { background: var(--wx-shui); }
.wx-bar-huo { background: var(--wx-huo); }
.wx-bar-tu { background: var(--wx-tu); }

/* ---------- 梅花易数与六爻卦象卡片 ---------- */
.gua-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.gua-card {
  background: #ffffff;
  border: 1.5px solid var(--line-gold);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  box-shadow: var(--sh-sm);
  text-align: center;
}
.gua-card__t { font-size: 12.5px; color: var(--gold-ink); font-weight: 600; margin-bottom: 6px; }
.gua-card__name {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  color: var(--brand-deep);
  margin-bottom: 6px;
}
.gua-card__sub { font-size: 13px; color: var(--ink-3); margin-bottom: 8px; }
.gua-card__reading { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; text-align: left; }

/* 爻位表格 */
.lines-table, .matrix-table, .luck-table, .jieqi-table, .gz-table, .qimen-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 16px 0;
}
.lines-table th, .matrix-table th, .luck-table th, .jieqi-table th, .gz-table th, .qimen-table th {
  background: var(--bg-soft);
  color: var(--brand-deep);
  padding: 10px 12px;
  font-weight: 700;
  border: 1px solid var(--line-gold);
  font-family: var(--font-display);
}
.lines-table td, .matrix-table td, .luck-table td, .jieqi-table td, .gz-table td, .qimen-table td {
  padding: 10px 12px;
  border: 1px solid var(--line-gold);
  color: var(--ink);
  background: #ffffff;
}
.lines-table tr:nth-child(even) td, .matrix-table tr:nth-child(even) td { background: var(--bg-alt); }
.lines-table .row-changing td { background: var(--cinnabar-soft); color: var(--cinnabar); font-weight: 700; }

/* ---------- 奇门遁甲九宫格 ---------- */
.qimen-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 10px;
  max-width: 640px;
  margin: 20px auto;
  background: var(--bg-soft);
  padding: 12px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--line-gold);
}
.qimen-gong-cell, .qimen-gong-center {
  background: #ffffff;
  border: 1px solid var(--line-gold);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--sh-sm);
  position: relative;
}
.qimen-gong-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--gold-ink); }
.qimen-gong-shen { color: var(--brand); font-weight: 700; font-size: 13.5px; }
.qimen-gong-xing { color: var(--ink); font-size: 13px; }
.qimen-gong-men { color: var(--cinnabar); font-weight: 800; font-size: 14px; }
.qimen-gong-gan { font-size: 13px; font-weight: 700; }

/* ---------- 八字合婚得分卡 ---------- */
.score-card {
  text-align: center;
  padding: 28px 16px;
  background: #ffffff;
  border: 2px solid var(--line-gold);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}
.score-num {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 900;
  color: var(--cinnabar);
  line-height: 1;
}
.score-label {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--brand-deep);
  margin: 10px 0 6px;
}

/* ---------- 城市与逆推列表 ---------- */
.city-list, .cand-list {
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--line-gold);
  border-radius: var(--radius-sm);
  background: #ffffff;
}
.city-item, .cand-row {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.15s ease;
}
.city-item:hover, .cand-row:hover { background: var(--bg-soft); color: var(--cinnabar); }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line-gold);
  background: rgba(246, 244, 236, 0.95);
  margin-top: 50px;
  padding: 32px 20px calc(24px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}
.site-footer__disclaimer { max-width: 620px; margin: 0 auto 16px; line-height: 1.6; }
.site-footer__links a { color: var(--ink-2); margin: 0 8px; }
.site-footer__links a:hover { color: var(--cinnabar); }
.site-footer__copy { margin-top: 14px; color: var(--gold-ink); font-weight: 600; letter-spacing: 0.16em; }

/* ---------- 响应式断点适配 ---------- */
@media (max-width: 860px) {
  .tools, .learn { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  #utils .tools { grid-template-columns: repeat(2, 1fr); }
  .hero, .tool-hero { padding: 30px 12px 18px; }
  .page { padding: 0 16px 48px; }
  .card, .page .card { padding: 18px 16px; }
}

@media (max-width: 580px) {
  .tools, .learn { grid-template-columns: 1fr; }
  #utils .tools { grid-template-columns: 1fr; }
  .main-nav a { padding: 5px 8px; font-size: 13.5px; }
  .brand { font-size: 20px; letter-spacing: 0.12em; }
  .brand small { display: none; }
  
  .pillars-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .pillar-gz { font-size: 26px; }
  
  /* 移动端紧凑单行排版：年月日保持单行，大幅收拢垂直高度，手机上一屏立见主排盘按钮 */
  .date-row { grid-template-columns: 1.25fr 1fr 1fr !important; gap: 6px !important; }
  .row-gender-time { grid-template-columns: 120px 1fr !important; gap: 8px !important; }
  .seg-gender { width: 120px !important; height: 44px !important; }
  
  .tri { gap: 14px; }
  .tri__row { gap: 14px; }
  .tri__btn { width: 110px; height: 110px; }
  .tri__btn--spin-a { width: 136px; height: 136px; }
  .tri__label { font-size: 18px; }
  .tri__btn--spin-a .tri__label { font-size: 22px; }

  /* 触控面积与手感优化 */
  .btn, .btn--primary, .btn--ghost { min-height: 46px !important; }
  .form-actions .btn--primary { min-height: 52px !important; margin-top: 18px !important; }
}
