/*!
 * style.css —— 2027 中国 × 印尼假期对照
 *
 * 排版原则：
 *   1. 字号整体偏大、对比度偏高，小字（农历、节气、清单）也保持 11px 以上，便于老年读者阅读；
 *   2. 块与块之间的外边距收紧，把空间留给内容本身；
 *   3. 假期用「细单色框 / 细双色框 + 前置标记（中·印·同）」表示。
 *
 * 目录：
 *   01 设计变量
 *   02 基础与排版
 *   03 页面容器与按钮
 *   04 页头
 *   05 最近节假日倒计时
 *   05b 热门节日快捷入口
 *   06 数据状态提示条
 *   07 全年统计
 *   08 工具条（图例 / 控件）
 *   09 日期详情
 *   10 月卡与网格
 *   11 日期单元格（公历 + 农历 + 假期状态）
 *   12 月卡清单
 *   13 说明与页脚
 *   14 词条索引
 *   15 词条介绍页
 *   15b 词条页：题图 / 直答 / 问答
 *   16 响应式
 *   17 打印
 */

/* ============================ 00 全站 header ============================ */
.site-header {
  position: relative;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.site-header::before,
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
}

.site-header::before {
  top: 0;
  background: linear-gradient(90deg, var(--cn) 0%, var(--cn) 50%, var(--id) 50%, var(--id) 100%);
}

.site-header::after {
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, transparent 49.5%, var(--line) 49.5%, var(--line) 50.5%, transparent 50.5%, transparent 100%);
  height: 1px;
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 16px;
}

.site-header__brand {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  color: inherit;
  text-decoration: none;
  font-size: 15px;
}

.site-header__brand:hover {
  text-decoration: none;
  color: var(--id);
}

.site-header__brand-mark {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -.01em;
  color: var(--ink);
}

.site-header__brand-sep {
  color: var(--faint);
}

.site-header__brand-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
}

.site-header__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-size: 12.5px;
}

.site-header__year {
  padding: 2px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg);
  font-weight: 700;
  color: var(--ink-soft);
}
:root {
  --ink: #0f172a;
  --ink-soft: #3f4c5f;
  --muted: #5b6b80;   /* 小字用色：比常规灰色更深，保证对比度 */
  --faint: #94a3b8;   /* 装饰性文字与线条 */

  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --bg: #f5f7fa;
  --card: #fff;

  --cn: #d92b2b;
  --cn-soft: #fef4f4;
  --cn-ink: #991b1b;

  --id: #2563eb;
  --id-soft: #f4f8ff;
  --id-ink: #1d4ed8;

  --cuti-soft: #f4f8ff;
  --both: #7c3aed;
  --both-ink: #5b21b6;

  --term: #0f766e;
  --festival: #b91c1c;

  --frame: 1.5px;      /* 假期状态框线粗细 */

  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 2px rgb(15 23 42 / 5%);
  --shadow-lg: 0 6px 18px rgb(15 23 42 / 8%);
}

/* ========================== 02 基础与排版 ========================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: var(--id);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

select {
  font: inherit;
}

time {
  font-variant-numeric: tabular-nums;
}

/* ========================= 03 页面容器与按钮 ========================= */
.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 16px 26px;
}

.button {
  padding: 7px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
}

.button:hover {
  background: #f8fafc;
}

a.button {
  display: inline-block;
  color: inherit;
  text-decoration: none;
}

a.button:hover {
  text-decoration: none;
}

.load-error {
  margin: 20px 0;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  background: #fef2f2;
  color: var(--cn-ink);
  font-weight: 600;
}

