/* ==========================================================================
   蔡氏历史档案馆 · 全站样式
   设计基调：庄重素雅，中国传统色系
   米白 #f7f3ea 底 · 墨黑 #2b2620 字 · 朱砂 #9e2b25 点缀
   字体：宋体/明朝体衬线栈（中文馆阁气质），不引外部字体保证访问速度
   ========================================================================== */

:root {
  --paper: #f7f3ea;          /* 米白 - 页面底 */
  --paper-deep: #efe7d6;     /* 深米 - 卡片/分隔 */
  --ink: #2b2620;            /* 墨黑 - 正文 */
  --ink-light: #6b6155;      /* 淡墨 - 次要文字 */
  --zhu: #9e2b25;            /* 朱砂 - 主点缀 */
  --zhu-deep: #7c1f1a;       /* 深朱砂 - hover */
  --gold: #b8923f;           /* 赭金 - 装饰 */
  --line: #d8cdb6;           /* 边线 */
  --green: #3d6b4f;          /* 竹青 - 成功状态 */
  --shadow: 0 2px 12px rgba(60, 45, 20, 0.08);
}

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

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

body {
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong",
               "SimSun", "FangSong", Georgia, serif;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 20% 10%, rgba(184, 146, 63, 0.05), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(158, 43, 37, 0.04), transparent 40%);
  color: var(--ink);
  line-height: 1.85;
  font-size: 16px;
}

a { color: var(--zhu); text-decoration: none; }
a:hover { color: var(--zhu-deep); }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* --------------------------------------------------------------------------
   顶部细条 / 头部
   -------------------------------------------------------------------------- */
.top-strip {
  background: var(--ink);
  color: #d9cfb8;
  text-align: center;
  font-size: 12px;
  letter-spacing: 4px;
  padding: 5px 10px;
}

.site-header {
  background: var(--paper);
  border-bottom: 3px double var(--line);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 8px rgba(60, 45, 20, 0.06);
}

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px; padding-bottom: 12px; gap: 16px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-seal { width: 46px; height: 46px; border-radius: 6px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name {
  font-size: 22px; font-weight: 700; color: var(--ink);
  letter-spacing: 3px;
}
.brand-sub { font-size: 10px; color: var(--ink-light); letter-spacing: 1.5px; }

.site-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  color: var(--ink);
  padding: 6px 14px;
  font-size: 16px;
  letter-spacing: 2px;
  border-radius: 2px;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--zhu); background: rgba(158, 43, 37, 0.05); }
.site-nav a.active { color: var(--zhu); border-bottom-color: var(--zhu); font-weight: 700; }
.site-nav a.nav-admin {
  border: 1px solid var(--zhu); color: var(--zhu);
  margin-left: 8px; font-size: 14px; padding: 4px 12px;
}
.site-nav a.nav-admin:hover { background: var(--zhu); color: #fff; }

/* 移动端汉堡按钮 */
.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  width: 40px; height: 40px; padding: 8px;
}
.nav-toggle span {
  display: block; height: 2px; background: var(--ink); margin: 5px 0;
  transition: 0.3s;
}

/* --------------------------------------------------------------------------
   通用区块
   -------------------------------------------------------------------------- */
.main-content { min-height: 60vh; padding-top: 24px; padding-bottom: 48px; }

.section-head { text-align: center; margin-bottom: 28px; }
.section-head h2 {
  font-size: 26px; letter-spacing: 8px; color: var(--ink);
  font-weight: 700;
}
.section-en {
  font-size: 11px; color: var(--gold); letter-spacing: 4px;
  margin-top: 4px; font-family: Georgia, serif;
}

.card-paper {
  background: #fffdf6;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 4px;
  position: relative;
}
.card-paper::before {
  content: ""; position: absolute; inset: 4px;
  border: 1px solid rgba(184, 146, 63, 0.25);
  pointer-events: none; border-radius: 2px;
}

