/* ==========================================================
   宏渊观澜 · 格物致知 — 宋明高雅文艺风格
   设计语言：宣纸素底 · 浓墨淡墨 · 朱砂点睛 · 大量留白 · 细线分隔
   ========================================================== */

:root {
  /* 纸墨 */
  --paper: #f7f2e8;           /* 宣纸素底 */
  --paper-2: #efe7d7;         /* 旧纸 */
  --paper-light: #fffdf8;     /* 新纸 / 卡片底 */
  --ink: #2a2318;             /* 浓墨 */
  --ink-soft: #5c5346;        /* 淡墨 */
  --ink-faint: #9a8d75;       /* 虚墨 */
  --line: #ddd2bd;            /* 细线 */

  /* 点缀 */
  --seal: #a63a2e;            /* 朱砂·印章（唯一强调色） */
  --seal-deep: #7c2418;
  --earth: #8b5e3c;           /* 赭石 */
  --qing: #3a5a4a;            /* 黛青 */
  --gold: #b8963c;            /* 古金 */

  /* 兼容旧引用 */
  --fire: var(--seal);
  --fire-deep: var(--seal-deep);
  --wood: var(--qing);
  --wood-deep: #2a4638;
  --metal: var(--gold);
  --metal-deep: #8a6d1f;
  --teal: var(--qing);
  --jade: var(--qing);

  --shadow: 0 2px 14px rgba(90, 70, 40, 0.08);
  --radius: 10px;

  --serif: "STKaiti", "KaiTi", "Songti SC", "SimSun", "STSong", Georgia, serif;
  --sans: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background:
    radial-gradient(ellipse at 50% -10%, rgba(166, 58, 46, 0.03), transparent 55%),
    var(--paper);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.7;
}

::selection { background: rgba(166, 58, 46, 0.16); }

/* ==========================================================
   顶栏 — 素纸 · 细线 · 朱砂印
   ========================================================== */
.site-header {
  background: rgba(247, 242, 232, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 13px; }

.brand-seal {
  width: 44px; height: 44px;
  flex-shrink: 0;
  background: var(--seal);
  color: var(--paper-light);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700;
  font-family: var(--serif);
  box-shadow: inset 0 0 0 2px rgba(255, 253, 248, 0.32);
}

.brand-text h1 {
  font-size: 21px;
  font-family: var(--serif);
  letter-spacing: 4px;
  color: var(--ink);
  line-height: 1.2;
}

.brand-text p {
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 3px;
  margin-top: 2px;
}

/* 导航：细线底边 · 朱砂激活 */
.main-tabs { display: flex; gap: 4px; flex-wrap: wrap; }

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--ink-soft);
  padding: 8px 15px;
  font-size: 14.5px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--serif);
  letter-spacing: 4px;
}

.tab-btn:hover { color: var(--ink); }

.tab-btn.active {
  color: var(--seal);
  border-bottom-color: var(--seal);
  font-weight: 700;
}

/* ==========================================================
   面板与 Hero
   ========================================================== */
.panel { display: none; }
.panel.active { display: block; animation: fadeIn 0.35s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.hero {
  text-align: center;
  padding: 52px 24px 40px;
}

.hero-inner { max-width: 720px; margin: 0 auto; }

.ban-seal {
  display: inline-block;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 8px;
  padding: 5px 14px 5px 22px;   /* 左补空格以平衡字距 */
  color: var(--seal);
  border: 1px solid var(--seal);
  border-radius: 4px;
}

.hero-title {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--ink);
  margin-top: 24px;
}

.hero-sub {
  margin-top: 12px;
  color: var(--ink-faint);
  font-size: 13.5px;
  letter-spacing: 4px;
}

/* 内容容器 */
.panel-body {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px 56px;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 40px 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.section-head h3 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--ink);
}

.orn { color: var(--seal); margin-right: 2px; }

.badge {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--ink-faint);
  border: 1px solid var(--line);
  padding: 1px 9px;
  border-radius: 999px;
  letter-spacing: 1px;
}

/* ==========================================================
   每日一卦
   ========================================================== */
.qian-card {
  max-width: 560px;
  margin: 4px auto 0;
  text-align: center;
  background: var(--paper-light);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 40px 32px 34px;
}

.qian-tag {
  font-size: 12.5px;
  color: var(--ink-faint);
  letter-spacing: 3px;
  margin-bottom: 20px;
}

