:root {
  --paper: #f7f2e7;
  --paper-2: #fbf7ee;
  --card: #fffdf8;
  --ink: #2c2721;
  --ink-soft: #4d463c;
  --muted: #857a69;
  --line: #e8dfcd;
  --line-soft: #f0e8d8;
  --red: #b3261e;
  --red-dark: #8a1b15;
  --red-tint: #fdf0ed;
  --gold: #a9823f;
  --green: #4f6b4a;
  --green-tint: #eef4ea;
  --shadow: 0 12px 34px rgba(84, 63, 38, 0.07);
  --radius: 16px;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font-sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(168, 141, 99, 0.09) 1px, transparent 1px);
  background-size: 22px 22px;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p, dl, dd, dt { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 22px;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(247, 242, 231, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 74px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--red);
  color: #fff8ec;
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 700;
  box-shadow: inset 0 0 0 2px rgba(255, 248, 236, 0.35), 0 6px 14px rgba(139, 27, 21, 0.25);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-family: var(--font-serif); font-size: 19px; letter-spacing: 1px; }
.brand-text small { color: var(--muted); font-size: 11px; letter-spacing: 1px; }

.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a {
  position: relative;
  padding: 9px 14px;
  border-radius: 9px;
  color: var(--ink-soft);
  font-size: 15px;
  transition: color 0.15s, background 0.15s;
}
.site-nav a:hover { color: var(--red); background: rgba(179, 38, 30, 0.06); }
.site-nav a.active { color: var(--red); font-weight: 600; }
.site-nav a.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--red);
  transform: translateX(-50%);
}

/* ---------- today banner ---------- */
.today-banner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 24px 0 22px;
  padding: 22px 28px;
  border-radius: var(--radius);
  overflow: hidden;
  color: #fdf5e6;
  background: linear-gradient(115deg, #7f1a14 0%, #a8241c 46%, #8d1e17 100%);
  box-shadow: 0 14px 30px rgba(122, 26, 20, 0.22);
}

.today-banner::before,
.today-banner::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.today-banner::before {
  right: -70px;
  top: -110px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(255, 244, 224, 0.16);
  box-shadow: inset 0 0 0 26px rgba(255, 244, 224, 0.04);
}
.today-banner::after {
  right: 90px;
  bottom: -90px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(255, 233, 196, 0.1), transparent 65%);
}

.tb-left { display: flex; align-items: baseline; gap: 14px; flex-shrink: 0; }
.tb-date { font-family: var(--font-serif); font-size: 30px; letter-spacing: 1px; }
.tb-week { font-size: 14px; opacity: 0.82; }

.tb-mid {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 26px;
  border-left: 1px solid rgba(255, 244, 224, 0.28);
}
.tb-lunar { font-family: var(--font-serif); font-size: 19px; letter-spacing: 1px; }
.tb-gz { font-size: 12px; letter-spacing: 1px; opacity: 0.82; }

.tb-right {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 246, 227, 0.12);
  border: 1px solid rgba(255, 246, 227, 0.22);
  white-space: nowrap;
}
.tb-right em { font-style: normal; font-weight: 600; }
.tb-right .yi-word { color: #cfe4bf; }
.tb-right .ji-word { color: #ffc9bc; }

/* ---------- layout ---------- */
.page-home { padding-bottom: 40px; }

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 372px;
  grid-template-areas: "cal detail" "extra detail";
  gap: 22px;
  align-items: start;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- calendar ---------- */
.calendar-card { grid-area: cal; padding: 20px 22px 16px; }

.cal-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.cal-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-serif);
  font-size: 22px;
  letter-spacing: 0.5px;
  margin-right: auto;
}
.cal-title select {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  padding: 4px 6px;
  border-radius: 8px;
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.cal-title select:hover { border-color: var(--line); background: var(--paper-2); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
  color: var(--ink-soft);
  font-size: 20px;
  line-height: 1;
  padding: 0 0 3px;
  transition: all 0.15s;
}
.icon-btn:hover { border-color: var(--red); color: var(--red); background: var(--red-tint); }

.ghost-btn {
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--red);
  border-radius: 10px;
  background: transparent;
  color: var(--red);
  font-size: 14px;
  transition: all 0.15s;
}
.ghost-btn:hover { background: var(--red); color: #fff8ec; }

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 6px;
  padding: 6px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.cal-weekdays span {
  text-align: center;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--muted);
}
.cal-weekdays span:first-child,
.cal-weekdays span:last-child { color: var(--red); }

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