/* ============================= 04 页头 ============================= */
.page-header {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 14px;
  padding: 14px 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, #fff 0%, #fbfcfe 100%),
    linear-gradient(90deg, #d92b2b 0 22px, transparent 22px 100%),
    linear-gradient(270deg, #2563eb 0 22px, transparent 22px 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.page-header::before,
.page-header::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 6px;
}

.page-header::before {
  left: 0;
  background: linear-gradient(180deg, var(--cn) 0%, #ef4444 100%);
  border-top-left-radius: var(--radius-lg);
  border-bottom-left-radius: var(--radius-lg);
}

.page-header::after {
  right: 0;
  background: linear-gradient(180deg, var(--id) 0%, #60a5fa 100%);
  border-top-right-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

.page-header__text {
  min-width: 0;
}

.page-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--cn);
}

.eyebrow__ganzhi {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--muted);
}

.eyebrow__ganzhi:empty {
  display: none;
}

.lead {
  margin-top: 5px;
  font-size: 15px;
  color: var(--ink-soft);
}

/* ======================= 05 页头内嵌倒计时 ======================= */
/* 倒计时（最近假期）并入页头大卡片；items/item 系列样式见下方 */
.page-header__countdown {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--cn);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.countdown__items {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 30px;
}

.countdown__item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.countdown__item-label {
  flex: none;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--cn);
  font-size: 12.5px;
  font-weight: 800;
  color: #fff;
}

.countdown__item--holiday .countdown__item-label {
  background: var(--cn);
}

.countdown__item-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-soft);
}

.countdown__item-text b {
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  color: var(--cn);
  font-variant-numeric: tabular-nums;
}

.countdown__item-text a {
  color: inherit;
}