.qian-gua {
  font-size: 92px;
  line-height: 1;
  color: var(--seal);
  margin-bottom: 16px;
  font-family: var(--serif);
}

.qian-name {
  font-size: 21px;
  font-weight: 700;
  color: var(--ink);
  font-family: var(--serif);
  letter-spacing: 3px;
  margin-bottom: 14px;
}

.qian-ci {
  font-size: 15.5px;
  color: var(--earth);
  font-family: var(--serif);
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.qian-jie {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.9;
  max-width: 420px;
  margin: 0 auto 16px;
}

.qian-note {
  font-size: 11.5px;
  color: var(--ink-faint);
  letter-spacing: 1px;
  margin-bottom: 22px;
}

.qian-actions { display: flex; justify-content: center; }

.qian-btn {
  padding: 9px 26px;
  background: transparent;
  color: var(--seal);
  border: 1px solid var(--seal);
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--serif);
  letter-spacing: 3px;
}

.qian-btn:hover { background: var(--seal); color: var(--paper-light); }

/* ==========================================================
   先天八卦图
   ========================================================== */
.bagua-wrap {
  display: flex;
  justify-content: center;
  margin: 4px 0 8px;
}

.bagua-svg {
  max-width: 340px;
  width: 100%;
  height: auto;
}

/* ==========================================================
   话题卡片
   ========================================================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 14px;
}

.tcard {
  position: relative;
  display: block;
  background: var(--paper-light);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px 40px;
  text-decoration: none;
  transition: all 0.2s;
}

.tcard:hover {
  border-color: var(--seal);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.tcard-name {
  font-family: var(--serif);
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--ink);
}

.tcard-desc {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.tcard-arrow {
  position: absolute;
  right: 16px;
  bottom: 12px;
  font-size: 15px;
  color: var(--ink-faint);
  transition: all 0.2s;
}

.tcard:hover .tcard-arrow { color: var(--seal); transform: translateX(3px); }

/* ==========================================================
   经典专题入口
   ========================================================== */
.topic-entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.topic-entry {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--paper-light);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  text-decoration: none;
  transition: all 0.2s;
}

.topic-entry:hover { border-color: var(--seal); box-shadow: var(--shadow); }

.entry-seal {
  width: 52px; height: 52px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--seal);
  color: var(--paper-light);
  border-radius: 8px;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
}

.entry-body { flex: 1; }

.entry-name {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--ink);
}

.entry-sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }

.entry-quote {
  font-family: var(--serif);
  font-size: 12.5px;
  color: var(--earth);
  margin-top: 8px;
}

.entry-meta { font-size: 11.5px; color: var(--ink-faint); margin-top: 6px; }

.entry-arrow { font-size: 16px; color: var(--ink-faint); }

/* ==========================================================
   道宗（宏渊 著 · 格物之纲 · 法道之枢）
   彰显地位：大字标题 · 双线描框 · 序章朱砂
   彰显秩序：章序统一 · 义理加粗 · 金句居中
   ========================================================== */
.dao-article {
  position: relative;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(166, 58, 46, 0.05), transparent 55%),
    var(--paper-light);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 48px 46px 50px;
  margin: 8px 0 34px;
  line-height: 2.1;
  font-size: 14.5px;
  color: var(--ink-soft);
  box-shadow: inset 0 0 0 4px var(--paper-light), inset 0 0 0 5px rgba(166, 58, 46, 0.18), var(--shadow);
}

/* 顶部天地双线 */
.dao-article::before {
  content: "";
  position: absolute;
  top: 12px; left: 46px; right: 46px;
  border-top: 1px solid rgba(166, 58, 46, 0.4);
}

/* ---------- 文章头：题名区 ---------- */
.dao-hero {
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 6px 6px 30px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.dao-seal {
  flex-shrink: 0;
  width: 74px;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--seal);
  color: var(--paper-light);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(124, 36, 24, 0.25);
}

.dao-hero-txt { flex: 1; min-width: 0; }

.dao-title {
  font-family: var(--serif);
  font-size: 52px;
  font-weight: 700;
  letter-spacing: 24px;
  line-height: 1.25;
  color: var(--ink);
  text-indent: 8px; /* 抵消末字字距留白，视觉居中 */
}

.dao-sub {
  margin-top: 6px;
  font-size: 13px;
  letter-spacing: 6px;
  color: var(--earth);
  font-family: var(--serif);
}

.dao-author {
  flex-shrink: 0;
  text-align: center;
  padding: 0 10px;
}

