/* ============================================================
   老黄历吉日网 jiri.82377.com - 全局样式 v2
   视觉体系：暖米纸底 / 深红通栏页头 / 白色圆角卡 / 宜绿忌粉
   舒适明亮 · 卡片化 · 移动优先 · reduced-motion 全兼容
   ============================================================ */

:root {
  --paper: #F7F3EA;          /* 暖米 页面背景 */
  --paper-deep: #EFE8DA;     /* 深一档纸色 表头/次级底 */
  --paper-light: #FFFFFF;    /* 白色 卡片/浮层 */
  --ink: #33302B;            /* 正文 近黑暖灰 */
  --ink-soft: #5C564D;       /* 次文字 */
  --ink-faint: #9A9184;      /* 辅助文字 */
  --red: #C0392B;            /* 主红 横幅/强调 */
  --red-deep: #A93226;       /* 深红 hover */
  --red-soft: #FBE9E7;       /* 浅红底 */
  --cinnabar: #C0392B;       /* 朱砂 别名（旧模板兼容） */
  --cinnabar-deep: #A93226;
  --gold: #D4A017;           /* 金黄 中吉/点缀 */
  --gold-soft: #FDF3D7;      /* 金黄浅底 */
  --green: #2E7D32;          /* 宜/大吉 绿 */
  --green-soft: #E8F5E9;     /* 宜 浅绿底 */
  --pink: #E57373;           /* 小吉 粉红 */
  --pink-soft: #FCE4E4;      /* 忌 浅粉底 */
  --gray: #8E8880;           /* 平日 灰 */
  --line: #E6DFD2;           /* 细分隔线 */
  --line-strong: #C9BFAE;    /* 强调分隔线 */
  --radius: 12px;
  --shadow-soft: 0 1px 2px rgba(51, 48, 43, 0.04), 0 4px 16px rgba(51, 48, 43, 0.06);
  --shadow-hover: 0 4px 12px rgba(51, 48, 43, 0.08), 0 10px 28px rgba(51, 48, 43, 0.10);
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", SimSun, "STSong", serif;
  --font-sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse at 18% -4%, rgba(192, 57, 43, 0.05), transparent 52%),
    radial-gradient(ellipse at 88% 8%, rgba(212, 160, 23, 0.05), transparent 45%);
  background-attachment: fixed;
  line-height: 1.75;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .serif { font-family: var(--font-serif); font-weight: 600; letter-spacing: 0.02em; }

a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-deep); text-decoration: underline; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 22px; }
.container-narrow { max-width: 860px; margin: 0 auto; padding: 0 22px; }

/* ================= 顶部导航：深红通栏 ================= */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: linear-gradient(180deg, #B03A2E 0%, var(--red) 100%);
  box-shadow: 0 2px 10px rgba(147, 34, 26, 0.25);
  border-bottom: 1px solid rgba(120, 28, 21, 0.55);
}
.nav-bar { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-seal {
  width: 42px; height: 42px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.10));
  color: #fff;
  font-family: var(--font-serif); font-size: 18px; font-weight: 700;
  border-radius: 9px; letter-spacing: 0;
  border: 1px solid rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}