.cal-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 68px;
  padding: 6px 2px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  transition: background 0.13s, border-color 0.13s;
}
.cal-cell:hover { background: var(--paper-2); border-color: var(--line-soft); }
.cal-cell:disabled { cursor: default; }
.cal-cell:disabled:hover { background: transparent; border-color: transparent; }

.cell-solar {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--ink);
  border-radius: 50%;
}
.cal-cell.weekend .cell-solar { color: var(--red); }
.cell-lunar {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  line-height: 1.2;
}
.cell-lunar.is-festival { color: var(--red); font-weight: 600; }
.cell-lunar.is-term { color: var(--green); }

.cal-cell.out { opacity: 0.38; }
.cal-cell.today .cell-solar {
  background: var(--red);
  color: #fff8ec;
  box-shadow: 0 4px 10px rgba(179, 38, 30, 0.28);
}
.cal-cell.selected {
  background: var(--red-tint);
  border-color: rgba(179, 38, 30, 0.45);
}
.cal-cell.selected .cell-lunar { color: var(--red-dark); }
.cal-cell.selected.today .cell-solar { background: var(--red-dark); }

.cal-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--muted);
}
.cal-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
}
.dot-today { background: var(--red); }
.dot-festival { background: #d9705f; }
.dot-term { background: var(--green); }

/* ---------- detail ---------- */
.detail-card {
  grid-area: detail;
  padding: 22px;
  position: sticky;
  top: 96px;
  align-self: start;
}

.detail-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}
.detail-day {
  font-family: var(--font-serif);
  font-size: 58px;
  line-height: 1;
  color: var(--red);
  min-width: 92px;
}
.detail-meta { display: flex; flex-direction: column; gap: 3px; }
.detail-date { font-size: 14px; color: var(--ink-soft); }
.detail-lunar { font-family: var(--font-serif); font-size: 18px; letter-spacing: 0.5px; }
.detail-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }

.tag {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: var(--paper-2);
}
.tag.festival { color: var(--red); border-color: rgba(179, 38, 30, 0.3); background: var(--red-tint); }
.tag.term { color: var(--green); border-color: rgba(79, 107, 74, 0.3); background: var(--green-tint); }

.gz-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0;
}
.gz-item {
  padding: 9px 6px;
  text-align: center;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--paper-2);
}
.gz-item span { display: block; font-size: 11px; color: var(--muted); }
.gz-item strong { font-family: var(--font-serif); font-size: 16px; font-weight: 600; }