.dao-author-name {
  display: inline-block;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--seal);
  border: 1.6px solid var(--seal);
  border-radius: 6px;
  padding: 3px 14px;
}

.dao-author-note {
  display: block;
  margin-top: 9px;
  font-size: 10.5px;
  letter-spacing: 1px;
  color: var(--ink-faint);
  writing-mode: vertical-rl;
  max-height: 96px;
  text-align: left;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- 章标题：序 + 名 ---------- */
.dao-h {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 5px;
  color: var(--ink);
  margin: 34px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
}

.dao-h span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: var(--seal);
  color: var(--paper-light);
  border-radius: 50%;
  font-size: 15px;
  font-family: var(--serif);
  letter-spacing: 0;
  box-shadow: 0 2px 6px rgba(124, 36, 24, 0.2);
}

.dao-article p {
  margin-bottom: 14px;
  text-align: justify;
}

.dao-article p b {
  color: var(--ink);
  font-weight: 700;
}

/* 鲁班尺道法原理研究 · 一级章节（章名·小节） */
.dao-h4 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--ink);
  margin: 42px 0 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--line);
}
.dao-h4 span {
  flex-shrink: 0;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
  color: var(--seal);
  padding: 3px 9px;
  border: 1.4px solid var(--seal);
  border-radius: 4px;
  letter-spacing: 1px;
}
/* 子节标签：1.1 / 2.4 等 */
.dao-sub-h {
  display: inline-block;
  font-family: var(--serif);
  font-size: 15.5px;
  font-weight: 700;
  color: var(--seal-deep);
  letter-spacing: 2px;
  margin: 22px 0 6px;
  padding-left: 8px;
  border-left: 3px solid var(--seal);
}
/* 论文专用表格 · 简洁古雅 */
.dao-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 22px;
  font-size: 13.5px;
  line-height: 1.65;
  font-family: var(--serif);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  display: block;
  overflow-x: auto;
}
.dao-table thead {
  background: rgba(166, 58, 46, 0.08);
}
.dao-table th,
.dao-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px dashed var(--line);
  vertical-align: top;
}
.dao-table th {
  font-weight: 700;
  color: var(--seal-deep);
  letter-spacing: 1.5px;
}
.dao-table tr:last-child td { border-bottom: none; }
.dao-table-wrap {
  margin: 0 0 22px;
}
/* 文章列表：格物精解等长文用 */
.dao-list {
  margin: 10px 0 18px;
  padding-left: 4px;
  list-style: none;
}
.dao-list li {
  position: relative;
  padding-left: 20px;
  margin: 6px 0;
  line-height: 1.85;
}
.dao-list li::before {
  content: "·";
  position: absolute;
  left: 6px;
  color: var(--seal);
  font-weight: 700;
}
.dao-list ol { padding-left: 22px; }
ol.dao-list { list-style: decimal; padding-left: 24px; }
ol.dao-list li::before { content: none; }

/* 法则六纲：秩序方格 */
.dao-fa {
  margin: 16px 0 18px;
  padding: 18px 24px;
  background: rgba(166, 58, 46, 0.04);
  border-left: 3px solid rgba(166, 58, 46, 0.5);
  border-radius: 0 10px 10px 0;
}

/* 八雅取德：八字小卡阵列 */
.dao-baya {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 18px 0;
}

.db-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(160deg, rgba(166, 58, 46, 0.05), transparent 55%),
    var(--paper);
  padding: 12px 10px 10px;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.db-item:hover {
  border-color: rgba(166, 58, 46, 0.45);
  box-shadow: var(--shadow);
}

.db-name {
  display: block;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--ink);
}

.db-de {
  display: inline-block;
  margin: 5px 0 6px;
  font-family: var(--serif);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--seal);
  border: 1.4px solid var(--seal);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  line-height: 23px;
}

.db-desc {
  display: block;
  font-size: 11.5px;
  letter-spacing: 1px;
  color: var(--ink-faint);
  line-height: 1.5;
}

.dao-fa p {
  margin-bottom: 9px;
  font-size: 13.5px;
}

.dao-fa p:last-child { margin-bottom: 0; }

.dao-fa b {
  color: var(--seal-deep);
  font-family: var(--serif);
  letter-spacing: 1px;
}