.countdown__meta {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.countdown__meta a {
  font-weight: 700;
}

/* 仅供屏幕阅读器与搜索引擎的隐藏标题 */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ==================== 05b 热门节日快捷入口 ==================== */
/* 紧凑两行布局：≥768px 固定 3 列（6 张卡 = 2 行），卡片内 名称与日期 同行 */
.featured {
  margin-bottom: 12px;
  padding: 12px 14px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
}

.featured__title {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
}

.featured__lead {
  margin-top: 3px;
  font-size: 13px;
  color: var(--muted);
}

.featured__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.featured-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 1px 8px;
  min-width: 0;
  padding: 7px 11px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.featured-card:hover {
  border-color: var(--line-strong);
  background: #f8fafc;
  box-shadow: var(--shadow);
  text-decoration: none;
}

.featured-card--cn {
  border-left: 3px solid var(--cn);
}

.featured-card--id {
  border-left: 3px solid var(--id);
}

.featured-card__cat {
  grid-column: 1 / -1;
  overflow: hidden;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.featured-card--cn .featured-card__cat {
  color: var(--cn-ink);
}

.featured-card--id .featured-card__cat {
  color: var(--id-ink);
}

.featured-card__name {
  overflow: hidden;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.featured-card__date {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.featured-card__desc {
  grid-column: 1 / -1;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* ======================= 06 数据状态提示条 ======================= */
.notices {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.notice {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.notice--cn {
  border-left-color: var(--cn);
  background: #fffafa;
}

.notice--id {
  border-left-color: var(--id);
  background: #fafcff;
}

.notice strong {
  color: var(--ink);
}

/* =========================== 07 全年统计 =========================== */
.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.stat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.stat:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.stat__body {
  min-width: 0;
}

.stat__label {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-soft);
}

.stat__value {
  margin-top: 3px;
  font-size: 29px;
  font-weight: 900;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.stat__value small {
  margin-left: 2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.stat__hint {
  margin-top: 3px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

.stat__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
}

.stat__icon svg {
  width: 30px;
  height: 30px;
}

.stat--cn .stat__value {
  color: var(--cn);
}

.stat--cuti .stat__value,
.stat--id .stat__value {
  color: var(--id);
}

.stat--both .stat__value {
  color: var(--both);
}

.stat--cn .stat__icon {
  background: #fef4f4;
  color: var(--cn);
}

.stat--id .stat__icon {
  background: #f4f8ff;
  color: var(--id);
}

.stat--cuti .stat__icon {
  background: #f4f8ff;
  color: #60a5fa;
}

.stat--both .stat__icon {
  background: linear-gradient(135deg, #fef4f4 0 50%, #f4f8ff 50% 100%);
  color: var(--both);
}

/* ====================== 08 工具条（图例 / 控件） ====================== */
.board {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
}

.board__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 18px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 14px;
  color: var(--ink-soft);
}

.legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend li.is-off {
  opacity: .45;
  text-decoration: line-through;
}

.key {
  flex: none;
  width: 14px;
  height: 14px;
  border: var(--frame) solid transparent;
  border-radius: 4px;
}

.key--cn {
  border-color: var(--cn);
  background: var(--cn-soft);
}

.key--id {
  border-color: var(--id);
  background: var(--id-soft);
}

.key--cuti {
  border-style: dashed;
  border-color: var(--id);
  background: var(--cuti-soft);
}

.key--both {
  background:
    linear-gradient(#fdfbff, #fdfbff) padding-box,
    linear-gradient(135deg, var(--cn) 0 50%, var(--id) 50% 100%) border-box;
}

.key--festival {
  border: 0;
  background: var(--festival);
}

.key--term {
  border: 0;
  background: var(--term);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.control {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.control--check {
  cursor: pointer;
  user-select: none;
}

.control__label {
  color: var(--muted);
}

.select {
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--card);
  font-size: 14px;
}

.control input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--id);
}

/* =========================== 09 日期详情 =========================== */
.day-detail {
  position: sticky;
  top: 10px;
  z-index: 3;
  display: grid;
  gap: 5px;
  margin: 10px 12px 0;
  padding: 10px 34px 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #f8fafc;
  box-shadow: var(--shadow-lg);
  font-size: 14.5px;
  color: var(--ink-soft);
}

.day-detail--empty {
  padding-right: 12px;
  color: var(--muted);
  box-shadow: var(--shadow);
}

.day-detail__close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--card);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  color: var(--muted);
}

.day-detail__close:hover {
  background: #eef2f7;
  color: var(--ink);
}

.day-detail__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}

.day-detail__head span {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
}

.day-detail__row {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 10px;
}

.day-detail__field {
  flex: none;
  min-width: 44px;
  font-weight: 700;
  color: var(--muted);
}

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

.chip {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: #eef2f7;
  color: var(--ink-soft);
}

.chip--cn {
  background: #fee2e2;
  color: var(--cn-ink);
}

.chip--id {
  background: #dbeafe;
  color: var(--id-ink);
}

.chip--cuti {
  background: var(--cuti-soft);
  color: var(--id-ink);
  box-shadow: inset 0 0 0 1px #bfdbfe;
}

.chip--festival {
  background: #fee2e2;
  color: var(--festival);
}

.chip--term {
  background: #ccfbf1;
  color: var(--term);
}

a.chip,
.inline-link {
  text-decoration: none;
}

a.chip:hover {
  filter: brightness(.96);
  text-decoration: none;
}

.chip--link {
  cursor: pointer;
}

.inline-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 2px;
}

.inline-link:hover {
  color: var(--id);
  text-decoration-color: currentColor;
}

/* ========================= 10 月卡与网格 ========================= */
/* 月卡最多 3 列，12 个月正好排成 3 × 4 */
.months {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
}

.month {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  scroll-margin-top: 74px; /* 供词条页"在月历中查看"跳转时避开吸顶的详情面板 */
}

.month__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 8px;
  margin-bottom: 6px;
}

.month__title {
  font-size: 17px;
  font-weight: 800;
}

.month__lunar {
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
  text-align: right;
}

.month__week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin-bottom: 3px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

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

.month__pad {
  height: 52px;
}

/* ==================== 11 日期单元格（公历 + 农历） ==================== */
.day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  height: 52px;
  padding: 2px 1px;
  border: var(--frame) solid transparent; /* 假期状态用细「单色框 / 双色框」表示 */
  border-radius: 7px;
  text-align: center;
}

.day:hover {
  filter: brightness(.96);
}

/* 假期状态：单色框 = 单国放假，双色框 = 两国同日（只用边框颜色区分，不带文字标记） */
.day__num {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.day__lunar--month {
  font-weight: 700;
  color: var(--ink-soft);
}

.day__lunar--term {
  font-weight: 700;
  color: var(--term);
}

.day__lunar--festival {
  font-weight: 800;
  color: var(--festival);
}

.day__lunar {
  max-width: 100%;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
}

/* 周末：浅粉底；与假期同日时，后方的假期底色规则会覆盖粉色 */
.day--weekend {
  background: #fff7f7;
}

.day--weekend .day__num {
  color: var(--faint);
}

.day--cn {
  border-color: var(--cn);
  background: var(--cn-soft);
}

.day--id {
  border-color: var(--id);
  background: var(--id-soft);
}

/* 印尼共同休假同属印尼一侧，用虚线框与法定假日区分 */
.day--cuti {
  border-style: dashed;
  border-color: var(--id);
  background: var(--cuti-soft);
}

/* 两国同日：红蓝双色框（padding-box 铺底色，border-box 显渐变） */
.day--both {
  border-color: transparent;
  background:
    linear-gradient(#fdfbff, #fdfbff) padding-box,
    linear-gradient(135deg, var(--cn) 0 50%, var(--id) 50% 100%) border-box;
}

.day--cn .day__num {
  color: var(--cn-ink);
}

.day--cuti .day__num,
.day--id .day__num {
  color: var(--id-ink);
}

.day--both .day__num {
  color: var(--both-ink);
}

.day--today {
  box-shadow: inset 0 0 0 1.5px rgb(15 23 42 / 30%);
}

.day.is-selected {
  box-shadow: 0 0 0 2px var(--ink);
}

/* ========================== 12 月卡清单 ========================== */
.month__summary {
  display: grid;
  gap: 3px;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.5;
}

.summary-row {
  display: flex;
  gap: 6px;
}

.summary-row__text {
  color: var(--ink-soft);
}

.tag {
  flex: none;
  width: 19px;
  height: 19px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 19px;
  color: #fff;
  text-align: center;
}

.tag--both {
  background: linear-gradient(135deg, var(--cn) 50%, var(--id) 50%);
}

.tag--cn {
  background: var(--cn);
}

.tag--id {
  background: var(--id);
}

.tag--festival {
  background: var(--festival);
}

.tag--term {
  background: var(--term);
}

/* ========================= 13 说明与页脚 ========================= */
/* 阅读方式两条已并入 .site-footer（见 site-footer__source 行） */

/* ===================== 2026 年假期回顾 ===================== */
.archive {
  margin-top: 12px;
  padding: 14px 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
}

.archive__title {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}

.archive__note {
  margin-top: 6px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--muted);
}

.archive__group {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.archive__group-title {
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-size: 15.5px;
  font-weight: 800;
  color: var(--ink);
}

.archive__group--cn {
  border-left: 3px solid var(--cn);
}

.archive__group--id {
  border-left: 3px solid var(--id);
}

.archive__group--cuti {
  border-left: 3px solid #60a5fa;
}

.archive-list {
  margin: 8px 0 0;
  padding-left: 26px;
  list-style: decimal;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--ink-soft);
}

.archive-list li {
  padding-left: 4px;
}

.archive-list li::marker {
  color: var(--muted);
  font-weight: 700;
}

/* ============================ 页脚 ============================ */
.site-footer {
  margin-top: 16px;
  padding: 16px 20px 18px;
  border-top: 1px solid var(--line);
  background:
    linear-gradient(180deg, #fff 0%, #f8fafc 100%),
    linear-gradient(90deg, var(--cn) 0 50%, var(--id) 50% 100%);
  background-size: 100% 100%, 100% 3px;
  background-repeat: no-repeat;
  background-position: 0 0, 0 0;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--muted);
}

.site-footer__brand {
  font-size: 15.5px;
  font-weight: 900;
  letter-spacing: .01em;
  color: var(--ink);
}

.site-footer__brand::before {
  content: "·";
  margin-right: 6px;
  color: var(--cn);
  font-weight: 900;
}

/* 品牌句的后缀备注：小一号浅色，与前段大字深色形成层次 */
.site-footer__brand-note {
  margin-left: 3px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--faint);
}

.site-footer__meta {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}

.site-footer__source {
  display: block;
  margin-top: 5px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

.site-footer__source-key {
  font-weight: 700;
  color: var(--ink-soft);
}

.site-footer a {
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 2px;
}

.site-footer a:hover {
  color: var(--id);
  text-decoration-color: currentColor;
}

/* ========================= 14 词条索引 ========================= */
.topics {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
}

.topics__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}

.topics__title {
  font-size: 18px;
  font-weight: 800;
}

.topics__note {
  font-size: 13.5px;
  font-weight: 400;
  color: var(--muted);
}

.topics__groups {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.topic-group__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line);
  font-size: 15.5px;
  font-weight: 800;
}

.topic-group__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f1f5f9;
}

