/* 通胜择日 - 现代风格 */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { font-family: "Noto Serif SC", "Songti SC", "STZhongsong", "SimSun", "Microsoft YaHei", serif; font-size: 17px; }
body {
  background: linear-gradient(140deg, #fbf5e8 0%, #f3ead2 60%, #e9d8a3 100%);
  color: #2b1810;
  min-height: 100vh;
  padding: 24px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.app { max-width: 1200px; margin: 0 auto; }

/* 顶部 */
.topbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 16px;
  padding: 16px 24px;
  background: rgba(255, 252, 240, 0.7);
  border-radius: 12px;
  border: 1px solid #c9a96a55;
  box-shadow: 0 4px 14px rgba(120, 70, 20, 0.08);
  margin-bottom: 24px;
}
.title { display: flex; align-items: center; gap: 12px; }
.seal {
  display: inline-block;
  background: #a83232;
  color: #fef8e8;
  width: 42px; height: 42px; line-height: 42px;
  border-radius: 6px;
  font-weight: bold; font-size: 18px;
  letter-spacing: 0; text-align: center;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px #a83232;
}
.title h1 { font-size: 26px; color: #6b3a16; letter-spacing: 4px; font-weight: 700; }
.title .sub { color: #94784e; font-size: 17px; letter-spacing: 2px; }
.date-form { display: flex; gap: 8px; align-items: center; }
.date-form input[type=date] {
  padding: 8px 12px; border-radius: 8px; border: 1px solid #c9a96a;
  background: #fff8e8; font-family: inherit; font-size: 17px; color: #3a2818;
  outline: none;
}
.date-form input[type=date]:focus { border-color: #a83232; }
.date-form button {
  padding: 8px 16px;
  border: 1px solid #a83232;
  background: #fff8e8;
  color: #a83232;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 17px;
  transition: all 0.2s;
}
.date-form button:hover { background: #a83232; color: #fff8e8; }

/* 主网格 */
.dashboard {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 18px;
  margin-bottom: 18px;
}
@media (max-width: 880px) {
  .dashboard { grid-template-columns: 1fr; }
}

.card {
  background: rgba(255, 252, 240, 0.85);
  border-radius: 14px;
  border: 1px solid #c9a96a55;
  box-shadow: 0 4px 18px rgba(120, 70, 20, 0.06);
  padding: 20px;
}
.card h2 {
  font-size: 17px;
  letter-spacing: 3px;
  color: #6b3a16;
  border-bottom: 1px solid #c9a96a55;
  padding-bottom: 8px;
  margin-bottom: 14px;
  font-weight: 700;
}

/* 左侧主卡片 */
.hero-card .date-big {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 8px;
}
.hero-card .year-month-day {
  font-size: 36px;
  font-weight: 700;
  color: #2b1810;
  letter-spacing: 4px;
}
.hero-card .weekday {
  background: #a83232;
  color: #fff8e8;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 17px;
  letter-spacing: 2px;
}
.hero-card .gan-zhi-row {
  font-size: 18px;
  color: #6b3a16;
  margin-bottom: 4px;
}
.hero-card .gan-zhi-row strong { color: #2b1810; margin: 0 4px; letter-spacing: 4px; }
.hero-card .lunar-line {
  color: #94784e; font-size: 17px; letter-spacing: 2px; margin-bottom: 12px;
}

.divider { border-top: 1px dashed #c9a96a88; margin: 14px 0; }

.kv-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 17px; }
.kv-list dt { color: #94784e; }
.kv-list dd { color: #2b1810; }

/* 星宿 + 建除 */
.special-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 8px;
}
.spec-box {
  background: #fff8e8;
  border: 1px solid #c9a96a66;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}
.spec-box .lab { font-size: 17px; color: #94784e; letter-spacing: 2px; }
.spec-box .val { font-size: 20px; font-weight: 700; color: #a83232; margin-top: 2px; }
.spec-box .sub { font-size: 17px; color: #94784e; }

/* 宜忌 */
.yiji-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
.yiji-box .col {
  background: #fff8e8;
  border-radius: 10px;
  padding: 12px;
}
.yiji-box .col.yi { border-left: 4px solid #2d8859; }
.yiji-box .col.ji { border-left: 4px solid #a83232; }
.yiji-box .head {
  font-weight: 700; letter-spacing: 4px; margin-bottom: 8px; font-size: 17px;
}
.yiji-box .col.yi .head { color: #2d8859; }
.yiji-box .col.ji .head { color: #a83232; }
.yiji-box .tags {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.yiji-box .tag {
  background: #fff;
  border: 1px solid currentColor;
  padding: 3px 10px;
  border-radius: 14px;
  font-size: 17px;
  opacity: 0.9;
}
.yiji-box .col.yi .tag { color: #2d8859; }
.yiji-box .col.ji .tag { color: #a83232; }

/* 右侧九宫 */
.jiugong-card .fly-header {
  text-align: center;
  font-size: 17px;
  color: #6b3a16;
  letter-spacing: 4px;
  margin-bottom: 12px;
  padding: 6px;
  background: #fff8e8;
  border-radius: 6px;
}

.jiugong-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 4px;
  aspect-ratio: 1;
  max-width: 420px;
  margin: 0 auto 14px;
}
.jg-cell {
  background: #fff8e8;
  border: 2px solid #c9a96a88;
  border-radius: 6px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  text-align: center;
  min-height: 100px;
}
.jg-cell.center {
  background: #a83232;
  color: #fef8e8;
  border-color: #a83232;
}
.jg-cell .pos {
  font-size: 17px;
  color: #94784e;
  letter-spacing: 1px;
  position: absolute;
  top: 4px; left: 6px;
}
.jg-cell.center .pos { color: #fff; opacity: 0.8; }
.jg-cell .star {
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  margin-top: 10px;
}
.jg-cell .star-name {
  font-size: 17px;
  margin-top: 2px;
  letter-spacing: 1px;
  color: #94784e;
}
.jg-cell.center .star { color: #fef8e8; }
.jg-cell.center .star-name { color: #ffe; }
.jg-cell .star-meta {
  font-size: 13px;
  margin-top: 2px;
  color: #94784e;
}
.jg-cell.center .star-meta { color: #fff8e8; opacity: 0.9; }

/* 九宫颜色（按九星五行着色） */
.jg-cell.star1, .jg-cell.star6, .jg-cell.star8 { background: linear-gradient(140deg, #fff 0%, #f0f8ff 100%); }
.jg-cell.star5 { background: linear-gradient(140deg, #fffbe8 0%, #fdeec2 100%); border-color: #d4a017; }
.jg-cell.star2 { background: linear-gradient(140deg, #555 0%, #333 100%); color: #fff; }
.jg-cell.star2 .pos, .jg-cell.star2 .star-name, .jg-cell.star2 .star-meta { color: #ddd; }
.jg-cell.star3, .jg-cell.star4 { background: linear-gradient(140deg, #f0fff4 0%, #d2f0d6 100%); }
.jg-cell.star7 { background: linear-gradient(140deg, #ffe8e8 0%, #ffcccc 100%); }
.jg-cell.star9 { background: linear-gradient(140deg, #f5e8ff 0%, #dab8f5 100%); }

/* 评注 */
.eval-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.eval-grid .col {
  background: #fff8e8;
  border-radius: 8px;
  padding: 10px 12px;
}
.eval-grid .head { font-size: 17px; letter-spacing: 2px; margin-bottom: 4px; }
.eval-grid .col.good .head { color: #2d8859; }
.eval-grid .col.bad .head { color: #a83232; }
.eval-grid .col .body { font-size: 17px; color: #2b1810; line-height: 1.6; }
.eval-grid .col .body span { display: inline-block; margin: 2px 4px 2px 0; padding: 2px 8px; background: #fff; border-radius: 4px; border: 1px solid #ddd; }

/* 第二行 */
.row-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
@media (max-width: 880px) { .row-2 { grid-template-columns: 1fr; } }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-block;
  background: #fff8e8;
  border: 1px solid #c9a96a88;
  color: #6b3a16;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 17px;
  letter-spacing: 1px;
}
.chip.good { border-color: #2d885988; color: #2d8859; }
.chip.bad { border-color: #a8323288; color: #a83232; }
.chip.animal { background: #fff; }

/* 12 时辰 */
.shichen-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.shichen {
  background: #fff8e8;
  border: 1px solid #c9a96a66;
  border-radius: 8px;
  padding: 8px 6px;
  text-align: center;
  font-size: 17px;
}
.shichen .hh { font-size: 17px; font-weight: 700; color: #6b3a16; }
.shichen .gz { font-size: 17px; color: #94784e; margin: 1px 0; letter-spacing: 1px; }
.shichen .luck { font-size: 17px; padding: 2px 4px; border-radius: 4px; display: inline-block; min-width: 24px; }
.shichen .luck.ji { background: #2d8859; color: #fff; }
.shichen .luck.xiong { background: #a83232; color: #fff; }

/* 底部信息卡 */
.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
  margin-bottom: 24px;
}
@media (max-width: 880px) { .bottom-grid { grid-template-columns: 1fr; } }

.dir-card .dir-item {
  display: flex; justify-content: space-between; padding: 6px 0;
  border-bottom: 1px dashed #c9a96a55;
  font-size: 17px;
}
.dir-card .dir-item:last-child { border: none; }
.dir-card .dir-item .name { color: #94784e; }

.note-card {
  background: linear-gradient(140deg, #fff8e8 0%, #fff2cd 100%);
  border-left: 4px solid #a83232;
}
.note-card .title { font-weight: 700; color: #a83232; letter-spacing: 2px; margin-bottom: 6px; }
.note-card .body { font-size: 17px; color: #2b1810; line-height: 1.75; }

footer {
  text-align: center;
  font-size: 17px;
  color: #94784e;
  padding: 20px;
  letter-spacing: 1px;
  line-height: 1.9;
}

.loading {
  text-align: center;
  padding: 60px;
  font-size: 18px;
  color: #94784e;
  letter-spacing: 4px;
}

.error {
  background: #ffe8e8;
  border: 1px solid #a83232;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  color: #a83232;
}

/* ========== Tabs ========== */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.tab-btn {
  padding: 10px 24px;
  background: rgba(255, 252, 240, 0.7);
  border: 1px solid #c9a96a88;
  border-radius: 10px;
  color: #6b3a16;
  font-family: inherit;
  font-size: 17px;
  letter-spacing: 3px;
  cursor: pointer;
  transition: all 0.2s;
}
.tab-btn:hover { border-color: #a83232; }
.tab-btn.active {
  background: #a83232;
  color: #fef8e8;
  border-color: #a83232;
}
.tab-pane { display: block; }

/* ========== 万年历 ========== */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  background: rgba(255, 252, 240, 0.85);
  border: 1px solid #c9a96a55;
  border-radius: 12px;
  padding: 12px 18px;
}
.cal-title {
  font-size: 22px;
  font-weight: 700;
  color: #2b1810;
  letter-spacing: 3px;
  min-width: 240px;
  text-align: center;
}
.cal-title .gz {
  display: block;
  font-size: 17px;
  color: #94784e;
  letter-spacing: 2px;
  font-weight: 400;
}
.cal-nav {
  padding: 8px 16px;
  border: 1px solid #c9a96a;
  background: #fff8e8;
  color: #6b3a16;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 17px;
  transition: all 0.2s;
}
.cal-nav:hover { border-color: #a83232; color: #a83232; }
.cal-nav.today-btn { border-color: #a83232; color: #a83232; font-weight: 700; }
.cal-nav.today-btn:hover { background: #a83232; color: #fff8e8; }

.cal-legend {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  font-size: 17px;
  color: #94784e;
  margin-bottom: 8px;
}
.cal-legend .dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 4px;
}
.fly-legend { background: #a83232; }
.yi-legend { background: #2d8859; }
.ji-legend { background: #a83232; opacity: 0.5; }
.festival-legend { background: #d4a017; }

.cal-grid-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}
.cal-grid-head div {
  text-align: center;
  font-size: 17px;
  color: #6b3a16;
  letter-spacing: 1px;
  padding: 6px 0;
  background: rgba(255, 252, 240, 0.6);
  border-radius: 6px;
  font-weight: 700;
}
.cal-grid-head div:first-child, .cal-grid-head div:last-child { color: #a83232; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  background: rgba(255, 252, 240, 0.85);
  border: 1px solid #c9a96a55;
  border-radius: 12px;
  padding: 10px;
}

.cal-cell {
  min-height: 88px;
  background: #fff8e8;
  border: 1px solid #c9a96a55;
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 1px;
  position: relative;
  transition: all 0.15s;
  overflow: hidden;
}
.cal-cell:hover {
  border-color: #a83232;
  box-shadow: 0 0 0 2px #a8323233;
  transform: translateY(-1px);
}
.cal-cell.empty { background: transparent; border: none; cursor: default; pointer-events: none; }
.cal-cell.empty:hover { box-shadow: none; transform: none; }
.cal-cell.today-cell { border-color: #a83232; box-shadow: 0 0 0 2px #a8323255; }
.cal-cell .cd {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px dashed #c9a96a55;
  padding-bottom: 2px;
  margin-bottom: 2px;
}
.cal-cell .cd .dnum {
  font-size: 18px;
  font-weight: 700;
  color: #2b1810;
}
.cal-cell .cd .fly {
  font-size: 13px;
  color: #a83232;
  background: #ffe8e8;
  border-radius: 4px;
  padding: 1px 5px;
  letter-spacing: 0.5px;
}
.cal-cell .lunar { font-size: 17px; color: #94784e; letter-spacing: 0.5px; }
.cal-cell .gz-row { font-size: 17px; color: #6b3a16; letter-spacing: 0.5px; }
.cal-cell .jc {
  font-size: 13px;
  color: #6b3a16;
}
.cal-cell .jc .xq { margin-left: 4px; color: #94784e; }
.cal-cell .tags-cal {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 2px;
}
.cal-cell .tag-cal {
  font-size: 13px;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.cal-cell .tag-cal.yi { background: #e4f4ea; color: #2d8859; }
.cal-cell .tag-cal.ji { background: #fbe4e4; color: #a83232; }
.cal-cell .festival {
  position: absolute;
  bottom: 2px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 13px;
  color: #8a6d1f;
  background: #fff6d8;
  letter-spacing: 1px;
  padding: 1px 0;
}
.cal-cell .chong { font-size: 13px; color: #94784e; }
.cal-cell.weekend .cd .dnum { color: #a83232; }

/* 移动端适配 */
@media (max-width: 700px) {
  .cal-cell { min-height: 64px; padding: 4px; }
  .cal-cell .cd .dnum { font-size: 17px; }
  .cal-cell .lunar, .cal-cell .gz-row, .cal-cell .jc, .cal-cell .tag-cal, .cal-cell .chong { font-size: 12px; }
  .cal-title { font-size: 18px; min-width: 160px; }
}

/* ========== 大师版：凶日横幅 ========== */
.warn-banner {
  background: linear-gradient(90deg, #fbe4e4 0%, #f8d0d0 100%);
  border: 1px solid #a83232;
  border-left: 5px solid #a83232;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 18px;
  color: #7a2020;
}
.warn-banner .warn-title { font-weight: 700; letter-spacing: 2px; margin-bottom: 4px; font-size: 17px; }
.warn-banner .warn-item { font-size: 17px; line-height: 1.85; }

/* 四柱表 */
.sizhu-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
  font-size: 17px;
}
.sizhu-table th, .sizhu-table td {
  border: 1px solid #c9a96a66;
  padding: 6px 4px;
  text-align: center;
}
.sizhu-table th { background: #fff3d6; color: #6b3a16; font-size: 17px; letter-spacing: 1px; }
.sizhu-table .gz-main { font-size: 17px; font-weight: 700; color: #2b1810; }
.sizhu-table .gz-sub { font-size: 17px; color: #94784e; }

/* 五行分布条 */
.wx-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
}
.wx-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 17px;
  color: #6b3a16;
}
.wx-item .bar {
  width: 70px;
  height: 8px;
  border-radius: 4px;
  background: #f0e2c0;
  overflow: hidden;
}
.wx-item .bar i {
  display: block;
  height: 100%;
  border-radius: 4px;
}
.wx-item .num { font-weight: 700; min-width: 16px; text-align: right; }

/* 三飞星 */
.fly3-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
@media (max-width: 880px) { .fly3-grid { grid-template-columns: 1fr; } }
.fly3-card {
  background: #fff8e8;
  border: 1px solid #c9a96a66;
  border-radius: 10px;
  padding: 12px;
}
.fly3-card h3 {
  font-size: 17px;
  color: #6b3a16;
  text-align: center;
  letter-spacing: 2px;
  margin-bottom: 8px;
  font-weight: 700;
}
.fly3-card .fly-header-sm {
  text-align: center;
  font-size: 17px;
  color: #a83232;
  margin-bottom: 8px;
  letter-spacing: 1px;
}
.fly3-grid .jg-cell { min-height: 62px; padding: 2px; }
.fly3-grid .jg-cell .star { font-size: 17px; margin-top: 4px; }
.fly3-grid .jg-cell .pos { font-size: 12px; top: 1px; left: 3px; }
.fly3-grid .jg-cell .star-name { font-size: 12px; }
.fly3-grid .jg-cell .star-meta { display: none; }

/* 时辰加紫白 */
.shichen .zibai { font-size: 13px; color: #a83232; margin-top: 2px; }

/* 神煞解释 tooltip */
.ss-tip {
  cursor: help;
  border-bottom: 1px dashed #94784e;
}

/* 生肖卡 */
.zodiac-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 6px;
}
.zodiac-box .zi {
  background: #fff8e8;
  border: 1px solid #c9a96a66;
  border-radius: 8px;
  padding: 8px;
  font-size: 17px;
  color: #2b1810;
}
.zodiac-box .zi b { color: #6b3a16; display: block; font-size: 17px; margin-bottom: 2px; }

/* 方位卡 */
.dir-list { font-size: 17px; }
.dir-list .dir-item {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px dashed #c9a96a55;
}
.dir-list .dir-item:last-child { border: none; }
.dir-list .dir-item .name { color: #94784e; }
.dir-list .dir-item .val { color: #2b1810; font-weight: 500; }

/* 知识字典 */
.dict-search {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #c9a96a;
  background: #fff8e8;
  font-family: inherit;
  font-size: 17px;
  margin-bottom: 14px;
  outline: none;
  box-sizing: border-box;
}
.dict-search:focus { border-color: #a83232; box-shadow: 0 0 0 3px rgba(168,50,50,0.12); }
.dict-summary {
  font-size: 14px;
  color: #94784e;
  margin-bottom: 12px;
  padding: 6px 12px;
  background: #f3e6c8;
  border-radius: 6px;
  display: inline-block;
}
.dict-summary b { color: #a83232; }
.dict-section { margin-bottom: 22px; }
.dict-section h3 {
  font-size: 17px;
  font-weight: 700;
  color: #6b3a16;
  letter-spacing: 1px;
  border-left: 4px solid #a83232;
  padding-left: 10px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dict-count {
  font-size: 12px;
  font-weight: 400;
  color: #fff;
  background: #c9a96a;
  border-radius: 10px;
  padding: 1px 9px;
  letter-spacing: 0;
}
/* 分区导语：把 title/_源/说明 等说明文字单列，不再挤进网格 */
.dict-intro {
  background: #fdf3da;
  border: 1px solid #e3cd9c;
  border-left: 4px solid #c9a96a;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  color: #6b3a16;
}
.dict-intro p { margin: 0 0 6px; line-height: 1.8; font-size: 15px; }
.dict-intro p:last-child { margin-bottom: 0; }
/* 瀑布流：卡片按内容自然流动填充两列，避免“一列高、一列大片留白” */
.dict-grid {
  column-count: 2;
  column-gap: 10px;
}
@media (max-width: 700px) { .dict-grid { column-count: 1; } }
.dict-item {
  background: #fff8e8;
  border: 1px solid #c9a96a66;
  border-radius: 8px;
  padding: 11px 13px;
  font-size: 16px;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  margin-bottom: 10px;
  width: 100%;
  box-sizing: border-box;
}
.dict-item .di-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  padding-bottom: 5px;
  border-bottom: 1px dashed #c9a96a55;
}
.dict-item .di-label {
  font-weight: 700;
  color: #2b1810;
  font-size: 15px;
}
.dict-item .di-cat {
  font-size: 11px;
  font-weight: 400;
  color: #6b3a16;
  background: #f3e6c8;
  border: 1px solid #e3cd9c;
  border-radius: 8px;
  padding: 0 7px;
  line-height: 18px;
  flex-shrink: 0;
}
.dict-item .di-body { color: #6b3a16; line-height: 1.8; }
.dict-txt { color: #6b3a16; line-height: 1.8; }
.dim { color: #b3a07e; }

/* 二十四山等长字符串：拆成带间距的字符块，不再挤成一团 */
.m-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  line-height: 1.6;
}
.m-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 4px;
  background: #f3e6c8;
  border: 1px solid #e3cd9c;
  border-radius: 6px;
  color: #2b1810;
  font-size: 16px;
  font-weight: 700;
}

/* 字典内嵌对象/数组展开 */
.dict-list {
  margin: 4px 0 0 18px;
  padding-left: 0;
  color: #6b3a16;
  line-height: 1.8;
}
.dict-list li { margin-bottom: 2px; }
.sub-dict {
  margin-top: 8px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.6);
  border: 1px dashed #c9a96a88;
  border-radius: 8px;
}
.sub-dict.nested { background: rgba(255,248,232,0.75); margin-top: 5px; padding: 6px 9px; }
.sub-dict-row {
  display: flex;
  gap: 10px;
  padding: 4px 0;
  border-bottom: 1px dashed #c9a96a44;
  align-items: flex-start;
}
.sub-dict-row:last-child { border-bottom: none; }
.sub-dict-row b {
  min-width: 84px;
  color: #6b3a16;
  font-size: 15px;
  flex-shrink: 0;
}
.sub-dict-val { flex: 1; color: #2b1810; }
.sub-dict-val ul.dict-list { margin-top: 0; }

/* 搜索无结果 */
.dict-empty {
  text-align: center;
  color: #94784e;
  font-size: 17px;
  padding: 50px 20px;
  line-height: 2;
}
.dict-empty span { font-size: 14px; color: #b3a07e; }
.dict-foot {
  font-size: 12px;
  color: #94784e;
  line-height: 1.8;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px dashed #c9a96a55;
}

/* 生肖运程 / 年视图响应式 */
@media (max-width: 900px) {
  .sx-grid { grid-template-columns: repeat(3, 1fr) !important; }
  .year-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 560px) {
  .sx-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .year-grid { grid-template-columns: 1fr !important; }
}
.ym-card:hover { border-color: #a83232 !important; box-shadow: 0 0 0 2px #a8323233; }

/* 彭祖百忌横条 */
.pengzu-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  background: #fff3e8; border: 1px solid #c9a96a88; border-left: 4px solid #a83232;
  border-radius: 8px; padding: 7px 12px; margin: 8px 0 10px;
  font-size: 17px; color: #6b3a16;
}
.pz-label { font-weight: 700; color: #a83232; letter-spacing: 1px; font-size: 17px; }
.pz-item { background: #fff; border: 1px solid #e0c9a0; border-radius: 5px; padding: 2px 8px; }

/* 本日卦象卡 */
.gua-main { display: flex; gap: 18px; align-items: flex-start; padding: 4px 0 10px; }
.gua-yao-box { display: flex; flex-direction: column; gap: 3px; background: #fff8e8; border: 1px solid #c9a96a66; border-radius: 8px; padding: 10px 14px; }
.gua-yao-line { font-size: 18px; line-height: 1.15; color: #2b1810; letter-spacing: 1px; text-align: center; }
.gua-info { flex: 1; }
.gua-name { font-size: 22px; font-weight: 700; color: #2b1810; letter-spacing: 3px; display: flex; align-items: center; gap: 10px; }
.gua-badge { color: #fff; font-size: 17px; padding: 2px 10px; border-radius: 10px; letter-spacing: 1px; }
.gua-ci { font-size: 13.5px; color: #6b3a16; line-height: 1.85; margin-top: 8px; }
.gua-note { font-size: 11.5px; color: #94784e; line-height: 1.75; margin-top: 6px; }
.season-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.season-item { background: #fff8e8; border: 1px solid #c9a96a66; border-radius: 8px; padding: 8px 10px; }
.season-item .lab { font-size: 17px; color: #94784e; letter-spacing: 1px; margin-bottom: 3px; }
.season-item .val { font-size: 17px; color: #2b1810; line-height: 1.5; }
@media (max-width: 560px) {
  .season-row { grid-template-columns: repeat(2, 1fr); }
  .gua-main { flex-direction: column; }
}

/* 日历补位格（上月尾/下月首，灰显不抢当月视觉） */
.cal-cell.prev, .cal-cell.next {
  background: rgba(255, 248, 232, 0.45);
  border: 1px dashed #c9a96a44;
  cursor: pointer;
}
.cal-cell.prev:hover, .cal-cell.next:hover {
  border-color: #a83232;
  box-shadow: 0 0 0 2px #a8323222;
  background: rgba(255, 243, 232, 0.9);
}
.cal-cell.prev .dnum, .cal-cell.next .dnum { color: #c9b896; font-size: 15px; }
.cal-cell.prev .lunar, .cal-cell.next .lunar { color: #d8c9a8; font-size: 12px; }
.cal-cell.prev .fly, .cal-cell.next .fly { color: #d8c9a8; }
.prev-num { opacity: 0.75; }
.prev-fly { opacity: 0.6; font-size: 11px; }
.prev-lunar { letter-spacing: 1px; }

/* 日干喜忌卡 */
.xiji-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 14px; }
.xj-cell { background: #fff8e8; border: 1px solid #c9a96a66; border-radius: 8px; padding: 12px; }
.xj-cell.xi { border-left: 4px solid #2d8859; }
.xj-cell.ji { border-left: 4px solid #a83232; }
.xj-cell .lab { font-size: 13px; color: #94784e; letter-spacing: 1px; margin-bottom: 6px; }
.xj-cell .val { font-size: 16px; font-weight: 700; color: #2b1810; line-height: 1.5; margin-bottom: 8px; }
.xj-cell .tag-row { font-size: 13px; letter-spacing: 1px; }
.t-xi { color: #2d8859; }
.t-ji { color: #a83232; }
.xj-detail { display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 10px; background: rgba(255, 243, 230, 0.6); border-radius: 8px; padding: 10px 14px; font-size: 14px; color: #2b1810; line-height: 1.6; }
@media (max-width: 700px) { .xiji-grid { grid-template-columns: 1fr; } .xj-detail { grid-template-columns: 1fr; } }

/* 本月节气卡 */
.jq-list { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.jq-item { background: #fff8e8; border: 1px solid #c9a96a66; border-radius: 8px; padding: 12px 16px; border-left: 4px solid #c9a96a; }
.jq-item.today { border-left-color: #a83232; background: #fff3e8; }
.jq-item.future { border-left-color: #2d8859; }
.jq-item.past { border-left-color: #94784e; opacity: 0.78; }
.jq-name { font-size: 18px; font-weight: 700; color: #6b3a16; letter-spacing: 2px; }
.jq-date { font-size: 14px; color: #6b3a16; margin: 4px 0 6px; }
.jq-tag { display: inline-block; background: #c9a96a66; color: #2b1810; padding: 1px 10px; border-radius: 10px; font-size: 12px; margin-left: 6px; }
.jq-item.today .jq-tag { background: #a83232; color: #fff; }
.jq-item.future .jq-tag { background: #2d8859; color: #fff; }
.jq-min { font-size: 14px; color: #2b1810; line-height: 1.75; }

/* ========== v14 新增：日干十二长生卡 ========== */
.sc-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin: 10px 0;
}
@media (max-width: 700px) { .sc-grid { grid-template-columns: repeat(4, 1fr); } }
.sc-cell {
  background: #fff8e8;
  border: 1px solid #c9a96a66;
  border-radius: 8px;
  padding: 8px 4px;
  text-align: center;
  font-size: 15px;
  position: relative;
}
.sc-cell b { display: block; color: #6b3a16; font-size: 17px; margin-bottom: 2px; }
.sc-cell span { display: block; color: #2b1810; font-weight: 600; }
.sc-cell i {
  position: absolute; top: 2px; right: 4px;
  font-size: 10px; font-style: normal;
  background: #a83232; color: #fff;
  width: 16px; height: 16px; line-height: 16px;
  border-radius: 50%; text-align: center;
}
.sc-cell.da-ji { background: #e4f4ea; border-color: #2d8859; }
.sc-cell.da-ji span { color: #2d8859; }
.sc-cell.ji { background: #f0faf3; border-color: #2d885988; }
.sc-cell.ji span { color: #2d8859; }
.sc-cell.xiong { background: #fbe4e4; border-color: #a8323288; }
.sc-cell.xiong span { color: #a83232; }
.sc-cell.ping span { color: #94784e; }
.sc-cell.today { box-shadow: 0 0 0 2px #a8323255; }

/* ========== v14 新增：月令民俗岁时卡 ========== */
.ms-list { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.ms-item {
  background: #fff8e8;
  border: 1px solid #c9a96a66;
  border-radius: 8px;
  padding: 10px 14px;
  border-left: 4px solid #d46a2a;
}
.ms-name { font-size: 17px; font-weight: 700; color: #6b3a16; letter-spacing: 1px; }
.ms-date { font-size: 13px; color: #a83232; margin: 3px 0 5px; }
.ms-desc { font-size: 14px; color: #2b1810; line-height: 1.75; }

/* ========== v22 新增：详情页工具栏 + 择吉展开 ========== */
.detail-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.detail-toolbar .today-btn { box-shadow: none; }
.zj-detail table td { padding: 3px 6px; color: #6b3a16; }
.zj-detail table tr + tr td { border-top: 1px solid #c9a96a33; }
.zj-head:hover { background: #fffdf2; }

/* ========== v23 打印：输出「通胜详情」全部内容 ========== */
@media print {
  html, body { background: #fff !important; padding: 0 !important; font-size: 13px; }
  .app { max-width: 100% !important; }
  /* 隐藏与详情无关的一切：标题栏、Tab、页脚、其余 Tab 面板、打印按钮本身 */
  .topbar, .tabs, footer, .detail-toolbar,
  #calendarArea, #dictArea, #doushouArea, #zhaijiArea, #marriageArea { display: none !important; }
  /* 只显示通胜详情主区，铺满整页 */
  #mainArea {
    display: block !important;
    width: 100% !important; max-width: 100% !important;
    padding: 0 !important; margin: 0 !important;
  }
  /* 强制彩色背景与边框真正打印出来（否则会被浏览器默认省掉） */
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  /* 多列网格改单列堆叠，保证全部卡片完整、可读、不错位 */
  .dashboard, .row-2, .bottom-grid, .fly3-grid, .sc-grid, .xiji-grid,
  .year-grid, .eval-grid, .dict-grid { display: block !important; }
  .dashboard > div, .row-2 > div, .bottom-grid > div { margin-bottom: 12px !important; }
  /* 避免卡片被分页截断 */
  .card, .note-card, .warn-banner { break-inside: avoid; page-break-inside: avoid; }
  .card { box-shadow: none !important; }
}

/* ========== v24 移动端打磨（手机 / 小平板通用） ========== */
@media (max-width: 880px) {
  .title h1 { font-size: 22px; letter-spacing: 2px; }
  .title .sub { font-size: 14px; }
}
@media (max-width: 700px) {
  /* Tab 栏：换行 + 加大点按区域，避免 6 个标签在窄屏溢出 */
  .tabs { gap: 6px; }
  .tab-btn {
    flex: 1 1 calc(33.333% - 6px);
    min-height: 44px;
    padding: 10px 6px;
    font-size: 15px;
    letter-spacing: 1px;
    text-align: center;
  }
  /* 顶栏日期表单占满宽度，输入框自适应 */
  .topbar { padding: 12px 14px; }
  .date-form { width: 100%; }
  .date-form input[type=date] { flex: 1 1 auto; min-width: 0; }
}
@media (max-width: 560px) {
  html, body { font-size: 15px; }
  body { padding: 12px; }
  .card { padding: 14px; }
  .card h2 { font-size: 16px; }
  .card .body, .note-card .body { font-size: 15px; line-height: 1.7; }
  /* 统一加大可点元素，方便手指操作 */
  button, .cal-nav, .tab-btn, .date-form button, .today-btn { min-height: 42px; }
  .title h1 { font-size: 20px; }
  .title .sub { font-size: 12px; }
  /* 日历单元格进一步压缩 */
  .cal-cell { min-height: 56px; padding: 3px; gap: 0; }
  .cal-cell .cd .dnum { font-size: 15px; }
  .cal-cell .lunar { font-size: 11px; }
  .cal-cell .gz-row { font-size: 11px; }
  .cal-cell .jc, .cal-cell .tag-cal, .cal-cell .chong, .cal-cell .festival { font-size: 10px; }
  .cal-grid-head div { font-size: 13px; padding: 4px 0; }
  .dict-item { padding: 12px; }
}
@media (max-width: 420px) {
  .tab-btn { flex: 1 1 calc(50% - 6px); font-size: 14px; }
  /* 极窄屏只保留公历 + 农历，去掉次要行以免拥挤 */
  .cal-cell .gz-row, .cal-cell .jc { display: none; }
}


/* ================================================================
   通胜表格（v25 默认首页）—— 书本式日课详表
   ================================================================ */
#tableArea { display: block; }
.ts-page { max-width: 860px; margin: 0 auto; }
.ts-header { text-align: center; margin-bottom: 16px; }
.ts-header h1 {
  font-size: 26px; font-weight: 700; color: #6b3a16; letter-spacing: 6px;
  margin-bottom: 4px;
}
.ts-header p { font-size: 14px; color: #94784e; letter-spacing: 2px; }

.ts-card {
  background: #fffdf6;
  border: 1px solid #c9a96a66;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
}

/* 顶部信息 */
.ts-info-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
  margin-bottom: 12px;
}
.ts-label { color: #94784e; }
.ts-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.ts-tag {
  background: #f3ead2;
  border: 1px solid #c9a96a88;
  color: #6b3a16;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
}

/* 吉星所宜 / 凶星所忌 */
.ts-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ts-section-title {
  font-size: 15px; font-weight: 700; letter-spacing: 2px;
  padding-bottom: 8px; margin-bottom: 10px;
  border-bottom: 1px solid #c9a96a55;
}
.ts-good .ts-section-title { color: #2d8859; border-bottom-color: #2d885955; }
.ts-bad  .ts-section-title { color: #a83232; border-bottom-color: #a8323255; }
.ts-rows { display: flex; flex-direction: column; gap: 8px; }
.ts-row-item {
  display: grid; grid-template-columns: 72px 1fr auto;
  gap: 8px; align-items: center;
  font-size: 13px;
}
.ts-row-item b { color: #2b1810; font-weight: 700; }
.ts-desc { color: #94784e; font-size: 12px; }
.ts-yiji { font-size: 12px; text-align: right; }
.ts-yiji.good { color: #2d8859; }
.ts-yiji.bad  { color: #a83232; }
.ts-empty { color: #b0a58c; font-size: 13px; }

/* 九宫飞星（书本式 3×3） */
.ts-jg-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; max-width: 420px; margin: 0 auto 10px;
}
.ts-jg-cell {
  border: 1px solid #c9a96a88;
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  background: #fff;
}
.ts-jg-cell.center { border: 2px solid #a83232; background: #fdf3ec; }
.ts-jg-cell.bad  { border-color: #e8b3ad; background: #fdf4f2; }
.ts-jg-cell.good { border-color: #b8d8a8; background: #f4faf0; }
.ts-jg-pos { font-size: 12px; color: #94784e; }
.ts-jg-star { font-size: 26px; font-weight: 700; color: #2b1810; margin: 2px 0; }
.ts-jg-name { font-size: 13px; color: #6b3a16; }
.ts-jg-sha { font-size: 11px; margin-top: 4px; }
.ts-jg-sha.good { color: #2d8859; }
.ts-jg-sha.bad  { color: #a83232; }
.ts-jg-yiji { font-size: 11px; color: #94784e; margin-top: 2px; }
.ts-jg-center-title {
  text-align: center; font-size: 12px; color: #6b3a16;
  letter-spacing: 1px;
}

/* 选课宜 / 嫁娶宜 / 斗首 / 彭祖 */
.ts-tip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; font-size: 13px; }
.ts-tip-grid .ts-label { font-weight: 700; color: #6b3a16; margin-right: 6px; }

/* 十二时辰（连续文本式） */
.ts-shichen-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 28px; line-height: 2.1; }
.ts-row { font-size: 13px; }
.ts-row .ts-time { color: #94784e; }
.ts-row .ts-gz { color: #2b1810; }
.ts-row .ts-god { font-weight: 700; }
.ts-row.good .ts-god { color: #2d8859; }
.ts-row.bad  .ts-god { color: #a83232; }
.ts-row.mid  .ts-god { color: #b08a3e; }
.ts-row .ts-luck { font-weight: 700; }
.ts-row.good .ts-luck { color: #2d8859; }
.ts-row.bad  .ts-luck { color: #a83232; }
.ts-row.mid  .ts-luck { color: #b08a3e; }
.ts-row .ts-yiji { color: #94784e; font-size: 12px; }

@media (max-width: 700px) {
  .ts-two-col { grid-template-columns: 1fr; }
  .ts-info-grid { grid-template-columns: 1fr; }
  .ts-tip-grid { grid-template-columns: 1fr; }
  .ts-shichen-list { grid-template-columns: 1fr; }
  .ts-row-item { grid-template-columns: 64px 1fr; }
  .ts-row-item .ts-yiji { grid-column: 1 / -1; text-align: left; }
}
