/* ===========================================================
   长景·中华黄历 · 太极历盘
   玄夜 · 星流 · 太極 · 金篆
   =========================================================== */

:root {
  --bg: #06060a;
  --bg-2: #0a0a11;
  --panel: rgba(255, 255, 255, 0.028);
  --panel-2: rgba(255, 255, 255, 0.055);
  --line: rgba(201, 169, 97, 0.16);
  --line-2: rgba(255, 255, 255, 0.07);
  --line-3: rgba(255, 255, 255, 0.045);

  --txt: #e9e3d5;
  --txt-2: #a49c8c;
  --txt-3: #6f6a60;
  --txt-4: #4a463e;

  --red: #d2453c;
  --red-2: #e86a5e;
  --red-dim: rgba(210, 69, 60, 0.12);

  --gold: #c9a961;
  --gold-2: #e6cd93;
  --gold-dim: rgba(201, 169, 97, 0.12);

  /* 清冷月白 / 银蓝：用于新增模块，避免金光 */
  --moon: #dcdfe4;
  --ice: #8fa8c4;
  --ice-2: #a9c0d6;
  --ice-dim: rgba(143, 168, 196, 0.12);
  --ice-line: rgba(143, 168, 196, 0.26);

  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  --kai: "Kaiti SC", "STKaiti", "KaiTi", "Songti SC", serif;
  --sans: "HarmonyOS Sans SC", "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: #2a2a33 #08080c;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--txt);
  font-family: var(--serif);
  font-size: clamp(14.5px, 0.18vw + 14px, 15.5px);
  line-height: 1.7;
  background:
    radial-gradient(120% 80% at 50% -20%, #12121c 0%, #08080d 45%, #050508 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(210, 69, 60, 0.35); color: #fff; }

/* ---------------- 背景层 ---------------- */

.stars {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.aura {
  position: fixed;
  inset: -10% -10% auto -10%;
  height: 70vh;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(50% 60% at 22% 12%, rgba(201, 169, 97, 0.10), transparent 70%),
    radial-gradient(45% 55% at 82% 4%, rgba(96, 108, 168, 0.12), transparent 72%),
    radial-gradient(60% 70% at 50% 100%, rgba(210, 69, 60, 0.06), transparent 70%);
  filter: blur(6px);
  transition: transform 0.9s cubic-bezier(0.22, 0.68, 0.35, 1);
}

.taiji-watermark {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(78vh, 760px);
  height: min(78vh, 760px);
  margin: calc(min(78vh, 760px) / -2) 0 0 calc(min(78vh, 760px) / -2);
  z-index: 0;
  pointer-events: none;
  opacity: 0.055;
  animation: spinSlow 200s linear infinite;
}

.taiji-watermark .tj-yang { fill: #e9e3d5; }
.taiji-watermark .tj-yin { fill: #06060a; }

@keyframes spinSlow { to { transform: rotate(360deg); } }

/* 月球式呼吸：光晕明暗与尺度微变 */
@keyframes moonBreath {
  0%, 100% { opacity: 0.6; transform: scale(0.97); }
  50%      { opacity: 1;   transform: scale(1.05); }
}

.page {
  position: relative;
  z-index: 1;
  max-width: clamp(1080px, 92vw, 1340px);
  margin: 0 auto;
  padding: 0 clamp(16px, 2.6vw, 34px) 60px;
  padding-left: max(clamp(16px, 2.6vw, 34px), env(safe-area-inset-left));
  padding-right: max(clamp(16px, 2.6vw, 34px), env(safe-area-inset-right));
}

/* ---------------- 顶部 ---------------- */

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 18px;
  padding: clamp(20px, 3.4vw, 36px) 2px clamp(14px, 2vw, 20px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: clamp(10px, 1.4vw, 16px); min-width: 0; }

/* 标准太极图：左阳右阴，白鱼头在上、黑鱼头在下 */
.taiji-svg { display: block; width: 100%; height: 100%; }
.tj-yang { fill: #e9e3d5; }
.tj-yin { fill: #14141c; }

.brand-taiji {
  position: relative;
  width: clamp(34px, 3.4vw, 46px);
  height: clamp(34px, 3.4vw, 46px);
  flex: none;
  border-radius: 50%;
  box-shadow:
    0 0 0 1px rgba(226, 236, 250, 0.38),
    0 0 9px rgba(232, 240, 252, 0.20),
    0 0 24px rgba(190, 208, 236, 0.15);
}

.brand-taiji .taiji-svg { animation: spinSlow 40s linear infinite; }

.brand-taiji::before {
  content: "";
  position: absolute;
  inset: -30%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%,
    rgba(232, 240, 252, 0.16) 0%,
    rgba(200, 216, 240, 0.08) 45%,
    transparent 72%);
  filter: blur(4px);
  animation: moonBreath 6.5s ease-in-out infinite;
  pointer-events: none;
}

.brand-taiji .tj-yang { fill: #e9e3d5; }
.brand-taiji .tj-yin { fill: #14141c; }

.brand-txt h1 {
  margin: 0;
  font-size: clamp(16px, 1.1vw + 8px, 23px);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  color: #f1ebdc;
  text-shadow: 0 0 30px rgba(201, 169, 97, 0.28);
  white-space: nowrap;
}

/* 名称中的间隔号：略小、压暗，避免与汉字抢视线 */
.brand-dot {
  display: inline-block;
  margin: 0 0.05em;
  font-size: 0.8em;
  vertical-align: 0.06em;
  color: var(--txt-4);
}

.brand-txt p {
  margin: 5px 0 0;
  font-size: clamp(9.5px, 0.9vw, 10.5px);
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  color: var(--txt-3);
}

.head-actions { display: flex; gap: 10px; flex: none; }

.ghost-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--txt-2);
  font-family: var(--serif);
  font-size: clamp(12px, 1vw, 13px);
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  padding: 8px clamp(12px, 1.4vw, 16px);
  min-height: 38px;
  border-radius: 2px;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.28s ease;
}

.ghost-btn:hover {
  color: var(--gold-2);
  border-color: rgba(201, 169, 97, 0.55);
  background: var(--gold-dim);
  box-shadow: 0 0 24px -8px rgba(201, 169, 97, 0.55);
}

/* ---------------- 布局 ---------------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(292px, 25vw, 344px);
  gap: clamp(16px, 1.9vw, 28px);
  align-items: start;
  margin-top: clamp(16px, 1.9vw, 26px);
}

.card {
  position: relative;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  border: 1px solid var(--line-2);
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 40px 90px -60px #000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.card:hover {
  border-color: var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 40px 90px -60px #000, 0 0 40px -18px rgba(201, 169, 97, 0.35);
}

/* ---------------- 主历 ---------------- */

.almanac {
  position: relative;
  padding: clamp(16px, 2.2vw, 28px) clamp(14px, 2.4vw, 32px) clamp(18px, 2.2vw, 30px);
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background:
    radial-gradient(120% 90% at 50% -30%, rgba(201, 169, 97, 0.09), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.038), rgba(255, 255, 255, 0.008));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 50px 120px -70px #000;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
}

.almanac::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 169, 97, 0.55), transparent);
}

.day-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: clamp(8px, 1.2vw, 14px);
}

.nav-btn {
  appearance: none;
  width: clamp(34px, 3.2vw, 40px);
  height: clamp(34px, 3.2vw, 40px);
  display: grid;
  place-items: center;
  padding: 0 0 3px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.025);
  color: var(--txt-2);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.26s ease;
}

.nav-btn:hover {
  color: var(--gold-2);
  border-color: rgba(201, 169, 97, 0.5);
  box-shadow: 0 0 22px -6px rgba(201, 169, 97, 0.6);
  background: var(--gold-dim);
}

.nav-btn:active { transform: scale(0.93); }
.nav-btn.sm { width: 30px; height: 30px; font-size: 15px; padding-bottom: 2px; }

.day-main { display: flex; align-items: center; gap: clamp(12px, 1.8vw, 24px); min-width: 0; }

.dh-solar { display: flex; align-items: flex-end; gap: 12px; flex: none; }

.dh-day {
  font-family: var(--serif);
  font-size: clamp(44px, 4.6vw + 16px, 74px);
  line-height: 0.84;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: #f4efe2;
  text-shadow: 0 0 40px rgba(255, 255, 255, 0.14);
  transition: opacity 0.35s ease;
}

.dh-ym {
  font-size: clamp(11px, 1vw, 12px);
  line-height: 1.7;
  letter-spacing: 0.1em;
  color: var(--txt-3);
  padding-bottom: 4px;
  white-space: nowrap;
}

.dh-ym b { display: block; color: var(--txt-2); font-weight: 400; letter-spacing: 0.16em; }

.dh-lunar { min-width: 0; border-left: 1px solid var(--line-3); padding-left: clamp(12px, 1.6vw, 22px); }

