/* ============================================================
   刘氏宗族族谱站 - 古风宗祠风格
   ============================================================ */
:root {
  --ink: #3b342c;
  --ink-2: #6b6152;
  --paper: #faf6ec;
  --paper-2: #f3ecdd;
  --line: #d9cdb4;
  --gold: #b8860b;
  --gold-deep: #96660a;
  --cinnabar: #9a3b26;
  --card: #fffdf6;
}

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

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

body {
  font-family: "Songti SC", "SimSun", "KaiTi", "STKaiti", "Noto Serif SC", serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.75;
  font-size: 15px;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ---------- 头部 ---------- */
.site-header {
  background: linear-gradient(160deg, #3a2f23 0%, #4c3d2b 55%, #5a4732 100%);
  border-bottom: 3px solid var(--gold);
  color: #f5ead2;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 22px;
  padding-bottom: 16px;
}
.logo a { display: flex; flex-direction: column; }
.logo-cn {
  font-size: 30px;
  letter-spacing: 8px;
  color: #f6e3b4;
  text-shadow: 0 2px 6px rgba(0,0,0,.45);
  font-weight: bold;
}
.logo-sub { font-size: 13px; color: #d9c48f; letter-spacing: 3px; margin-top: 2px; }

.main-nav ul { display: flex; flex-wrap: wrap; gap: 2px; }
.main-nav li { }
.main-nav a {
  display: block;
  padding: 8px 14px;
  font-size: 15px;
  color: #eadfc2;
  letter-spacing: 2px;
  border-radius: 4px 4px 0 0;
  transition: all .2s;
}
.main-nav li.on a,
.main-nav a:hover {
  background: var(--gold);
  color: #fff;
}

/* ---------- 页面主体 ---------- */
.body-wrap { padding-top: 22px; padding-bottom: 30px; min-height: 60vh; }

.page-title {
  font-size: 22px;
  letter-spacing: 3px;
  color: var(--cinnabar);
  border-left: 4px solid var(--gold);
  padding-left: 12px;
  margin-bottom: 18px;
}
.page-sub { font-size: 13px; color: var(--ink-2); margin: -10px 0 18px 16px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 20px;
  box-shadow: 0 1px 4px rgba(90, 70, 40, .08);
  margin-bottom: 16px;
}

/* ---------- 首页横幅 ---------- */
.hero {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: 16px;
  background:
    radial-gradient(circle at 20% 30%, rgba(184,134,11,.16), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(154,59,38,.12), transparent 45%),
    linear-gradient(150deg, #4a3a28, #2f271c);
  color: #f3e7c9;
  padding: 44px 34px 40px;
  text-align: center;
}
.hero-seal {
  display: inline-block;
  width: 74px;
  height: 74px;
  line-height: 74px;
  border: 2px solid #c8a45c;
  border-radius: 8px;
  color: #e9cf95;
  font-size: 21px;
  letter-spacing: 3px;
  font-weight: bold;
  margin-bottom: 14px;
  background: rgba(184,134,11,.10);
  box-shadow: inset 0 0 0 3px rgba(200,164,92,.15);
  text-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.hero h1 {
  font-size: 34px;
  letter-spacing: 12px;
  color: #f6e3b4;
  margin-bottom: 10px;
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.hero p.hero-sub { font-size: 15px; letter-spacing: 4px; color: #dcc98f; margin-bottom: 16px; }
.hero p.hero-desc { font-size: 14px; color: #cdb98c; max-width: 660px; margin: 0 auto; line-height: 2; }
.hero-links { margin-top: 22px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hl-btn {
  display: inline-block;
  padding: 9px 26px;
  border: 1px solid #c8a45c;
  border-radius: 4px;
  color: #e9cf95;
  font-size: 14px;
  letter-spacing: 3px;
  transition: all .2s;
}
.hl-btn:hover { background: #c8a45c; color: #2f271c; }
.hl-btn.hl-main { background: var(--cinnabar); border-color: var(--cinnabar); color: #fff; }
.hl-btn.hl-main:hover { background: var(--gold); border-color: var(--gold); }

/* 统计条 */
.stat-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.stat {
  flex: 1 1 120px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 6px;
  box-shadow: 0 1px 3px rgba(90,70,40,.06);
}
.stat b { display: block; font-size: 26px; color: var(--cinnabar); font-family: "KaiTi", "STKaiti", serif; }
.stat span { font-size: 12.5px; color: var(--ink-2); letter-spacing: 1px; }

/* 家训 */
.jiaxun li {
  padding: 7px 2px;
  border-bottom: 1px dashed var(--line);
  font-size: 14.5px;
  letter-spacing: 1px;
}
.jiaxun li:last-child { border-bottom: none; }
.jiaxun li b {
  display: inline-block;
  width: 30px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--cinnabar);
  margin-right: 10px;
  font-size: 15px;
}

/* ---------- 首页分栏 ---------- */
.home-grid { display: flex; gap: 16px; flex-wrap: wrap; }
.home-col { flex: 1 1 340px; min-width: 0; }

.panel-title {
  font-size: 17px;
  letter-spacing: 3px;
  color: var(--cinnabar);
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 2px solid var(--gold);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.panel-title .more { font-size: 12px; color: var(--ink-2); letter-spacing: 1px; }

.news-item {
  display: flex;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.news-item:last-child { border-bottom: none; }
.news-item .tag {
  flex: 0 0 auto;
  background: var(--cinnabar);
  color: #fff;
  font-size: 12px;
  padding: 0 8px;
  border-radius: 3px;
  height: 22px;
  line-height: 22px;
  margin-top: 4px;
}
.news-item .tag.top { background: var(--gold); }
.news-item a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.news-item time { flex: 0 0 auto; color: #a09580; font-size: 12.5px; line-height: 30px; }

/* 字辈速览 */
.beizi-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.beizi-strip .bz {
  flex: 1 1 64px;
  text-align: center;
  padding: 10px 4px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.beizi-strip .bz b { display: block; font-size: 22px; color: var(--cinnabar); font-family: "KaiTi", "STKaiti", serif; }
.beizi-strip .bz span { font-size: 11.5px; color: var(--ink-2); }

/* 快捷入口 */
.quick-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.quick-grid a {
  flex: 1 1 120px;
  text-align: center;
  padding: 16px 6px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
  letter-spacing: 2px;
  color: var(--ink);
  transition: all .2s;
}
.quick-grid a:hover { background: var(--gold); color: #fff; border-color: var(--gold); }

/* ---------- 世系树 ---------- */
.tree-box { overflow-x: auto; padding: 6px 2px; }
.tree-list { padding-left: 0; }
.tree-list .tree-list { padding-left: 34px; position: relative; }
.tree-list .tree-list::before {
  content: '';
  position: absolute;
  left: 14px; top: 0; bottom: 0;
  border-left: 1.5px solid var(--line);
}
.tree-node { position: relative; margin: 7px 0; }
.tree-node.has-child > .tree-card::before {
  content: '';
  position: absolute;
  left: -19px; top: 24px;
  width: 20px; height: 1.5px;
  background: var(--line);
}
.tree-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 12px;
  position: relative;
  box-shadow: 0 1px 3px rgba(90,70,40,.08);
}
.tree-card .t-name { font-size: 17px; font-weight: bold; color: var(--cinnabar); letter-spacing: 2px; }
.tree-card .t-name:hover { text-decoration: underline; }
.tree-card .t-gen { font-size: 11.5px; color: var(--gold-deep); background: rgba(184,134,11,.12); padding: 0 6px; border-radius: 3px; }
.tree-card .t-beizi { font-size: 12.5px; color: var(--ink-2); }
.tree-card .t-spouse { font-size: 12px; color: var(--ink-2); }
.tree-card .t-branch { font-size: 11.5px; color: #fff; background: var(--gold-deep); padding: 0 6px; border-radius: 3px; }

/* ---------- 成员名录 ---------- */
.member-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.member-card {
  flex: 1 1 240px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(90,70,40,.08);
}
.member-card .m-name { font-size: 18px; color: var(--cinnabar); font-weight: bold; letter-spacing: 2px; }
.member-card .m-meta { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; line-height: 1.8; }
.member-card .m-meta span { margin-right: 10px; }

/* 搜索条 */
.search-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.search-bar input[type=text] {
  flex: 1 1 220px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  background: var(--card);
}
.search-bar select {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: inherit;
  background: var(--card);
  color: var(--ink);
}
.btn {
  display: inline-block;
  padding: 9px 22px;
  background: var(--cinnabar);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all .2s;
}
.btn:hover { background: var(--gold); }
.btn.ghost { background: var(--paper-2); color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--gold); color: #fff; border-color: var(--gold); }

/* ---------- 公告列表 / 详情 ---------- */
.news-list li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 11px 2px;
  border-bottom: 1px dashed var(--line);
  font-size: 15px;
}
.news-list li:last-child { border-bottom: none; }
.news-list .dot { color: var(--gold); }
.news-list a { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-list a:hover { color: var(--cinnabar); }
.news-list time { flex: 0 0 auto; color: #a09580; font-size: 13px; }

.article-title { font-size: 22px; letter-spacing: 2px; color: var(--cinnabar); margin-bottom: 8px; }
.article-meta { font-size: 12.5px; color: #a09580; margin-bottom: 18px; border-bottom: 1px dashed var(--line); padding-bottom: 12px; }
.article-body { font-size: 15px; line-height: 2.1; }
.article-body p { margin-bottom: 12px; text-indent: 2em; }

/* ---------- 家族资料 ---------- */
.ziliao-list li {
  padding: 12px 2px;
  border-bottom: 1px dashed var(--line);
}
.ziliao-list .zl-cat {
  font-size: 12px;
  color: #fff;
  background: var(--gold-deep);
  padding: 1px 8px;
  border-radius: 3px;
  margin-right: 8px;
}
.ziliao-list .zl-title { font-size: 16px; font-weight: bold; letter-spacing: 1px; }
.ziliao-list .zl-title:hover { color: var(--cinnabar); }
.ziliao-list .zl-brief { font-size: 13px; color: var(--ink-2); margin-top: 4px; }

/* ---------- 寻亲登记表单 ---------- */
.form-wrap { max-width: 640px; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 14px; margin-bottom: 5px; color: var(--ink); letter-spacing: 1px; }
.form-row label .req { color: var(--cinnabar); }
.form-row input[type=text],
.form-row input[type=password],
.form-row textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  background: var(--card);
  color: var(--ink);
}
.form-row textarea { min-height: 110px; resize: vertical; }
.form-tip { font-size: 12.5px; color: #a09580; margin-top: 4px; }
.form-ok {
  background: #f0f7e8;
  border: 1px solid #b7d99b;
  color: #4c7a24;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
}
.form-err {
  background: #f9ece9;
  border: 1px solid #e0b3aa;
  color: #9a3b26;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
}

/* ---------- 分页 ---------- */
.pager { margin-top: 18px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pager a, .pager span {
  display: inline-block;
  min-width: 32px;
  text-align: center;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13.5px;
  background: var(--card);
}
.pager a:hover { background: var(--gold); color: #fff; border-color: var(--gold); }
.pager span.cur { background: var(--cinnabar); color: #fff; border-color: var(--cinnabar); }

/* ---------- 页脚 ---------- */
.site-footer {
  background: linear-gradient(160deg, #2f271c, #3a2f23);
  color: #c9b88f;
  text-align: center;
  padding: 26px 0 20px;
  border-top: 3px solid var(--gold);
  font-size: 13px;
}
.site-footer .f-line1 { font-size: 15px; letter-spacing: 6px; color: #e6d3a2; margin-bottom: 6px; }
.site-footer .f-line2 { color: #b49e6d; margin-bottom: 4px; }
.site-footer .f-line3 { color: #8d7d5c; margin-bottom: 2px; }
.site-footer .f-line4 { color: #7c6d50; font-size: 12px; }

/* ---------- 空态 ---------- */
.empty { text-align: center; color: #a09580; padding: 40px 0; font-size: 14px; }

/* ---------- 移动端 ---------- */
@media (max-width: 720px) {
  .logo-cn { font-size: 24px; letter-spacing: 5px; }
  .header-inner { justify-content: center; text-align: center; }
  .main-nav a { padding: 7px 10px; font-size: 14px; }
  .hero { padding: 30px 18px 26px; }
  .hero h1 { font-size: 26px; letter-spacing: 6px; }
  .hero-seal { width: 58px; height: 58px; line-height: 58px; font-size: 17px; letter-spacing: 2px; }
  .tree-list .tree-list { padding-left: 24px; }
  .tree-list .tree-list::before { left: 10px; }
  .tree-node.has-child > .tree-card::before { left: -13px; width: 14px; }
  .article-body { font-size: 14.5px; }
}