/* 金句居中 */
.dao-quote {
  margin: 24px auto;
  max-width: 92%;
  text-align: center;
  font-family: var(--serif);
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 2;
  color: var(--seal);
  border-top: 1px solid rgba(166, 58, 46, 0.35);
  border-bottom: 1px solid rgba(166, 58, 46, 0.35);
  padding: 14px 16px;
}

/* 赞曰 */
.dao-zan {
  margin: 34px 0 6px;
  padding: 26px 30px 22px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(166, 58, 46, 0.035), transparent 60%),
    var(--paper);
}

.dao-zan-title {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 8px;
  color: var(--seal);
  margin-bottom: 12px;
  text-indent: 8px;
}

.dao-zan p {
  font-family: var(--serif);
  font-size: 14.5px;
  letter-spacing: 3px;
  line-height: 2.2;
  color: var(--ink-soft);
  margin: 0;
  text-align: center;
}

/* 落款 */
.dao-end {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  text-align: center;
}

/* 结尾散文（赞曰之后 · 余韵） */
.dao-tail {
  margin: 26px auto 0;
  max-width: 92%;
  text-align: center;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 2px;
  line-height: 2.2;
  color: var(--ink-faint);
  padding: 0 6px;
}

.dao-end-seal {
  display: inline-block;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--paper-light);
  background: var(--seal);
  border-radius: 8px;
  padding: 5px 18px 5px 20px;
  margin-bottom: 12px;
}

.dao-end-txt {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--ink);
}

.dao-end-sub {
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--ink-faint);
}
.dao-readmore {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
  text-align: center;
}
.dao-readmore-link {
  display: inline-block;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 4px;
  color: var(--seal);
  text-decoration: none;
  border: 1.4px solid var(--seal);
  border-radius: 30px;
  padding: 9px 28px;
  transition: all 0.2s;
}
.dao-readmore-link:hover {
  background: var(--seal);
  color: var(--paper-light);
  letter-spacing: 5px;
}

/* ==========================================================
   独立文章页（lubanchi.html · 鲁班尺道法原理研究）
   ========================================================== */
.article-hero {
  background:
    linear-gradient(135deg, rgba(166, 58, 46, 0.06), transparent 60%),
    var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 56px 20px 36px;
  position: relative;
}
.article-hero-inner {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  position: relative;
}
.article-back {
  position: absolute;
  top: 0;
  left: 0;
  font-family: var(--serif);
  font-size: 14px;
  color: var(--ink-faint);
  text-decoration: none;
  letter-spacing: 2px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 6px 16px;
  transition: all 0.2s;
}
.article-back:hover { color: var(--seal); border-color: var(--seal); }
.article-cat {
  display: inline-block;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 4px;
  color: var(--seal);
  border: 1.4px solid var(--seal);
  border-radius: 4px;
  padding: 3px 12px;
  margin: 12px 0 18px;
}
.article-title {
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 700;
  letter-spacing: 8px;
  color: var(--ink);
  margin: 0 0 10px;
  line-height: 1.4;
}
.article-sub {
  font-size: 14px;
  letter-spacing: 3px;
  color: var(--ink-faint);
  margin: 0 0 22px;
}
.article-meta {
  font-size: 12.5px;
  letter-spacing: 2px;
  color: var(--ink-faint);
}
.article-meta span {
  margin: 0 8px;
  position: relative;
}
.article-meta span + span::before {
  content: "·";
  margin-right: 16px;
  color: var(--line);
}
.article-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 50px 20px 60px;
  background: var(--paper);
  box-shadow: 0 6px 30px -8px rgba(0, 0, 0, 0.08);
}
.article-main.dao-article { padding: 50px 28px 60px; }
.article-main p {
  margin-bottom: 14px;
  text-align: justify;
}
.article-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 760px;
  margin: 0 auto 50px;
  padding: 22px 28px;
  background: rgba(166, 58, 46, 0.04);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 2px;
}
.article-foot a {
  color: var(--seal);
  text-decoration: none;
  border: 1px solid var(--seal);
  border-radius: 20px;
  padding: 5px 16px;
  transition: all 0.2s;
}
.article-foot a:hover { background: var(--seal); color: var(--paper-light); }
.article-foot span { color: var(--ink-faint); }
.dao-pre {
  font-family: 'Cascadia Code', 'Consolas', 'Microsoft YaHei', monospace;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink);
  background: rgba(166, 58, 46, 0.04);
  border-left: 3px solid var(--seal);
  padding: 18px 22px;
  border-radius: 0 8px 8px 0;
  overflow-x: auto;
  white-space: pre;
  margin: 14px 0 22px;
}
.article-main hr {
  border: none;
  border-top: 1px dashed var(--line);
  margin: 36px 0;
}

