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

: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); }

/* ==========================================================
   精选文章（观 · 智证法）
   ========================================================== */
.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);
}

/* ==========================================================
   精选文章列表（宏渊易学 · 手风琴）
   ========================================================== */
.art-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.art-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-light);
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.art-item:hover { box-shadow: var(--shadow); }
.art-item[open] { border-color: rgba(166, 58, 46, 0.4); }

.art-item summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  font-family: var(--serif);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--ink);
  user-select: none;
}

.art-item summary::-webkit-details-marker { display: none; }

.art-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  background: rgba(166, 58, 46, 0.08);
  color: var(--seal);
  border-radius: 50%;
  font-size: 11px;
  font-family: var(--sans);
}

.art-item-title { flex: 1; line-height: 1.6; }

.art-item-arrow {
  color: var(--ink-faint);
  font-size: 15px;
  transition: transform 0.25s;
  flex-shrink: 0;
}

.art-item[open] .art-item-arrow { transform: rotate(45deg); color: var(--seal); }

.art-item-body {
  padding: 14px 18px 18px 56px;
  font-size: 13.5px;
  line-height: 2;
  color: var(--ink-soft);
  border-top: 1px dashed var(--line);
  margin-top: 2px;
}

/* 栏目文章：理源标注（逻辑库挂接） */
.intro-src {
  padding: 2px 18px 14px 56px;
  font-size: 11.5px;
  letter-spacing: 0.5px;
  color: var(--seal);
  opacity: 0.75;
  font-family: var(--sans);
}

/* ==========================================================
   八雅
   ========================================================== */
.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; }
}
