/* ============ 族谱网站 · 视觉体系 v2 ============
   风格：宣纸暖米 + 墨色 + 朱砂印章红 + 金棕点缀
   含：响应式（手机）、适老大字模式（body.elderly） */

:root {
  --ink: #2b2621;            /* 墨 */
  --ink-soft: #4a423a;
  --paper: #fffdf8;          /* 纸面 */
  --accent: #9e2b25;         /* 朱砂 */
  --accent-deep: #7c1f1a;
  --gold: #b08d4f;           /* 金棕 */
  --muted: #85796a;
  --line: #e3dac8;
  --bg: #f5f0e4;             /* 宣纸底 */
  --bg-deep: #ede6d4;
  --card: #fffdf8;
  --shadow: 0 2px 10px rgba(70, 55, 30, .08);
  --shadow-lift: 0 6px 18px rgba(70, 55, 30, .14);
  --c-male: #005aff;         /* 男 · 鲜蓝（天师定色 0,90,255） */
  --c-female: #ff0000;       /* 女 · 正红（天师定色 255,0,0） */
  --c-spouse: #d8a4b8;       /* 配偶 */
  --wife-1: #ff9ecb;         /* 元配·粉 */
  --wife-2: #ffd34d;         /* 继室·黄 */
  --wife-3: #c084fc;         /* 三室·紫 */
  --wife-4: #ffb066;         /* 四室·橙 */
  --wife-5: #4dd0b1;         /* 五室·青 */
.ft-wdot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:4px; vertical-align:middle; border:1px solid rgba(0,0,0,.18); }
}

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

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

body {
  font-family: "Source Han Serif SC", "Noto Serif SC", "SimSun", "Microsoft YaHei", serif;
  background:
    radial-gradient(1200px 400px at 50% -80px, rgba(176, 141, 79, .07), transparent 70%),
    var(--bg);
  color: var(--ink);
  line-height: 1.75;
  min-height: 100vh;
  font-size: 15.5px;
}

a { color: inherit; text-decoration: none; }
::selection { background: rgba(158, 43, 37, .18); }

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

/* ===== 顶部：站名 ===== */
.masthead {
  background: linear-gradient(180deg, #fffef9 0%, var(--paper) 100%);
  border-bottom: 1px solid var(--line);
  position: relative;
}
.masthead::before {           /* 顶部金线 */
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, transparent, var(--gold) 18%, var(--gold) 82%, transparent);
  opacity: .8;
}
.masthead .inner {
  max-width: 1080px; margin: 0 auto; padding: 24px 18px 16px;
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}
.site-title {
  font-size: 34px; font-weight: 900; letter-spacing: 10px; color: var(--ink);
  position: relative; padding-left: 6px;
}
.site-title::after {          /* 站名旁小印 */
  content: "譜"; position: absolute; right: -34px; top: 6px;
  width: 24px; height: 24px; border: 2px solid var(--accent); border-radius: 5px;
  color: var(--accent); font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; letter-spacing: 0;
  transform: rotate(6deg); opacity: .85;
}
.site-sub { font-size: 13px; color: var(--muted); letter-spacing: 4px; }