@media (max-width: 640px) {
  .article-hero { padding: 44px 16px 28px; }
  .article-title { font-size: 26px; letter-spacing: 4px; }
  .article-sub { font-size: 12px; letter-spacing: 1.5px; }
  .article-main { padding: 30px 16px 40px; }
  .article-main.dao-article { padding: 30px 18px 40px; }
  .article-foot { margin: 0 16px 36px; padding: 16px 18px; }
  .article-back { font-size: 12px; padding: 5px 12px; }
  .dao-h4 { font-size: 18px; letter-spacing: 3px; }
  .dao-h4 span { font-size: 11px; padding: 2px 6px; }
  .dao-table { font-size: 12px; }
  .dao-table th, .dao-table td { padding: 8px 10px; }
}

/* 移动端 */
@media (max-width: 640px) {
  .dao-article { padding: 34px 18px 38px; }
  .dao-article::before { left: 18px; right: 18px; }
  .dao-hero { flex-wrap: wrap; gap: 16px; }
  .dao-seal { width: 56px; height: 56px; font-size: 28px; }
  .dao-title { font-size: 36px; letter-spacing: 14px; }
  .dao-sub { font-size: 11px; letter-spacing: 3px; }
  .dao-author { order: 3; width: 100%; text-align: left; padding: 0; }
  .dao-author-note { writing-mode: horizontal-tb; max-height: none; margin: 8px 0 0; }
  .dao-h { font-size: 16.5px; }
  .dao-h span { width: 34px; height: 34px; font-size: 13px; }
  .dao-quote { font-size: 14.5px; letter-spacing: 1px; }
  .dao-fa { padding: 14px 16px; }
  .dao-zan { padding: 20px 14px 16px; }
  .dao-zan p { font-size: 13px; letter-spacing: 2px; }
  .dao-baya { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

/* ==========================================================
   精选文章（观 · 智证法）
   ========================================================== */
.guan-article {
  background: var(--paper-light);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 36px 42px 46px;
  line-height: 2;
  font-size: 14.5px;
  color: var(--ink-soft);
}

/* 文章头部 */
.art-hero {
  display: flex;
  align-items: center;
  gap: 30px;
  padding-bottom: 26px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.art-hero-svg { width: 96px; height: auto; flex-shrink: 0; }

.art-hero-txt { flex: 1; }

.art-seal {
  display: inline-block;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--seal);
  border: 2px solid var(--seal);
  border-radius: 8px;
  padding: 2px 14px;
  margin-bottom: 10px;
}

.art-title {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--ink);
}

.art-sub {
  margin-top: 8px;
  font-size: 12.5px;
  letter-spacing: 4px;
  color: var(--ink-faint);
}

/* 引言 */
.art-lead {
  font-size: 14.5px;
  color: var(--ink-soft);
  border-left: 3px solid var(--seal);
  padding-left: 16px;
  margin-bottom: 24px;
}

/* 小节标题 */
.art-h {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--serif);
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--ink);
  margin: 30px 0 14px;
}

.art-h span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  background: var(--seal);
  color: var(--paper-light);
  border-radius: 50%;
  font-size: 13px;
  font-family: var(--serif);
}

/* 排比列表 */
.art-li {
  margin: 14px 0;
  padding: 14px 20px;
  background: rgba(166, 58, 46, 0.045);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.art-li p { font-size: 13.5px; }

/* 金句 */
.art-quote {
  margin: 22px auto;
  max-width: 90%;
  text-align: center;
  font-family: var(--serif);
  font-size: 18.5px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--seal);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 10px;
}

/* 配图 */
.art-figure {
  margin: 26px auto;
  text-align: center;
}

.art-figure-svg {
  max-width: 420px;
  width: 100%;
  height: auto;
}

.art-figure figcaption {
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--ink-faint);
}

/* 结语 */
.art-end {
  margin-top: 36px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.art-end-seal {
  display: inline-block;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 700;
  color: var(--paper-light);
  background: var(--seal);
  border-radius: 10px;
  padding: 4px 16px;
  margin-bottom: 16px;
}

.art-end-txt {
  font-family: var(--serif);
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--ink);
}

.art-end-sub {
  margin-top: 10px;
  font-size: 12.5px;
  letter-spacing: 2px;
  color: var(--ink-faint);
}