.topic-group__icon svg {
  width: 20px;
  height: 20px;
}

.topic-group--cn .topic-group__icon {
  background: #fef4f4;
  color: var(--cn);
}

.topic-group--id .topic-group__icon {
  background: #f4f8ff;
  color: var(--id);
}

.topic-group--lunar .topic-group__icon {
  background: #fef3c7;
  color: #b45309;
}

.topic-group--term .topic-group__icon {
  background: #ccfbf1;
  color: var(--term);
}

.topic-group__label {
  flex: none;
}

.topic-group__count {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin-left: auto;
}

.topic-group__note {
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.topic-group__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  margin-top: 9px;
}

.topic-card {
  display: grid;
  gap: 3px;
  height: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.topic-card:hover {
  border-color: var(--line-strong);
  background: #f8fafc;
  box-shadow: var(--shadow);
  text-decoration: none;
}

.topic-card__name {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--ink);
}

.topic-card__meta {
  font-size: 12.5px;
  color: var(--muted);
}

.topic-card__summary {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.topic-group--cn .topic-card {
  border-left: 3px solid var(--cn);
}

.topic-group--id .topic-card {
  border-left: 3px solid var(--id);
}

.topic-group--lunar .topic-card {
  border-left: 3px solid #d97706;
}

.topic-group--term .topic-card {
  border-left: 3px solid var(--term);
}

/* ========================= 15 词条介绍页 ========================= */
.topic-page .page {
  max-width: 900px;
}

.topic-page__hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-soft);
}