.flash-area { margin-top: 16px; }
.flash {
  padding: 10px 18px; margin-bottom: 8px; border-radius: 3px;
  border-left: 4px solid var(--ink-light);
  background: #f3ecdd; font-size: 15px;
}
.flash-success { border-left-color: var(--green); background: #eef5ef; }
.flash-danger  { border-left-color: var(--zhu);  background: #f9eceb; }
.flash-warning { border-left-color: var(--gold); background: #f8f1de; }
.flash-info    { border-left-color: #5b7a99; background: #ecf1f6; }

.btn-zhu {
  display: inline-block;
  background: var(--zhu); color: #fff;
  border: 1px solid var(--zhu);
  padding: 9px 28px; font-size: 16px; letter-spacing: 3px;
  border-radius: 2px; cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}
.btn-zhu:hover { background: var(--zhu-deep); color: #fff; }
.btn-block { width: 100%; }

.btn-outline {
  display: inline-block;
  background: transparent; color: var(--ink);
  border: 1px solid var(--line);
  padding: 8px 20px; font-size: 15px; letter-spacing: 2px;
  border-radius: 2px; cursor: pointer;
  font-family: inherit;
}
.btn-outline:hover { border-color: var(--zhu); color: var(--zhu); }

.empty-note {
  text-align: center; color: var(--ink-light);
  padding: 48px 20px; font-size: 15px; grid-column: 1 / -1;
}

/* --------------------------------------------------------------------------
   首页横幅
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  background: linear-gradient(160deg, #2b2620 0%, #3a3229 55%, #4a3a2c 100%);
  color: #f3ead8;
  border-radius: 4px;
  padding: 64px 20px 56px;
  text-align: center;
  overflow: hidden;
  margin-bottom: 40px;
}
.hero-pattern {
  position: absolute; inset: 0; opacity: 0.08;
  background-image:
    repeating-linear-gradient(45deg, transparent 0 18px, #d9cfb8 18px 19px),
    repeating-linear-gradient(-45deg, transparent 0 18px, #d9cfb8 18px 19px);
  pointer-events: none;
}
.hero-content { position: relative; }
.hero-seal img { width: 72px; height: 72px; border-radius: 8px; opacity: 0.92; }
.hero-title {
  font-size: 42px; font-weight: 700; letter-spacing: 10px;
  margin: 18px 0 8px; color: #f5edda;
  text-indent: 10px; /* 抵消字距造成的偏移 */
}
.hero-sub { font-size: 17px; letter-spacing: 5px; color: #c9b98f; }
.hero-divider {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 22px 0 14px;
}
.hero-divider .line { width: 90px; height: 1px; background: rgba(217, 207, 184, 0.5); }
.hero-divider .diamond { color: var(--gold); font-size: 12px; }
.hero-motto { font-size: 20px; letter-spacing: 10px; color: #e3d5b3; text-indent: 10px; }

/* --------------------------------------------------------------------------
   前言
   -------------------------------------------------------------------------- */
.preface { padding: 40px 48px; margin-bottom: 48px; }
.preface-text p { margin-bottom: 18px; font-size: 16.5px; text-indent: 2em; }
.preface-text strong { color: var(--zhu); }
.preface-placeholder, .about-placeholder, .legal-placeholder {
  color: var(--gold); font-size: 14px; background: rgba(184, 146, 63, 0.08);
  padding: 8px 16px; border-radius: 2px; display: inline-block;
}
.preface-sign { text-align: right; color: var(--ink-light); margin-top: 10px; }
.preface-more { text-align: center; margin-top: 18px; }

/* --------------------------------------------------------------------------
   栏目卡片
   -------------------------------------------------------------------------- */
.columns { margin-bottom: 48px; }
.column-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
}
.column-card {
  display: block; text-align: center;
  background: #fffdf6; border: 1px solid var(--line);
  border-radius: 4px; padding: 34px 20px 26px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  box-shadow: var(--shadow);
}
.column-card:hover {
  transform: translateY(-4px);
  border-color: var(--zhu);
  box-shadow: 0 8px 24px rgba(158, 43, 37, 0.12);
}
.column-char {
  display: inline-flex; align-items: center; justify-content: center;
  width: 62px; height: 62px; border-radius: 50%;
  background: var(--zhu); color: #f7f3ea;
  font-size: 30px; font-weight: 700;
  margin-bottom: 14px;
  box-shadow: 0 0 0 3px #fffdf6, 0 0 0 4px var(--zhu);
}
.column-card h3 { font-size: 21px; letter-spacing: 4px; margin-bottom: 10px; color: var(--ink); }
.column-card p { color: var(--ink-light); font-size: 14px; line-height: 1.9; }
.column-go {
  display: inline-block; margin-top: 16px;
  color: var(--zhu); font-size: 14px; letter-spacing: 2px;
  border-top: 1px solid var(--line); padding-top: 12px; width: 100%;
}

/* --------------------------------------------------------------------------
   最新入库列表
   -------------------------------------------------------------------------- */
.latest { margin-bottom: 48px; }
.latest-list { list-style: none; border-top: 2px solid var(--ink); }
.latest-list li { border-bottom: 1px solid var(--line); }
.latest-list a {
  display: flex; align-items: center; gap: 16px;
  padding: 13px 8px; color: var(--ink); flex-wrap: wrap;
}
.latest-list a:hover { background: rgba(158, 43, 37, 0.03); }
.latest-tag {
  flex-shrink: 0; font-size: 13px; padding: 1px 10px;
  border-radius: 2px; color: #fff;
}
.tag-genealogy { background: #7a6147; }
.tag-gazetteer { background: var(--zhu); }
.tag-research  { background: var(--green); }
.latest-title { flex: 1; min-width: 180px; font-size: 16px; }
.latest-list a:hover .latest-title { color: var(--zhu); }
.latest-meta { color: var(--ink-light); font-size: 13.5px; }
.latest-date { color: var(--ink-light); font-size: 13px; font-family: Georgia, serif; }

/* 共建提示 */
.join-banner {
  text-align: center; padding: 36px 20px;
  border: 1px dashed var(--gold); border-radius: 4px;
  background: rgba(184, 146, 63, 0.06);
}
.join-banner p { font-size: 18px; letter-spacing: 2px; }
.join-banner .join-sub { color: var(--ink-light); font-size: 14.5px; margin: 6px 0 18px; }

/* --------------------------------------------------------------------------
   列表页
   -------------------------------------------------------------------------- */
.page-head { text-align: center; padding: 28px 0 20px; }
.page-head h1 {
  font-size: 32px; letter-spacing: 10px; font-weight: 700; text-indent: 10px;
}
.page-desc { color: var(--ink-light); margin-top: 10px; font-size: 15px; }
.title-rule {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin-top: 18px;
}
.title-rule span:not(.rule-mark) { width: 110px; height: 1px; background: var(--line); }
.rule-mark { color: var(--gold); }

.filter-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 14px 4px; margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.filter-label { color: var(--ink-light); font-size: 14px; }
.filter-chip {
  padding: 3px 16px; border: 1px solid var(--line); border-radius: 20px;
  color: var(--ink); font-size: 14px; background: #fffdf6;
}
.filter-chip:hover { border-color: var(--zhu); color: var(--zhu); }
.filter-chip.active { background: var(--zhu); color: #fff; border-color: var(--zhu); }
.filter-result { margin-left: auto; color: var(--ink-light); font-size: 13px; }

.material-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
}
.material-card {
  background: #fffdf6; border: 1px solid var(--line); border-radius: 4px;
  box-shadow: var(--shadow); overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.material-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(60, 45, 20, 0.13); }
.card-link { display: block; padding: 20px 20px 14px; color: var(--ink); height: 100%; }
.card-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.card-category {
  font-size: 13px; color: var(--zhu);
  border: 1px solid var(--zhu); padding: 0 10px; border-radius: 2px;
}
.card-filetype { font-size: 12px; color: var(--ink-light); }
.card-filetype.no-file { color: var(--gold); }
.card-title {
  font-size: 17.5px; line-height: 1.55; margin-bottom: 10px;
  font-weight: 700;
}
.card-link:hover .card-title { color: var(--zhu); }
.card-summary {
  color: var(--ink-light); font-size: 13.5px; line-height: 1.8;
  min-height: 48px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta { margin: 12px 0; border-top: 1px dashed var(--line); padding-top: 10px; }
.card-meta > div { display: flex; font-size: 13px; margin-bottom: 4px; }
.card-meta dt { color: var(--ink-light); width: 56px; flex-shrink: 0; }
.card-meta dd { color: var(--ink); }
.card-foot {
  display: flex; justify-content: space-between;
  border-top: 1px solid var(--line); padding-top: 8px;
  color: var(--ink-light); font-size: 12.5px;
}

/* --------------------------------------------------------------------------
   详情页
   -------------------------------------------------------------------------- */
.breadcrumb { font-size: 14px; color: var(--ink-light); margin-bottom: 18px; }
.breadcrumb a { color: var(--ink-light); }
.breadcrumb a:hover { color: var(--zhu); }
.breadcrumb .current { color: var(--ink); }

.detail-page { padding: 40px 48px; }
.detail-category {
  font-size: 14px; color: #fff; padding: 2px 14px; border-radius: 2px;
}
.detail-head h1 {
  font-size: 28px; line-height: 1.5; margin: 14px 0 16px;
  letter-spacing: 1px;
}
.detail-info {
  display: flex; flex-wrap: wrap; gap: 8px 24px;
  color: var(--ink-light); font-size: 14px;
  padding-bottom: 18px; border-bottom: 2px solid var(--ink);
}

.detail-preview { margin: 28px 0; text-align: center; }
.detail-preview img {
  max-width: 100%; border: 1px solid var(--line); border-radius: 2px;
  box-shadow: var(--shadow);
}
.detail-preview figcaption, .preview-note {
  color: var(--ink-light); font-size: 13.5px; margin-top: 10px;
}
.pdf-frame-wrap {
  border: 1px solid var(--line); border-radius: 2px; overflow: hidden;
  box-shadow: var(--shadow);
}
.pdf-frame-wrap iframe { width: 100%; height: 72vh; min-height: 480px; border: 0; background: #e8e4dc; }
.placeholder-box, .file-box {
  padding: 44px 24px; border: 1px dashed var(--gold); border-radius: 4px;
  background: rgba(184, 146, 63, 0.06);
}
.placeholder-box p { font-size: 17px; }
.placeholder-sub { color: var(--ink-light); font-size: 14px !important; margin-top: 8px; }

.detail-body { margin-top: 30px; }
.body-title {
  font-size: 20px; letter-spacing: 6px; text-align: center;
  margin-bottom: 20px; color: var(--ink);
}
.body-text { font-size: 16.5px; line-height: 2.1; }
.body-text p { margin-bottom: 16px; text-indent: 2em; }

.detail-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line);
  flex-wrap: wrap; gap: 12px;
}
.view-count { color: var(--ink-light); font-size: 13.5px; }

/* --------------------------------------------------------------------------
   关于页 / 法律页
   -------------------------------------------------------------------------- */
.about-page { padding: 40px 48px; }
.about-section { margin-bottom: 34px; }
.about-section h2 {
  font-size: 20px; letter-spacing: 4px; color: var(--zhu);
  margin-bottom: 14px; padding-left: 14px;
  border-left: 4px solid var(--zhu);
}
.about-section p { margin-bottom: 12px; font-size: 16px; text-indent: 2em; }
.about-list { margin: 10px 0 10px 2.5em; }
.about-list li { margin-bottom: 8px; font-size: 15.5px; }
.about-list strong { color: var(--zhu); }
.contact-box {
  background: rgba(158, 43, 37, 0.04);
  border: 1px dashed var(--zhu);
  padding: 24px 28px; border-radius: 4px;
}
.contact-box p { text-indent: 0; }
.legal-placeholder { margin-bottom: 20px; }

/* --------------------------------------------------------------------------
   个人空间占位页
   -------------------------------------------------------------------------- */
.space-placeholder { padding: 30px 0; }
.space-card {
  max-width: 640px; margin: 0 auto; text-align: center;
  background: #fffdf6; border: 1px solid var(--line);
  box-shadow: var(--shadow); border-radius: 4px;
  padding: 48px 36px;
}
.space-seal img { width: 64px; height: 64px; border-radius: 8px; opacity: 0.85; }
.space-card h1 { font-size: 28px; letter-spacing: 6px; margin: 16px 0 6px; }
.space-sub { color: var(--ink-light); letter-spacing: 2px; }
.space-divider { color: var(--gold); margin: 20px 0; }
.space-text { color: var(--ink); font-size: 15.5px; line-height: 2.1; margin-bottom: 24px; }
.space-ritual-box {
  border: 1px dashed var(--zhu); border-radius: 4px;
  background: rgba(158, 43, 37, 0.04);
  padding: 20px; margin-bottom: 22px;
}
.ritual-title { color: var(--zhu); font-size: 17px; letter-spacing: 3px; margin-bottom: 8px; }
.ritual-desc { color: var(--ink-light); font-size: 14px; line-height: 2; }
.space-roadmap { color: var(--ink-light); font-size: 13px; margin-bottom: 24px; }

/* --------------------------------------------------------------------------
   后台
   -------------------------------------------------------------------------- */
.admin-login-wrap { max-width: 440px; margin: 40px auto; }
.admin-login { padding: 40px 36px; }
.admin-login h1 { text-align: center; font-size: 24px; letter-spacing: 8px; text-indent: 8px; }
.login-sub { text-align: center; color: var(--ink-light); font-size: 13.5px; margin: 8px 0 26px; }
.login-hint {
  margin-top: 18px; font-size: 12.5px; color: var(--ink-light);
  text-align: center; line-height: 1.9;
}
.login-hint code {
  background: var(--paper-deep); padding: 1px 6px; border-radius: 2px;
  color: var(--zhu); font-size: 12px;
}

.form-label {
  display: block; font-size: 14.5px; font-weight: 700;
  margin-bottom: 6px; letter-spacing: 1px;
}
.form-input {
  width: 100%; padding: 10px 14px; font-size: 15px;
  border: 1px solid var(--line); border-radius: 3px;
  background: #fffdf6; color: var(--ink);
  font-family: inherit; margin-bottom: 18px;
}
.form-input:focus { outline: none; border-color: var(--zhu); }
.form-textarea { resize: vertical; line-height: 1.9; }
.form-file { font-size: 14px; margin-bottom: 8px; }
.req { color: var(--zhu); }

.admin-bar {
  display: flex; justify-content: space-between; align-items: flex-end;
  flex-wrap: wrap; gap: 14px; margin-bottom: 22px;
}
.admin-bar h1 { font-size: 24px; letter-spacing: 4px; }
.admin-bar p { color: var(--ink-light); font-size: 13.5px; }
.admin-actions { display: flex; gap: 10px; align-items: center; }
.inline-form { display: inline; }

.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fffdf6; border: 1px solid var(--line); border-radius: 4px;
  padding: 18px; text-align: center; box-shadow: var(--shadow);
}
.stat-num { display: block; font-size: 30px; font-weight: 700; color: var(--ink); font-family: Georgia, serif; }
.stat-label { color: var(--ink-light); font-size: 13.5px; letter-spacing: 2px; }
.stat-pending .stat-num { color: var(--gold); }
.stat-approved .stat-num { color: var(--green); }
.stat-rejected .stat-num { color: var(--zhu); }

.admin-filter { margin-bottom: 18px; }
.filter-form { display: flex; gap: 20px; flex-wrap: wrap; }
.filter-form label { font-size: 14px; color: var(--ink-light); }
.filter-form select {
  padding: 5px 10px; border: 1px solid var(--line); border-radius: 3px;
  background: #fffdf6; font-family: inherit; font-size: 14px; margin-left: 6px;
}

.admin-table-wrap { overflow-x: auto; padding: 10px 16px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
.admin-table th {
  text-align: left; padding: 12px 10px; font-weight: 700;
  border-bottom: 2px solid var(--ink); letter-spacing: 1px;
  white-space: nowrap;
}
.admin-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:hover td { background: rgba(158, 43, 37, 0.02); }
.td-title { max-width: 240px; }
.td-title a { color: var(--ink); font-weight: 700; }
.td-title a:hover { color: var(--zhu); }
.td-meta { color: var(--ink-light); white-space: nowrap; }
.td-meta small { font-size: 12px; }
.no-file-text { color: var(--gold); }

.status-badge {
  display: inline-block; padding: 2px 12px; border-radius: 20px;
  font-size: 12.5px; white-space: nowrap;
}
.status-pending  { background: #f5ecd4; color: #8a6d1f; }
.status-approved { background: #e6f0e9; color: var(--green); }
.status-rejected { background: #f7e4e2; color: var(--zhu); }

.td-ops { white-space: nowrap; }
.op-link {
  background: none; border: none; cursor: pointer;
  color: #5b7a99; font-size: 13.5px; font-family: inherit;
  padding: 0 6px; border-right: 1px solid var(--line);
}
.op-link:last-child { border-right: none; }
.op-approve { color: var(--green); }
.op-reject { color: #b07a1f; }
.op-delete { color: var(--zhu); }
.op-link:hover { text-decoration: underline; }

.material-form { padding: 34px 40px; }
.form-row { margin-bottom: 4px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { margin-bottom: 16px; }
.form-group-full { width: 100%; }
.file-current { font-size: 13.5px; color: var(--ink-light); }
.file-delete-label { margin-left: 16px; color: var(--zhu); cursor: pointer; }
.form-actions {
  display: flex; gap: 14px; justify-content: center;
  margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line);
}

/* --------------------------------------------------------------------------
   页脚
   -------------------------------------------------------------------------- */
.site-footer {
  background: #2b2620; color: #b9ac93;
  padding: 40px 0 28px; margin-top: 40px;
  text-align: center;
}
.footer-seal img { width: 48px; height: 48px; border-radius: 6px; opacity: 0.85; }
.footer-seal p { font-size: 17px; letter-spacing: 4px; color: #e3d5b3; margin-top: 8px; }
.footer-links { margin: 16px 0 10px; font-size: 14px; }
.footer-links a { color: #c9b98f; }
.footer-links a:hover { color: #f0e2c0; }
.footer-links .dot { color: #6b6155; margin: 0 8px; }
.footer-note { font-size: 13px; color: #8d8169; line-height: 2; margin-bottom: 12px; }
.footer-icp {
  font-size: 12.5px; color: #8d8169;
  overflow-wrap: anywhere;   /* 窄屏下长备案号/版权串允许换行，防止溢出 */
}
.footer-icp a { color: #a99b7c; }

/* --------------------------------------------------------------------------
   响应式（族人群主要用手机，优先保证小屏可用）
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .column-grid, .material-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .preface, .detail-page, .about-page, .material-form { padding: 28px 24px; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .container { padding: 0 14px; }

  /* 导航折叠为汉堡菜单 */
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--paper);
    flex-direction: column; align-items: stretch;
    border-bottom: 2px solid var(--line);
    box-shadow: 0 8px 16px rgba(60, 45, 20, 0.12);
    padding: 8px 0;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 24px; font-size: 16px; border-bottom: none; }
  .site-nav a.nav-admin {
    margin: 8px 24px; border: 1px solid var(--zhu); text-align: center;
  }

  .brand-name { font-size: 18px; letter-spacing: 2px; }
  .brand-sub { display: none; }
  .brand-seal { width: 38px; height: 38px; }

  .hero { padding: 44px 16px 40px; }
  .hero-title { font-size: 28px; letter-spacing: 5px; text-indent: 5px; }
  .hero-motto { font-size: 16px; letter-spacing: 5px; text-indent: 5px; }
  .hero-divider .line { width: 50px; }

  .section-head h2 { font-size: 21px; letter-spacing: 5px; }
  .page-head h1 { font-size: 24px; letter-spacing: 5px; text-indent: 5px; }

  .column-grid, .material-grid, .stats-grid { grid-template-columns: 1fr; }
  .form-row-2 { grid-template-columns: 1fr; gap: 0; }

  .preface, .detail-page, .about-page, .material-form { padding: 24px 18px; }
  .detail-head h1 { font-size: 22px; }
  .pdf-frame-wrap iframe { height: 60vh; min-height: 360px; }

  .latest-list a { gap: 8px; }
  .latest-meta { flex-basis: 100%; }

  .admin-bar { align-items: flex-start; }
  .admin-actions { width: 100%; }
  .admin-actions .btn-zhu { flex: 1; text-align: center; }
  .detail-foot { flex-direction: column; align-items: stretch; text-align: center; }
}

/* ==========================================================================
   M1.5 族谱树 / 个人空间 / 五服图 / AI 录档
   ========================================================================== */

/* ---------- 族谱树（纯 HTML/CSS 缩进树） ---------- */
.clan-tree { padding: 28px 32px; margin-bottom: 26px; }
.clan-tree-head { text-align: center; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 2px solid var(--ink); }
.clan-tree-title { font-size: 21px; letter-spacing: 4px; color: var(--zhu); }
.clan-tree-meta { color: var(--ink-light); font-size: 13px; margin-top: 6px; display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.clan-note { color: var(--gold); }

.tree-scroll { overflow-x: auto; padding-bottom: 8px; }
.gen-tree { list-style: none; padding-left: 28px; position: relative; }
.gen-tree-root { padding-left: 0; }
.gen-tree li { position: relative; padding: 7px 0 7px 0; }
/* 竖线 */
.gen-tree ul { list-style: none; margin-left: 26px; padding-left: 22px; border-left: 1px dashed var(--line); }
.tree-node { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tree-gen {
  font-size: 12px; color: var(--ink-light); background: var(--paper-deep);
  border: 1px solid var(--line); border-radius: 20px; padding: 0 10px; white-space: nowrap;
}
.tree-name {
  font-size: 16.5px; font-weight: 700; color: var(--ink);
  border-bottom: 1px solid transparent;
}
.tree-name:hover { color: var(--zhu); border-bottom-color: var(--zhu); }
.tree-sex { font-size: 11px; border: 1px solid var(--line); border-radius: 2px; padding: 0 5px; color: var(--ink-light); }
.tree-male { border-color: #8aa0b8; color: #5b7a99; }
.tree-female { border-color: #c28a9c; color: #a85f78; }
.tree-zi { font-size: 12.5px; color: var(--zhu); }
.tree-life { font-size: 12px; color: var(--ink-light); font-family: Georgia, serif; }
.tree-unknown { color: var(--gold); font-size: 13px; font-style: normal; }

/* ---------- 个人空间人物卡 ---------- */
.person-card { margin-bottom: 30px; }
.person-card-inner { padding: 34px 40px; }
.person-name-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-bottom: 2px solid var(--ink); padding-bottom: 16px; }
.person-name { font-size: 30px; letter-spacing: 4px; }
.person-sex { font-size: 14px; color: var(--ink-light); font-weight: 400; border: 1px solid var(--line); border-radius: 20px; padding: 1px 12px; margin-left: 8px; letter-spacing: 1px; }
.ritual-btn { padding: 8px 22px; font-size: 15px; letter-spacing: 2px; }

.person-meta { display: flex; flex-wrap: wrap; gap: 10px 32px; margin: 18px 0 6px; }
.person-meta > div { display: flex; font-size: 14.5px; }
.person-meta dt { color: var(--ink-light); width: 78px; flex-shrink: 0; }
.person-meta dd { color: var(--ink); }

.person-bio { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.person-bio-title { font-size: 16px; color: var(--zhu); letter-spacing: 3px; margin-bottom: 8px; }
.person-bio p { font-size: 15.5px; line-height: 2; text-indent: 2em; color: var(--ink); }

.person-relations { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 10px 28px; }
.rel-group { display: flex; font-size: 14.5px; }
.rel-label { color: var(--ink-light); width: 86px; flex-shrink: 0; }
.rel-body a { margin-right: 10px; white-space: nowrap; }
.rel-unknown { color: var(--gold); font-style: normal; font-size: 13.5px; }

/* ---------- 五服图 ---------- */
.wufu-section { padding: 28px 20px 24px; margin-bottom: 30px; }
.wufu-head { text-align: center; margin-bottom: 18px; }
.wufu-title { font-size: 22px; letter-spacing: 6px; color: var(--ink); text-indent: 6px; }
.wufu-sub { color: var(--ink-light); font-size: 13px; margin-top: 6px; }
.wufu-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 3px; background: #fdfaf1; -webkit-overflow-scrolling: touch; }
.wufu-svg { display: block; margin: 0 auto; min-width: 720px; }
.wufu-svg a { cursor: pointer; }
.wufu-svg a:hover rect { stroke: var(--zhu); stroke-width: 2; }

.wufu-legend {
  display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center;
  justify-content: center; margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line);
}
.legend-title { font-size: 13.5px; color: var(--ink-light); }
.legend-chip { font-size: 13px; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.legend-color { width: 16px; height: 16px; border-radius: 2px; display: inline-block; border: 1px solid #8d7d62; }
.wufu-note { color: var(--ink-light); font-size: 12.5px; line-height: 1.9; margin-top: 12px; text-align: center; }

/* ---------- 支派管理 ---------- */
.clan-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; align-items: start; }
.clan-new-form { padding: 26px 28px; }

/* ---------- AI 录档 ---------- */
.ai-rules { padding: 22px 28px; margin-bottom: 22px; }
.ai-rules-title { font-size: 17px; letter-spacing: 3px; color: var(--zhu); margin-bottom: 10px; }
.ai-rules-list { margin-left: 1.6em; font-size: 14px; color: var(--ink); line-height: 2.1; }
.ai-or { text-align: center; margin: 6px 0 18px; color: var(--ink-light); font-size: 14px; }
.ai-or span { position: relative; padding: 0 14px; }
.ai-or span::before, .ai-or span::after { content: ""; position: absolute; top: 50%; width: 60px; height: 1px; background: var(--line); }
.ai-or span::before { right: 100%; }
.ai-or span::after { left: 100%; }

.ai-section-title { font-size: 18px; letter-spacing: 3px; color: var(--ink); margin-bottom: 16px; }
.ai-clans { padding: 24px 28px; margin-bottom: 22px; }
.ai-clan-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.ai-clan-row .ai-input { flex: 1; min-width: 110px; }
.ai-input-wide { flex: 2; }
.ai-tip { color: var(--ink-light); font-size: 12.5px; margin-top: 10px; }

.ai-persons { padding: 24px 20px; }
.ai-table-wrap { overflow-x: auto; }
.ai-table { border-collapse: collapse; font-size: 13px; width: 100%; min-width: 1100px; }
.ai-table th {
  text-align: left; padding: 8px 8px; border-bottom: 2px solid var(--ink);
  white-space: nowrap; font-weight: 700; color: var(--ink);
}
.ai-table td { padding: 6px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ai-table tr.ai-low-conf td { background: #fbf3d4; }
.ai-bio-row td { background: transparent !important; padding-top: 0; }
.ai-bio-row.ai-low-conf td { background: #fbf3d4 !important; }
.ai-bio-label { font-size: 12.5px; color: var(--ink-light); }
.ai-bio-row textarea { margin-bottom: 8px; font-size: 13px; }
.ai-input {
  padding: 6px 8px; border: 1px solid var(--line); border-radius: 3px;
  background: #fffdf6; font-family: inherit; font-size: 13px; color: var(--ink); width: 100%;
}
.ai-input-name { min-width: 90px; }
.ai-input-year { min-width: 64px; width: 72px; }
.ai-input-zi { width: 56px; }
.ai-conf { white-space: nowrap; }
.conf-badge {
  display: inline-block; padding: 1px 9px; border-radius: 20px; font-size: 12px;
  background: #e6f0e9; color: var(--green); font-family: Georgia, serif;
}
.conf-badge.conf-low { background: #f5e3b3; color: #8a6d1f; }
.ai-quote { max-width: 180px; font-size: 12px; color: var(--ink-light); line-height: 1.6; }

/* ---------- M1.5 响应式 ---------- */
@media (max-width: 900px) {
  .clan-layout { grid-template-columns: 1fr; }
  .person-relations { grid-template-columns: 1fr; }
  .clan-tree, .wufu-section { padding: 22px 16px; }
  .person-card-inner { padding: 24px 20px; }
}
@media (max-width: 640px) {
  .person-name { font-size: 24px; letter-spacing: 2px; }
  .wufu-title { font-size: 19px; letter-spacing: 3px; }
  .gen-tree ul { margin-left: 14px; padding-left: 14px; }
  .gen-tree { padding-left: 10px; }
  .ai-clans, .ai-persons { padding: 18px 12px; }
}


/* 移动端五服图横滚提示 */
.wufu-scroll-hint{display:none;text-align:center;font-size:.85rem;color:#8a6d4b;margin:.4rem 0 .6rem;letter-spacing:.05em;}
@media (max-width:640px){.wufu-scroll-hint{display:block;}}