.dh-lunar-big {
  font-family: var(--kai);
  font-size: clamp(22px, 2.3vw + 12px, 37px);
  line-height: 1.3;
  letter-spacing: 0.12em;
  white-space: nowrap;
  background: linear-gradient(100deg, #f6e7c4, #c9a961 45%, #f2d9a4 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(201, 169, 97, 0.35));
}

.dh-ganzhi {
  margin-top: 5px;
  font-size: clamp(11.5px, 1.1vw, 13px);
  letter-spacing: 0.16em;
  color: var(--txt-2);
  white-space: nowrap;
}

.dh-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }

.tag {
  font-family: var(--serif);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--txt-2);
  border: 1px solid var(--line-2);
  border-radius: 1px;
  padding: 2px 8px 3px;
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.3s ease;
}

.tag.red {
  color: var(--red-2);
  border-color: rgba(210, 69, 60, 0.35);
  background: var(--red-dim);
}

/* 太极历盘 */
.dial {
  position: relative;
  width: clamp(96px, 9.4vw, 140px);
  height: clamp(96px, 9.4vw, 140px);
  flex: none;
  display: grid;
  place-items: center;
}

.dial-face {
  position: relative;
  width: 70%;
  height: 70%;
  border-radius: 50%;
  /* 多层外辉光：月白描边 → 近距冷白 → 中距银蓝 → 远距弥散 */
  box-shadow:
    0 0 0 1px rgba(226, 236, 250, 0.40),
    0 0 6px rgba(232, 240, 252, 0.26),
    0 0 18px rgba(200, 216, 240, 0.20),
    0 0 38px rgba(184, 203, 234, 0.13),
    0 0 72px rgba(168, 190, 224, 0.075);
}

/* 图案自转，光照固定 —— 像被照亮的球体 */
.dial-face .taiji-svg { animation: spinSlow 48s linear infinite; }

/* 扩散光晕：呼吸 */
.dial-face::before {
  content: "";
  position: absolute;
  inset: -26%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%,
    rgba(232, 240, 252, 0.18) 0%,
    rgba(200, 216, 240, 0.10) 38%,
    rgba(184, 203, 234, 0.04) 62%,
    transparent 76%);
  filter: blur(5px);
  animation: moonBreath 7.5s ease-in-out infinite;
  pointer-events: none;
}

/* 月面：左上受光、右下暗边、两处淡环形山 */
.dial-face::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 24%, rgba(248, 251, 255, 0.42), rgba(248, 251, 255, 0) 46%),
    radial-gradient(circle at 68% 76%, rgba(0, 0, 0, 0.30), rgba(0, 0, 0, 0) 54%),
    radial-gradient(circle at 63% 33%, rgba(0, 0, 0, 0.10), transparent 17%),
    radial-gradient(circle at 37% 63%, rgba(0, 0, 0, 0.08), transparent 13%);
  pointer-events: none;
}

.dial-face .tj-yang { fill: #e2e8f3; }
.dial-face .tj-yin { fill: #0f0f16; }

.dial-dots { position: absolute; inset: 0; pointer-events: none; }

.dial-dots span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  transition: all 0.35s ease;
  pointer-events: auto;
  cursor: pointer;
}

.dial-dots span:hover { background: rgba(226, 236, 250, 0.75); }

.dial-dots span.on {
  background: #eaf1ff;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  box-shadow: 0 0 12px 2px rgba(214, 228, 250, 0.85);
}

.dial-dots span.ji { background: rgba(210, 69, 60, 0.55); }
.dial-dots span.ji:hover, .dial-dots span.ji.on { background: var(--red-2); box-shadow: 0 0 14px 2px rgba(210, 69, 60, 0.8); }

.dial-label {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--kai);
  font-size: clamp(10px, 0.9vw, 11.5px);
  letter-spacing: 0.14em;
  color: var(--gold-2);
  white-space: nowrap;
  text-shadow: 0 0 14px rgba(201, 169, 97, 0.5);
}

.dial-label.xiong { color: var(--txt-3); text-shadow: none; }

/* 节气条 */
.jieqi-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px clamp(12px, 1.8vw, 24px);
  margin-top: clamp(14px, 1.8vw, 22px);
  padding: clamp(10px, 1.2vw, 13px) clamp(12px, 1.4vw, 18px);
  border-top: 1px solid var(--line-3);
  border-bottom: 1px solid var(--line-3);
  background: linear-gradient(90deg, rgba(201, 169, 97, 0.07), rgba(201, 169, 97, 0.01));
  font-size: clamp(11.5px, 1.05vw, 12.5px);
  color: var(--txt-2);
}

.jq-item { display: flex; align-items: baseline; gap: 7px; white-space: nowrap; min-width: 0; }
.jq-item .k { font-size: 10px; letter-spacing: 0.2em; color: var(--txt-4); }
.jq-item .n { font-family: var(--kai); font-size: 14.5px; letter-spacing: 0.1em; color: var(--txt); }
.jq-item .t { font-size: 11px; color: var(--txt-3); font-variant-numeric: tabular-nums; }
.jq-item .d { font-size: 10.5px; color: var(--gold); letter-spacing: 0.08em; }

.jq-today {
  font-family: var(--kai);
  font-size: 13.5px;
  letter-spacing: 0.12em;
  color: var(--red-2);
  padding: 1px 10px;
  border: 1px solid rgba(210, 69, 60, 0.35);
  border-radius: 1px;
  background: var(--red-dim);
  box-shadow: 0 0 22px -8px rgba(210, 69, 60, 0.8);
}

/* 宜忌 */
.yiji {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: clamp(14px, 1.8vw, 22px);
  border: 1px solid var(--line-3);
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
  overflow: hidden;
}

.yiji-col {
  display: grid;
  grid-template-columns: clamp(38px, 4vw, 50px) minmax(0, 1fr);
  gap: clamp(10px, 1.4vw, 16px);
  padding: clamp(14px, 1.7vw, 20px) clamp(12px, 1.8vw, 22px);
}
.yiji-col + .yiji-col { border-left: 1px solid var(--line-3); }

.seal-box {
  width: clamp(38px, 3.8vw, 48px);
  height: clamp(38px, 3.8vw, 48px);
  display: grid;
  place-items: center;
  font-family: var(--kai);
  font-size: clamp(21px, 2.2vw, 27px);
  line-height: 1;
  border-radius: 2px;
  transition: transform 0.45s cubic-bezier(0.22, 0.68, 0.35, 1), box-shadow 0.45s ease;
}