.topic-page__hero-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.topic-page__hero-icon svg {
  width: 22px;
  height: 22px;
}

.topic-page__hero-label {
  letter-spacing: .02em;
}

.topic-page__hero-link {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
}

.topic-page__hero-link:hover {
  color: var(--id);
  text-decoration: underline;
}

.topic-page__hero--cn {
  background: #fff8f8;
  border-color: #fecaca;
  color: var(--cn-ink);
}

.topic-page__hero--cn .topic-page__hero-icon {
  background: #fee2e2;
  color: var(--cn);
}

.topic-page__hero--id {
  background: #f6f9ff;
  border-color: #bfdbfe;
  color: var(--id-ink);
}

.topic-page__hero--id .topic-page__hero-icon {
  background: #dbeafe;
  color: var(--id);
}

.topic-page__hero--lunar {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}

.topic-page__hero--lunar .topic-page__hero-icon {
  background: #fef3c7;
  color: #b45309;
}

.topic-page__hero--term {
  background: #f0fdfa;
  border-color: #99f6e4;
  color: var(--term);
}

.topic-page__hero--term .topic-page__hero-icon {
  background: #ccfbf1;
  color: var(--term);
}

.topic-page[data-category="cn"] .eyebrow {
  color: var(--cn);
}

.topic-page[data-category="id"] .eyebrow {
  color: var(--id);
}

.topic-page[data-category="lunar"] .eyebrow {
  color: #b45309;
}

.topic-page[data-category="term"] .eyebrow {
  color: var(--term);
}

.topic-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 13.5px;
  color: var(--muted);
}

.topic-crumbs a {
  color: var(--ink-soft);
}

.topic-header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.topic-title {
  margin-top: 6px;
  font-size: 31px;
  font-weight: 900;
  letter-spacing: -.01em;
  line-height: 1.2;
}

.topic-title__alt {
  display: block;
  margin-top: 3px;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
}

.topic-lead {
  margin-top: 8px;
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--ink-soft);
}

.topic-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.topic-tags li {
  padding: 2px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
}

.topic-year {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #f8fafc;
}

.topic-year__note {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.topic-section {
  margin-top: 18px;
}

.topic-section__title {
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line);
  font-size: 17px;
  font-weight: 800;
}

.topic-text {
  margin-top: 8px;
  font-size: 16px;
  line-height: 1.9;
  color: var(--ink-soft);
}

.topic-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.topic-list li {
  position: relative;
  padding-left: 18px;
  font-size: 15.5px;
  line-height: 1.8;
  color: var(--ink-soft);
}

.topic-list li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 11px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--line-strong);
}

.topic-facts {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.topic-facts > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 10px;
}

.topic-facts dt {
  flex: none;
  min-width: 84px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--muted);
}

.topic-facts dd {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink);
}