/* ===== 导航条：斜切分隔（设计稿风格）===== */
.navbar { background: var(--paper); border-bottom: 2px solid var(--ink); position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 8px rgba(43,38,33,.08); }
.nav-inner { max-width: 1080px; margin: 0 auto; display: flex; padding: 0 18px; }
.nav-item {
  flex: 1; text-align: center; padding: 14px 4px; border: none;
  font-size: 17px; font-weight: 700; letter-spacing: 2px; font-family: inherit;
  border-right: 2px solid var(--line); position: relative; white-space: nowrap;
  transform: skewX(-12deg); margin-right: 4px; color: var(--ink); background: transparent;
  transition: background .16s, color .16s; cursor: pointer;
}
.nav-item:last-of-type { border-right: none; }
.nav-item > span { display: inline-block; transform: skewX(12deg); }
.nav-item:hover { background: var(--bg-deep); color: var(--ink); }
.nav-item.active { background: var(--ink); color: var(--paper); }
/* 适老切换按钮 */
.nav-item.elder-btn { flex: 0 0 auto; color: var(--gold); font-size: 15px; padding: 14px 14px; }
.nav-item.elder-btn:hover { color: var(--accent); }
.nav-item.elder-btn.on { background: var(--gold); color: #fff; }
.nav-inner::after { content: ""; width: 14px; background: var(--paper); border-left: 2px solid var(--line); transform: skewX(-12deg); }

/* ===== 通用区块 ===== */
.page { padding: 30px 0 60px; }
.page-title {
  font-size: 25px; font-weight: 900; letter-spacing: 5px;
  border-left: 6px solid var(--accent); padding-left: 14px; margin-bottom: 20px;
}
.page-title::after { content: ""; display: block; height: 3px; margin-top: 8px; width: 100%;
  background: linear-gradient(90deg, var(--gold), transparent 60%); border-radius: 2px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--gold);
  border-radius: 8px; padding: 20px 22px; margin-bottom: 16px;
  box-shadow: var(--shadow); transition: box-shadow .18s, transform .18s;
}
.card:hover { box-shadow: var(--shadow-lift); }
.card h3 { font-size: 19px; margin-bottom: 10px; letter-spacing: 2px; }
.card h3::before { content: "◈ "; color: var(--gold); font-size: 15px; }
.card .meta { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.card .body { font-size: 15px; }
.card .body p { margin-bottom: 8px; }

.btn {
  display: inline-block; padding: 8px 20px; border: 2px solid var(--ink); border-radius: 6px;
  background: var(--paper); color: var(--ink);
  font-family: inherit; font-size: 15px; font-weight: 700; letter-spacing: 2px; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.btn:active { transform: scale(.97); }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); }
.btn.small { padding: 4px 11px; font-size: 13px; border-width: 1.5px; }
.btn.danger { border-color: var(--accent); color: var(--accent); }
.btn.danger:hover { background: var(--accent); color: #fff; }
.btn:disabled { opacity: .4; cursor: default; }

input, select, textarea {
  font-family: inherit; font-size: 15px; padding: 8px 11px;
  border: 1.5px solid var(--ink-soft); border-radius: 6px; background: var(--paper); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }

.search-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.search-bar input[type="text"] { flex: 1; min-width: 180px; }

.tag {
  display: inline-block; font-size: 12px; border: 1px solid var(--ink-soft); border-radius: 4px;
  padding: 1px 9px; margin-right: 6px; letter-spacing: 1px; background: var(--paper);
}
.tag.red { border-color: var(--accent); color: var(--accent); }

/* ===== 人员 ===== */
.person-card { cursor: pointer; }
.person-card:hover { transform: translateY(-2px); }
.gen-badge {
  display: inline-block; background: var(--ink); color: var(--paper); font-size: 12px;
  border-radius: 4px; padding: 1px 8px; letter-spacing: 2px; margin-right: 8px;
}
.rel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 8px; }
.rel-chip { border: 1px solid var(--line); border-radius: 6px; background: var(--paper); padding: 8px 10px; font-size: 14px; cursor: pointer; transition: border-color .15s; }
.rel-chip:hover { border-color: var(--gold); }
.rel-chip .r { font-size: 12px; color: var(--muted); display: block; }