/* ==========================================================
   八雅
   ========================================================== */
.baya-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.baya-card {
  display: block;
  background: var(--paper-light);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  text-decoration: none;
  transition: all 0.2s;
  text-align: center;
}

.baya-card:hover { border-color: var(--seal); box-shadow: var(--shadow); transform: translateY(-2px); }

.baya-seal {
  width: 44px; height: 44px;
  margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--paper-light);
  border-radius: 8px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
}

.baya-icon { font-size: 22px; margin-bottom: 6px; }

.baya-name {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--ink);
}

.baya-sub { font-size: 12px; color: var(--ink-faint); letter-spacing: 2px; margin-left: 8px; }

.baya-desc {
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.7;
}

/* ==========================================================
   非遗
   ========================================================== */
.fy-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.fy-cat-card {
  display: block;
  background: var(--paper-light);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  transition: all 0.2s;
}

.fy-cat-card:hover { border-color: var(--seal); box-shadow: var(--shadow); }

.fy-cat-icon { font-size: 24px; }

.fy-cat-name {
  font-family: var(--serif);
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--ink);
  margin-top: 8px;
}

.fy-cat-items { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }

.fy-feat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.fy-feat-card {
  display: block;
  background: var(--paper-light);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  text-decoration: none;
  transition: all 0.2s;
}

.fy-feat-card:hover { border-color: var(--seal); box-shadow: var(--shadow); }

.fy-feat-top { display: flex; align-items: center; gap: 14px; }

.fy-feat-img {
  width: 52px; height: 52px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  border-radius: 10px;
}

.fy-feat-name {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--ink);
}

.fy-feat-tags { margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; }

.fy-feat-tags span {
  font-size: 11px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 9px;
}

.fy-feat-desc { margin-top: 14px; font-size: 12.5px; color: var(--ink-soft); line-height: 1.8; }

/* ==========================================================
   页脚
   ========================================================== */
.site-footer {
  text-align: center;
  padding: 44px 24px 56px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-family: var(--serif);
  letter-spacing: 3px;
  font-size: 13px;
}

.site-footer .muted {
  margin-top: 10px;
  color: var(--ink-faint);
  font-size: 12px;
  letter-spacing: 1px;
}

.site-footer .beian {
  color: var(--ink-faint);
  text-decoration: none;
  letter-spacing: 1px;
}

.site-footer .beian:hover { color: var(--seal); }

/* ==========================================================
   加载态
   ========================================================== */
.loading {
  text-align: center;
  color: var(--ink-faint);
  font-size: 13px;
  letter-spacing: 2px;
  padding: 24px 0;
}

/* ==========================================================
   响应式
   ========================================================== */
@media (max-width: 640px) {
  .header-inner { padding: 12px 18px; }
  .tab-btn { padding: 7px 11px; font-size: 13.5px; letter-spacing: 2px; }
  .hero { padding: 40px 18px 30px; }
  .hero-title { font-size: 24px; }
  .panel-body { padding: 0 18px 44px; }
  .qian-gua { font-size: 76px; }
  .guan-article { padding: 24px 18px 34px; }
  .art-hero { flex-direction: column; gap: 14px; text-align: center; }
  .art-hero-svg { width: 80px; }
  .art-title { font-size: 20px; }
  .art-quote { font-size: 16.5px; letter-spacing: 2px; }
  .art-item summary { padding: 12px 14px; font-size: 13.5px; }
  .art-item-body { padding: 12px 14px 16px; }
}

/* ==========================================================
   PWA 安装引导（添加到主屏幕 · 宋明小笺风格）
   ========================================================== */

/* 右下角浮标：朱砂圆钮 + 号 */
.pwa-fab {
  position: fixed;
  right: 18px;
  bottom: 22px;
  z-index: 999;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: var(--seal);
  color: var(--paper-light);
  font-size: 26px;
  font-family: var(--serif);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(124, 36, 24, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: pwaFabPulse 2.6s ease-in-out infinite;
}

.pwa-fab:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 20px rgba(124, 36, 24, 0.45);
}

@keyframes pwaFabPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(124, 36, 24, 0.35); }
  50% { box-shadow: 0 4px 22px rgba(124, 36, 24, 0.55); }
}

/* 引导小笺卡片 */
.pwa-hint {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%) translateY(12px);
  z-index: 1000;
  width: min(360px, calc(100vw - 32px));
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background: var(--paper-light);
  border: 1px solid rgba(166, 58, 46, 0.35);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(90, 70, 40, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s, transform 0.35s;
}