.seal-yi {
  color: #fff2ec;
  background: linear-gradient(150deg, #d2453c, #93231d);
  box-shadow: 0 0 26px -6px rgba(210, 69, 60, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.seal-ji {
  color: #cfc7b6;
  background: linear-gradient(150deg, #26262f, #101017);
  border: 1px solid var(--line-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.yiji-col:hover .seal-yi { transform: rotate(-4deg) scale(1.04); box-shadow: 0 0 36px -4px rgba(210, 69, 60, 0.9); }
.yiji-col:hover .seal-ji { transform: rotate(4deg) scale(1.04); }

.yiji-title {
  font-size: 10px;
  letter-spacing: 0.26em;
  color: var(--txt-4);
  margin-bottom: 6px;
}

.yiji-list {
  font-size: clamp(13.5px, 1.2vw, 15px);
  line-height: 2;
  letter-spacing: 0.05em;
  color: var(--txt);
  word-break: break-word;
}

.yiji-col.ji .yiji-list { color: var(--txt-2); }
.yiji-empty { color: var(--txt-3); font-size: 13.5px; }

/* 信息网格 */
.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: clamp(12px, 1.6vw, 20px);
  border-top: 1px solid var(--line-3);
}

.fact {
  padding: clamp(11px, 1.3vw, 14px) clamp(10px, 1.4vw, 18px) clamp(12px, 1.4vw, 15px);
  border-bottom: 1px solid var(--line-3);
  transition: background 0.35s ease;
}

.fact:hover { background: rgba(255, 255, 255, 0.022); }
.fact + .fact { border-left: 1px solid var(--line-3); }
.fact:nth-child(3n + 1) { border-left: none; padding-left: 2px; }
.fact:nth-child(3n) { padding-right: 2px; }
.fact .v { overflow-wrap: anywhere; }

.fact .k {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--txt-4);
  margin-bottom: 3px;
}

.fact .v {
  font-size: 14px;
  line-height: 1.6;
  color: var(--txt);
  letter-spacing: 0.03em;
  word-break: break-word;
}

.fact .v small { font-size: 11px; color: var(--txt-3); letter-spacing: 0.04em; }
.fact .v .hot { color: var(--gold-2); }

/* 面板 */
.panel { margin-top: 24px; }

.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-head h2 {
  margin: 0;
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0.3em;
  color: var(--gold);
  white-space: nowrap;
}

.panel-head .rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

.panel-head .sub { font-size: 10.5px; color: var(--txt-4); letter-spacing: 0.12em; white-space: nowrap; }

/* 二十八宿 */
.xiu-box {
  display: grid;
  grid-template-columns: clamp(66px, 7.6vw, 96px) minmax(0, 1fr);
  gap: clamp(12px, 1.8vw, 22px);
  align-items: center;
  padding: clamp(13px, 1.5vw, 18px) clamp(13px, 1.6vw, 20px);
  border: 1px solid var(--line-3);
  border-radius: 2px;
  background: radial-gradient(120% 140% at 0% 50%, rgba(201, 169, 97, 0.09), transparent 60%);
}

.xiu-mark {
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 8px 0;
  border-right: 1px solid var(--line-3);
}

.xiu-mark .zi {
  font-family: var(--kai);
  font-size: 32px;
  line-height: 1;
  color: #f2ecdd;
  text-shadow: 0 0 22px rgba(201, 169, 97, 0.45);
}

.xiu-mark .nm { font-size: 10.5px; letter-spacing: 0.2em; color: var(--txt-3); }

.xiu-body { font-size: 13px; line-height: 1.9; color: var(--txt-2); }
.xiu-body .meta { letter-spacing: 0.08em; }
.xiu-body .meta b { color: var(--txt); font-weight: 500; }
.xiu-body .meta .lucky { color: var(--gold-2); }
.xiu-body .poem { margin-top: 6px; font-size: 12px; line-height: 1.85; color: var(--txt-3); }

/* 神煞 */
.shensha { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.shensha-col .k {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--txt-4);
  margin-bottom: 8px;
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  font-size: 12px;
  letter-spacing: 0.05em;
  padding: 2px 9px 3px;
  border: 1px solid var(--line-2);
  border-radius: 1px;
  color: var(--txt-2);
  background: rgba(255, 255, 255, 0.025);
  transition: all 0.28s ease;
}

.chip:hover { transform: translateY(-1px); }

.chip.good {
  color: var(--gold-2);
  border-color: rgba(201, 169, 97, 0.3);
  background: var(--gold-dim);
}

.chip.good:hover { box-shadow: 0 0 20px -8px rgba(201, 169, 97, 0.9); }

.chip.bad { color: var(--txt-2); border-color: var(--line-3); background: rgba(255, 255, 255, 0.018); }

/* 时辰 */
.hours {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(82px, 8vw, 106px), 1fr));
  gap: clamp(6px, 0.8vw, 8px);
}

.hour {
  appearance: none;
  text-align: center;
  padding: 10px 5px 11px;
  min-height: 62px;
  border: 1px solid var(--line-3);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.022);
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.3s cubic-bezier(0.22, 0.68, 0.35, 1);
  font-family: var(--serif);
  color: var(--txt-2);
}

.hour:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -18px #000;
}

.hour.active {
  border-color: rgba(201, 169, 97, 0.55);
  background: var(--gold-dim);
  box-shadow: 0 0 30px -12px rgba(201, 169, 97, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.hour .hz { font-family: var(--kai); font-size: 18px; line-height: 1.2; color: var(--txt); }
.hour .hg { font-size: 10px; letter-spacing: 0.1em; color: var(--txt-4); margin-top: 1px; }
.hour .hs { font-size: 11px; letter-spacing: 0.04em; margin-top: 5px; }
.hour .hs .ji { color: var(--gold-2); }
.hour .hs .xiong { color: var(--txt-3); }

.hour-detail {
  margin-top: 12px;
  padding: 14px 18px;
  border-left: 2px solid var(--red);
  background: linear-gradient(90deg, rgba(210, 69, 60, 0.09), transparent 70%);
  font-size: 12.5px;
  line-height: 1.95;
  color: var(--txt-2);
  min-height: 58px;
}

.hour-detail b { color: var(--txt); font-weight: 500; }
.hour-detail .lbl { color: var(--txt-4); letter-spacing: 0.14em; font-size: 10.5px; margin-right: 4px; }
.hour-detail .sep { color: var(--txt-4); margin: 0 10px; }

/* ---------------- 侧栏 ---------------- */

.side { display: grid; gap: clamp(12px, 1.4vw, 18px); position: sticky; top: 18px; align-content: start; }

.cal-card { padding: clamp(12px, 1.4vw, 18px) clamp(12px, 1.4vw, 18px) clamp(12px, 1.2vw, 16px); }

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line-3);
}

.cal-title { text-align: center; font-size: 13.5px; letter-spacing: 0.16em; color: var(--txt); }
.cal-title small { display: block; font-size: 10px; letter-spacing: 0.18em; color: var(--txt-4); margin-top: 2px; }

.cal-week,
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }

.cal-week {
  margin-top: 10px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--txt-4);
  text-align: center;
}

.cal-week span { padding: 4px 0; }
.cal-week span.we { color: rgba(210, 69, 60, 0.75); }

.cal-grid { gap: 1px; }

.cal-cell {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  padding: clamp(4px, 0.7vw, 7px) 0 clamp(4px, 0.6vw, 6px);
  min-height: 42px;
  touch-action: manipulation;
  cursor: pointer;
  display: grid;
  gap: 1px;
  justify-items: center;
  font-family: var(--serif);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.cal-cell:hover { background: rgba(255, 255, 255, 0.06); transform: translateY(-1px); }

.cal-cell .cd { font-size: clamp(12.5px, 1.1vw, 13.5px); line-height: 1.1; color: var(--txt); font-variant-numeric: tabular-nums; }
.cal-cell .cl { font-size: clamp(8.5px, 0.75vw, 9.5px); line-height: 1.2; color: var(--txt-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.cal-cell.out .cd { color: var(--txt-4); }
.cal-cell.out .cl { opacity: 0.45; }
.cal-cell.we .cd { color: rgba(210, 69, 60, 0.85); }
.cal-cell.fest .cl { color: var(--red-2); }
.cal-cell.jq .cl { color: var(--gold); }

.cal-cell.today { border-color: rgba(201, 169, 97, 0.5); box-shadow: 0 0 18px -8px rgba(201, 169, 97, 0.8); }
.cal-cell.today .cd { color: var(--gold-2); }

.cal-cell.sel {
  background: linear-gradient(150deg, #d2453c, #8e211c);
  border-color: transparent;
  box-shadow: 0 0 26px -10px rgba(210, 69, 60, 0.9);
}

.cal-cell.sel .cd,
.cal-cell.sel .cl { color: #fff4ee; }
.cal-cell.sel.we .cd { color: #fff4ee; }

/* 跳转 */
.jump-card { padding: 16px 18px 18px; }

.jump-card .k { font-size: 10px; letter-spacing: 0.22em; color: var(--txt-4); margin-bottom: 8px; }

.jump-card input[type="date"] {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--txt);
  font-family: var(--serif);
  font-size: 13.5px;
  letter-spacing: 0.08em;
  outline: none;
  transition: all 0.28s ease;
}

.jump-card input[type="date"]:focus {
  border-color: rgba(201, 169, 97, 0.6);
  box-shadow: 0 0 22px -10px rgba(201, 169, 97, 0.9);
}

.jump-card input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.75) sepia(0.3) saturate(3) hue-rotate(2deg);
  cursor: pointer;
}

.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(6px, 0.8vw, 8px); margin-top: 10px; }

.quick button {
  appearance: none;
  padding: 9px 0;
  min-height: 40px;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--txt-2);
  font-family: var(--serif);
  font-size: clamp(11.5px, 1vw, 12px);
  touch-action: manipulation;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.26s ease;
}

.quick button:hover {
  color: var(--gold-2);
  border-color: rgba(201, 169, 97, 0.45);
  background: var(--gold-dim);
}

/* 说明 */
.note-card { padding: 16px 18px 18px; }

.note-card h3 {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.26em;
  color: var(--gold);
}

.note-card p { margin: 0; font-size: 11.5px; line-height: 1.95; color: var(--txt-3); letter-spacing: 0.01em; }

.jq-list { display: grid; gap: 8px; }

.jq-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--txt-2);
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line-3);
}

.jq-row:last-child { border-bottom: none; padding-bottom: 0; }
.jq-row .nm { font-family: var(--kai); letter-spacing: 0.1em; color: var(--txt); }
.jq-row .tm { font-size: 11px; color: var(--txt-3); font-variant-numeric: tabular-nums; }

/* ---------------- 页脚 ---------------- */

.site-foot {
  margin-top: clamp(26px, 3vw, 42px);
  padding-top: 18px;
  padding-bottom: max(0px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-3);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--txt-4);
}

/* ---------------- 动效 ---------------- */

.fade-in { animation: fadeUp 0.5s cubic-bezier(0.22, 0.68, 0.35, 1) both; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); filter: blur(3px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 0.68, 0.35, 1); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  .reveal { opacity: 1; transform: none; }
}


/* ===========================================================
   扩充模块：八字 / 方位 / 卦象 / 穿衣 / 择日 / 节气年表 / 术语
   =========================================================== */

/* ---------------- 宜忌词条 ---------------- */

.yiji-title em {
  font-style: normal;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--txt-4);
  margin-left: 10px;
}