/* ===== 族谱树（可折叠倒树）===== */
.ftree-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 4px 2px; }
ul.ftree, ul.ft-children { list-style: none; margin: 0; padding: 0; }
ul.ft-children { margin-left: 22px; padding-left: 14px; border-left: 2px solid var(--gold); position: relative; }
ul.ft-children::before { content: ""; position: absolute; left: -2px; top: -9px; height: 9px; border-left: 2px solid var(--gold); }
.ft-item { position: relative; }
.ft-item::before { content: ""; position: absolute; left: -14px; top: 19px; width: 14px; border-top: 2px solid var(--gold); opacity: .7; }
.ft-item:last-child::after { content: ""; position: absolute; left: -16px; top: 21px; bottom: 0; width: 6px; background: var(--card); }
ul.ftree > .ft-item::before { display: none; }
.ft-node { display: flex; flex-direction: column; align-items: flex-start; padding: 3px 4px; border-radius: 6px; }
.ft-node:hover { background: rgba(176, 141, 79, .08); }
.ft-main { display: flex; align-items: center; gap: 7px; white-space: nowrap; min-width: 0; }
.ft-sps { display: flex; gap: 6px; margin: 2px 0 0 29px; flex-wrap: wrap; }
.ft-toggle { cursor: pointer; width: 22px; height: 22px; border: 1.5px solid var(--gold); border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; color: var(--gold); font-size: 12px; flex: 0 0 auto; background: var(--paper); user-select: none; }
.ft-toggle::before { content: "▾"; }
.ft-item.collapsed > .ft-node .ft-toggle::before { content: "▸"; }
.ft-item.collapsed > .ft-children { display: none; }
.ft-leaf { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; color: var(--gold); flex: 0 0 auto; font-size: 14px; }
.ft-leaf::before { content: "·"; font-weight: 900; }
.ft-dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; }
.ft-dot.m { background: var(--c-male); }
.ft-dot.f { background: var(--c-female); }
.ft-name { font-size: 16.5px; font-weight: 700; letter-spacing: 1px; cursor: pointer; padding: 1px 6px; border-radius: 5px; border: 1.5px solid transparent; }
.ft-name:hover { color: var(--accent); border-color: var(--accent); }
.ft-gen { font-size: 12px; background: var(--ink); color: var(--paper); border-radius: 4px; padding: 1px 7px; letter-spacing: 1px; }
.ft-yr { font-size: 12.5px; color: var(--muted); letter-spacing: 1px; }
.ft-spouse { font-size: 12.5px; color: #8c4a63; background: rgba(216, 164, 184, .22); border: 1px solid rgba(216, 164, 184, .6); border-radius: 4px; padding: 1px 7px; cursor: pointer; }
.ft-spouse:hover { background: rgba(216, 164, 184, .45); }
body.elderly .ft-name { font-size: 20px; }
body.elderly .ft-yr { font-size: 15px; }
body.elderly .ft-gen, body.elderly .ft-spouse { font-size: 15px; }
@media (max-width: 768px) {
  .ft-name { font-size: 15px; }
  .ft-yr { font-size: 11.5px; }
  .ft-gen { font-size: 11px; }
  .ft-spouse { font-size: 11.5px; padding: 0 5px; }
  .ft-toggle, .ft-leaf { width: 19px; height: 19px; font-size: 11px; }
  .ft-dot { width: 9px; height: 9px; }
  .ft-main { gap: 5px; }
  .ft-sps { margin-left: 24px; gap: 4px; }
  ul.ft-children { margin-left: 9px; padding-left: 7px; }
  .ft-item::before { left: -7px; width: 7px; top: 15px; }
  .ft-item:last-child::after { left: -9px; width: 5px; }
}

/* ===== 正文内嵌插图 & 资料多类型卡片 ===== */
.content-img { display: block; max-width: 100%; max-height: 440px; border-radius: 8px; margin: 12px auto; cursor: zoom-in; border: 1px solid var(--line); box-shadow: var(--shadow); }
.asset-file-block {
  height: 240px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: linear-gradient(160deg, var(--bg-deep), #e2d8c2); border-radius: 6px; cursor: pointer;
  color: var(--ink-soft); text-decoration: none; transition: box-shadow .15s;
}
.asset-file-block:hover { box-shadow: inset 0 0 0 2px var(--gold); }
.asset-file-block .ico { font-size: 54px; line-height: 1; }
.asset-file-block.video .ico { color: #fff; background: #3d6cab; border-radius: 50%; width: 84px; height: 84px; display: flex; align-items: center; justify-content: center; font-size: 34px; padding-left: 8px; }
.asset-file-block.audio .ico { color: var(--accent); }
.asset-file-block .hint { font-size: 13px; color: var(--muted); letter-spacing: 1px; }
.asset-type-badge {
  display: inline-block; font-size: 11px; border-radius: 4px; padding: 0 6px; margin-right: 6px;
  color: #fff; letter-spacing: 1px; vertical-align: 1px;
}
.asset-type-badge.t-image { background: #3d6cab; }
.asset-type-badge.t-video { background: #7a4fa3; }
.asset-type-badge.t-audio { background: var(--accent); }
.asset-type-badge.t-pdf { background: #b0483f; }
.asset-type-badge.t-archive { background: #8a7340; }
.asset-type-badge.t-doc { background: #5f7a5f; }
body.elderly .asset-file-block .ico { font-size: 64px; }

/* ===== 人员照片画廊 ===== */
.photo-strip {
  display: flex; gap: 12px; overflow-x: auto; padding: 10px 4px 12px; margin-bottom: 6px;
  scroll-snap-type: x mandatory;
}
.photo-cell {
  flex: 0 0 auto; width: 210px; cursor: zoom-in; scroll-snap-align: start;
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  box-shadow: var(--shadow); transition: box-shadow .15s;
}
.photo-cell:hover { box-shadow: var(--shadow-lift); }
.photo-cell img { width: 100%; height: 170px; object-fit: cover; display: block; background: var(--bg-deep); }
.photo-cell figcaption { font-size: 12.5px; color: var(--ink-soft); padding: 6px 9px; line-height: 1.5; }

/* ===== 世系图（五代行式）===== */
.tree-wrap { overflow-x: auto; padding: 10px 2px 4px; }
.lineage { display: flex; flex-direction: column; align-items: center; min-width: max-content; margin: 0 auto; }
.lg-row { display: flex; align-items: center; gap: 12px; position: relative; padding: 9px 0; }
.lg-row + .lg-row::before {              /* 代间连线 */
  content: ""; position: absolute; top: -9px; left: 50%; height: 9px;
  border-left: 2px solid var(--gold); opacity: .65;
}
.lg-row + .gs-group::before {             /* 子辈↔孙辈大框：竖线连接 */
  content: ""; position: absolute; top: -10px; left: 50%; height: 10px;
  border-left: 2px solid var(--gold); opacity: .65;
}
.gs-group .lg-row + .lg-row::before { display: none; }  /* 孙辈框内各行之间：不画连线 */
.lg-label {
  flex: 0 0 auto; font-size: 12px; color: var(--paper); background: var(--gold);
  border-radius: 4px; padding: 2px 8px; letter-spacing: 2px; writing-mode: horizontal-tb;
}
.lg-row.hl .lg-label { background: var(--accent); }
.lg-row.hl { background: rgba(158, 43, 37, .05); border-radius: 8px; padding-left: 10px; padding-right: 10px; }
.lg-cells { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: nowrap; }
.lg-fam { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 10px; padding: 5px 9px 3px 5px; margin: 4px 5px 0; position: relative; background: rgba(255,253,248,.6); }
.gs-group { border: 2px solid var(--gold); border-radius: 12px; padding: 12px 8px 2px; position: relative; margin-top: 10px; }
.gs-title { position: absolute; top: -10px; left: 14px; background: var(--paper); padding: 0 8px; font-size: 12.5px; color: var(--gold); letter-spacing: 3px; font-weight: 700; }
.lg-cells.lg-box { border: 1.5px solid var(--line); border-radius: 10px; padding: 5px 9px; background: rgba(255,253,248,.65); }
.lg-label.fam { color: var(--ink-soft); }
.lg-unit { display: inline-flex; align-items: center; margin-right: 14px; }
.lg-unit:last-child { margin-right: 0; }
.tnode {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 86px; padding: 7px 12px; margin: 3px 2px; color: #fff; font-size: 13.5px; letter-spacing: 1px;
  cursor: pointer; vertical-align: top; border-radius: 6px; box-shadow: 0 1px 4px rgba(43,38,33,.18);
  transition: transform .12s, box-shadow .12s;
}
.tnode:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(43,38,33,.26); }
.tnode .nm { font-weight: 700; }
.tnode .yr { font-size: 11px; opacity: .88; }
.tnode.m { background: var(--c-male); }
.tnode.f { background: var(--c-female); }
.tnode.sp { background: var(--c-spouse); color: #5c2b3c; }
.tnode.spouse-pair { background: transparent; padding: 0; margin: 0; display: inline-flex; box-shadow: none; }
.t-gen { text-align: center; margin: 14px 0 4px; font-size: 13px; color: var(--muted); letter-spacing: 2px; }
.tree-line { text-align: center; }
/* 旧树结构（保留兼容）*/
.tree-node { border: 1.5px solid var(--ink); background: var(--paper); display: inline-block; padding: 4px 12px; font-size: 14px; position: relative; margin: 4px; cursor: pointer; white-space: nowrap; border-radius: 4px; }
.tree-node.female { border-style: dashed; }
.tree-node .yr { font-size: 11px; color: var(--muted); display: block; text-align: center; }
.tree-node:hover { background: var(--ink); color: var(--paper); }
.tree-children { margin-left: 28px; border-left: 1.5px solid var(--line); padding-left: 14px; }
.tree-row { position: relative; }
.tree-row::before { content: ""; position: absolute; left: -14px; top: 22px; width: 14px; border-top: 1.5px solid var(--line); }

/* ===== 资料图墙 ===== */
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.asset-cell { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px; box-shadow: var(--shadow); transition: box-shadow .15s; }
.asset-cell:hover { box-shadow: var(--shadow-lift); }
.asset-cell img { width: 100%; height: 240px; object-fit: contain; background: var(--bg-deep); display: block; cursor: zoom-in; border-radius: 4px; }
.asset-cell .cap { font-size: 13px; padding-top: 6px; text-align: center; color: var(--muted); }

/* ===== 管理后台 ===== */
.admin-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-tab { padding: 6px 16px; border: 1.5px solid var(--ink-soft); border-radius: 20px; cursor: pointer; font-size: 14px; background: var(--paper); letter-spacing: 1px; transition: all .15s; }
.admin-tab:hover { border-color: var(--ink); }
.admin-tab.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; align-items: center; }
.form-row label { font-size: 14px; min-width: 72px; letter-spacing: 1px; }
.form-row input, .form-row select, .form-row textarea { flex: 1; min-width: 140px; }
table.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--paper); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); }
table.admin-table th, table.admin-table td { border: 1px solid var(--line); padding: 7px 9px; text-align: left; }
table.admin-table th { background: var(--bg-deep); letter-spacing: 1px; }
table.admin-table tr:hover td { background: rgba(176, 141, 79, .05); }

/* 照片管理行 */
.ph-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; background: var(--paper); }
.ph-thumb { width: 86px; height: 86px; object-fit: cover; border-radius: 6px; cursor: zoom-in; border: 1px solid var(--line); }

.pager { display: flex; gap: 8px; align-items: center; margin-top: 14px; justify-content: center; flex-wrap: wrap; }
.pager .info { font-size: 13px; color: var(--muted); }

/* ===== 弹层 ===== */
.modal-mask { position: fixed; inset: 0; background: rgba(30, 25, 18, .6); backdrop-filter: blur(2px); display: none; align-items: center; justify-content: center; z-index: 200; padding: 14px; }
.modal-mask.open { display: flex; }
.modal { background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--gold); border-radius: 10px; width: min(820px, 100%); max-width: 96vw; min-width: 380px; resize: horizontal; max-height: 88vh; overflow: auto; padding: 22px 24px; box-shadow: 0 20px 50px rgba(30,25,18,.35); }
.modal h3 { margin-bottom: 12px; letter-spacing: 2px; }
.modal .close-x { float: right; cursor: pointer; font-size: 20px; padding: 0 8px; color: var(--muted); border-radius: 4px; }
.modal .close-x:hover { color: var(--accent); }

/* ===== 详情双栏 ===== */
.detail-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.detail-2col .card { margin-bottom: 0; }
.stat-line { background: var(--bg); border: 1px dashed var(--gold); border-radius: 6px; padding: 9px 12px; font-size: 13.5px; margin-top: 10px; line-height: 1.9; }

img.view-full { max-width: 92vw; max-height: 88vh; cursor: zoom-out; border-radius: 8px; box-shadow: 0 20px 50px rgba(0,0,0,.4); }

footer.site-footer { border-top: 1px solid var(--line); background: var(--paper); margin-top: 44px; }
footer.site-footer .inner {
  max-width: 1080px; margin: 0 auto; padding: 18px; font-size: 13px; color: var(--muted);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  border-top: 3px double var(--gold); width: fit-content; 
}
footer.site-footer .inner { width: 100%; }

/* ============ 适老模式（大字 · 高对比）============ */
body.elderly { font-size: 19px; line-height: 2; }
body.elderly .site-title { font-size: 38px; }
body.elderly .site-sub { font-size: 16px; }
body.elderly .nav-item { font-size: 21px; padding: 16px 6px; }
body.elderly .nav-item.elder-btn { font-size: 19px; }
body.elderly .page-title { font-size: 29px; }
body.elderly .card .body { font-size: 19px; }
body.elderly .card h3 { font-size: 23px; }
body.elderly .btn { font-size: 19px; padding: 11px 24px; }
body.elderly .btn.small { font-size: 17px; padding: 7px 14px; }
body.elderly input, body.elderly select, body.elderly textarea { font-size: 19px; padding: 10px 12px; }
body.elderly .tnode { font-size: 17px; min-width: 104px; padding: 9px 14px; }
body.elderly .tnode .yr { font-size: 13px; }
body.elderly .lg-label { font-size: 15px; }
body.elderly .photo-cell { width: 250px; }
body.elderly .photo-cell img { height: 200px; }
body.elderly .photo-cell figcaption { font-size: 16px; }
body.elderly .tag { font-size: 15px; }
body.elderly .gen-badge { font-size: 15px; }
body.elderly .pager .info { font-size: 17px; }
body.elderly .stat-line { font-size: 17px; }
body.elderly table.admin-table { font-size: 17px; }
body.elderly .muted, body.elderly .meta { color: #6d6154; }
/* 适老模式提高对比 */
body.elderly { --muted: #6d6154; --ink: #1d1913; }

/* ============ 响应式（手机）============ */
@media (max-width: 768px) {
  .container { padding: 0 12px; }
  .masthead .inner { padding: 16px 12px 12px; justify-content: center; text-align: center; }
  .site-title { font-size: 26px; letter-spacing: 6px; }
  .site-title::after { right: -30px; width: 20px; height: 20px; font-size: 12px; }
  .site-sub { font-size: 12px; letter-spacing: 2px; }
  /* 导航横向滑动 */
  .nav-inner { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 0 8px; }
  .nav-inner::-webkit-scrollbar { display: none; }
  .nav-item { flex: 0 0 auto; font-size: 15px; padding: 12px 12px; letter-spacing: 1px; }
  .nav-item.elder-btn { font-size: 14px; }
  .page { padding: 18px 0 44px; }
  .page-title { font-size: 21px; letter-spacing: 3px; }
  .card { padding: 14px 14px; border-radius: 8px; }
  .detail-2col { grid-template-columns: 1fr; }
  .photo-cell { width: 160px; }
  .photo-cell img { height: 130px; }
  .tree-wrap { -webkit-overflow-scrolling: touch; }
  .lg-label { writing-mode: vertical-rl; padding: 6px 3px; letter-spacing: 1px; }
  .lg-row { gap: 8px; }
  .tnode { min-width: 74px; font-size: 12.5px; padding: 6px 8px; }
  .modal { padding: 16px 12px; max-height: 92vh; }
  table.admin-table { font-size: 13px; display: block; overflow-x: auto; }
  .ph-row { flex-wrap: wrap; }
  footer.site-footer .inner { justify-content: center; text-align: center; }
}

/* 手机上的适老模式再放大一点 */
@media (max-width: 768px) {
  body.elderly { font-size: 20px; }
  body.elderly .nav-item { font-size: 19px; }
  body.elderly .tnode { font-size: 16px; min-width: 92px; }
}