.yiji {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.yiji-col {
  padding: 12px 12px 10px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
}
.yiji-col.yi { background: var(--green-tint); border-color: #dfe9d8; }
.yiji-col.ji { background: var(--red-tint); border-color: #f2dcd7; }
.yiji-col h4 {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 7px;
  letter-spacing: 2px;
}
.yiji-col.yi h4 { color: var(--green); }
.yiji-col.ji h4 { color: var(--red); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.05);
  color: var(--ink-soft);
}
.yiji-col.yi .chip { color: #3f5d3b; }
.yiji-col.ji .chip { color: #8f312a; }

.facts { border-top: 1px solid var(--line-soft); }
.facts > div {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 13px;
}
.facts > div:last-child { border-bottom: 0; }
.facts dt {
  flex: 0 0 64px;
  color: var(--muted);
  font-size: 12px;
  padding-top: 1px;
}
.facts dd { margin: 0; color: var(--ink-soft); flex: 1; }
.facts dd .lucky { color: var(--green); }
.facts dd .unlucky { color: var(--red); }

.detail-foot {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.detail-foot strong { color: var(--ink-soft); font-weight: 600; }

/* ---------- month extras ---------- */
.month-extra {
  grid-area: extra;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 0;
  padding: 4px 22px;
}
.extra-block { padding: 16px 0; }
.extra-block + .extra-block {
  border-left: 1px solid var(--line-soft);
  padding-left: 22px;
  margin-left: 22px;
}
.extra-block h3 {
  font-family: var(--font-serif);
  font-size: 16px;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.extra-list { display: flex; flex-direction: column; gap: 7px; }
.extra-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-soft);
}
.extra-list .e-date {
  flex: 0 0 74px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.extra-list .e-name { font-weight: 500; }
.extra-list .e-sub { color: var(--muted); font-size: 12px; margin-left: auto; }
.extra-list .e-red { color: var(--red); }
.extra-list .e-green { color: var(--green); }

/* ---------- generic page ---------- */
.page-other { padding: 30px 0 48px; }

.page-head { margin-bottom: 22px; }
.page-head h1 {
  font-family: var(--font-serif);
  font-size: 30px;
  letter-spacing: 2px;
  margin-bottom: 6px;
}
.page-head p { color: var(--muted); font-size: 14px; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
}

.panel h2 {
  font-family: var(--font-serif);
  font-size: 19px;
  letter-spacing: 1px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel h2::before {
  content: "";
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--red);
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.form-actions { margin-top: 12px; }
.form-note { margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.tool-grid .span-2 { grid-column: 1 / -1; }
.countdown-list.wide { display: grid; grid-template-columns: 1fr 1fr; column-gap: 30px; }
.field { display: flex; flex-direction: column; gap: 5px; flex: 1 1 130px; }
.field label { font-size: 12px; color: var(--muted); letter-spacing: 0.5px; }
.field input,
.field select {
  width: 100%;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper-2);
  font-size: 14px;
}
.field input:focus,
.field select:focus { border-color: var(--red); outline: none; background: #fff; }

.primary-btn {
  height: 40px;
  padding: 0 22px;
  border: 0;
  border-radius: 9px;
  background: var(--red);
  color: #fff8ec;
  font-size: 14px;
  letter-spacing: 1px;
  box-shadow: 0 6px 14px rgba(179, 38, 30, 0.22);
  transition: background 0.15s;
  flex: 0 0 auto;
}
.primary-btn:hover { background: var(--red-dark); }

.result {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}
.result-empty { color: var(--muted); font-size: 13px; }
.result-big {
  font-family: var(--font-serif);
  font-size: 28px;
  letter-spacing: 1px;
  color: var(--red);
  margin-bottom: 4px;
}
.result-sub { font-size: 13px; color: var(--ink-soft); }
.result-sub span { color: var(--muted); }

.mini-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}
.mini-fact {
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--paper-2);
  text-align: center;
}
.mini-fact span { display: block; font-size: 11px; color: var(--muted); }
.mini-fact strong { font-family: var(--font-serif); font-size: 15px; }

.countdown-list { display: flex; flex-direction: column; gap: 0; }
.countdown-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 2px;
  border-bottom: 1px dashed var(--line-soft);
}
.countdown-list li:last-child { border-bottom: 0; }
.cd-days {
  flex: 0 0 62px;
  text-align: center;
  font-family: var(--font-serif);
}
.cd-days strong { display: block; font-size: 22px; color: var(--red); line-height: 1.1; }
.cd-days span { font-size: 11px; color: var(--muted); }
.cd-info { display: flex; flex-direction: column; }
.cd-info strong { font-family: var(--font-serif); font-size: 15px; }
.cd-info span { font-size: 12px; color: var(--muted); }

/* ---------- bazi ---------- */
.bazi-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 22px; align-items: start; }
.bazi-form .form-row + .form-row { margin-top: 12px; }
.bazi-head { margin-bottom: 18px; }
[hidden] { display: none !important; }

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.pillar {
  padding: 14px 8px;
  text-align: center;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--paper-2);
}
.pillar span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.pillar .p-gan {
  font-family: var(--font-serif);
  font-size: 27px;
  line-height: 1.2;
}
.pillar .p-zhi {
  font-family: var(--font-serif);
  font-size: 27px;
  line-height: 1.2;
}
.pillar .p-nayin { font-size: 11px; color: var(--muted); margin-top: 5px; }

.wx-bar { margin-top: 18px; }
.wx-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
  font-size: 13px;
}
.wx-row .wx-name { flex: 0 0 24px; font-family: var(--font-serif); }
.wx-row .wx-track { display: block; flex: 1; height: 8px; border-radius: 4px; background: #efe7d7; overflow: hidden; }
.wx-row .wx-fill { display: block; height: 100%; border-radius: 4px; }
.wx-row .wx-num { flex: 0 0 20px; text-align: right; color: var(--muted); font-size: 12px; }
.wx-row.wood .wx-fill { background: #6f8f5c; }
.wx-row.fire .wx-fill { background: #c2543f; }
.wx-row.earth .wx-fill { background: #b08a4a; }
.wx-row.metal .wx-fill { background: #9a9a8f; }
.wx-row.water .wx-fill { background: #5c7f96; }

.bazi-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}
.lucky-note {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  font-size: 13px;
  color: var(--ink-soft);
}
.lucky-note strong { color: var(--red); font-family: var(--font-serif); }

.zodiac-card { display: flex; gap: 14px; align-items: flex-start; }
.zodiac-icon {
  flex: 0 0 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red-tint);
  color: var(--red);
  font-family: var(--font-serif);
  font-size: 30px;
}
.zodiac-card h3 { font-family: var(--font-serif); font-size: 18px; margin-bottom: 3px; }
.zodiac-card p { font-size: 13px; color: var(--ink-soft); }

/* ---------- footer ---------- */
.site-footer {
  margin-top: 34px;
  padding: 26px 0 34px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.9;
}
.site-footer .footer-links { display: flex; gap: 16px; justify-content: center; margin-bottom: 6px; }
.site-footer a:hover { color: var(--red); }
.site-footer .footer-groups { margin-top: 8px; }
.site-footer .footer-groups p { margin-top: 10px; }
.site-footer .footer-groups a { display: inline-block; margin: 0 5px; white-space: nowrap; }

.ad-slot { margin: 18px 0; text-align: center; }
.ad-slot:empty { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .home-grid {
    grid-template-columns: 1fr;
    grid-template-areas: "cal" "detail" "extra";
  }
  .detail-card { position: static; }
  .bazi-layout { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .today-banner { flex-wrap: wrap; row-gap: 10px; }
  .tb-date { font-size: 26px; }
  .tb-mid { padding-left: 0; border-left: 0; }
  .tb-right { margin-left: 0; }
}

@media (max-width: 720px) {
  .wrap { padding: 0 14px; }
  .header-inner { min-height: 60px; gap: 8px; }
  .brand { gap: 9px; }
  .brand-mark { width: 36px; height: 36px; font-size: 21px; }
  .brand-text strong { font-size: 15px; letter-spacing: 0; }
  .brand-text small { display: none; }
  .site-nav { gap: 2px; }
  .site-nav a { padding: 7px 8px; font-size: 13px; }

  .today-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 18px;
    margin: 16px 0;
  }
  .tb-date { font-size: 24px; }
  .tb-mid { padding-left: 0; border-left: 0; }
  .tb-lunar { font-size: 17px; }
  .tb-right { margin-left: 0; font-size: 12px; }

  .calendar-card { padding: 14px 10px 12px; }
  .cal-title { font-size: 19px; }
  .cal-title select { font-size: 18px; }
  .icon-btn { width: 34px; height: 34px; }
  .ghost-btn { height: 34px; padding: 0 11px; font-size: 13px; }
  .cal-grid { gap: 0; }
  .cal-cell { min-height: 56px; padding: 4px 1px; border-radius: 8px; }
  .cell-solar { min-width: 25px; height: 25px; font-size: 16px; }
  .cell-lunar { font-size: 9.5px; }
  .cal-legend { gap: 12px; }

  .detail-card { padding: 18px; }
  .detail-day { font-size: 48px; min-width: 76px; }

  .month-extra { grid-template-columns: 1fr; padding: 4px 18px; }
  .extra-block + .extra-block { border-left: 0; border-top: 1px solid var(--line-soft); padding-left: 0; margin-left: 0; }

  .tool-grid { grid-template-columns: 1fr; }
  .tool-grid .span-2 { grid-column: auto; }
  .countdown-list.wide { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 25px; }
  .panel { padding: 18px; }
  .pillar-grid { gap: 6px; }
  .pillar .p-gan, .pillar .p-zhi { font-size: 23px; }
  .bazi-summary { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 430px) {
  .brand-text { display: none; }
  .brand { gap: 0; }
  .site-nav { margin-left: auto; }
  .site-nav a { padding: 7px 10px; }
}

@media (max-width: 400px) {
  .cell-lunar { font-size: 9px; }
  .cal-cell { min-height: 52px; }
  .gz-item strong { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