.yiji-list { display: flex; flex-wrap: wrap; gap: 5px 6px; align-items: center; }

.tchip {
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--serif);
  font-size: clamp(12.5px, 1.02vw, 14px);
  line-height: 1.5;
  letter-spacing: 0.04em;
  padding: 2px 9px 3px;
  border: 1px solid var(--line-3);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--txt);
  cursor: pointer;
  transition: background 0.26s ease, border-color 0.26s ease, color 0.26s ease;
}

.tchip.has {
  border-bottom-color: rgba(143, 168, 196, 0.42);
  border-bottom-width: 1px;
}

.tchip.yi.has { border-bottom-color: rgba(210, 69, 60, 0.45); }

.tchip:hover {
  background: rgba(143, 168, 196, 0.1);
  border-color: var(--ice-line);
  color: var(--moon);
}

.tchip:active { transform: translateY(0.5px); }

/* ---------------- 四柱八字 ---------------- */

.bazi-wrap { display: grid; gap: 14px; }

.bz-table {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line-3);
  border-radius: 2px;
  overflow: hidden;
}

.bz-col {
  padding: clamp(10px, 1.2vw, 15px) 6px clamp(11px, 1.3vw, 16px);
  text-align: center;
  border-left: 1px solid var(--line-3);
  background: rgba(255, 255, 255, 0.014);
}

.bz-col:first-child { border-left: none; }

.bz-col.bz-day {
  background: linear-gradient(180deg, rgba(143, 168, 196, 0.09), rgba(143, 168, 196, 0.02));
}

.bz-h {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  color: var(--txt-4);
  margin-bottom: 7px;
}

.bz-gz { display: flex; flex-direction: column; align-items: center; gap: 1px; }

.bz-gz .bz-g {
  font-family: var(--kai);
  font-size: clamp(21px, 2.1vw, 27px);
  line-height: 1.15;
  color: var(--moon);
}

.bz-gz .bz-z {
  font-family: var(--kai);
  font-size: clamp(21px, 2.1vw, 27px);
  line-height: 1.15;
  color: var(--txt-2);
}

.bz-col.bz-day .bz-gz .bz-g { color: var(--red-2); }
.bz-col.bz-day .bz-gz .bz-z { color: var(--red); }

.bz-s {
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--txt-2);
}

.bz-s.dim { color: var(--txt-4); margin-top: 1px; }

.bz-ny {
  margin-top: 6px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--txt-3);
}

.bz-wx {
  margin-top: 3px;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--ice);
  opacity: 0.85;
}

.bz-wxbox {
  padding: 12px 14px 13px;
  border: 1px solid var(--line-3);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.014);
}

.wx-title {
  font-size: 10.5px;
  letter-spacing: 0.2em;
  color: var(--txt-3);
  margin-bottom: 9px;
}

.wx-title em {
  font-style: normal;
  letter-spacing: 0.1em;
  color: var(--ice-2);
  margin-left: 8px;
}

.wx-rows { display: grid; gap: 6px; }

.wx-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 9px;
}

.wx-k {
  font-family: var(--kai);
  font-size: 13px;
  color: var(--txt-2);
  text-align: center;
}

.wx-bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.wx-bar i {
  display: block;
  height: 100%;
  border-radius: 2px;
  opacity: 0.82;
  transition: width 0.5s cubic-bezier(0.22, 0.68, 0.35, 1);
}

.wx-n {
  font-size: 11px;
  color: var(--txt-3);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.wx-note {
  margin-top: 10px;
  font-size: 11px;
  line-height: 1.7;
  color: var(--txt-4);
  letter-spacing: 0.04em;
}

.bz-hint {
  margin-top: 9px;
  font-size: 10.5px;
  line-height: 1.7;
  letter-spacing: 0.04em;
  color: var(--ice);
  opacity: 0.75;
}

/* ---------------- 吉神方位罗盘 ---------------- */

.fw-wrap {
  display: grid;
  grid-template-columns: clamp(150px, 19vw, 210px) minmax(0, 1fr);
  gap: clamp(14px, 2vw, 26px);
  align-items: center;
}

.compass {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 210px;
}

.compass svg { width: 100%; height: 100%; display: block; }

.cp-ring {
  fill: none;
  stroke: var(--line-2);
  stroke-width: 0.7;
}

.cp-ring-2 { stroke: var(--line-3); stroke-dasharray: 2 4; }

.cp-core {
  fill: var(--ice);
  opacity: 0.5;
}

.cp-dir {
  fill: var(--txt-3);
  font-family: var(--serif);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.cp-dir.major { fill: var(--txt-2); font-size: 8.6px; }

.cp-god circle {
  fill: rgba(143, 168, 196, 0.13);
  stroke: var(--ice-line);
  stroke-width: 0.8;
}

.cp-god text {
  fill: var(--moon);
  font-family: var(--kai);
  font-size: 9px;
  letter-spacing: 0;
}

.cp-cai circle {
  fill: rgba(210, 69, 60, 0.16);
  stroke: rgba(210, 69, 60, 0.5);
}

.cp-cai text { fill: var(--red-2); }

.fw-side { display: grid; gap: 12px; }

.fw-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; }

.cp-lg {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--txt-2);
}

.cp-lg i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ice);
  opacity: 0.75;
  flex: none;
}

.cp-lg.cp-cai i { background: var(--red); opacity: 0.9; }

.fw-taisui {
  font-size: 10.5px;
  line-height: 1.8;
  letter-spacing: 0.06em;
  color: var(--txt-4);
  padding-top: 2px;
  border-top: 1px dashed var(--line-3);
}

.pz-box {
  padding: 11px 13px 12px;
  border-left: 2px solid rgba(143, 168, 196, 0.4);
  background: rgba(143, 168, 196, 0.045);
}

.pz-title {
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--txt-4);
  margin-bottom: 5px;
}

.pz-line {
  margin: 0;
  font-family: var(--kai);
  font-size: clamp(13px, 1.2vw, 15px);
  line-height: 1.85;
  letter-spacing: 0.08em;
  color: var(--txt-2);
}

/* ---------------- 每日卦象 ---------------- */

.gua-box {
  display: grid;
  grid-template-columns: clamp(74px, 9vw, 100px) minmax(0, 1fr);
  gap: clamp(14px, 2vw, 26px);
  align-items: center;
  padding: clamp(12px, 1.5vw, 18px) clamp(13px, 1.6vw, 20px);
  border: 1px solid var(--line-3);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.014);
}

.gua-body { min-width: 0; }

.gua-svg { width: 100%; height: auto; display: block; }

.gua-line {
  fill: var(--txt-2);
  opacity: 0.82;
}

.gua-line.dong {
  fill: var(--red-2);
  opacity: 1;
  filter: drop-shadow(0 0 5px rgba(232, 106, 94, 0.45));
}

.gua-name {
  font-family: var(--kai);
  font-size: clamp(19px, 1.9vw, 24px);
  letter-spacing: 0.14em;
  color: var(--moon);
  line-height: 1.3;
}

.gua-meta {
  margin-top: 5px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--txt-4);
}

.gua-desc {
  margin-top: 9px;
  font-size: clamp(12.5px, 1.1vw, 13.5px);
  line-height: 1.85;
  letter-spacing: 0.03em;
  color: var(--txt-2);
}

/* ---------------- 五行穿衣 ---------------- */

.dress { display: grid; gap: 1px; border: 1px solid var(--line-3); border-radius: 2px; overflow: hidden; }

.dr-row {
  display: grid;
  grid-template-columns: 14px 34px 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.014);
  font-size: 12px;
}

.dr-row + .dr-row { border-top: 1px solid var(--line-3); }

.dr-chip {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  opacity: 0.9;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.dr-lv {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--txt-4);
  white-space: nowrap;
}

.dr-row.dr-top .dr-lv { color: var(--ice-2); }
.dr-row.dr-top { background: rgba(143, 168, 196, 0.055); }
.dr-row.dr-good .dr-lv { color: var(--txt-2); }
.dr-row.dr-bad .dr-lv { color: var(--red-2); opacity: 0.85; }

.dr-wx {
  font-family: var(--kai);
  font-size: 13px;
  color: var(--txt);
  letter-spacing: 0.06em;
}

.dr-words { font-size: 11.5px; color: var(--txt-3); letter-spacing: 0.05em; }

.dr-note { font-size: 11px; color: var(--txt-4); white-space: nowrap; }

.dress-note {
  margin-top: 9px;
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--txt-4);
  letter-spacing: 0.04em;
}

/* ---------------- 择日检索 ---------------- */

.zeri-card { padding: clamp(15px, 1.8vw, 20px) clamp(15px, 1.8vw, 20px) clamp(16px, 1.9vw, 21px); }

.zeri-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 11px;
}

.zeri-head h3 {
  margin: 0;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.28em;
  color: var(--txt-2);
  white-space: nowrap;
}

.zeri-head.sub2 { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-3); }

