/* ============================================================
   东楼村李氏宗祠 — 中式传统风设计系统
   ============================================================ */

:root {
  --paper: #f6f1e4;
  --paper-deep: #ece3cd;
  --paper-card: #fbf7ec;
  --red: #8c1f28;
  --red-deep: #6e141c;
  --red-soft: #a5353f;
  --gold: #b98a3c;
  --gold-light: #d6b36a;
  --gold-pale: #e9dcbc;
  --ink: #2b2b26;
  --ink-soft: #55503f;
  --line: #c9bda0;
  --line-soft: #ddd3b8;
  --green: #3f6f4e;
  --shadow: 0 6px 24px rgba(60, 48, 28, 0.12);

  --serif: "SimSun", "Songti SC", "Noto Serif SC", STSong, serif;
  --kai: "KaiTi", "STKaiti", "BiauKai", "Noto Serif SC", serif;

  --container: 1180px;
  --radius: 4px;
  --header-h: 66px;
  --ease: cubic-bezier(.23, 1, .32, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: rgba(140, 31, 40, 0.12); }
button, a { touch-action: manipulation; }

body {
  font-family: var(--serif);
  background-color: var(--paper);
  background-image:
    radial-gradient(rgba(130, 110, 70, 0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  color: var(--ink);
  line-height: 1.8;
  font-size: 16.5px;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
button { font-family: inherit; cursor: pointer; }
ul, ol { list-style: none; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 22px; }

/* ============ 顶部金线 ============ */
.topline { height: 4px; background: linear-gradient(90deg, var(--gold-pale), var(--gold) 30%, var(--red) 50%, var(--gold) 70%, var(--gold-pale)); }

/* ============ 页首 ============ */
.site-header { position: sticky; top: 0; z-index: 60; background: rgba(246, 241, 228, 0.96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 14px; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand-seal {
  width: 44px; height: 44px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--red); border-radius: 8px 8px 8px 2px;
  color: var(--gold-pale); font-family: var(--kai);
  font-size: 25px; font-weight: bold;
  box-shadow: inset 0 0 0 2px var(--gold), inset 0 0 0 3px rgba(246,241,228,.7);
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.brand-text { line-height: 1.15; }
.brand-text strong { display: block; font-family: var(--kai); font-size: 21px; color: var(--red-deep); letter-spacing: 2px; }
.brand-text span { font-size: 12.5px; color: var(--ink-soft); letter-spacing: 3px; }

.main-nav ul { display: flex; gap: 2px; }
.main-nav a {
  display: block; padding: 8px 15px; font-size: 16px; font-family: var(--kai);
  color: var(--ink); border-bottom: 2px solid transparent; letter-spacing: 1px;
}
.main-nav a:hover { color: var(--red); }
body[data-page="index"] .main-nav a[data-nav="index"],
body[data-page="guankuang"] .main-nav a[data-nav="guankuang"],
body[data-page="history"] .main-nav a[data-nav="history"],
body[data-page="genealogy"] .main-nav a[data-nav="genealogy"],
body[data-page="shiwu"] .main-nav a[data-nav="shiwu"],
body[data-page="caiwu"] .main-nav a[data-nav="caiwu"] {
  color: var(--red); border-bottom-color: var(--red); font-weight: bold;
}

.nav-admin a {
  font-size: 14px; color: var(--gold); border: 1px solid var(--gold);
  padding: 5px 14px; border-radius: var(--radius); font-family: var(--serif);
}
.nav-admin a:hover { background: var(--red); color: var(--paper); border-color: var(--red); }

.burger { display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 10px; font-size: 20px; color: var(--red); }

/* ============ 通用区块 ============ */
.section { padding: 64px 0; }
.section-alt { background: linear-gradient(180deg, var(--paper-deep), var(--paper) 18%); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }

.sec-head { text-align: center; margin-bottom: 40px; }
.sec-head .en { font-size: 12px; letter-spacing: 5px; color: var(--gold); font-family: var(--kai); }
.sec-title {
  font-family: var(--kai); font-size: 34px; color: var(--red-deep);
  letter-spacing: 6px; display: flex; align-items: center; justify-content: center; gap: 16px;
}
.sec-title::before, .sec-title::after {
  content: ""; width: 46px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.sec-title::after { background: linear-gradient(90deg, var(--gold), transparent); }
.sec-sub { margin-top: 10px; color: var(--ink-soft); font-size: 15px; }

/* 理事会名单 */
.council-names { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.council-name-item {
  display: inline-flex; align-items: center;
  font-family: var(--kai); font-size: 19px; color: var(--red-deep); letter-spacing: 3px;
  line-height: 1; white-space: nowrap;
  background: var(--paper-card); border: 1px solid var(--gold-pale); border-radius: 20px;
  padding: 8px 18px; box-shadow: var(--shadow);
}
.council-name-item::after { content: ""; margin-left: 0; }
@media (max-width: 700px) {
  .council-names { gap: 8px; }
  .council-name-item { font-size: 16px; padding: 6px 12px; }
}
.council-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin: 6px 0 10px; }
.council-card {
  background: var(--paper-deep); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 14px 12px; text-align: center; transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.council-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--gold-pale); }
.council-name { font-family: var(--kai); font-size: 19px; color: var(--red-deep); letter-spacing: 3px; }
.council-branch { margin-top: 6px; font-size: 12px; color: var(--ink-soft); letter-spacing: 1px; }

/* 菱形分隔符 */
.ornament { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 14px auto 0; color: var(--gold); }
.ornament::before, .ornament::after { content: ""; width: 70px; height: 1px; background: var(--line); }
.ornament i { font-style: normal; font-size: 10px; }

/* 鎏金双线 */
.rule-double { height: 6px; background: repeating-linear-gradient(90deg, var(--gold) 0 6px, transparent 6px 8px, var(--gold-pale) 8px 12px); opacity: .5; margin: 0 auto; max-width: 220px; }

/* ============ 首页 Hero ============ */
.hero {
  position: relative; min-height: 78vh; display: flex; align-items: center; justify-content: center;
  text-align: center; overflow: hidden;
  background: var(--ink);
}
.hero-img { position: absolute; inset: 0; background-size: cover; background-position: center; }
.hero-img::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,16,8,.45), rgba(20,16,8,.25) 40%, rgba(20,16,8,.72));
}
.hero-inner { position: relative; z-index: 2; color: #fbf7ec; padding: 40px 22px; max-width: 860px; }
.hero-seal {
  width: 72px; height: 72px; margin: 0 auto 22px;
  display: flex; align-items: center; justify-content: center;
  background: var(--red); color: var(--gold-pale); font-family: var(--kai);
  font-size: 40px; font-weight: bold; border-radius: 12px 12px 12px 4px;
  box-shadow: inset 0 0 0 3px var(--gold), 0 0 0 4px rgba(246,241,228,.35);
}
.hero-cn { font-family: var(--kai); font-size: clamp(38px, 7vw, 66px); letter-spacing: 12px; text-shadow: 0 2px 18px rgba(0,0,0,.5); }
.hero-sub { margin-top: 14px; font-size: 17px; letter-spacing: 6px; color: var(--gold-pale); }
.hero-quote { margin: 26px auto 0; max-width: 620px; font-size: 15px; color: rgba(251,247,236,.82); letter-spacing: 2px; border-top: 1px solid rgba(214,179,106,.4); border-bottom: 1px solid rgba(214,179,106,.4); padding: 12px 0; }
.hero-actions { margin-top: 34px; display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.btn-hero-3d { background: var(--gold); color: #3a2a10; border: 1px solid var(--gold-light); }
.btn-hero-3d:hover { background: var(--gold-light); }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 26px; font-size: 16px; font-family: var(--kai);
  border-radius: var(--radius); border: 1px solid var(--gold);
  background: transparent; color: var(--red-deep); letter-spacing: 2px;
  transition: all .22s ease;
}
.btn:hover { background: var(--red); color: var(--paper); border-color: var(--red); }
.btn-primary { background: var(--red); color: var(--paper); border-color: var(--red); }
.btn-primary:hover { background: var(--red-deep); }
.btn-ghost-light { color: #f6f1e4; border-color: rgba(246,241,228,.6); }
.btn-ghost-light:hover { background: rgba(246,241,228,.12); }
.btn-sm { padding: 5px 14px; font-size: 14px; }
.btn-danger { border-color: var(--red-soft); color: var(--red-soft); }
.btn-danger:hover { background: var(--red-soft); color: var(--paper); border-color: var(--red-soft); }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ============ 卡片 ============ */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--paper-card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(60,48,28,.18); }
.card-media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--paper-deep); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-media img { transform: scale(1.05); }
.card-body { padding: 18px 20px 20px; }
.card-body h3 { font-family: var(--kai); font-size: 20px; color: var(--red-deep); margin-bottom: 8px; letter-spacing: 1px; }
.card-body p { color: var(--ink-soft); font-size: 14.5px; }
.card-meta { margin-top: 12px; font-size: 13px; color: var(--gold); display: flex; gap: 12px; align-items: center; }
.card-meta .tag { background: var(--red); color: var(--paper); padding: 1px 8px; border-radius: 2px; font-family: var(--kai); }

/* 文章列表卡片（事务部） */
.article-card { display: block; padding: 20px 24px; margin-bottom: 16px; }
.article-card h3 { font-family: var(--kai); font-size: 21px; color: var(--red-deep); margin-bottom: 6px; }
.article-card:hover h3 { color: var(--red); }
.article-card p { color: var(--ink-soft); font-size: 14.5px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.article-card .meta { margin-top: 10px; font-size: 13px; color: var(--gold); display: flex; gap: 14px; }

/* ============ 表格 ============ */
.table-wrap { overflow-x: auto; background: var(--paper-card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table.table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 640px; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); }
.table th {
  background: var(--red); color: var(--paper); font-family: var(--kai); font-weight: normal;
  letter-spacing: 2px; font-size: 15px; white-space: nowrap;
}
.table td { color: var(--ink); }
.table tbody tr:nth-child(even) { background: rgba(214, 179, 106, 0.08); }
.table tbody tr:hover { background: rgba(140, 31, 40, 0.05); }
.table .num { font-family: var(--kai); }
.amount-in { color: var(--green); font-weight: bold; }
.amount-out { color: var(--red); font-weight: bold; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat {
  background: var(--paper-card); border: 1px solid var(--line); border-top: 3px solid var(--gold);
  border-radius: var(--radius); padding: 16px 20px; text-align: center; box-shadow: var(--shadow);
}
.stat .k { font-size: 13.5px; color: var(--ink-soft); letter-spacing: 2px; }
.stat .v { font-family: var(--kai); font-size: 26px; color: var(--red-deep); margin-top: 4px; }
.stat.income .v { color: var(--green); }
.stat.expense .v { color: var(--red); }

/* ============ 表单 ============ */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14.5px; color: var(--ink-soft); margin-bottom: 6px; letter-spacing: 1px; }
.field label .req { color: var(--red); }
.input, .select, .textarea {
  width: 100%; padding: 10px 14px; font-family: var(--serif); font-size: 15.5px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fffdf6; color: var(--ink); transition: border-color .2s ease, box-shadow .2s ease;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(185,138,60,.15); }
.textarea { min-height: 160px; resize: vertical; line-height: 1.9; }
.select { cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 18px; }

/* 筛选栏 */
.filters { display: flex; gap: 14px; flex-wrap: wrap; align-items: end; margin-bottom: 22px; }
.filters .field { margin-bottom: 0; min-width: 150px; }

/* ============ 标签/筛选 chip ============ */
.chips { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-bottom: 26px; }
.chip {
  padding: 7px 20px; border: 1px solid var(--line); border-radius: 20px;
  background: transparent; color: var(--ink-soft); font-size: 15px; font-family: var(--kai);
  transition: all .2s ease;
}
.chip:hover { border-color: var(--gold); color: var(--red-deep); }
.chip.active { background: var(--red); border-color: var(--red); color: var(--paper); }
.chip .cnt { font-size: 12px; opacity: .75; }

/* ============ 时间线 ============ */
.timeline { position: relative; max-width: 900px; margin: 0 auto; padding-top: 10px; }
.timeline::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: linear-gradient(180deg, var(--gold-light), var(--red) 60%, var(--gold-light)); transform: translateX(-50%); }
.tl-item { position: relative; width: 50%; padding: 0 40px 44px; }
.tl-item:nth-child(odd) { left: 0; text-align: right; }
.tl-item:nth-child(even) { left: 50%; text-align: left; }
.tl-dot { position: absolute; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--gold); border: 3px solid var(--paper); box-shadow: 0 0 0 2px var(--gold); z-index: 2; }
.tl-item:nth-child(odd) .tl-dot { right: -8px; }
.tl-item:nth-child(even) .tl-dot { left: -6px; }
.tl-year { font-family: var(--kai); font-size: 22px; color: var(--red-deep); letter-spacing: 2px; }
.tl-card { margin-top: 8px; background: var(--paper-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); }
.tl-card h4 { font-family: var(--kai); color: var(--red-deep); margin-bottom: 4px; }
.tl-card p { font-size: 14px; color: var(--ink-soft); }

/* ============ 族谱树 ============ */
.tree { display: flex; justify-content: center; overflow-x: auto; padding: 30px 0 10px; }
.tree ul { display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; padding-left: 0; }
.tree li { position: relative; display: flex; flex-direction: column; align-items: center; }
.tree .node-card {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 128px; padding: 8px 14px; margin: 4px 8px;
  background: var(--paper-card); border: 1px solid var(--line); border-left: 4px solid var(--red);
  border-radius: var(--radius); box-shadow: var(--shadow); cursor: pointer;
  transition: all .2s ease;
}
.tree .node-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.tree .node-card.root { border-left: 4px solid var(--gold); background: var(--paper-deep); }
.tree .node-name { font-family: var(--kai); font-size: 16.5px; color: var(--red-deep); letter-spacing: 1px; }
.tree .node-lifetime { font-size: 12px; color: var(--ink-soft); }
.tree .node-branch { font-size: 11px; color: var(--gold); border: 1px solid var(--gold-pale); padding: 0 6px; border-radius: 8px; margin-top: 2px; }
.tree .children { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; position: relative; margin-top: 10px; padding-top: 10px; }
.tree .children::before { content: ""; position: absolute; top: 0; left: 50%; width: 2px; height: 10px; background: var(--line); transform: translateX(-50%); }
.tree .node-collapse { border: 1px solid var(--line-soft); background: none; color: var(--gold); border-radius: 50%; width: 22px; height: 22px; font-size: 13px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; margin-top: 4px; }
.tree .node-collapse:hover { background: var(--gold); color: #fff; }
.tree li.stale > .children { display: none; }

.genealogy-layout { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: start; }

/* 成员详情 */
.person-detail { position: sticky; top: calc(var(--header-h) + 20px); }
.person-detail .detail-card { background: var(--paper-card); border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.detail-card h3 { font-family: var(--kai); font-size: 28px; color: var(--red-deep); letter-spacing: 2px; }
.detail-card .dl { margin-top: 14px; display: grid; grid-template-columns: 74px 1fr; row-gap: 8px; font-size: 15px; }
.detail-card .dl dt { color: var(--ink-soft); }
.detail-card .dl dd { color: var(--ink); }
.detail-card .bio { margin-top: 12px; font-size: 14.5px; color: var(--ink-soft); border-top: 1px dashed var(--line); padding-top: 12px; }
.detail-placeholder { color: var(--ink-soft); text-align: center; padding: 40px 10px; font-size: 15px; opacity: .8; }

/* ============ 财务 ============ */
.fin-summary h4 { font-family: var(--kai); color: var(--red-deep); font-size: 20px; margin: 26px 0 12px; letter-spacing: 2px; border-left: 4px solid var(--gold); padding-left: 12px; }

/* ============ 卷轴正文（概况/历史） ============ */
.prose { max-width: 900px; margin: 0 auto; font-size: 16.5px; line-height: 2.1; color: var(--ink); }
.prose p { text-indent: 2em; margin-bottom: 16px; }
.prose h3 { font-family: var(--kai); font-size: 24px; color: var(--red-deep); letter-spacing: 2px; margin: 34px 0 12px; text-indent: 0; }
.prose .img-inline { margin: 24px 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.prose figcaption { text-align: center; font-size: 13px; color: var(--ink-soft); padding: 8px; background: var(--paper-card); }

/* ============ 全景板块（首页） ============ */
.pano-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.pano-tile {
  position: relative; border-radius: var(--radius); overflow: hidden; cursor: pointer;
  border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--paper-deep);
  aspect-ratio: 4 / 3;
}
.pano-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.pano-tile:hover img { transform: scale(1.06); }
.pano-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(20,16,8,.75)); }
.pano-tile .pano-meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 14px; z-index: 2; color: #fbf7ec; }
.pano-tile .pano-meta strong { font-family: var(--kai); font-size: 18px; letter-spacing: 2px; display: block; }
.pano-tile .pano-meta span { font-size: 12.5px; color: var(--gold-pale); }
.pano-tile .pano-orient {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: rgba(140,31,40,.88); color: var(--paper); font-size: 12px;
  padding: 2px 10px; border-radius: 12px; letter-spacing: 1px;
}

/* 全景查看器 */
.viewer-mask {
  position: fixed; inset: 0; z-index: 90; background: #14110c;
  display: none; flex-direction: column;
}
.viewer-mask.open { display: flex; }
.viewer-stage { position: relative; flex: 1; overflow: hidden; }
.viewer-stage canvas { display: block; }
.viewer-hint {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  color: rgba(246,241,228,.85); font-size: 13px; letter-spacing: 2px;
  background: rgba(20,16,8,.55); padding: 6px 18px; border-radius: 16px; pointer-events: none;
}
.viewer-info {
  position: absolute; left: 24px; top: 16px; color: #f6f1e4; z-index: 3;
  text-shadow: 0 1px 6px rgba(0,0,0,.7);
}
.viewer-info strong { font-family: var(--kai); font-size: 26px; letter-spacing: 4px; display: block; }
.viewer-info span { font-size: 13px; color: var(--gold-pale); }
.viewer-nav { display: flex; justify-content: center; gap: 10px; padding: 14px 16px; background: rgba(20,16,8,.92); border-top: 1px solid rgba(214,179,106,.3); overflow-x: auto; }
.viewer-nav button {
  background: none; border: 1px solid rgba(214,179,106,.5); color: #e8ddc0;
  padding: 7px 16px; border-radius: 4px; flex: none; font-family: var(--kai); font-size: 15px;
  transition: all .2s ease;
}
.viewer-nav button:hover { background: rgba(214,179,106,.18); }
.viewer-nav button.active { background: var(--gold); color: #3a2a10; border-color: var(--gold); }
.viewer-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--gold-pale); font-family: var(--kai); letter-spacing: 4px; background: #14110c;
}
.viewer-loading::after { content: ""; width: 34px; height: 34px; border: 3px solid rgba(214,179,106,.3); border-top-color: var(--gold); border-radius: 50%; margin-left: 12px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 热点标签 */
.hotspot { position: absolute; transform: translate(-50%, -50%); z-index: 4; cursor: pointer; }
.hotspot .dot {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid #f6f1e4;
  background: radial-gradient(circle at 35% 35%, var(--gold-light), var(--gold));
  box-shadow: 0 0 0 6px rgba(214,179,106,.35); animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 4px rgba(214,179,106,.4); } 50% { box-shadow: 0 0 0 9px rgba(214,179,106,.15); } }
.hotspot .hint {
  position: absolute; top: -34px; left: 50%; transform: translateX(-50%);
  white-space: nowrap; background: rgba(20,16,8,.8); color: #f6f1e4; font-size: 13px;
  padding: 2px 12px; border-radius: 12px; opacity: 0; transition: opacity .2s ease; border: 1px solid rgba(214,179,106,.5);
}
.hotspot:hover .hint, .hotspot:hover .dot { background: radial-gradient(circle at 35% 35%, #f5e7c4, var(--gold-light)); }
.hotspot:hover .hint { opacity: 1; }

.viewer-close {
  position: absolute; top: 16px; right: 20px; z-index: 5;
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(214,179,106,.6);
  background: rgba(20,16,8,.6); color: var(--gold-pale); font-size: 22px; line-height: 1; transition: all .2s ease;
}
.viewer-close:hover { background: var(--red); border-color: var(--red); color: #fff; }

/* ============ 灯箱 ============ */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(10,8,4,.92);
  display: none; align-items: center; justify-content: center; padding: 30px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 86vh; border: 2px solid var(--gold); border-radius: 4px; }
.lightbox .lb-close { position: absolute; top: 18px; right: 24px; color: #fff; font-size: 34px; background: none; border: none; }

/* ============ 模态框 ============ */
.modal-mask {
  position: fixed; inset: 0; z-index: 80; background: rgba(20,16,8,.6);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-mask.open { display: flex; }
.modal {
  background: var(--paper-card); border: 1px solid var(--line); border-top: 4px solid var(--red);
  border-radius: var(--radius); width: 100%; max-width: 680px; max-height: 88vh;
  overflow-y: auto; padding: 30px; box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.modal h3 { font-family: var(--kai); font-size: 24px; color: var(--red-deep); margin-bottom: 6px; letter-spacing: 2px; }
.modal .modal-close { float: right; font-size: 30px; color: var(--ink-soft); background: none; border: none; }
.modal .modal-content { white-space: pre-line; line-height: 2; margin-top: 16px; color: var(--ink); }

/* ============ 提示条 ============ */
.notice { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14.5px; border: 1px solid; display: none; }
.notice.show { display: block; }
.notice.error { background: rgba(140,31,40,.08); border-color: var(--red-soft); color: var(--red-deep); }
.notice.success { background: rgba(63,111,78,.1); border-color: var(--green); color: var(--green); }
.notice.info { background: rgba(185,138,60,.1); border-color: var(--gold); color: #7a5a1f; }

/* ============ 页脚 ============ */
.site-footer { background: #241f16; color: #cfc5a4; margin-top: 40px; }
.footer-main { padding: 44px 0 30px; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 34px; }
.footer-main h4 { font-family: var(--kai); color: var(--gold-pale); letter-spacing: 3px; margin-bottom: 14px; font-size: 18px; }
.footer-main li { font-size: 14.5px; line-height: 2.2; color: #b9ae90; }
.footer-brand p { font-size: 14px; line-height: 2; color: #b9ae90; margin-top: 10px; }
.footer-bottom { border-top: 1px solid rgba(214,179,106,.2); padding: 16px 0; text-align: center; font-size: 13px; color: #8f8569; letter-spacing: 1px; }

/* ============ 滚动显现 ============ */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ============ 加载态 ============ */
.skeleton { position: relative; overflow: hidden; background: var(--paper-deep); border-radius: var(--radius); min-height: 80px; }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.empty { text-align: center; color: var(--ink-soft); padding: 40px 10px; font-size: 15px; }

/* ============ 家庭名册 ============ */
.roster-filters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; column-gap: 24px; align-items: end; }
.roster-stat { margin-top: 14px; font-size: 14px; color: var(--ink-soft); letter-spacing: 1px; }
.family-card { background: var(--paper-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 20px; box-shadow: var(--shadow); }
.family-head h4 { font-family: var(--kai); font-size: 22px; color: var(--red-deep); letter-spacing: 3px; margin-bottom: 6px; }
.family-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chip-mini { display: inline-block; padding: 2px 10px; border: 1px solid var(--gold); color: #7a5a1f; background: rgba(214,179,106,.12); border-radius: 20px; font-size: 12.5px; letter-spacing: 1px; }
.family-note { font-size: 13.5px; color: var(--ink-soft); margin: 4px 0 10px; }
.gen-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 8px; margin-right: 8px; font-family: var(--kai); font-size: 18px; color: #fff; background: var(--red-deep); border: 1px solid var(--red); border-radius: 6px; vertical-align: middle; }
.gen-seq { font-size: 12.5px; color: var(--ink-soft); }
@media (max-width: 760px) { .roster-filters { grid-template-columns: 1fr; } }

/* ============ 响应式 ============ */
@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .genealogy-layout { grid-template-columns: 1fr; }
  .person-detail { position: static; }
  .timeline::before { left: 12px; }
  .tl-item, .tl-item:nth-child(even) { width: 100%; left: 0; padding: 0 0 32px 42px; text-align: left; }
  .tl-item:nth-child(odd) .tl-dot, .tl-item:nth-child(even) .tl-dot { left: 5px; right: auto; }
  .footer-main { grid-template-columns: 1fr; gap: 26px; }
}
@media (max-width: 860px) {
  .main-nav { display: none; }
  .main-nav.open { display: block; position: absolute; top: var(--header-h); left: 0; right: 0; background: rgba(246,241,228,.98); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); max-height: calc(100vh - var(--header-h)); overflow-y: auto; }
  .main-nav.open ul { flex-direction: column; padding: 10px; }
  .main-nav.open a { border-bottom: 1px solid var(--line-soft); border-left: 2px solid transparent; padding: 13px 15px; font-size: 17px; }
  .main-nav.open a:hover { border-left-color: var(--red); }
  .burger { display: block; padding: 8px 13px; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; align-items: center; }
  .hero-cn { letter-spacing: 6px; }
}

/* ============ 手机端增强 ============ */
@media (max-width: 980px) {
  .section { padding: 46px 0; }
  .sec-head { margin-bottom: 30px; }
  .sec-title { font-size: 28px; letter-spacing: 4px; }
  .sec-title::before, .sec-title::after { width: 28px; }
  .hero { min-height: 62vh; }
  .hero-sub { font-size: 15px; letter-spacing: 4px; }
  .hero-quote { font-size: 14px; letter-spacing: 1px; }
  .filters { align-items: stretch; }
  .filters .field { min-width: 0; flex: 1 1 160px; }
  .chips { gap: 9px; }
  .chip { padding: 7px 15px; font-size: 14px; }
}

@media (max-width: 700px) {
  body { font-size: 16px; line-height: 1.75; }
  .container { padding: 0 16px; }
  .section { padding: 38px 0; }
  .sec-title { font-size: 24px; letter-spacing: 3px; }
  .sec-title::before, .sec-title::after { width: 20px; }
  .ornament::before, .ornament::after { width: 46px; }

  .main-nav.open a { padding: 13px 16px; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
  .stat { padding: 12px 10px; }
  .stat .k { font-size: 12.5px; }
  .stat .v { font-size: 21px; }

  .table th, .table td { padding: 10px 8px; font-size: 14px; }
  .table-wrap { box-shadow: none; border-radius: var(--radius); }

  .modal { padding: 20px; max-height: 92vh; }
  .modal-mask { padding: 12px; }
  .lightbox { padding: 12px; }
  .notice { font-size: 13.5px; }

  .footer-main { padding: 30px 0 22px; gap: 18px; }
  .footer-main h4 { font-size: 16px; margin-bottom: 10px; }
  .footer-main li { font-size: 14px; }

  .card-body { padding: 15px 16px 17px; }
  .article-card { padding: 16px 16px; }
  .article-card h3 { font-size: 19px; }

  .detail-card { padding: 18px; }
  .detail-card h3 { font-size: 24px; }

  .family-card { padding: 16px 14px; }
  .family-head h4 { font-size: 20px; }
  .council-grid { grid-template-columns: repeat(auto-fill, minmax(125px, 1fr)); gap: 10px; }
  .council-card { padding: 12px 8px; }
  .council-name { font-size: 17px; }

  .pano-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }

  .tree .node-card { min-width: 96px; padding: 6px 10px; margin: 3px 4px; }
  .tree .node-name { font-size: 15px; }
  .tree .node-branch { font-size: 10px; }
  .tree .node-lifetime { font-size: 11px; }

  .viewer-info { left: 14px; top: 12px; }
  .viewer-info strong { font-size: 22px; letter-spacing: 3px; }
  .viewer-info span { font-size: 12px; }
  .viewer-hint { display: none; }
  .viewer-close { top: 12px; right: 14px; width: 38px; height: 38px; font-size: 20px; }
  .viewer-nav { justify-content: flex-start; padding: 10px 12px; gap: 8px; }
  .viewer-nav button { padding: 8px 13px; font-size: 14px; }

  .hotspot .dot { width: 18px; height: 18px; }
  .hotspot .hint { font-size: 12px; }
}

@media (max-width: 420px) {
  .container { padding: 0 13px; }
  .site-header { --header-h: 58px; }
  .brand-seal { width: 38px; height: 38px; font-size: 22px; }
  .brand-text strong { font-size: 18px; letter-spacing: 1px; }
  .brand-text span { display: none; }
  .hero { min-height: 56vh; }
  .hero-cn { font-size: 34px; letter-spacing: 4px; }
  .hero-seal { width: 60px; height: 60px; font-size: 34px; }
  .hero-sub { font-size: 13px; letter-spacing: 2px; }
  .btn { padding: 9px 20px; font-size: 15px; }
  .filters { flex-direction: column; align-items: stretch; }
  .filters .field { min-width: 0; }
  .chips { gap: 8px; }
  .chip { padding: 6px 12px; font-size: 13px; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .prose h3 { font-size: 21px; }
  .council-grid { grid-template-columns: repeat(2, 1fr); }
  .council-name { font-size: 16px; letter-spacing: 2px; }
  .family-tags { gap: 6px; }
  .chip-mini { font-size: 11.5px; padding: 2px 8px; }
  .roster-stat { font-size: 13px; }
  .footer-bottom { font-size: 12px; }
}