.brand-name { font-family: var(--font-serif); font-size: 21px; font-weight: 700; color: #fff; letter-spacing: 0.06em; text-shadow: 0 1px 3px rgba(90, 20, 15, 0.3); }
.brand-sub { font-size: 11px; color: rgba(255, 255, 255, 0.82); letter-spacing: 0.2em; }

.nav-links { display: flex; gap: 4px; }
.nav-links a {
  padding: 8px 16px; border-radius: 999px;
  color: rgba(255, 255, 255, 0.92); font-size: 15px; font-weight: 500;
  transition: background 0.18s, color 0.18s;
}
.nav-links a:hover { background: rgba(255, 255, 255, 0.16); color: #fff; text-decoration: none; }
.nav-links a.active { color: var(--red); background: #fff; font-weight: 600; box-shadow: 0 1px 4px rgba(90, 20, 15, 0.25); }

.nav-toggle {
  display: none; width: 42px; height: 42px; border: 1px solid rgba(255, 255, 255, 0.45);
  background: transparent; border-radius: 8px; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.nav-toggle span { width: 19px; height: 2px; background: #fff; display: block; border-radius: 1px; }

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none; position: absolute; top: 66px; left: 0; right: 0;
    background: var(--red);
    border-bottom: 1px solid rgba(120, 28, 21, 0.55);
    flex-direction: column; padding: 8px 22px 16px; gap: 2px;
    box-shadow: 0 8px 18px rgba(90, 20, 15, 0.22);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 12px; border-radius: 8px; color: #fff; }
  .nav-links a.active { color: var(--red); }
}

/* ================= 页脚：深红沉稳 ================= */
.site-footer {
  margin-top: 56px;
  background: linear-gradient(180deg, #8E2A20 0%, #6E1F17 100%);
  padding: 40px 0 26px;
  color: rgba(255, 255, 255, 0.78); font-size: 13px;
  border-top: 3px solid var(--gold);
}
.footer-grid { display: grid; grid-template-columns: 2fr 1.3fr 1.3fr 1.3fr; gap: 28px; }
.footer-grid h4 {
  font-size: 15px; margin-bottom: 12px; color: #fff;
  font-family: var(--font-serif); letter-spacing: 0.05em;
  padding-bottom: 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}
.footer-grid .footer-intro { line-height: 1.9; color: rgba(255, 255, 255, 0.72); }
.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: 7px; }
.footer-grid li a { color: rgba(255, 255, 255, 0.78); text-decoration: none; transition: color 0.15s; }
.footer-grid li a:hover { color: var(--gold); text-decoration: none; }
.footer-note { grid-column: 1 / -1; border-top: 1px solid rgba(255, 255, 255, 0.18); padding-top: 16px; margin-top: 8px; font-size: 12px; line-height: 1.8; color: rgba(255, 255, 255, 0.6); }
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr; gap: 18px; } }

/* ================= 通用区块 ================= */
.section { padding: 36px 0 8px; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.section-title { font-size: 24px; position: relative; padding-left: 16px; }
.section-title::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 5px; background: var(--red); border-radius: 3px;
}
.section-sub { color: var(--ink-faint); font-size: 13px; }
.section-link { font-size: 14px; margin-left: auto; font-weight: 600; }
.section-link a { color: var(--red); }
.section-link a:hover { text-decoration: underline; }

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

/* ================= 今日黄历主卡 ================= */
.today-hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: stretch; }

.today-main { padding: 28px 30px; position: relative; }
.today-date-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.today-date { font-size: 46px; font-weight: 700; font-family: var(--font-serif); letter-spacing: 0.03em; color: var(--red); }
.today-week {
  font-size: 14px; color: var(--ink-soft); background: var(--paper-deep);
  border: 1px solid var(--line); padding: 4px 14px; border-radius: 999px;
}
.today-lunar { margin-top: 6px; color: var(--ink-soft); font-size: 17px; display: flex; gap: 16px; flex-wrap: wrap; }
.today-lunar .g { color: var(--red); font-weight: 600; }

.level-badge {
  display: inline-block; padding: 4px 15px; border-radius: 999px;
  font-size: 14px; font-weight: 700; letter-spacing: 0.12em; font-family: var(--font-serif);
  color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.level-daji { background: var(--green); }
.level-zhongji { background: #E6A817; }
.level-xiaoji { background: var(--pink); }
.level-pingri { background: var(--gray); }
.level-jiyong { background: #6E4B3A; }

.today-meta { margin-top: 20px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 20px; font-size: 14px; }
.today-meta .m { display: flex; gap: 8px; line-height: 1.9; min-width: 0; }
.today-meta .k { color: var(--ink-faint); flex-shrink: 0; min-width: 66px; }
.today-meta .v { color: var(--ink); min-width: 0; overflow-wrap: break-word; }

.yi-ji { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px; }
.yi-ji .yi-box, .yi-ji .ji-box { border-radius: var(--radius); padding: 14px 18px; }
.yi-ji .yi-box { background: var(--green-soft); border: 1px solid #CDE8CF; }
.yi-ji .ji-box { background: var(--pink-soft); border: 1px solid #F2C9C9; }
.yi-ji .yj-title { font-size: 18px; font-family: var(--font-serif); font-weight: 700; padding: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.yi-ji .yi-box .yj-title { color: var(--green); }
.yi-ji .ji-box .yj-title { color: var(--red); }
.yj-tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0; }
.yj-tag {
  font-size: 13px; padding: 4px 13px; border-radius: 6px;
  font-weight: 500;
}
.yi-box .yj-tag { background: #fff; color: var(--green); border: 1px solid #CDE8CF; }
.ji-box .yj-tag { background: #fff; color: var(--red); border: 1px solid #F0C4C4; }

/* 通用标签（day 页宜忌 / 吉神凶煞） */
.tag {
  display: inline-block; font-size: 13px; padding: 4px 13px; border-radius: 6px;
  font-weight: 500; margin: 2px 4px 2px 0;
}
.tag-yi { background: #fff; color: var(--green); border: 1px solid #CDE8CF; }
.tag-ji { background: #fff; color: var(--red); border: 1px solid #F0C4C4; }
.tag-good { background: #FFF7E0; color: #9A6B00; border: 1px solid #EAD9A2; }

.today-aside { display: flex; flex-direction: column; gap: 16px; }
.today-aside .sub-card { padding: 18px 22px; flex: 1; }
.aside-title {
  font-size: 13px; color: var(--red); font-weight: 700; letter-spacing: 0.18em;
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.aside-title::before { content: "◆"; font-size: 9px; color: var(--gold); }
.dir-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dir-item { text-align: center; padding: 12px 4px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
.dir-item .d-name { font-size: 12px; color: var(--ink-faint); }
.dir-item .d-val { font-size: 19px; font-family: var(--font-serif); color: var(--red); font-weight: 700; margin-top: 3px; }

.today-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 4px; }
.strip-cell { display: flex; flex-direction: column; }
.strip-cell .s-k { font-size: 12px; color: var(--ink-faint); }
.strip-cell .s-v { font-size: 15px; margin-top: 2px; color: var(--ink-soft); }

@media (max-width: 900px) {
  .today-hero { grid-template-columns: 1fr; }
  .today-date { font-size: 38px; }
}
@media (max-width: 768px) {
  .today-meta { grid-template-columns: 1fr; }
  .yi-ji { grid-template-columns: 1fr; gap: 12px; }
  .dir-grid { grid-template-columns: repeat(3, 1fr); }
  .today-strip { grid-template-columns: repeat(2, 1fr); }
  .today-main { padding: 20px 18px; }
  .today-aside .sub-card { padding: 16px 18px; }
}

/* ================= 十二时辰 ================= */
.shichen-wrap { overflow-x: auto; }
.shichen-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px;
  min-width: 640px;
}
.sc-card { padding: 16px 10px; text-align: center; border-radius: 10px; border: 1px solid var(--line); background: var(--paper-light); box-shadow: var(--shadow-soft); transition: box-shadow 0.15s, transform 0.15s; }
.sc-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.sc-card.huangdao { border-top: 3px solid var(--gold); }
.sc-card.heidiao { border-top: 3px solid var(--gray); }
.sc-name { font-family: var(--font-serif); font-size: 17px; font-weight: 700; color: var(--ink); }
.sc-range { font-size: 11px; color: var(--ink-faint); margin-top: 2px; }
.sc-gz { font-size: 14px; margin-top: 6px; color: var(--ink-soft); }
.sc-shen { font-size: 13px; margin-top: 2px; }
.sc-shen.huangdao { color: #B8860B; font-weight: 700; }
.sc-shen.heidiao { color: var(--ink-faint); }
.sc-chong { font-size: 11px; color: var(--ink-faint); margin-top: 5px; }
.sc-mark { display: inline-block; margin-top: 8px; padding: 2px 12px; border-radius: 999px; font-size: 12px; color: #fff; }
.sc-mark.huangdao { background: #E6A817; }
.sc-mark.heidiao { background: var(--gray); }
@media (max-width: 768px) {
  .shichen-grid { grid-template-columns: repeat(3, 1fr); min-width: 0; gap: 10px; }
}

/* ================= 月历 ================= */
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.calendar-nav { display: flex; gap: 8px; align-items: center; }
.cal-nav-btn {
  padding: 7px 14px; border: 1px solid var(--line-strong); background: var(--paper-light);
  border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--ink-soft);
  transition: all 0.15s;
}
.cal-nav-btn:hover { background: #fff; color: var(--red); border-color: var(--red); }
.cal-month-title { font-size: 22px; font-family: var(--font-serif); font-weight: 700; min-width: 180px; text-align: center; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow-soft); }
.cal-week { padding: 11px 6px 7px; text-align: center; font-size: 13px; font-weight: 600; color: var(--ink-faint); border-bottom: 1px solid var(--line); background: var(--paper-deep); }
.cal-week.sun, .cal-week.sat { color: var(--red); }
.cal-cell {
  min-height: 92px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  cursor: pointer; transition: background 0.15s; position: relative;
  background: #fff;
}
.cal-cell:nth-child(n+2):not(:nth-child(8)):not(:nth-child(15)):not(:nth-child(22)):not(:nth-child(29)):not(:nth-child(36)):not(:nth-child(43)):not(:nth-child(50)) { border-left: none; }
.cal-cell:hover { background: var(--paper); }
.cal-cell.blank { cursor: default; background: var(--paper); }
.cal-cell.today { outline: 2px solid var(--red); outline-offset: -2px; background: var(--red-soft); }
.cal-cell.selected { background: var(--gold-soft); }
.cal-day-top { display: flex; justify-content: space-between; align-items: baseline; }
.cal-day-num { font-size: 18px; font-weight: 700; font-family: var(--font-serif); }
.cal-cell.sun .cal-day-num { color: var(--red); }
.cal-lunar { font-size: 11px; color: var(--ink-faint); }
.cal-level { font-size: 11px; margin-top: 5px; font-weight: 600; }
.cal-fest { font-size: 10px; color: var(--red); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-jiachu { font-size: 10px; color: var(--ink-faint); margin-top: 2px; }
.mark-daji .cal-day-num, .mark-daji .cal-level { color: var(--green); font-weight: 700; }
.mark-zhongji .cal-day-num, .mark-zhongji .cal-level { color: #B8860B; font-weight: 600; }
.mark-xiaoji .cal-day-num, .mark-xiaoji .cal-level { color: var(--pink); font-weight: 600; }
.mark-pingri .cal-level { color: var(--gray); }
.mark-jiyong .cal-day-num, .mark-jiyong .cal-level { color: var(--red); font-weight: 700; }
.cal-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--ink-soft); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 5px; vertical-align: middle; }

@media (max-width: 768px) {
  .cal-cell { min-height: 68px; padding: 5px; }
  .cal-day-num { font-size: 15px; }
  .cal-lunar, .cal-fest, .cal-jiachu { font-size: 9px; }
}

/* ================= 吉日查询 ================= */
.query-toolbar { padding: 24px 26px; margin-bottom: 24px; }
.query-block { margin-bottom: 18px; }
.query-block:last-child { margin-bottom: 0; }
.query-label { font-size: 13px; color: var(--ink-faint); font-weight: 600; margin-bottom: 10px; letter-spacing: 0.08em; }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 17px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: #fff; cursor: pointer; font-size: 14px; color: var(--ink-soft);
  transition: all 0.15s; user-select: none;
}
.chip:hover { border-color: var(--red); color: var(--red); }
.chip.on { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.chip.on:hover { background: var(--red-deep); }

.query-actions { display: flex; gap: 12px; margin-top: 20px; align-items: center; flex-wrap: wrap; }
.btn-primary, .btn-ghost {
  padding: 10px 28px; border-radius: 999px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: all 0.15s; border: 1px solid transparent;
}
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 2px 8px rgba(192, 57, 43, 0.3); }
.btn-primary:hover { background: var(--red-deep); }
.btn-ghost { border-color: var(--line-strong); background: #fff; color: var(--ink-soft); }
.btn-ghost:hover { border-color: var(--red); color: var(--red); }
.query-hint { font-size: 13px; color: var(--ink-faint); margin-top: 12px; }
.query-hint b { color: var(--red); }

.result-summary { font-size: 14px; color: var(--ink-soft); margin-bottom: 16px; }

.gd-summary { font-size: 14px; color: var(--ink-soft); margin-bottom: 16px; }
.gd-summary b { color: var(--red); font-size: 17px; }

.goodday-list { display: flex; flex-direction: column; gap: 14px; }
.goodday-card { display: grid; grid-template-columns: 130px 1fr; gap: 20px; padding: 20px 24px; transition: box-shadow 0.15s; text-decoration: none; color: inherit; }
.goodday-card:hover { box-shadow: var(--shadow-hover); }
.goodday-card.goodday-link { cursor: pointer; border-color: var(--line-strong); }
.goodday-card.goodday-link:hover { border-color: var(--red); }
a.goodday-card:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.gd-more { margin-top: 2px; font-size: 13px; color: var(--red); font-weight: 700; }
.gd-left { text-align: center; border-right: 1px dashed var(--line-strong); padding-right: 20px; }
.gd-date { font-size: 13px; color: var(--ink-faint); }
.gd-day { font-size: 36px; font-weight: 700; font-family: var(--font-serif); line-height: 1.15; color: var(--red); }
.gd-lunar { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.gd-gz { font-size: 13px; color: var(--ink-faint); margin-top: 2px; }
.gd-level { margin-top: 8px; }
.gd-right { display: flex; flex-direction: column; gap: 8px; }
.gd-matched { display: flex; flex-wrap: wrap; gap: 6px; }
.gd-tag { font-size: 12px; padding: 3px 11px; border-radius: 6px; background: var(--red-soft); color: var(--red-deep); font-weight: 700; }

/* 吉日卡 宜/忌 标签云 */
.gd-yj { display: block; }
.gd-yj-row { display: flex; align-items: flex-start; gap: 6px; }
.gd-yj-row + .gd-yj-row { margin-top: 6px; }
.gd-yj-key {
  flex-shrink: 0; min-width: 24px; height: 24px; line-height: 24px;
  text-align: center; border-radius: 5px; font-size: 12px; font-weight: 700;
  font-family: var(--font-serif); margin-top: 1px;
}
.gd-yj-yi { background: var(--green-soft); color: var(--green); border: 1px solid #CDE8CF; }
.gd-yj-ji { background: var(--pink-soft); color: var(--red); border: 1px solid #F2C9C9; }
.gd-yj-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.gd-yj-item {
  font-size: 12px; line-height: 1; padding: 5px 9px; border-radius: 5px;
  background: #fff; border: 1px solid var(--line); color: var(--ink-soft);
  transition: border-color 0.12s, color 0.12s;
}
.gd-yj-row:nth-child(1) .gd-yj-item:hover { border-color: var(--green); color: var(--green); }
.gd-yj-row:nth-child(2) .gd-yj-item:hover { border-color: var(--red); color: var(--red); }
.gd-yi-ji { font-size: 13px; color: var(--ink-soft); line-height: 1.9; }
.gd-meta { font-size: 12px; color: var(--ink-faint); margin-top: auto; }
.gd-meta span { margin-right: 14px; }
.empty-tip { padding: 40px; text-align: center; color: var(--ink-faint); font-size: 15px; }
@media (max-width: 768px) {
  .goodday-card { grid-template-columns: 1fr; gap: 12px; padding: 16px; }
  .gd-left { border-right: none; border-bottom: 1px dashed var(--line-strong); padding: 0 0 12px; }
}

/* ================= 黄历知识 ================= */
.knowledge-article { padding: 30px 36px; }
.knowledge-article h3 { font-size: 21px; margin: 26px 0 12px; padding-left: 14px; border-left: 4px solid var(--gold); }
.knowledge-article h3:first-child { margin-top: 0; }
.knowledge-article h4 { font-size: 17px; margin: 18px 0 8px; color: var(--ink-soft); }
.knowledge-article p { margin-bottom: 12px; color: var(--ink-soft); }
.knowledge-article ul, .knowledge-article ol { margin: 0 0 14px 22px; color: var(--ink-soft); }
.knowledge-article li { margin-bottom: 6px; }
.knowledge-article table { width: 100%; border-collapse: collapse; margin: 14px 0 20px; font-size: 14px; }
.knowledge-article th, .knowledge-article td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.knowledge-article th { background: var(--paper-deep); font-weight: 600; }
.knowledge-article .tip {
  background: var(--gold-soft); border-left: 4px solid var(--gold);
  padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 16px 0; font-size: 14px; color: var(--ink-soft);
}
.knowledge-article .warn {
  background: var(--red-soft); border-left: 4px solid var(--red);
  padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 16px 0; font-size: 14px; color: var(--red-deep);
}
.knowledge-toc { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-bottom: 8px; }
.knowledge-toc a { display: block; padding: 10px 14px; background: #fff; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; color: var(--ink-soft); }
.knowledge-toc a:hover { border-color: var(--red); color: var(--red); text-decoration: none; }

/* ================= 快捷分类入口 ================= */
.entry-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.entry-card {
  padding: 20px 18px; text-align: center; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  box-shadow: var(--shadow-soft);
}
.entry-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--gold); }
.entry-emoji { font-size: 28px; }
.entry-name { font-size: 18px; font-family: var(--font-serif); font-weight: 700; margin-top: 8px; color: var(--ink); }
.entry-desc { font-size: 12px; color: var(--ink-faint); margin-top: 4px; line-height: 1.6; }
.entry-card a { color: inherit; text-decoration: none; }
@media (max-width: 900px) { .entry-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .entry-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

/* ================= 事项吉日专页 ================= */
.item-hero { padding: 30px 34px; margin-bottom: 24px; }
.item-hero .item-title { font-size: 30px; font-weight: 700; font-family: var(--font-serif); color: var(--red); margin-bottom: 8px; }
.item-hero .item-sub { color: var(--ink-faint); font-size: 15px; margin-bottom: 18px; }
.item-hero p.lead { color: var(--ink-soft); line-height: 1.9; }
.item-tips { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tip-card { background: var(--paper-light); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-soft); }
.tip-card h4 { font-size: 16px; color: var(--red); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.tip-card h4::before { content: "✓"; color: var(--green); font-weight: 700; }
.tip-card p { font-size: 13px; color: var(--ink-soft); line-height: 1.8; }
.item-faq { display: flex; flex-direction: column; gap: 12px; }
.faq-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.faq-item h4 { font-size: 15px; color: var(--ink); margin-bottom: 6px; }
.faq-item h4::before { content: "Q · "; color: var(--red); font-weight: 700; }
.faq-item p { font-size: 14px; color: var(--ink-soft); line-height: 1.9; }
.timeline-list { list-style: none; }
.timeline-list li { position: relative; padding: 0 0 16px 28px; color: var(--ink-soft); font-size: 14px; line-height: 1.8; }
.timeline-list li::before { content: ""; position: absolute; left: 6px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--gold); }
.timeline-list li:last-child { padding-bottom: 0; }

/* ================= 每日黄历详情页 ================= */
.day-hero { padding: 26px 30px; margin-bottom: 24px; }
.day-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.day-level-big { text-align: right; }
.day-level-big .level-badge { font-size: 17px; padding: 6px 22px; }
.day-score { font-size: 13px; color: var(--ink-faint); margin-top: 6px; }
.day-talk {
  margin-top: 16px; background: var(--gold-soft); border-left: 4px solid var(--gold);
  border-radius: 0 10px 10px 0; padding: 14px 18px;
  font-size: 14px; line-height: 2; color: var(--ink-soft);
}
.day-yiji { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.day-yiji .yi-block, .day-yiji .ji-block { border-radius: var(--radius); padding: 14px 18px; }
.day-yiji .yi-block { background: var(--green-soft); border: 1px solid #CDE8CF; }
.day-yiji .ji-block { background: var(--pink-soft); border: 1px solid #F2C9C9; }
.day-yiji h3 { font-size: 16px; font-family: var(--font-serif); font-weight: 700; margin-bottom: 10px; }
.day-yiji .yi-block h3 { color: var(--green); }
.day-yiji .ji-block h3 { color: var(--red); }
.day-yiji .yj-tags { margin-top: 0; }
.day-yiji .yj-tag { background: #fff; }

.hl-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-soft); font-size: 14px; }
.hl-table th, .hl-table td { border: 1px solid var(--line); padding: 11px 14px; }
.hl-table th { background: var(--paper-deep); font-weight: 600; color: var(--ink-soft); width: 118px; text-align: left; }
.hl-table td { color: var(--ink); line-height: 1.8; }
.hl-table tr:nth-child(even) td { background: #FDFBF6; }
@media (max-width: 768px) {
  .hl-table th { width: 84px; padding: 8px 10px; }
  .hl-table td { padding: 8px 10px; font-size: 13px; }
  .day-hero { padding: 18px 16px; }
  .day-yiji { grid-template-columns: 1fr; }
}

.hour-line { margin-bottom: 10px; font-size: 14px; color: var(--ink-soft); }
.hour-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.hour-cell {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 8px; text-align: center; box-shadow: var(--shadow-soft);
  transition: box-shadow 0.15s, transform 0.15s;
}
.hour-cell:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.hour-cell.hour-good { border-top: 3px solid var(--gold); }
.hour-cell.hour-bad { border-top: 3px solid var(--gray); }
.hour-cell .h-name { display: block; font-family: var(--font-serif); font-size: 15px; font-weight: 700; }
.hour-cell .h-range { display: block; font-size: 11px; color: var(--ink-faint); margin-top: 2px; }
.hour-cell .h-gz { display: block; font-size: 13px; margin-top: 6px; color: var(--ink-soft); }
.hour-cell .h-ts { display: block; font-size: 12px; margin-top: 2px; color: var(--ink-soft); }
.hour-cell .h-luck { display: inline-block; margin-top: 7px; padding: 2px 12px; border-radius: 999px; font-size: 12px; color: #fff; }
.hour-cell.hour-good .h-luck { background: #E6A817; }
.hour-cell.hour-bad .h-luck { background: var(--gray); }
@media (max-width: 768px) { .hour-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; } }

/* 相关择日 chips */
.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chip-wrap .chip { text-decoration: none; }
.range-btn { cursor: pointer; user-select: none; font-size: 14px; padding: 7px 18px; border-radius: 999px; }

/* 当月吉日速览 */
.day-list { display: flex; flex-direction: column; gap: 10px; }
.day-list-item {
  display: grid; grid-template-columns: 95px 120px auto 110px 1fr; gap: 12px; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 18px;
  text-decoration: none; color: inherit; box-shadow: var(--shadow-soft);
  transition: box-shadow 0.15s, transform 0.15s;
}
.day-list-item:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); border-color: var(--gold); }
.day-list-item .dl-date { font-family: var(--font-serif); font-size: 16px; font-weight: 700; color: var(--red); }
.day-list-item .dl-lunar { font-size: 13px; color: var(--ink-soft); }
.day-list-item .dl-yi { font-size: 13px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-list-item .level-badge { font-size: 12px; padding: 3px 12px; }
@media (max-width: 768px) {
  .day-list-item { grid-template-columns: 78px 1fr; padding: 10px 14px; gap: 6px 10px; }
  .day-list-item .level-badge { grid-column: 2; justify-self: start; }
  .day-list-item .dl-yi { grid-column: 1 / -1; white-space: normal; }
  .day-list-item .dl-gz { display: none; }
}
.day-navbar {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  margin: 8px 0 10px; flex-wrap: wrap;
}
.day-navbar .day-nav {
  font-size: 14px; color: var(--red); font-weight: 600; padding: 8px 16px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.day-navbar .day-nav:hover { border-color: var(--red); text-decoration: none; }
.day-navbar .day-nav-now { font-size: 13px; color: var(--ink-faint); padding: 6px 14px; border-radius: 999px; border: 1px dashed var(--line-strong); }
.muted { color: var(--ink-faint); font-size: 14px; padding: 10px 0; }
.goodday-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 6px; }
@media (max-width: 768px) { .goodday-grid { grid-template-columns: 1fr; } }

/* ================= 今日黄历小卡（资讯型） ================= */
.today-mini { font-size: 14px; color: var(--ink-soft); line-height: 1.9; }
.day-date-main { text-align: center; padding: 8px 0 4px; }
.day-date-main .d-date { font-size: 40px; font-weight: 700; font-family: var(--font-serif); color: var(--red); }
.day-date-main .d-lunar { font-size: 17px; color: var(--ink-soft); margin-top: 6px; }
.day-date-main .d-gz { font-size: 15px; color: var(--ink-faint); margin-top: 2px; }
.day-summary { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-top: 14px; font-size: 13px; color: var(--ink-soft); }
.day-summary span { background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; }

/* ================= 吉日等级说明 ================= */
.level-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.level-card { padding: 20px 22px; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.level-card .lv-name { font-size: 16px; font-weight: 700; font-family: var(--font-serif); }
.level-card .levels-badge { display: inline-block; padding: 5px 18px; border-radius: 999px; font-size: 15px; font-weight: 700; font-family: var(--font-serif); }
.level-card .lv-freq { font-size: 12px; color: var(--ink-faint); margin-top: 6px; }
.level-card .lv-desc { font-size: 13px; color: var(--ink-soft); line-height: 1.8; margin-top: 10px; text-align: left; }
.level-card .lv-do { font-size: 12px; color: var(--ink-faint); margin-top: 8px; line-height: 1.7; text-align: left; }
@media (max-width: 900px) { .level-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .level-grid { grid-template-columns: 1fr; } }

/* ================= 详情弹层 ================= */
.modal-mask {
  display: none; position: fixed; inset: 0; background: rgba(51, 48, 43, 0.5);
  z-index: 200; align-items: center; justify-content: center; padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius); max-width: 580px; width: 100%;
  max-height: 84vh; overflow-y: auto; padding: 28px 30px; position: relative;
  box-shadow: 0 14px 44px rgba(51, 48, 43, 0.28); border: 1px solid var(--line);
}
.modal-close {
  position: absolute; top: 14px; right: 16px; background: none; border: none;
  font-size: 22px; cursor: pointer; color: var(--ink-faint); line-height: 1;
}
.modal-close:hover { color: var(--red); }
.modal-title { font-size: 22px; font-family: var(--font-serif); font-weight: 700; margin-bottom: 4px; }
.modal-sub { font-size: 14px; color: var(--ink-faint); margin-bottom: 16px; }
.modal .yi-ji { margin-top: 6px; }

/* ================= 返回顶部 ================= */
.back-top {
  position: fixed; right: 24px; bottom: 24px; width: 46px; height: 46px;
  background: var(--red); color: #fff; border: none; border-radius: 50%;
  font-size: 18px; cursor: pointer; box-shadow: 0 4px 14px rgba(192, 57, 43, 0.35);
  display: none; align-items: center; justify-content: center; z-index: 90;
}
.back-top.show { display: flex; }
.back-top:hover { background: var(--red-deep); }

/* ================= 工具类 ================= */
.fade-in { animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

/* ================= 黄历数据导出栏 ================= */
.export-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 14px;
  padding: 13px 16px;
  background: linear-gradient(135deg, rgba(192, 57, 43, 0.05), rgba(247, 243, 234, 0.6));
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
}
.export-hint {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.7;
}
.export-hint b { color: var(--cinnabar-deep); font-weight: 600; }
.export-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.export-btns .btn-ghost {
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-soft);
  cursor: pointer;
  line-height: 1.4;
}
.export-btns .btn-ghost:hover {
  border-color: var(--red);
  color: var(--red);
  background: #fff;
}
.export-btns .btn-ghost:active { transform: translateY(1px); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
/* ============================================================
   生肖择日专题页（shengxiao.html / shengxiao/*.html）
   ============================================================ */
.sx-main { padding-top: 8px; }
.breadcrumb { font-size: 13px; color: var(--ink-faint); margin: 4px 0 14px; }
.breadcrumb a { color: var(--red); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

.sx-hero {
  background: linear-gradient(135deg, #FFFDF7 0%, #FDF3E3 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 24px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
  box-shadow: var(--shadow-soft);
}
.sx-hero-emoji { font-size: 52px; line-height: 1.1; filter: drop-shadow(0 2px 6px rgba(192, 57, 43, 0.18)); }
.sx-hero-main h1 { font-family: var(--font-serif); font-size: 26px; color: var(--ink); margin-bottom: 8px; }
.sx-hero-main p { font-size: 14px; color: var(--ink-soft); line-height: 1.9; margin-bottom: 10px; }
.sx-hero-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.sx-yearinfo {
  display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: var(--gold-soft); color: #8A6D13; border: 1px solid #EAD9A6;
}
.sx-benming {
  display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: var(--red-soft); color: var(--red); border: 1px solid #F0C4BD; font-weight: 600;
}

.sx-prop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.sx-prop-card { padding: 16px 18px; }
.sx-prop-card h3 { font-size: 14px; color: var(--red); margin-bottom: 10px; font-family: var(--font-serif); }
.sx-prop-card ul { list-style: none; }
.sx-prop-card li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.sx-prop-card li:last-child { border-bottom: 0; }
.sx-prop-card b { color: var(--ink); font-weight: 600; white-space: nowrap; }
.sx-prop-card span { color: var(--ink-soft); text-align: right; }

.sx-tip { padding: 18px 22px; margin-bottom: 18px; }
.sx-tip h3 { font-size: 15px; color: var(--red); margin-bottom: 8px; font-family: var(--font-serif); }
.sx-tip p { font-size: 14px; color: var(--ink-soft); line-height: 1.95; }
.sx-tip b { color: var(--ink); }

.sx-sec-title { font-family: var(--font-serif); font-size: 20px; color: var(--ink); margin: 22px 0 12px; }
.sx-auto { font-size: 12px; color: var(--green); font-weight: 400; margin-left: 6px; vertical-align: middle; }
.sx-gd-sub { font-size: 13px; color: var(--ink-soft); margin-bottom: 12px; line-height: 1.8; }

.sx-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.sx-chip {
  font: inherit; font-size: 13px; cursor: pointer;
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink-soft);
  transition: all .15s ease;
}
.sx-chip:hover { border-color: var(--red); color: var(--red); }
.sx-chip.active { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }

.sx-gd-head { font-size: 13px; color: var(--ink-soft); margin-bottom: 10px; }
.sx-goodday-list { min-height: 120px; }
.sx-loading { padding: 26px; text-align: center; color: var(--ink-faint); font-size: 14px; }
.sx-empty { padding: 22px; text-align: center; color: var(--ink-soft); font-size: 14px; }
.sx-empty a { color: var(--red); }
.sx-more { text-align: center; margin-top: 12px; }
.sx-more a { font-size: 14px; color: var(--red); text-decoration: none; border-bottom: 1px dashed var(--red); }

.sx-relate-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.sx-relate-card { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; text-decoration: none; transition: all .15s ease; }
.sx-relate-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); border-color: var(--gold); }
.sx-relate-card b { font-size: 15px; color: var(--red); font-family: var(--font-serif); }
.sx-relate-card span { font-size: 13px; color: var(--ink-soft); }
.sx-relate-all { background: linear-gradient(135deg, var(--red-soft), #FFF); border-style: dashed; }

.sx-faq { padding: 6px 20px 12px; }
.sx-faq .faq-item { margin: 12px 0; }
.sx-faq summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink); padding: 6px 0; }
.sx-faq summary::before { content: "Q · "; color: var(--red); }
.sx-faq p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.95; padding: 4px 0 2px; }

.sx-nav-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.sx-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 8px 12px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); text-decoration: none; transition: all .15s ease;
}
.sx-nav-item:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); border-color: var(--gold); }
.sx-nav-item.active { border-color: var(--red); background: var(--red-soft); }
.sx-nav-emoji { font-size: 26px; }
.sx-nav-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.sx-nav-meta { font-size: 11px; color: var(--ink-faint); }

.sx-overview-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.sx-overview-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 14px 16px; text-decoration: none; text-align: center; transition: all .15s ease; }
.sx-overview-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); border-color: var(--gold); }
.sx-overview-emoji { font-size: 36px; }
.sx-overview-card h3 { font-family: var(--font-serif); font-size: 17px; color: var(--ink); }
.sx-overview-card p { font-size: 12.5px; color: var(--ink-soft); }
.sx-overview-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.sx-overview-tags span { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--paper); color: var(--ink-soft); border: 1px solid var(--line); }
.sx-overview-more { font-size: 13px; color: var(--red); margin-top: 4px; border-bottom: 1px dashed var(--red); }

@media (max-width: 900px) {
  .sx-prop-grid { grid-template-columns: 1fr; }
  .sx-relate-grid { grid-template-columns: 1fr 1fr; }
  .sx-nav-grid { grid-template-columns: repeat(3, 1fr); }
  .sx-overview-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .sx-hero { flex-direction: column; align-items: center; text-align: center; }
  .sx-hero-tags { justify-content: center; }
  .sx-relate-grid { grid-template-columns: 1fr; }
}