.zeri-sub { font-size: 10px; letter-spacing: 0.1em; color: var(--txt-4); white-space: nowrap; }

.zchips { display: flex; flex-wrap: wrap; gap: 5px; }

.zchip {
  appearance: none;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.05em;
  padding: 3px 10px 4px;
  border: 1px solid var(--line-3);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--txt-2);
  cursor: pointer;
  transition: all 0.24s ease;
}

.zchip:hover { border-color: var(--ice-line); color: var(--moon); }

.zchip.on {
  border-color: rgba(143, 168, 196, 0.55);
  background: rgba(143, 168, 196, 0.14);
  color: var(--moon);
}

.zrange { display: flex; gap: 6px; margin-top: 11px; }

.zr-btn {
  flex: 1;
  appearance: none;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 5px 0;
  border: 1px solid var(--line-3);
  border-radius: 2px;
  background: transparent;
  color: var(--txt-3);
  cursor: pointer;
  transition: all 0.24s ease;
}

.zr-btn:hover { color: var(--txt-2); border-color: var(--line-2); }

.zr-btn.on {
  color: var(--moon);
  border-color: rgba(143, 168, 196, 0.5);
  background: rgba(143, 168, 196, 0.1);
}

.z-list {
  margin-top: 11px;
  max-height: 258px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(143, 168, 196, 0.3) transparent;
}

.z-list::-webkit-scrollbar { width: 3px; }
.z-list::-webkit-scrollbar-thumb { background: rgba(143, 168, 196, 0.28); border-radius: 2px; }

.z-item {
  width: 100%;
  appearance: none;
  display: grid;
  grid-template-columns: 46px 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: none;
  border-bottom: 1px solid var(--line-3);
  background: transparent;
  font-family: var(--serif);
  text-align: left;
  cursor: pointer;
  transition: background 0.22s ease;
}

.z-item:hover { background: rgba(143, 168, 196, 0.07); }

.z-date {
  font-size: 12.5px;
  color: var(--moon);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.z-week { font-size: 10.5px; color: var(--txt-4); }

.z-lunar {
  font-size: 11.5px;
  color: var(--txt-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.z-shen { font-size: 10.5px; color: var(--txt-4); white-space: nowrap; }

.z-item.lucky .z-date { color: var(--red-2); }
.z-item.lucky .z-shen { color: var(--red); opacity: 0.75; }

.z-empty, .z-more {
  margin: 8px 0 0;
  font-size: 11.5px;
  color: var(--txt-4);
  letter-spacing: 0.05em;
  line-height: 1.7;
}

.hchips { display: flex; flex-wrap: wrap; gap: 5px; }

.hchip {
  appearance: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 34px;
  padding: 4px 6px 5px;
  border: 1px solid var(--line-3);
  border-radius: 2px;
  background: rgba(210, 69, 60, 0.06);
  color: var(--red-2);
  font-family: var(--serif);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.22s ease;
}

.hchip em {
  font-style: normal;
  font-size: 8.5px;
  letter-spacing: 0.02em;
  color: var(--txt-4);
  transform: scale(0.95);
}

.hchip:hover { border-color: rgba(210, 69, 60, 0.45); background: rgba(210, 69, 60, 0.13); }

/* ---------------- 全年节气 ---------------- */

.fold-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.fold-head h3 {
  margin: 0;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.26em;
  color: var(--txt-2);
}

.fold-arrow { font-size: 10.5px; letter-spacing: 0.1em; color: var(--txt-4); transition: color 0.24s ease; }

.fold-head:hover .fold-arrow { color: var(--ice); }

.jq-row.cur .nm { color: var(--red-2); }
.jq-row.cur .tm { color: var(--red); opacity: 0.8; }

/* ---------------- 术语浮层 ---------------- */

.term-sheet {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.term-sheet.open { opacity: 1; visibility: visible; }

.term-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 8, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.term-body {
  position: relative;
  width: min(460px, 100%);
  padding: 20px 22px 18px;
  border: 1px solid var(--ice-line);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(18, 20, 26, 0.97), rgba(10, 10, 16, 0.97));
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9), 0 0 60px -30px rgba(143, 168, 196, 0.35);
  transform: translateY(10px) scale(0.985);
  transition: transform 0.34s cubic-bezier(0.22, 0.68, 0.35, 1);
}

.term-sheet.open .term-body { transform: translateY(0) scale(1); }

.term-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-3);
}

.term-word {
  font-family: var(--kai);
  font-size: 22px;
  letter-spacing: 0.16em;
  color: var(--moon);
}

.term-close {
  appearance: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0 0 3px;
  border: 1px solid var(--line-3);
  border-radius: 50%;
  background: transparent;
  color: var(--txt-3);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.24s ease;
}

.term-close:hover { color: var(--red-2); border-color: rgba(210, 69, 60, 0.45); }

.term-desc {
  margin: 14px 0 0;
  font-size: 13.5px;
  line-height: 1.95;
  letter-spacing: 0.03em;
  color: var(--txt);
}

.term-hint {
  margin: 14px 0 0;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--txt-4);
}

@media (max-width: 560px) {
  .term-sheet { align-items: flex-end; padding: 0; }
  .term-body {
    width: 100%;
    border-radius: 14px 14px 0 0;
    border-bottom: none;
    padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px));
    transform: translateY(24px);
  }
  .term-sheet.open .term-body { transform: translateY(0); }
}


/* ===========================================================
   個人命盤
   =========================================================== */

body.no-scroll { overflow: hidden; }

.ghost-btn.ghost-accent {
  border-color: rgba(143, 168, 196, 0.45);
  color: var(--ice-2);
}

.ghost-btn.ghost-accent:hover {
  border-color: var(--ice);
  color: var(--moon);
  background: rgba(143, 168, 196, 0.12);
}

.chart-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.32s ease, visibility 0.32s ease;
}

.chart-modal.open { opacity: 1; visibility: visible; }

.chart-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 3, 7, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.chart-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(780px, 100%);
  max-height: min(88vh, 900px);
  border: 1px solid var(--ice-line);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(17, 19, 25, 0.985), rgba(9, 9, 14, 0.99));
  box-shadow: 0 40px 100px -50px rgba(0, 0, 0, 0.95), 0 0 80px -40px rgba(143, 168, 196, 0.3);
  transform: translateY(14px) scale(0.99);
  transition: transform 0.38s cubic-bezier(0.22, 0.68, 0.35, 1);
  overflow: hidden;
}

.chart-modal.open .chart-panel { transform: translateY(0) scale(1); }

.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 15px;
  border-bottom: 1px solid var(--line-3);
  flex: none;
}

.chart-title { display: flex; align-items: center; gap: 13px; }

.chart-seal {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--ice-line);
  border-radius: 2px;
  font-family: var(--kai);
  font-size: 21px;
  line-height: 1;
  color: var(--ice-2);
  background: rgba(143, 168, 196, 0.08);
}

.chart-title h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-indent: 0.26em;
  color: var(--moon);
}

.chart-title p {
  margin: 4px 0 0;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--txt-4);
}

.chart-close {
  appearance: none;
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  padding: 0 0 3px;
  border: 1px solid var(--line-3);
  border-radius: 50%;
  background: transparent;
  color: var(--txt-3);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.24s ease;
}

.chart-close:hover { color: var(--red-2); border-color: rgba(210, 69, 60, 0.45); }

.chart-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 22px 26px;
  scrollbar-width: thin;
  scrollbar-color: rgba(143, 168, 196, 0.3) transparent;
}

.chart-scroll::-webkit-scrollbar { width: 4px; }
.chart-scroll::-webkit-scrollbar-thumb { background: rgba(143, 168, 196, 0.28); border-radius: 2px; }

/* ---------- 表单 ---------- */

.chart-form {
  display: grid;
  gap: 11px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line-3);
}

.cf-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.cf-label {
  flex: none;
  width: 36px;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--txt-4);
}

.cf-hint { font-size: 10px; letter-spacing: 0.06em; color: var(--txt-4); opacity: 0.8; }

#cf-name {
  flex: 1;
  min-width: 130px;
  padding: 8px 12px;
  border: 1px solid var(--line-3);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--moon);
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.14em;
  outline: none;
  transition: border-color 0.24s ease, background 0.24s ease;
}

#cf-name::placeholder { color: var(--txt-4); letter-spacing: 0.06em; font-size: 12.5px; }
#cf-name:focus { border-color: var(--ice-line); background: rgba(143, 168, 196, 0.07); }

.cf-group { display: flex; gap: 0; flex: none; }

.gbtn, .cbtn {
  appearance: none;
  padding: 7px 15px;
  border: 1px solid var(--line-3);
  background: transparent;
  color: var(--txt-3);
  font-family: var(--serif);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.24s ease;
}

.gbtn:first-child, .cbtn:first-child { border-radius: 2px 0 0 2px; }
.gbtn:last-child, .cbtn:last-child { border-radius: 0 2px 2px 0; border-left: none; }

