/* ============================================================
   国学词典 · 站点样式 v3
   设计语言：素朴工具站（国潮低饱和）
   - 白/米白底 + 细线边框，去阴影、去渐变、去浮起
   - 朱砂红仅用于强调（当前栏目/主按钮/数字/标题条）
   - 三端自适应：PC / 平板(≤860px) / 手机(≤520px)
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: hidden; }
img, video { max-width: 100%; }

:root {
  --red: #B03A2E;
  --red-dark: #8E2B21;
  --ink: #2B2B2B;
  --ink-soft: #4A463D;
  --paper: #F6F3EC;
  --card: #FFFFFF;
  --line: #E6DFCE;
  --line-soft: #F0EADA;
  --muted: #8B8475;
  --tag-bg: #F4EFE3;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Helvetica Neue", Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.75;
  font-size: 15px;
}

a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-dark); }

.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ---------- 顶部 ---------- */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
.logo-seal {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 6px;
  background: var(--red); color: #fff;
  font-family: "KaiTi", "STKaiti", "SimSun", serif;
  font-size: 24px; font-weight: 700; line-height: 1;
  flex-shrink: 0;
}
.logo-text { line-height: 1.3; min-width: 0; }
.logo-text .cn { font-size: 20px; font-weight: 700; color: var(--ink); font-family: "SimSun", "Songti SC", serif; letter-spacing: 1px; }
.logo-text .cn a { color: var(--ink); }
.logo-text .sub { font-size: 11px; color: var(--muted); letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 导航（移动端横向滚动） ---------- */
.site-nav { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.site-nav .container { display: flex; flex-wrap: wrap; }
.site-nav a {
  display: inline-block; padding: 10px 14px; font-size: 15px; color: var(--ink-soft);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.site-nav a:hover { color: var(--red); }
.site-nav a.on { color: var(--red); border-bottom-color: var(--red); font-weight: 600; }

/* ---------- 面包屑 ---------- */
.crumb { padding: 12px 0 2px; font-size: 13px; color: var(--muted); }
.crumb a { color: var(--red); }
.crumb .sep { margin: 0 6px; color: #C9C2B0; }

/* ---------- 主体 ---------- */
main { padding-bottom: 36px; }
main .container { padding-top: 10px; }

.card {
  background: var(--card); border: 1px solid var(--line);
  padding: 18px 20px; margin-bottom: 14px;
}
h1 { font-size: 23px; margin-bottom: 10px; font-family: "SimSun", "Songti SC", serif; }
h2 {
  font-size: 16px; margin: 2px 0 10px; padding-left: 10px;
  border-left: 3px solid var(--red); color: var(--ink); font-weight: 700;
}

/* ---------- 详情页 Hero ---------- */
.hero {
  display: flex; align-items: center; gap: 22px;
  background: var(--card); border: 1px solid var(--line);
  padding: 24px 26px; margin-bottom: 14px;
}
.hero-char {
  font-family: "KaiTi", "STKaiti", "SimSun", serif;
  font-size: 92px; line-height: 1.1; color: var(--ink);
  letter-spacing: 4px; flex-shrink: 0;
}
.hero-char.small { font-size: 54px; letter-spacing: 2px; }
.hero-info { min-width: 0; flex: 1; }
.hero-pinyin { font-size: 24px; color: var(--red); font-weight: 700; margin-bottom: 2px; letter-spacing: 1px; }
.hero-sub { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.hero-tags .tag {
  display: inline-block; padding: 2px 10px; background: var(--tag-bg);
  border: 1px solid var(--line); border-radius: 3px; font-size: 13px; color: var(--ink-soft);
}
.hero-actions { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  display: inline-block; padding: 6px 15px; border-radius: 4px;
  background: var(--red); color: #fff !important; font-size: 14px;
}
.btn:hover { background: var(--red-dark); }
.btn.ghost { background: var(--card); color: var(--red) !important; border: 1px solid var(--red); }
.btn.ghost:hover { background: #FBF3EF; }

/* ---------- 信息表（移动端可横滑） ---------- */
.info-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.info-table td { padding: 8px 12px; border: 1px solid var(--line-soft); }
.info-table td:first-child {
  width: 110px; background: #F7F3E8; font-weight: 600; color: var(--ink-soft);
  white-space: nowrap; font-size: 14px;
}
.info-table td a { font-weight: 600; }

/* ---------- 释义正文 ---------- */
.dict-content { color: var(--ink-soft); }
.dict-content ol, .dict-content ul { padding-left: 24px; }
.dict-content li { margin: 4px 0; }
.dict-content p { margin: 6px 0; }
.dict-content .tip { color: var(--red); font-weight: 600; }
.dict-content img { max-width: 100%; }

/* ---------- 词/字链接块 ---------- */
.related-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.related-tags a {
  display: inline-block; padding: 3px 11px; background: var(--card);
  border: 1px solid var(--line); border-radius: 3px; font-size: 14px; color: var(--ink-soft);
}
.related-tags a:hover { border-color: var(--red); color: var(--red); background: #FDF8F4; }
.related-tags .more { color: var(--muted); font-size: 13px; }

/* ---------- 列表 ---------- */
.item-list { list-style: none; }
.item-list li { padding: 7px 2px; border-bottom: 1px dashed var(--line-soft); font-size: 15px; }
.item-list li:last-child { border-bottom: none; }
.item-list li a { font-size: 16px; font-weight: 500; }
.item-list li .sub { color: var(--muted); font-size: 13px; margin-left: 8px; }

.alpha-nav { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; }
.alpha-nav a {
  display: inline-block; min-width: 32px; text-align: center; padding: 4px 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 4px;
  font-size: 14px; color: var(--ink-soft);
}
.alpha-nav a:hover { border-color: var(--red); color: var(--red); }
.alpha-nav a.on { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }

.stat-badge {
  display: inline-block; padding: 2px 11px; background: var(--tag-bg);
  border: 1px solid var(--line); border-radius: 3px;
  font-size: 13px; color: var(--ink-soft); margin-left: 6px;
}

/* ---------- 首页 ---------- */
.hero-home {
  background: var(--card); border: 1px solid var(--line);
  padding: 28px 24px; margin-bottom: 14px; text-align: center;
}
.hero-home h1 { font-size: 28px; letter-spacing: 2px; font-family: "SimSun", "Songti SC", serif; }
.hero-home h1 em { font-style: normal; color: var(--red); }
.hero-home .slogan { color: var(--muted); font-size: 14px; margin-top: 4px; }
.stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 28px; margin: 18px 0 4px; }
.stats .num { font-size: 23px; font-weight: 700; color: var(--red); font-family: Georgia, serif; }
.stats .lbl { font-size: 13px; color: var(--muted); margin-left: 4px; }
.hero-search-links { margin-top: 18px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.hero-search-links .btn { font-size: 15px; padding: 8px 18px; }

.sec-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.sec-item {
  background: var(--card); border: 1px solid var(--line);
  padding: 14px 16px; display: block; color: var(--ink);
}
.sec-item:hover { border-color: var(--red); }
.sec-item .t { font-size: 16px; font-weight: 700; font-family: "SimSun", "Songti SC", serif; }
.sec-item .t .seal-dot { display: inline-block; width: 6px; height: 6px; background: var(--red); margin-right: 7px; vertical-align: 3px; }
.sec-item .d { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.6; }
.sec-item .n { font-size: 12px; color: var(--red); margin-top: 5px; }

.hot-chars { display: flex; flex-wrap: wrap; gap: 8px; }
.hot-chars a {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 6px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 4px;
  min-width: 52px;
}
.hot-chars a:hover { border-color: var(--red); }
.hot-chars .zi { font-family: "KaiTi", "STKaiti", "SimSun", serif; font-size: 28px; color: var(--ink); line-height: 1.2; }
.hot-chars .py { font-size: 12px; color: var(--red); }

/* ---------- 页脚 ---------- */
.site-footer { background: var(--ink); color: #B9B2A2; padding: 22px 0 26px; font-size: 13px; }
.site-footer .container { text-align: center; }
.site-footer .brand { font-size: 15px; color: #EFE9DA; font-family: "SimSun", serif; letter-spacing: 1px; margin-bottom: 4px; }
.site-footer a { color: #C9C2B0; }
.site-footer a:hover { color: #fff; }
.site-footer .flinks { margin-top: 6px; display: flex; flex-wrap: wrap; justify-content: center; gap: 3px 14px; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 56px 16px; }
.notfound .code { font-size: 60px; font-family: "SimSun", serif; color: var(--red); }
.notfound p { color: var(--muted); margin: 8px 0 20px; }

/* ============================================================
   三端自适应
   ============================================================ */
/* 平板及以下 */
@media (max-width: 860px) {
  .container { padding: 0 12px; }
  .sec-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 18px 16px; gap: 14px; }
  .hero-char { font-size: 60px; }
  .hero-char.small { font-size: 40px; }
  .hero-home { padding: 22px 14px; }
  .site-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .site-nav .container { flex-wrap: nowrap; min-width: max-content; }
  .site-nav a { padding: 9px 12px; font-size: 14px; }
  h1 { font-size: 20px; }
  .info-table td:first-child { width: 88px; font-size: 13px; }
  .info-table td { font-size: 14px; padding: 6px 8px; }
}

/* 手机 */
@media (max-width: 520px) {
  .container { padding: 0 10px; }
  .logo-text .cn { font-size: 18px; }
  .logo-seal { width: 36px; height: 36px; font-size: 21px; }
  .site-nav a { padding: 8px 10px; font-size: 13px; }
  .crumb { font-size: 12px; }
  .card { padding: 14px 12px; margin-bottom: 10px; }
  h2 { font-size: 15px; }

  /* 首页：统计 2x2、按钮 2 列、栏目 2 列 */
  .hero-home { padding: 18px 8px; }
  .hero-home h1 { font-size: 24px; }
  .hero-home .slogan { font-size: 12px; }
  .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin: 14px 0 0; }
  .stats .num { font-size: 20px; }
  .hero-search-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
  .hero-search-links .btn { font-size: 14px; padding: 9px 6px; text-align: center; }
  .sec-grid { gap: 8px; }
  .sec-item { padding: 11px 12px; }
  .sec-item .t { font-size: 15px; }
  .sec-item .d { font-size: 11.5px; }

  /* 详情页 Hero：纵向排列 */
  .hero { flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px 12px; }
  .hero-char { font-size: 52px; }
  .hero-char.small { font-size: 36px; }
  .hero-pinyin { font-size: 20px; }
  .hero-tags .tag { font-size: 12px; padding: 1px 8px; }
  .hero-actions .btn { font-size: 13px; padding: 6px 12px; }
  .hero-sub { font-size: 12px; }

  /* 热门汉字：每行 6 个 */
  .hot-chars { gap: 6px; }
  .hot-chars a { min-width: 0; flex: 1 1 calc(16.666% - 6px); padding: 5px 2px; }
  .hot-chars .zi { font-size: 24px; }
  .hot-chars .py { font-size: 10px; }

  /* 信息表防溢出 */
  .info-table { display: block; overflow-x: auto; white-space: nowrap; }
  .info-table td { padding: 7px 8px; }
  .info-table td:first-child { width: 76px; }

  .alpha-nav a { min-width: 28px; padding: 3px 6px; font-size: 13px; }
  .related-tags a { font-size: 13px; padding: 3px 9px; }
  .item-list li a { font-size: 15px; }
  .site-footer { font-size: 12px; padding: 16px 0 20px; }
}