.topic-sources {
  display: grid;
  gap: 5px;
  margin-top: 8px;
  padding-left: 22px;
  list-style: decimal;
}

.topic-sources li {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.topic-links {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  margin-top: 8px;
}

.topic-links a {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
}

.topic-links a:hover {
  border-color: var(--line-strong);
  background: #f8fafc;
  text-decoration: none;
}

.topic-links span {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--muted);
}

.topic-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-top: 18px;
}

.topic-pager .button {
  flex: 1 1 auto;
  text-align: center;
}

/* ================== 15b 词条页：题图 / 直答 / 问答 ================== */
.topic-hero {
  margin: 10px 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg);
  overflow: hidden;
}

.topic-hero img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
}

/* 「直答」摘要：词条页首屏直接给出当年日期答案 */
.topic-lead__answer {
  margin-top: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  border-radius: var(--radius);
  background: #f8fafc;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.7;
  color: var(--ink);
}

.topic-page[data-category="cn"] .topic-lead__answer {
  border-left-color: var(--cn);
  background: #fffafa;
}

.topic-page[data-category="id"] .topic-lead__answer {
  border-left-color: var(--id);
  background: #fafcff;
}

.topic-page[data-category="lunar"] .topic-lead__answer {
  border-left-color: #d97706;
  background: #fffbeb;
}

.topic-page[data-category="term"] .topic-lead__answer {
  border-left-color: var(--term);
  background: #f0fdfa;
}

.topic-faqs {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

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

.topic-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  border-radius: var(--radius);
}

.topic-faq summary::-webkit-details-marker {
  display: none;
}

.topic-faq summary::after {
  content: "+";
  flex: none;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
  color: var(--muted);
}

.topic-faq[open] summary::after {
  content: "−";
}

.topic-faq[open] summary {
  border-bottom: 1px solid var(--line);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.topic-faq summary:hover {
  background: #f8fafc;
}

.topic-faq p {
  margin: 0;
  padding: 10px 12px;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--ink-soft);
}

/* =========================== 16 响应式 =========================== */
@media (max-width: 420px) {
  .day__lunar {
    font-size: 10.5px;
  }
}

@media (min-width: 640px) {
  .months {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .notices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .featured__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .topic-group__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topic-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1152px) {
  .months {
    /* 上限 3 列（12 个月 = 3 × 4），同时保证日期格足够宽，农历文字不折行 */
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .topic-group__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ============================ 17 打印 ============================ */
@page {
  margin: 12mm;
}

@media print {
  body {
    background: #fff;
    font-size: 15px;
  }

  .page {
    max-width: none;
    padding: 0;
  }

  #print,
  .controls,
  .day-detail,
  .topics,
  .stat__icon,
  .topic-group__icon,
  .topic-page__hero,
  .topic-hero,
  .topic-section--faqs,
  .page-header::before,
  .page-header::after,
  .site-header::before,
  .site-header::after,
  .site-footer::before,
  .site-footer::after {
    display: none !important;
  }

  .site-header {
    border: 0;
    background: #fff;
    padding: 0 0 6px;
    border-bottom: 1px solid var(--line);
  }

  .site-footer {
    background: #fff;
    border-top: 1px solid var(--line);
    margin-top: 8px;
    padding: 8px 0 0;
  }

  .site-footer__brand::before {
    display: none;
  }

  .page-header {
    border: 0;
    background: #fff;
    box-shadow: none;
    padding: 0 0 6px;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }

  .stat,
  .topic-card {
    border-color: var(--line);
    box-shadow: none;
  }

  .board {
    border: 0;
    box-shadow: none;
  }

  .board__toolbar {
    padding: 0 0 6px;
    border-bottom: 0;
  }

  .months {
    /* A4 上用 2 列，日期格更宽，农历与小字更清楚 */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0;
  }

  .month,
  .site-footer,
  .page-header__countdown {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* 打印时倒计时随页头平铺为纯文本 */
  .page-header__countdown {
    border: 0;
    background: none;
    padding: 0;
    margin-top: 4px;
  }

  .page-header__countdown .countdown__item-text b {
    font-size: 15px;
  }

  .day,
  .month__pad {
    height: 40px;
  }

  .day__lunar {
    font-size: 9.5px;
  }

  .site-footer {
    margin-top: 8px;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