.gbtn.on, .cbtn.on {
  color: var(--moon);
  border-color: rgba(143, 168, 196, 0.5);
  background: rgba(143, 168, 196, 0.13);
}

.cf-date { display: flex; gap: 7px; flex: 1; flex-wrap: wrap; }

.cf-date select {
  flex: 1;
  min-width: 82px;
  padding: 8px 8px;
  border: 1px solid var(--line-3);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--txt);
  font-family: var(--serif);
  font-size: 13.5px;
  letter-spacing: 0.04em;
  outline: none;
  cursor: pointer;
  transition: border-color 0.24s ease;
}

.cf-date select:focus { border-color: var(--ice-line); }
.cf-date select option { background: #14161c; color: var(--txt); }

#cf-h { min-width: 148px; flex: 1.6; }

.chart-submit {
  appearance: none;
  justify-self: end;
  padding: 9px 34px;
  border: 1px solid rgba(143, 168, 196, 0.5);
  border-radius: 2px;
  background: rgba(143, 168, 196, 0.12);
  color: var(--moon);
  font-family: var(--kai);
  font-size: 15px;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  cursor: pointer;
  transition: all 0.26s ease;
}

.chart-submit:hover {
  background: rgba(143, 168, 196, 0.22);
  border-color: var(--ice);
  box-shadow: 0 0 26px -12px rgba(143, 168, 196, 0.8);
}

.chart-submit:active { transform: translateY(1px); }

/* ---------- 结果 ---------- */

.ch-empty, .ch-err {
  margin: 26px 0;
  text-align: center;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: var(--txt-4);
  line-height: 1.9;
}

.ch-err { color: var(--red-2); }

.ch-overview {
  padding: 16px 18px 14px;
  border: 1px solid var(--ice-line);
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(143, 168, 196, 0.075), rgba(143, 168, 196, 0.02));
}

.ch-name {
  font-family: var(--kai);
  font-size: 24px;
  letter-spacing: 0.2em;
  color: var(--moon);
  line-height: 1.3;
}

.ch-name em {
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ice-2);
  border: 1px solid var(--ice-line);
  border-radius: 2px;
  padding: 1px 7px 2px;
  margin-left: 10px;
  vertical-align: middle;
  opacity: 0.85;
}

.ch-ov-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px 16px;
  margin-top: 14px;
}

.ch-kv { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.ch-kv .k {
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--txt-4);
}

.ch-kv .v {
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--txt);
  line-height: 1.5;
  word-break: break-word;
}

.ch-ov-note {
  margin-top: 13px;
  padding-top: 10px;
  border-top: 1px dashed var(--line-3);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  color: var(--txt-4);
  line-height: 1.7;
}

.ch-sec { margin-top: 24px; }
.ch-sec:first-child { margin-top: 0; }

.bz-col.bz-empty .bz-g.dim { color: var(--txt-4); opacity: 0.55; }

/* 强弱 */

.ch-strength {
  padding: 15px 17px 16px;
  border: 1px solid var(--line-3);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.014);
}

.st-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.st-label {
  font-family: var(--kai);
  font-size: 17px;
  letter-spacing: 0.12em;
  color: var(--moon);
}

.st-val { font-size: 12px; letter-spacing: 0.16em; }
.st-val.up { color: var(--red-2); }
.st-val.down { color: var(--ice-2); }

.st-bar {
  height: 5px;
  margin-top: 11px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.st-bar i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--ice), var(--moon));
  opacity: 0.8;
  transition: width 0.6s cubic-bezier(0.22, 0.68, 0.35, 1);
}

.st-meta {
  margin-top: 9px;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--txt-4);
  line-height: 1.7;
}

.st-note {
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.85;
  letter-spacing: 0.03em;
  color: var(--txt-2);
}

.wchips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.wc-k {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--txt-4);
  width: 30px;
  flex: none;
}

.wchip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 2px 9px 3px;
  border: 1px solid var(--line-3);
  border-radius: 2px;
  color: var(--txt-2);
}

.wchip.xi { border-color: rgba(143, 168, 196, 0.4); background: rgba(143, 168, 196, 0.1); color: var(--moon); }
.wchip.ji { opacity: 0.72; }

.wc-none { font-size: 11.5px; color: var(--txt-4); }

.wx-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex: none;
  opacity: 0.9;
}

/* 姓名 */

.name-chars {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 13px;
}

.nc {
  flex: 1;
  min-width: 66px;
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 12px 8px 10px;
  border: 1px solid var(--line-3);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.016);
}

.nc.unknown { opacity: 0.55; }

.nc-char {
  font-family: var(--kai);
  font-size: 27px;
  line-height: 1.15;
  color: var(--moon);
}

.nc-wx {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--ice-2);
}

.nc-st { font-size: 10px; letter-spacing: 0.06em; color: var(--txt-4); }

.name-sum {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  padding: 10px 14px;
  border: 1px solid var(--line-3);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.014);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--txt-4);
}

.name-sum b {
  font-family: var(--kai);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--moon);
  margin-left: 5px;
}

.ch-fit {
  margin-top: 10px;
  padding: 9px 13px;
  border-left: 2px solid var(--line-2);
  font-size: 12px;
  line-height: 1.8;
  letter-spacing: 0.03em;
  color: var(--txt-2);
  background: rgba(255, 255, 255, 0.014);
}

.ch-fit.good { border-left-color: var(--ice); }
.ch-fit.bad { border-left-color: var(--red-2); }
.ch-fit.mid { border-left-color: var(--line-2); }

/* 五格 */

.wuge {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line-3);
  border-radius: 2px;
  overflow: hidden;
}

.wg-cell {
  padding: 11px 6px 10px;
  text-align: center;
  border-left: 1px solid var(--line-3);
  background: rgba(255, 255, 255, 0.014);
}

.wg-cell:first-child { border-left: none; }

.wg-k { font-size: 9.5px; letter-spacing: 0.16em; color: var(--txt-4); }

.wg-n {
  font-family: var(--kai);
  font-size: 21px;
  line-height: 1.25;
  color: var(--moon);
  margin-top: 3px;
}

.wg-w {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--ice-2);
  margin-top: 2px;
}

.wg-cell.unknown { opacity: 0.45; }
.wg-cell.unknown .wg-n { color: var(--txt-4); }

.wg-d { font-size: 9px; letter-spacing: 0.02em; color: var(--txt-4); margin-top: 4px; opacity: 0.85; }

.sancai {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line-3);
  border-left-width: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.014);
}

.sancai.top { border-left-color: var(--ice); }
.sancai.good { border-left-color: rgba(143, 168, 196, 0.6); }
.sancai.mid { border-left-color: var(--line-2); }
.sancai.bad { border-left-color: var(--red-2); }

.sc-wx {
  font-family: var(--kai);
  font-size: 15px;
  letter-spacing: 0.16em;
  color: var(--moon);
  white-space: nowrap;
}

.sc-txt { font-size: 12px; letter-spacing: 0.04em; color: var(--txt-2); line-height: 1.7; }

.ch-tip {
  padding: 14px 16px;
  border: 1px dashed var(--line-3);
  border-radius: 2px;
  font-size: 12px;
  line-height: 1.85;
  color: var(--txt-3);
  letter-spacing: 0.04em;
}

.ch-tip p { margin: 0; }

.ch-foot {
  margin: 22px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line-3);
  font-size: 10.5px;
  line-height: 1.8;
  letter-spacing: 0.05em;
  color: var(--txt-4);
  text-align: center;
}

/* 命盘内的标题走冷色，与主历的泥金区分 */
.chart-result .panel-head h2 { color: var(--ice-2); }
.chart-result .panel-head .rule { background: linear-gradient(90deg, var(--ice-line), transparent); }

/* ---------- 命盘响应式 ---------- */

@media (max-width: 760px) {
  .chart-modal { padding: 0; align-items: stretch; }
  .chart-panel {
    width: 100%;
    max-height: none;
    height: 100%;
    border-radius: 0;
    border: none;
    transform: translateY(20px);
  }
  .chart-head { padding: 14px 16px 12px; }
  .chart-scroll { padding: 14px 16px calc(24px + env(safe-area-inset-bottom, 0px)); }
  .ch-ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wuge { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .wg-d { display: none; }
  .cf-label { width: 32px; }
  #cf-h { min-width: 132px; }
}

@media (max-width: 620px) {
  .head-actions { gap: 6px; }
  .ghost-btn { padding: 8px 10px; letter-spacing: 0.1em; text-indent: 0.1em; }
}

@media (max-width: 560px) {
  .chart-title h2 { font-size: 14px; letter-spacing: 0.2em; }
  .chart-title p { font-size: 9px; letter-spacing: 0.06em; }
  .chart-seal { width: 32px; height: 32px; font-size: 18px; }
  .cf-row { gap: 8px; }
  .cf-date { gap: 5px; }
  .cf-date select { min-width: 66px; font-size: 12.5px; padding: 8px 5px; }
  #cf-h { min-width: 118px; }
  .chart-submit { justify-self: stretch; letter-spacing: 0.4em; }
  .nc-char { font-size: 23px; }
  .wg-n { font-size: 18px; }
  .ch-name { font-size: 20px; }
  .sancai { flex-direction: column; align-items: flex-start; gap: 6px; }
  .st-label { font-size: 15px; }
}

@media (max-width: 380px) {
  .ch-ov-grid { grid-template-columns: 1fr; }
  .cf-date select { min-width: 58px; }
  #cf-h { min-width: 104px; }
  .nc { min-width: 54px; }
}

@media print {
  .chart-modal { display: none !important; }
}

/* ===========================================================
   十二生肖月
   =========================================================== */

.sx-card {
  margin-top: 26px;
  padding: 24px 26px 20px;
}

.sx-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-3);
}