.pwa-hint[hidden] { display: none; }

.pwa-hint-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.pwa-hint-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--seal);
  color: var(--paper-light);
  border-radius: 10px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
}

.pwa-hint-body { flex: 1; min-width: 0; }

.pwa-hint-title {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--ink);
  margin-bottom: 6px;
}

.pwa-hint-ios,
.pwa-hint-android {
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--ink-soft);
}

.pwa-hint b { color: var(--seal); }

.pwa-hint-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: none;
  color: var(--ink-faint);
  font-size: 13px;
  cursor: pointer;
  padding: 4px;
}

.pwa-hint-close:hover { color: var(--seal); }

/* 安装成功提示 */
.pwa-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(16px);
  z-index: 1001;
  padding: 9px 20px;
  background: var(--ink);
  color: var(--paper-light);
  font-size: 13px;
  letter-spacing: 1px;
  border-radius: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  box-shadow: 0 4px 16px rgba(42, 35, 24, 0.3);
}

.pwa-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================
   道法条状折叠 · 暖纸底 + 道法条状 + 显明文章名
   · 总纲（dao-article / guan-article · 最重篇）：暖纸 + 描金细条 + 墨字
   · 精选（art-item · 常规篇）：暖纸 + 朱红细条 + 墨字
   点击条状：展开内文（短文）/ 跳转 topic.html（大部头）
   ========================================================== */

/* ---------------- 总纲/重要文章（dao-item · 一篇文章单独一栏）
   暖纸底 + 描金细条 + 朱砂印章 + 楷书墨字 — 地位高于 art-item
   展开交互与「二十四节气·天时之序」同款（点击摘要条 → 展开正文）
   ========================================================== */
.dao-item {
  margin: 14px 0 28px;
  background: var(--paper-light);
  border: 1px solid rgba(184, 146, 58, 0.4);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.dao-item:hover {
  border-color: rgba(184, 146, 58, 0.7);
  box-shadow: 0 5px 16px rgba(140, 105, 42, 0.16);
  transform: translateY(-1px);
}

/* summary 整条可点 */
.dao-item > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 28px;
  cursor: pointer;
  user-select: none;
  border-radius: 12px;
  background:
    radial-gradient(ellipse at 0% 50%, rgba(184, 146, 58, 0.07), transparent 55%),
    linear-gradient(180deg, rgba(255, 252, 244, 0.6), rgba(255, 252, 244, 0));
  transition: background 0.2s;
}
.dao-item > summary::-webkit-details-marker { display: none; }