.sx-title h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-indent: 0.26em;
  color: var(--moon);
}

.sx-title p {
  margin: 5px 0 0;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--txt-4);
}

.sx-sum { display: flex; gap: 8px; flex-wrap: wrap; }

.sx-tag {
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 3px 10px 4px;
  border: 1px solid var(--ice-line);
  border-radius: 2px;
  color: var(--ice-2);
  background: var(--ice-dim);
  white-space: nowrap;
}

.sx-tag.dim {
  border-color: var(--line-3);
  background: transparent;
  color: var(--txt-3);
}

.sx-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-top: 16px;
}

.sx-cell {
  appearance: none;
  display: grid;
  gap: 7px;
  padding: 12px 13px 11px;
  text-align: left;
  border: 1px solid var(--line-3);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.014);
  color: var(--txt);
  font-family: var(--serif);
  cursor: pointer;
  transition: border-color 0.26s ease, background 0.26s ease, transform 0.26s ease;
}

.sx-cell:hover {
  border-color: var(--ice-line);
  background: rgba(143, 168, 196, 0.06);
  transform: translateY(-1px);
}

.sx-cell.cur {
  border-color: var(--ice);
  background: rgba(143, 168, 196, 0.1);
  box-shadow: 0 0 22px -12px rgba(143, 168, 196, 0.9);
}

.sx-top {
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
}

.sx-m {
  font-family: var(--kai);
  font-size: 15px;
  letter-spacing: 0.1em;
  color: var(--moon);
}

.sx-alias { font-size: 9.5px; letter-spacing: 0.14em; color: var(--txt-4); }

.sx-badge {
  margin-left: auto;
  font-size: 9px;
  letter-spacing: 0.04em;
  padding: 1px 6px 2px;
  border: 1px solid rgba(210, 69, 60, 0.4);
  border-radius: 2px;
  color: var(--red-2);
  background: var(--red-dim);
  white-space: nowrap;
}

.sx-zhi { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 7px; }

.sx-z {
  font-family: var(--kai);
  font-size: 22px;
  line-height: 1;
  color: var(--ice-2);
}

.sx-sx {
  font-family: var(--kai);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--moon);
  opacity: 0.85;
}

.sx-gz {
  margin-left: auto;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: var(--txt-3);
}

.sx-range {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px 5px;
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: var(--txt-3);
  font-variant-numeric: tabular-nums;
}

.sx-jq { white-space: nowrap; }

.sx-arrow { color: var(--txt-4); opacity: 0.7; }

.sx-wang {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--txt-4);
  padding-top: 6px;
  border-top: 1px dashed var(--line-3);
}

/* 犯太岁 */

.ts-block {
  margin-top: 22px;
  padding: 16px 18px 15px;
  border: 1px solid var(--line-3);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.014);
}

.ts-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 11px;
  border-bottom: 1px dashed var(--line-3);
}

.ts-head h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--ice-2);
}

.ts-note { font-size: 10px; letter-spacing: 0.06em; color: var(--txt-4); }

.ts-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

/* 两行结构：首行「关系 + 生肖 + 地支」，次行独占整行放年份 */
.ts-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 9px;
  border: 1px solid var(--line-3);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.012);
}

.ts-rel {
  flex: none;
  min-width: 42px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--red-2);
  text-align: center;
  padding: 2px 5px 3px;
  border: 1px solid rgba(210, 69, 60, 0.3);
  border-radius: 2px;
  background: var(--red-dim);
  white-space: nowrap;
}

.ts-sx {
  flex: none;
  font-family: var(--kai);
  font-size: 17px;
  line-height: 1;
  color: var(--moon);
}

.ts-zhi {
  flex: none;
  font-size: 10.5px;
  color: var(--txt-4);
  letter-spacing: 0.06em;
}

.ts-years {
  flex: 1 0 100%;
  margin-left: 0;
  padding-top: 7px;
  border-top: 1px dashed var(--line-3);
  font-size: 10.5px;
  line-height: 1.75;
  letter-spacing: 0.03em;
  color: var(--txt-3);
  font-variant-numeric: tabular-nums;
  white-space: normal;
  overflow-wrap: break-word;
}

.sx-foot {
  margin: 16px 0 0;
  font-size: 10.5px;
  line-height: 1.85;
  letter-spacing: 0.03em;
  color: var(--txt-4);
}

/* ---------- 生肖月响应式 ---------- */

@media (max-width: 1180px) {
  .sx-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .sx-card { padding: 20px 18px 16px; }
  .sx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .sx-grid { grid-template-columns: 1fr; }
  .sx-cell { padding: 11px 12px 10px; }
  .sx-head { gap: 10px; }
  .sx-title h2 { font-size: 13.5px; }
  .sx-title p { font-size: 10px; line-height: 1.7; }
  .ts-list { grid-template-columns: 1fr; }
  .ts-years { font-size: 10px; }
}

@media (hover: none) {
  .sx-cell:hover { transform: none; }
}


/* ===========================================================
   个性化提醒条（依个人命盘生辰）
   =========================================================== */

.personal-bar {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--ice-line);
  border-radius: 3px;
  background: linear-gradient(100deg, rgba(143, 168, 196, 0.11), rgba(143, 168, 196, 0.025));
  box-shadow: 0 0 26px -20px rgba(143, 168, 196, 0.9);
}

/* 左侧生肖徽标 */
.pb-avatar {
  flex: none;
  display: grid;
  justify-items: center;
  gap: 1px;
  min-width: 38px;
  padding: 5px 0 4px;
  border-right: 1px solid var(--ice-line);
  padding-right: 12px;
}

.pb-zi {
  font-family: var(--kai);
  font-size: 21px;
  line-height: 1;
  color: var(--moon);
  text-shadow: 0 0 16px rgba(220, 223, 228, 0.28);
}

.pb-sx {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ice-2);
  opacity: 0.85;
}

.pb-main { flex: 1; min-width: 0; }

.pb-who {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pb-who-txt {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ice-2);
}

.pb-btn {
  appearance: none;
  margin-left: auto;
  padding: 2px 9px 3px;
  border: 1px solid var(--ice-line);
  border-radius: 2px;
  background: transparent;
  color: var(--txt-3);
  font-family: var(--serif);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color 0.22s ease, border-color 0.22s ease, background 0.22s ease;
  white-space: nowrap;
}

.pb-btn:hover {
  color: var(--moon);
  border-color: var(--ice);
  background: var(--ice-dim);
}

.pb-body { margin-top: 6px; display: grid; gap: 4px; }

.pb-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.65;
  letter-spacing: 0.02em;
  color: var(--txt-2);
}

.pb-dot {
  flex: none;
  width: 4px;
  height: 4px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--txt-4);
}

/* 冲刑害破：朱砂 */
.pb-line.chong, .pb-line.xing, .pb-line.hai, .pb-line.po { color: var(--txt); }
.pb-line.chong .pb-dot, .pb-line.xing .pb-dot,
.pb-line.hai .pb-dot, .pb-line.po .pb-dot {
  background: var(--red-2);
  box-shadow: 0 0 7px rgba(232, 106, 94, 0.65);
}

/* 同支：月白 */
.pb-line.zhi .pb-dot {
  background: var(--moon);
  box-shadow: 0 0 7px rgba(220, 223, 228, 0.5);
}

/* 六合 / 三合 / 生日：银蓝 */
.pb-line.he .pb-dot, .pb-line.sanhe .pb-dot {
  background: var(--ice);
  box-shadow: 0 0 7px rgba(143, 168, 196, 0.6);
}

/* 空状态 */
.personal-bar.empty {
  border-style: dashed;
  border-color: var(--line-2);
  background: rgba(255, 255, 255, 0.012);
  box-shadow: none;
  align-items: center;
  padding: 10px 14px;
}

.pb-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  flex-wrap: wrap;
}

.pb-empty-txt {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--txt-3);
}

.personal-bar.empty .pb-btn { margin-left: auto; }

@media (max-width: 560px) {
  .personal-bar { padding: 11px 12px; gap: 10px; }
  .pb-avatar { min-width: 32px; padding-right: 10px; }
  .pb-zi { font-size: 18px; }
  .pb-line { font-size: 12px; line-height: 1.7; }
  .pb-empty-txt { font-size: 11.5px; }
}

@media (hover: none) {
  .pb-btn:hover { background: transparent; border-color: var(--ice-line); color: var(--txt-3); }
}

/* ---------------- 响应式 ---------------- */

/* 大屏：放大基准，避免 4K 上元素过小 */
@media (min-width: 1440px) {
  body { font-size: 15.5px; }
  .almanac { padding: 30px 34px 32px; }
}

@media (min-width: 1560px) {
  .page { max-width: 1400px; }
}

@media (min-width: 1900px) {
  body { font-size: 16px; }
  .page { max-width: 1480px; }
}

/* 小笔记本 / 平板横屏：侧栏收窄，历盘缩小 */
@media (max-width: 1180px) {
  .layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .dial { width: 112px; height: 112px; }
}

/* 单列：侧栏转为两栏并排，避免页面过长 */
@media (max-width: 1020px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
  .dial { width: 104px; height: 104px; }
}

/* 平板竖屏：历盘让位给日期主体 */
@media (max-width: 900px) {
  .dial { display: none; }
  .day-head { grid-template-columns: auto minmax(0, 1fr) auto; }
}

/* 手机：主结构纵向化 */
@media (max-width: 760px) {
  .site-head { gap: 10px; }
  .brand-txt h1 { letter-spacing: 0.24em; text-indent: 0.24em; }
  .head-actions { margin-left: auto; }
  .almanac { padding: 16px 14px 18px; }
  .day-main { flex-direction: column; align-items: flex-start; gap: 10px; }
  .dh-solar { align-items: center; }
  .dh-lunar { border-left: none; padding-left: 0; }
  .yiji { grid-template-columns: 1fr; }
  .yiji-col + .yiji-col { border-left: none; border-top: 1px solid var(--line-3); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact,
  .fact:nth-child(3n + 1) { border-left: none; padding-left: 12px; padding-right: 12px; }
  .fact:nth-child(even) { border-left: 1px solid var(--line-3); }
  .shensha { grid-template-columns: 1fr; }
  .side { grid-template-columns: 1fr; }
  .hours { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
  .taiji-watermark { opacity: 0.04; }
  .jq-item { flex-wrap: wrap; white-space: normal; }
  .panel-head .sub { display: none; }
  .site-foot { flex-direction: column; gap: 4px; }
}

/* 窄屏手机：单列信息、三列时辰 */
@media (max-width: 560px) {
  .page { padding-bottom: 40px; }
  .facts { grid-template-columns: 1fr; }
  .fact:nth-child(even) { border-left: none; }
  .hours { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hour .hz { font-size: 17px; }
  .hour .hg { font-size: 9.5px; letter-spacing: 0.02em; }
  .dh-ganzhi,
  .dh-ym { white-space: normal; }
  .tag { font-size: 10px; padding: 2px 7px 3px; }
  .jump-card input[type="date"] { font-size: 16px; }
  .hour-detail { padding: 12px 14px; font-size: 12px; }
  .hour-detail .sep { margin: 0 6px; }
  .dial-face {
    box-shadow:
      0 0 0 1px rgba(226, 236, 250, 0.40),
      0 0 10px rgba(200, 216, 240, 0.22),
      0 0 26px rgba(184, 203, 234, 0.12);
  }
  .dial-face::before { filter: blur(4px); inset: -20%; }
  .brand-taiji::before { filter: blur(3px); inset: -24%; }
}

/* 极窄屏（320—380） */
@media (max-width: 380px) {
  .brand-txt h1 { font-size: 17px; letter-spacing: 0.18em; text-indent: 0.18em; }
  .brand-txt p { letter-spacing: 0.14em; }
  .ghost-btn { padding: 8px 10px; letter-spacing: 0.1em; }
  .hours { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dh-day { font-size: 40px; }
  .cal-cell { min-height: 38px; }
  .cal-cell .cl { font-size: 8px; }
  .jieqi-strip { font-size: 11px; }
}

/* 横屏矮屏：压缩纵向留白 */
@media (max-height: 560px) and (orientation: landscape) {
  .site-head { padding-top: 14px; padding-bottom: 10px; }
  .almanac { padding-top: 14px; }
  .dial { display: none; }
  .day-head { grid-template-columns: auto minmax(0, 1fr) auto; }
  .taiji-watermark { opacity: 0.03; }
}

/* 触控设备：去掉悬停位移，放大点击区 */
@media (hover: none), (pointer: coarse) {
  .hour:hover,
  .cal-cell:hover,
  .chip:hover,
  .ghost-btn:hover,
  .quick button:hover,
  .nav-btn:hover { transform: none; }
  .hour:hover {
    background: rgba(255, 255, 255, 0.022);
    border-color: var(--line-3);
    box-shadow: none;
  }
  .cal-cell:hover { background: transparent; }
  .nav-btn { min-width: 40px; min-height: 40px; }
  .nav-btn.sm { min-width: 34px; min-height: 34px; }
}


/* ---------------- 扩充模块响应式 ---------------- */

@media (max-width: 1180px) {
  .fw-wrap { grid-template-columns: clamp(140px, 22vw, 190px) minmax(0, 1fr); }
  .z-list { max-height: 226px; }
}

@media (max-width: 900px) {
  .bz-table { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dr-row { grid-template-columns: 13px 32px 26px minmax(0, 1fr) auto; gap: 8px; }
  .dr-note { font-size: 10.5px; }
}

@media (max-width: 760px) {
  .fw-wrap { grid-template-columns: 1fr; justify-items: center; }
  .compass { max-width: 178px; }
  .fw-side { width: 100%; }
  .fw-legend { justify-content: center; }
  .fw-taisui { text-align: center; }
  .gua-box { grid-template-columns: 66px minmax(0, 1fr); gap: 14px; }
  .bz-s { font-size: 10.5px; }
  .bz-ny { font-size: 10px; }
  .z-list { max-height: 240px; }
}

@media (max-width: 560px) {
  .bz-col { padding: 9px 4px 10px; }
  .bz-h { font-size: 9px; letter-spacing: 0.16em; text-indent: 0.16em; margin-bottom: 5px; }
  .bz-ny { display: none; }
  .bz-wxbox { padding: 10px 11px 11px; }
  .dr-row { grid-template-columns: 12px 30px 24px minmax(0, 1fr); gap: 7px; padding: 7px 10px; }
  .dr-note { display: none; }
  .dr-words { font-size: 11px; }
  .gua-box { grid-template-columns: 58px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .gua-name { font-size: 18px; }
  .gua-desc { font-size: 12.5px; margin-top: 7px; }
  .z-item { grid-template-columns: 44px 26px minmax(0, 1fr); gap: 7px; }
  .z-shen { display: none; }
  .zeri-head h3 { letter-spacing: 0.2em; }
  .pz-box { padding: 10px 11px 11px; }
}

@media (max-width: 380px) {
  .bz-gz .bz-g, .bz-gz .bz-z { font-size: 19px; }
  .bz-s { font-size: 9.5px; }
  .wx-row { grid-template-columns: 18px minmax(0, 1fr) 16px; gap: 7px; }
  .zchip { font-size: 11.5px; padding: 3px 8px 4px; }
  .hchip { min-width: 30px; }
}

@media (hover: none), (pointer: coarse) {
  .tchip, .zchip, .zr-btn, .z-item, .hchip, .fold-head, .term-close { touch-action: manipulation; }
  .tchip:active, .zchip:active, .zr-btn:active, .hchip:active { background: rgba(143, 168, 196, 0.14); }
  .z-item:active { background: rgba(143, 168, 196, 0.1); }
}

@media print {
  .zeri-card, #jieqi-year, .term-sheet, .dress-note, .wx-note { display: none !important; }
  .bazi-wrap, .fw-wrap, .gua-box, .dress { break-inside: avoid; }
  .bz-col.bz-day { background: #f4f4f4; }
  .tchip { border-color: #ccc; }
}

/* ---------------- 打印 ---------------- */

@media print {
  .stars, .aura, .taiji-watermark, .head-actions, .nav-btn, .dial, .jump-card { display: none !important; }
  body { background: #fff; color: #1a1a1a; }
  .page { max-width: none; padding: 0; }
  .layout { grid-template-columns: 1fr; }
  .almanac, .card { background: #fff; box-shadow: none; border-color: #ccc; backdrop-filter: none; }
  .reveal { opacity: 1; transform: none; }
  .dh-lunar-big { color: #8a1f19; -webkit-text-fill-color: #8a1f19; filter: none; background: none; }
  .dh-day, .fact .v, .yiji-list, .hour .hz { color: #111; }
  .fact .k, .yiji-title, .panel-head h2 { color: #666; }
  .chip, .tag { color: #333; border-color: #ccc; background: #f6f6f6; }
  .hour, .cal-card, .note-card { break-inside: avoid; }
}