/* 描金条（条状图标 · 总纲地位最高） */
.dao-item-strip {
  flex-shrink: 0;
  width: 7px;
  height: 60px;
  background: linear-gradient(180deg, #f0d278 0%, #c8a050 50%, #8c692a 100%);
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(184, 146, 58, 0.5);
}

/* 标题/副题/作者 三行 */
.dao-item-txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.dao-item-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
}
.dao-item-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  background: linear-gradient(180deg, #b94636 0%, #8a2e22 100%);
  color: #fbf6ec;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(124, 36, 24, 0.4),
              inset 0 0 0 1px rgba(255, 240, 220, 0.2);
}
.dao-item-name {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--ink);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dao-item-sub {
  font-style: normal;
  font-size: 13px;
  letter-spacing: 3px;
  color: rgba(58, 41, 26, 0.62);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dao-item-author {
  font-style: normal;
  font-size: 11.5px;
  letter-spacing: 2px;
  color: var(--ink-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 右侧「阅读 ▾」朱字指示 */
.dao-item-go {
  flex-shrink: 0;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 3px;
  color: rgba(166, 58, 46, 0.85);
  padding: 5px 14px;
  border: 1px solid rgba(166, 58, 46, 0.35);
  border-radius: 14px;
  background: rgba(166, 58, 46, 0.04);
  transition: background 0.2s, color 0.2s;
}
.dao-item:hover > summary .dao-item-go {
  background: rgba(166, 58, 46, 0.1);
  color: rgba(140, 30, 20, 1);
}

/* 展开态：底部虚线分隔 + 描金径向更深 */
.dao-item[open] > summary {
  border-radius: 12px 12px 0 0;
  border-bottom: 1px dashed rgba(184, 146, 58, 0.5);
  background:
    radial-gradient(ellipse at 0% 50%, rgba(184, 146, 58, 0.11), transparent 55%),
    linear-gradient(180deg, rgba(255, 252, 244, 0.75), rgba(255, 252, 244, 0.2));
}
.dao-item[open] > summary .dao-item-go {
  background: rgba(166, 58, 46, 0.14);
  color: rgba(140, 30, 20, 1);
}

/* 展开后正文 — 让内嵌 dao-article/guan-article 在 dao-item 内自然排版 */
.dao-item > article.dao-article,
.dao-item > article.guan-article {
  margin: 0;
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 22px 32px 28px;
}

/* ==========================================================
   精选文章 / 栏目条目（art-item · 暖纸底 + 朱红细条）
   整条 summary 即可点击展开，无显式按钮
   ========================================================== */
.art-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.art-item {
  background: var(--paper-light);
  border: 1px solid rgba(166, 58, 46, 0.18);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.art-item:hover {
  border-color: rgba(166, 58, 46, 0.4);
  box-shadow: 0 3px 9px rgba(124, 36, 24, 0.10);
  transform: translateY(-1px);
}

/* summary 整条 / 跳转 <a> 整条 共享基础布局 */
.art-item summary,
.art-item-link {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  color: inherit;
  border-radius: 6px;
}
.art-item summary::-webkit-details-marker { display: none; }

/* 朱红细条（条状图标 · 精选篇） */
.art-item-strip {
  flex-shrink: 0;
  width: 4px;
  height: 28px;
  background: linear-gradient(180deg, #b94636 0%, #a0362c 50%, #7a2820 100%);
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(124, 36, 24, 0.3);
}

/* 文章名称（占满剩余宽度） */
.art-item-title {
  flex: 1;
  min-width: 0;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--ink);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 跳转型末尾 → 箭头（与展开型区分） */
.art-item-go {
  flex-shrink: 0;
  font-family: var(--serif);
  font-size: 16px;
  color: var(--seal);
  margin-left: 4px;
  transition: transform 0.2s, color 0.2s;
}
.art-item-link:hover .art-item-go {
  color: var(--ink);
  transform: translateX(2px);
}

/* 展开态：summary 底分隔 */
.art-item[open] > summary {
  border-radius: 6px 6px 0 0;
  border-bottom: 1px dashed rgba(166, 58, 46, 0.3);
  background: rgba(166, 58, 46, 0.02);
}

/* 展开正文 */
.art-item-body {
  padding: 16px 24px 14px 50px;
  font-size: 14.5px;
  line-height: 2;
  color: var(--ink-soft);
}
.intro-src {
  padding: 4px 24px 14px 50px;
  font-size: 12px;
  letter-spacing: 1px;
}

/* 网格/列表容器中展开时横跨整行 */
.card-grid > .art-item[open],
.art-list > .art-item[open] { grid-column: 1 / -1; }

/* ==========================================================
   移动端适配（合并 · 总纲 / 精选通用 · 无显式按钮）
   ========================================================== */
@media (max-width: 800px) {
  .dao-item > summary {
    flex-wrap: wrap;
    gap: 10px 14px;
    padding: 14px 18px;
  }
  .dao-item-strip {
    width: 6px;
    height: 46px;
  }
  .dao-item-seal {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }
  .dao-item-name {
    font-size: 18px;
    letter-spacing: 3px;
  }
  .dao-item-sub,
  .dao-item-author {
    white-space: normal;
  }
  .dao-item-go {
    font-size: 12px;
    letter-spacing: 2px;
    padding: 4px 10px;
  }
  .dao-item > article.dao-article,
  .dao-item > article.guan-article {
    padding: 18px 22px 22px;
  }

  .art-item summary,
  .art-item-link {
    padding: 12px 18px;
    gap: 12px;
  }
  .art-item-strip {
    width: 3px;
    height: 24px;
  }
  .art-item-title {
    font-size: 15px;
    letter-spacing: 1.5px;
    white-space: normal;
  }
  .art-item-go {
    font-size: 14px;
  }
  .art-item-body {
    padding: 14px 18px 12px 44px;
    font-size: 13.5px;
  }
  .intro-src {
    padding: 4px 18px 12px 44px;
  }
}

@media (max-width: 480px) {
  .dao-item-name { letter-spacing: 2px; font-size: 16px; }
  .dao-item-seal { width: 28px; height: 28px; font-size: 13px; }
  .art-item-title { font-size: 14px; letter-spacing: 1.5px; }
}
