:root {
  --bg:#f4f1ea; --paper:#fffdf8; --ink:#24211d; --muted:#716a61;
  --line:#d8d0c3; --accent:#7b2f2f; --gold:#9a7437;
  --a:#246b45; --b:#376a93; --c:#9a6b22; --d:#8b4b4b; --question:#8b5f00;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:linear-gradient(180deg,#eee8dc 0,#f7f4ed 280px);color:var(--ink);
font-family:"Noto Serif SC","Source Han Serif SC","Songti SC","SimSun",serif;line-height:1.75}
a{color:#73501f;text-decoration:none;border-bottom:1px dotted #9a7437}
a:hover{color:var(--accent)}
.hero{padding:58px 22px 42px;text-align:center;background:
radial-gradient(circle at 50% -20%,rgba(154,116,55,.25),transparent 55%),
linear-gradient(135deg,#342921,#1f1b18);color:#f9f3e8;border-bottom:5px solid #9a7437}
.hero .seal{display:inline-flex;width:62px;height:62px;border:2px solid #c9a96b;align-items:center;justify-content:center;
transform:rotate(-3deg);font-size:25px;color:#e2c58d;margin-bottom:12px}
.hero h1{margin:0;font-size:clamp(28px,5vw,52px);letter-spacing:.08em;font-weight:700}
.hero h1 .latin-brand{display:block;margin-bottom:5px;color:#d1b174;font-family:Georgia,"Times New Roman",serif;font-size:.38em;font-weight:600;letter-spacing:.2em;line-height:1.2;text-transform:none}
.hero p{max-width:900px;margin:14px auto 0;color:#d8ccbb}
.shell{max-width:1280px;margin:0 auto;padding:26px 20px 70px}
.toolbar{position:sticky;top:0;z-index:20;background:rgba(255,253,248,.94);backdrop-filter:blur(12px);
border:1px solid var(--line);border-radius:12px;padding:12px;display:flex;gap:10px;flex-wrap:wrap;box-shadow:0 8px 25px rgba(40,31,20,.09)}
.toolbar input{flex:1;min-width:220px;padding:11px 13px;border:1px solid #c9c0b2;border-radius:8px;background:white;font-size:15px}
button{border:1px solid #a99980;background:#faf5ea;color:#3f352a;padding:10px 13px;border-radius:8px;cursor:pointer}
button:hover{background:#efe4cf}
nav{display:flex;gap:8px;flex-wrap:wrap;margin:18px 0}
nav a{border:1px solid var(--line);padding:7px 10px;border-radius:999px;background:var(--paper);font-size:14px}
.card{background:var(--paper);border:1px solid var(--line);border-radius:14px;padding:22px;margin:18px 0;box-shadow:0 7px 24px rgba(50,40,28,.055)}
.card h2{margin-top:0;border-bottom:1px solid var(--line);padding-bottom:10px;color:#4a2b21}
.warning{border-left:5px solid #9a6b22;background:#fff8e7}
.strongline{font-family:"Noto Sans SC","Microsoft YaHei",sans-serif;font-weight:700;padding:16px;border-radius:10px;background:#f2eee4;overflow:auto;white-space:nowrap}
.legend{display:grid;grid-template-columns:minmax(0,1fr);gap:0}
.legend>span{display:flex;align-items:flex-start;width:100%;padding:10px 2px;border-bottom:1px solid var(--line)}
.legend>span:last-child{border-bottom:0}
.legend .badge{flex:0 0 auto;margin:1px 11px 0 0}
.badge{display:inline-block;font-family:"Noto Sans SC","Microsoft YaHei",sans-serif;font-size:12px;line-height:1.3;padding:3px 7px;border-radius:999px;color:#fff;vertical-align:middle;margin-left:6px}
.ev-A{background:var(--a)} .ev-B{background:var(--b)} .ev-C{background:var(--c)} .ev-D{background:var(--d)}
.tree-wrap{font-family:"Noto Sans SC","Microsoft YaHei",sans-serif}
details.person, details.group{position:relative;margin:7px 0 7px 20px;border-left:1px solid #d7cebf;padding-left:14px}
details.person:before,details.group:before{content:"";position:absolute;left:-1px;top:18px;width:12px;border-top:1px solid #d7cebf}
summary{cursor:pointer;list-style:none;border:1px solid #ddd3c5;background:#fff;padding:9px 11px;border-radius:9px;transition:.15s}
summary::-webkit-details-marker{display:none}
summary:before{content:"＋";display:inline-block;width:22px;color:#805e31;font-weight:bold}
details[open]>summary:before{content:"－"}
summary:hover{border-color:#b89a6b;background:#fffaf0}
.group>summary{background:#efe8dc;font-weight:700}
.person-name{font-weight:750;color:#2f2923}
.years{color:#786f64;font-size:13px;margin-left:8px}
.title{color:#6b4f2c;font-size:13px;margin-left:8px}
.person-body{margin:7px 0 13px 20px;padding:11px 13px;background:#faf8f2;border-radius:8px;color:#453f37}
.person-body p{margin:4px 0}
.meta{font-size:13px;color:#716a61}
.source-links a{display:inline-block;margin-right:7px}
.hit>summary{outline:3px solid rgba(196,142,45,.35);background:#fff2c9}
.hidden-by-search{display:none!important}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:14px}
.fact{padding:15px;border:1px solid var(--line);border-radius:10px;background:#fff}
.fact h3{margin:0 0 6px;color:#633829}
table{width:100%;border-collapse:collapse;font-family:"Noto Sans SC","Microsoft YaHei",sans-serif;font-size:14px}
th,td{border:1px solid var(--line);padding:9px;vertical-align:top;text-align:left}
th{background:#ede5d8}
.sources li{margin-bottom:13px;padding-bottom:10px;border-bottom:1px dashed var(--line)}
.sources p{margin:4px 0;color:#665e54;font-size:14px}
.small{font-size:13px;color:var(--muted)}
footer{text-align:center;color:#786f64;padding:30px}
@media(max-width:650px){
 .shell{padding-left:10px;padding-right:10px}
 .card{padding:15px}
 details.person,details.group{margin-left:7px;padding-left:8px}
 .person-body{margin-left:8px}
 .hero{padding-top:38px}
}
/* ===== 纵向可拖动缩放世系树 v2 ===== */
.main-toolbar{align-items:center}
.search-box{position:relative;display:flex;align-items:center;flex:1;min-width:260px}
.search-box input{width:100%;padding-right:86px}
.search-status{position:absolute;right:10px;font-family:"Noto Sans SC","Microsoft YaHei",sans-serif;font-size:12px;color:#7a6c59;pointer-events:none}
.tree-card{padding:18px;overflow:visible}
.tree-heading-row{display:flex;justify-content:space-between;gap:18px;align-items:flex-start}
.tree-heading-row h2{margin-bottom:4px}
.tree-stats{white-space:nowrap;font-family:"Noto Sans SC","Microsoft YaHei",sans-serif;font-size:13px;color:#756a5b;padding-top:8px}
.tree-controls{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:12px 0;padding:10px;border:1px solid #d8d0c3;border-radius:10px;background:#f7f2e8;position:sticky;top:76px;z-index:15}
.tree-controls button{padding:8px 11px}
.zoom-label{margin-left:auto;min-width:54px;text-align:right;font-family:"Noto Sans SC","Microsoft YaHei",sans-serif;font-size:13px;color:#6e6253}
.tree-stage{position:relative;height:clamp(680px,78vh,980px);min-height:620px;overflow:hidden;border:1px solid #cfc4b4;border-radius:13px;background:
 radial-gradient(circle at 1px 1px,rgba(100,78,50,.13) 1px,transparent 1.4px) 0 0/24px 24px,
 linear-gradient(180deg,#fbfaf6,#f2eee5);touch-action:none;user-select:none;cursor:grab;outline:none}
.tree-stage:active{cursor:grabbing}
.tree-stage:focus-visible{box-shadow:0 0 0 3px rgba(154,116,55,.28)}
.tree-stage:fullscreen{height:100vh;width:100vw;border-radius:0;border:0;background-color:#f7f3eb}
.tree-stage:-webkit-full-screen{height:100vh;width:100vw;border-radius:0;border:0}
#treeSvg{display:block;width:100%;height:100%;overflow:visible}
.tree-link{fill:none;stroke:#b8ad9b;stroke-width:1.45;vector-effect:non-scaling-stroke}
.tree-link.mainline{stroke:#9a7437;stroke-width:3}
.tree-node{cursor:pointer;outline:none}
.tree-node .node-card{fill:#fffdf8;stroke:#d7cdbd;stroke-width:1.2;rx:10;ry:10;filter:url(#nodeShadow);vector-effect:non-scaling-stroke}
.tree-node:hover .node-card,.tree-node:focus .node-card{stroke:#9a7437;stroke-width:2}
.tree-node.selected .node-card{fill:#fff5d9;stroke:#9a7437;stroke-width:2.4}
.tree-node.search-hit .node-card{fill:#ffefb9;stroke:#a46813;stroke-width:2.4}
.tree-node.mainline .node-card{stroke:#9a7437;stroke-width:2}
.node-name{font-family:"Noto Sans SC","Microsoft YaHei",sans-serif;font-size:16px;font-weight:750;fill:#302821;pointer-events:none}
.node-meta{font-family:"Noto Sans SC","Microsoft YaHei",sans-serif;font-size:11.5px;fill:#796e60;pointer-events:none}
.node-title{font-family:"Noto Sans SC","Microsoft YaHei",sans-serif;font-size:11px;fill:#6b4f2c;pointer-events:none}
.node-fo{pointer-events:none;overflow:hidden}
.node-text-box{width:100%;height:100%;overflow:hidden;font-family:"Noto Sans SC","Microsoft YaHei",sans-serif;word-break:break-all;overflow-wrap:anywhere}
.node-name-html{font-size:16px;font-weight:750;line-height:1.2;color:#302821;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;max-height:38px;padding-right:4px}
.node-meta-html{font-size:11.5px;line-height:1.35;color:#796e60;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:3px}
.node-title-html{font-size:11px;line-height:1.35;color:#6b4f2c;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;max-height:30px;margin-top:2px;padding-right:3px}

.node-toggle{fill:#f5ead5;stroke:#a88d60;stroke-width:1.2;vector-effect:non-scaling-stroke}
.node-toggle-text{font-family:Arial,sans-serif;font-size:14px;font-weight:bold;fill:#74572d;text-anchor:middle;dominant-baseline:central;pointer-events:none}
.node-evidence{stroke:#fff;stroke-width:1.4;vector-effect:non-scaling-stroke}
.node-evidence-text{font-family:Arial,sans-serif;font-size:10px;font-weight:bold;fill:#fff;text-anchor:middle;dominant-baseline:central;pointer-events:none}
.tree-help{position:absolute;left:12px;bottom:10px;padding:6px 10px;border-radius:999px;background:rgba(47,39,31,.76);color:#fff;font:12px/1.3 "Noto Sans SC","Microsoft YaHei",sans-serif;pointer-events:none;z-index:4}
.tree-info{position:absolute;right:12px;top:12px;width:min(340px,calc(100% - 24px));max-height:calc(100% - 24px);overflow:auto;background:rgba(255,253,248,.97);backdrop-filter:blur(8px);border:1px solid #cfc2ae;border-radius:12px;padding:18px;box-shadow:0 14px 34px rgba(48,36,22,.16);z-index:6;transform:translateX(calc(100% + 26px));transition:transform .2s ease}
.tree-info.open{transform:translateX(0)}
.tree-info h3{margin:0 34px 8px 0;color:#553126;font-size:22px}
.tree-info p{margin:7px 0}
.tree-info .info-years{color:#766c60;font-size:13px}
.tree-info .info-title{color:#6d4c28;font-weight:650}
.tree-info .info-section{border-top:1px solid #ddd3c4;padding-top:9px;margin-top:10px}
.info-close{position:absolute;right:8px;top:8px;width:32px;height:32px;border-radius:50%;padding:0;font-size:22px;line-height:1}
@media(max-width:760px){
 .tree-card{padding:10px}.tree-heading-row{display:block}.tree-stats{padding-top:0}
 .tree-controls{top:68px;gap:5px}.tree-controls button{padding:7px 8px;font-size:12px}.zoom-label{margin-left:0}
 .tree-stage{height:76vh;min-height:580px}.tree-info{top:auto;bottom:10px;max-height:46%;width:calc(100% - 20px);right:10px}
 .tree-help{display:none}
}
/* ===== 史料扩展研究版 v4 ===== */
.node-record-count{font-family:Arial,sans-serif;font-size:9px;font-weight:bold;fill:#fff;text-anchor:middle;dominant-baseline:central;pointer-events:none}
.node-record-dot{fill:#7b2f2f;stroke:#fff;stroke-width:1.2;vector-effect:non-scaling-stroke}
.record-list{display:grid;gap:10px;margin-top:8px}
.record-item{border:1px solid #d9cfbf;border-left:4px solid #8c7047;border-radius:9px;padding:10px 11px;background:#fffdf8}
.record-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.record-head b{color:#553126}
.record-meta{font-size:12px;color:#776b5d;margin:3px 0}
.record-quote{margin:7px 0;padding:7px 9px;background:#f3ede1;border-radius:6px;color:#4b4034;font-family:"Noto Serif SC","Songti SC",serif}
.record-note{font-size:12px;color:#8a512c}
.record-confidence{display:inline-block;min-width:22px;padding:2px 6px;border-radius:999px;color:#fff;text-align:center;font:700 11px/1.4 Arial,sans-serif}
.rc-A{background:#246b45}.rc-B{background:#376a93}.rc-C{background:#9a6b22}.rc-D{background:#8b4b4b}
.research-links{display:flex;gap:7px;flex-wrap:wrap;margin-top:8px}
.research-links a{display:inline-block;padding:5px 8px;border:1px solid #cfc1ad;border-radius:7px;background:#fff7e8;font-size:12px}
.research-stats{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:12px;margin:14px 0}
.research-stats div{padding:14px;border:1px solid #d9cfbf;border-radius:10px;background:#fff;text-align:center}
.research-stats b{display:block;font:700 28px/1.1 "Noto Sans SC","Microsoft YaHei",sans-serif;color:#6b392b}
.research-stats span{display:block;margin-top:6px;color:#756b5d;font-size:13px}
.research-notes{display:flex;gap:12px;flex-wrap:wrap}.research-notes p{margin:0}
.candidate-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(310px,1fr));gap:14px}
.candidate-card{border:1px solid #d8c8aa;border-radius:12px;background:#fffdf7;padding:15px}
.candidate-card h3{margin:0 0 7px;color:#5e3428}.candidate-card p{margin:6px 0}.candidate-card ul{padding-left:20px}
.candidate-tag{font:12px/1.4 "Noto Sans SC","Microsoft YaHei",sans-serif;color:#fff;background:#986b2e;border-radius:999px;padding:3px 7px}
.tree-info{width:min(470px,calc(100% - 24px))}
@media(max-width:760px){.research-stats{grid-template-columns:repeat(2,1fr)}.candidate-grid{grid-template-columns:1fr}}


/* v4：推定支系以虚线显示 */
.tree-link.hypothesis{stroke:#a86d2d;stroke-width:2;stroke-dasharray:9 7}
.tree-node.hypothesis .node-card{stroke:#a86d2d;stroke-width:2;stroke-dasharray:7 5;fill:#fff9eb}
.hypothesis-note{border-left:5px solid #a86d2d;background:#fff6df}
.evidence-chain{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:12px;margin:14px 0}
.evidence-chain article{border:1px solid #dac9aa;border-radius:10px;padding:13px;background:#fff}
.evidence-chain h3{margin:0 0 6px;color:#683d2a}


/* ===== v4 谱页影像 ===== */
.scan-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:16px}
.scan-card{margin:0;border:1px solid var(--line);border-radius:12px;overflow:hidden;background:#f7f2e8}
.scan-card a{display:block;border:0}
.scan-card img{display:block;width:100%;height:330px;object-fit:contain;background:#1f1d1a;cursor:zoom-in}
.scan-card figcaption{padding:10px 12px;font:13px/1.55 "Noto Sans SC","Microsoft YaHei",sans-serif;color:#5d5348}
.warning-inline{padding:10px 12px;border-left:4px solid #9a6b22;background:#fff7df;border-radius:6px}
.tree-node.hypothesis .node-card{stroke-dasharray:7 4}
@media(max-width:650px){.scan-card img{height:260px}}


/* ===== v6 原图与原始证据访问 ===== */
.scan-card img{width:100%;height:360px;display:block;object-fit:contain;background:#20201e;cursor:zoom-in;image-rendering:auto}
.evidence-library{border-top:5px solid #6b4b2a}
.proof-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:16px}
.evidence-doc{border:1px solid #d7cbbb;border-radius:12px;padding:16px;background:#fffdf8;min-width:0}
.evidence-doc h3{margin:0 0 8px;color:#5b3126}
.evidence-doc details{margin:10px 0;border:1px solid #ddd2c0;border-radius:9px;background:#faf7f0;overflow:hidden}
.evidence-doc summary{padding:9px 12px;cursor:pointer;font-weight:700}
.transcription{margin:0;padding:14px;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;max-height:420px;overflow:auto;background:#f5f0e6;font:14px/1.8 "Noto Serif SC","Songti SC",serif}
.evidence-links{display:flex;flex-wrap:wrap;gap:8px}
.evidence-links a{display:inline-block;border:1px solid #c7b99f;border-radius:999px;padding:5px 9px;background:#fff7e7}
.image-lightbox{position:fixed;inset:0;display:none;align-items:center;justify-content:center;background:rgba(0,0,0,.92);z-index:9999;padding:18px}
.image-lightbox.open{display:flex}
.image-lightbox img{max-width:96vw;max-height:92vh;object-fit:contain;background:#fff}
.image-lightbox button{position:absolute;right:20px;top:16px;width:44px;height:44px;border-radius:50%;background:#fff;font-size:28px;line-height:1}
.image-lightbox .caption{position:absolute;left:20px;bottom:12px;right:20px;text-align:center;color:#fff;font:14px/1.4 "Noto Sans SC","Microsoft YaHei",sans-serif}
@media(max-width:650px){.scan-card img{height:270px}.proof-grid{grid-template-columns:1fr}}


/* ===== v7 墓志原图、分支标识与稳定点击 ===== */
.evidence-doc-wide{grid-column:1/-1}
.rubbing-viewer{background:#25231f;border-radius:10px;padding:10px;text-align:center;overflow:auto}
.rubbing-viewer img{max-width:100%;max-height:720px;object-fit:contain;cursor:zoom-in;background:#eee}
.download-pill{display:inline-block;border:1px solid #9d8257;border-radius:999px;padding:7px 12px;background:#fff5df;font-weight:700}
.scan-card a{display:block;border:0}
.scan-card img{height:440px;object-fit:contain;background:#191919}
@media(max-width:700px){.scan-card img{height:300px}.rubbing-viewer img{max-height:520px}}


/* v8 interaction and evidence */
.node-toggle{cursor:pointer;pointer-events:all;stroke-width:1.5}
.node-toggle:hover{fill:#ead5ae;stroke:#7b5a2c}
.tree-info{overscroll-behavior:contain;touch-action:pan-y;user-select:text}
.tree-info *{overflow-wrap:anywhere;word-break:break-word}
.remote-proof-gallery{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:12px;margin:12px 0}
.remote-proof{position:relative;display:block;min-height:190px;border:1px solid #d6cab8;border-radius:10px;overflow:hidden;background:#25221e;text-decoration:none}
.remote-proof img{display:block;width:100%;height:360px;object-fit:contain;background:#25221e}
.remote-proof .remote-fallback{display:none;padding:18px;color:#5b3a25;background:#fff8e8}
.remote-proof.image-failed img{display:none}.remote-proof.image-failed .remote-fallback{display:block}
.source-materials{margin-top:16px;padding:15px;border:1px solid #d9cfbf;border-radius:10px;background:#faf6ed}
@media(max-width:650px){.remote-proof img{height:270px}}

/* v10 本地墓志证据库 */
.local-proof-gallery{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px;margin:12px 0}
.local-proof-gallery figure{margin:0;background:#e8e0d2;border:1px solid #c8bca9;border-radius:10px;padding:8px}
.local-proof-gallery img{display:block;width:100%;max-height:520px;object-fit:contain;background:#f3ede2;cursor:zoom-in;border-radius:6px}
.local-proof-gallery figcaption{font:12px/1.5 "Noto Sans SC","Microsoft YaHei",sans-serif;color:#70675d;padding:5px 3px 0;word-break:break-all}
.evidence-status-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px;margin:15px 0}
.evidence-status-grid>div{border:1px solid var(--line);border-radius:10px;padding:12px;background:#f8f3e9}
.evidence-status-grid b,.evidence-status-grid span{display:block}.evidence-status-grid span{font-size:13px;color:var(--muted);margin-top:4px}
.status-note{border-left:4px solid #a16d26;background:#fff5dd;padding:10px 12px;border-radius:5px;font-size:13px}
.relation-list{display:grid;gap:8px}.relation-item{border:1px solid #ded4c5;background:#fffdf7;border-radius:8px;padding:9px 10px}.relation-item b{color:#603b2b}.relation-item .meta{display:block;margin-top:4px}
.proof-grid-v9 .evidence-doc{min-width:0}
@media(max-width:650px){.local-proof-gallery{grid-template-columns:1fr}.local-proof-gallery img{max-height:440px}}


.evidence-inventory-wrap{margin:18px 0 24px;overflow:auto;border:1px solid var(--line);border-radius:11px;background:#fffdf8;padding:12px}
.evidence-inventory-wrap h3{margin:0 0 10px;color:#56372b}
.evidence-inventory{min-width:920px;margin:0}
.evidence-inventory td:nth-child(1){font-weight:700;white-space:nowrap}
.evidence-inventory td:nth-child(5){color:#765221}

.missing-original{border:1px dashed #b88a54;background:#fff7e8;border-radius:10px;padding:18px;margin:10px 0;color:#69451f}.missing-original p{margin:.4em 0 0}.evidence-warning{background:#fff4d6;border-left:4px solid #c28a2c;padding:9px 12px}.evidence-text{white-space:pre-wrap;word-break:break-word;max-height:520px;overflow:auto;background:#f8f5ed;padding:14px;border-radius:8px;line-height:1.75}.marked-evidence{font-family:ui-monospace,SFMono-Regular,Consolas,monospace}.key-genealogy-quote{color:#b42318;font-weight:800;font-size:1.04em}.compact-gallery{grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}.info-uid{font:12px ui-monospace,monospace;color:#776b60}.office-list{display:grid;gap:7px}.office-item{border-left:3px solid #8e7959;padding:7px 10px;background:#faf7ef}.office-item span{display:block;color:#6f655d;font-size:12px;margin-top:3px}.same-name-note{background:#fff7e8}.genealogy-carousel{position:relative;max-width:980px;margin:auto;padding:0 52px 42px}.carousel-viewport{overflow:hidden;border-radius:14px;background:#f5f1e8;touch-action:pan-y}.carousel-track{display:flex;transition:transform .35s ease;will-change:transform}.genealogy-slide{flex:0 0 100%;margin:0;padding:12px;box-sizing:border-box}.genealogy-slide>figure{margin:0}.genealogy-slide img{display:block;max-width:100%;max-height:760px;margin:auto;object-fit:contain}.carousel-button{position:absolute;z-index:3;top:45%;width:42px;height:42px;border:0;border-radius:50%;background:#3f3428;color:#fff;font-size:32px;line-height:1;cursor:pointer;box-shadow:0 4px 14px #0003}.carousel-prev{left:2px}.carousel-next{right:2px}.carousel-counter{text-align:center;margin-top:10px;font-weight:700;color:#6d5b49}@media(max-width:700px){.genealogy-carousel{padding:0 36px 38px}.carousel-button{width:34px;height:34px;font-size:26px}}
.carousel-button{display:flex;align-items:center;justify-content:center;padding:0;font-size:0;line-height:0}.carousel-button::before{content:"";display:block;width:10px;height:10px;border-top:3px solid #fff;border-right:3px solid #fff}.carousel-prev::before{transform:translateX(2px) rotate(-135deg)}.carousel-next::before{transform:translateX(-2px) rotate(45deg)}.proof-grid-huangmei{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.proof-grid-huangmei>.evidence-doc-wide{grid-column:1/-1}.proof-grid-huangmei>.evidence-doc{min-width:0}@media(max-width:900px){.proof-grid-huangmei{grid-template-columns:1fr}.proof-grid-huangmei>.evidence-doc-wide{grid-column:auto}}

/* ===== v12 专业呈现、可访问性与响应式优化 ===== */
:root{--paper-deep:#f7f1e5;--wine:#6f2929;--gold-light:#c8a66a;--shadow:0 12px 34px rgba(55,40,24,.075)}
body{background:linear-gradient(180deg,#eae2d4 0,#f7f4ed 360px);text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased}
.skip-link{position:fixed;left:16px;top:12px;z-index:10000;transform:translateY(-150%);padding:9px 14px;border-radius:8px;background:#fff;color:#351f18;box-shadow:0 5px 20px #0004}
.skip-link:focus{transform:translateY(0)}
.hero{position:relative;isolation:isolate;overflow:hidden;padding:64px 22px 48px;border-bottom:4px solid var(--gold-light);box-shadow:inset 0 -1px rgba(255,255,255,.14)}
.hero::before,.hero::after{content:"";position:absolute;z-index:-1;width:290px;height:290px;border:1px solid rgba(209,177,116,.17);transform:rotate(45deg)}
.hero::before{left:-180px;top:-150px}.hero::after{right:-180px;bottom:-190px}
.hero .seal{border-radius:3px;box-shadow:inset 0 0 0 4px rgba(201,169,107,.08);font-weight:700}
.hero h1{text-shadow:0 2px 18px rgba(0,0,0,.28)}
.hero p{font-size:clamp(14px,2vw,17px);letter-spacing:.04em}
.shell{max-width:1320px}
.toolbar{top:10px;border-color:rgba(171,151,121,.65);box-shadow:0 10px 30px rgba(42,31,20,.11)}
.toolbar input{min-height:44px;outline:none;transition:border-color .2s,box-shadow .2s}
.toolbar input:focus{border-color:var(--gold);box-shadow:0 0 0 3px rgba(154,116,55,.16)}
button,nav a,.research-links a,.evidence-links a{transition:transform .16s ease,background-color .16s ease,border-color .16s ease,box-shadow .16s ease}
button:hover,nav a:hover{transform:translateY(-1px)}
button:active,nav a:active{transform:translateY(0)}
button:focus-visible,a:focus-visible,summary:focus-visible,input:focus-visible{outline:3px solid rgba(154,116,55,.38);outline-offset:2px}
nav{padding:2px 0 4px}
nav a{color:#62431f;border-bottom:1px solid var(--line);box-shadow:0 2px 7px rgba(59,42,23,.035)}
nav a:hover{background:#fff8e9;border-color:#bfa77e;color:var(--wine)}
.card{position:relative;border-color:#d8cdbd;box-shadow:var(--shadow)}
.card h2{font-size:clamp(20px,2.3vw,27px);letter-spacing:.025em;border-bottom-color:#d9cbb7}
.card h2::after{content:"";display:block;width:42px;border-bottom:3px solid var(--gold);transform:translateY(12px)}
.fact,.candidate-card,.evidence-doc,.research-stats div{box-shadow:0 4px 14px rgba(54,39,22,.04)}
.fact h3,.candidate-card h3,.evidence-doc h3{line-height:1.45}
table{line-height:1.65}
th{color:#4e3326;background:linear-gradient(180deg,#f1eadf,#e9dfd0)}
tbody tr:nth-child(even){background:rgba(241,235,224,.38)}
tbody tr:hover{background:#fff8e8}
img{max-width:100%;height:auto}
.scan-card,.remote-proof,.local-proof-gallery figure{transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease}
.scan-card:hover,.remote-proof:hover,.local-proof-gallery figure:hover{transform:translateY(-2px);border-color:#b99e72;box-shadow:0 10px 24px rgba(52,38,23,.11)}
footer{margin-top:10px;padding:34px 20px 42px;border-top:1px solid #d6ccbd;background:rgba(237,230,217,.55);font-family:"Noto Sans SC","Microsoft YaHei",sans-serif;line-height:1.9}
footer .footer-title{color:#51483e;font-weight:650}
footer .footer-copyright{font-size:13px;color:#82786c}
footer .footer-contact{font-size:14px}
footer a{color:var(--wine);border-bottom-style:solid}
@media(max-width:700px){
 .hero{padding:42px 18px 34px}.hero h1{letter-spacing:.04em}.hero .seal{width:54px;height:54px;font-size:22px}
 .shell{padding:14px 10px 46px}.toolbar{top:6px;padding:9px;gap:7px}.search-box{flex-basis:100%;min-width:0}
 .toolbar button{flex:1 1 auto;padding:8px 9px;font-size:13px}
 nav{flex-wrap:nowrap;overflow-x:auto;padding:4px 2px 10px;scrollbar-width:thin;overscroll-behavior-inline:contain}
 nav a{flex:0 0 auto}.card{margin:13px 0;border-radius:12px}.card h2{line-height:1.45}
 .evidence-inventory-wrap{padding:8px}footer{padding:28px 16px 34px}
}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important}}

/* ===== v13 青黛主题、紧凑页头与内容保护 ===== */
:root{
  --bg:#edf3f2;--paper:#fbfdfc;--paper-deep:#e7efed;--ink:#17282d;--muted:#657579;
  --line:#cddbd8;--accent:#126b74;--gold:#b28a48;--gold-light:#d8c08f;--wine:#145966;
  --a:#287653;--b:#3b6f91;--c:#9b7628;--d:#865166;--question:#8a681c;
  --shadow:0 12px 34px rgba(20,58,64,.075)
}
html{scroll-padding-top:88px}
body{
  background:linear-gradient(180deg,#dce9e7 0,#f4f8f7 350px,#edf3f2 100%);
  color:var(--ink);overflow-wrap:anywhere
}
body.lightbox-open{overflow:hidden}
body,body *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
input,textarea{-webkit-user-select:text;user-select:text}
a{color:#126572;border-bottom-color:#79a7a7}
a:hover{color:#0b4c57}
.hero{
  padding:22px 24px;background:
    radial-gradient(circle at 18% -40%,rgba(142,205,199,.26),transparent 48%),
    linear-gradient(135deg,#0c3544 0%,#115363 56%,#176b68 100%);
  color:#f5fbfa;border-bottom:3px solid #8cb8b3;box-shadow:inset 0 -1px rgba(255,255,255,.18)
}
.hero::before,.hero::after{border-color:rgba(176,221,216,.12)}
.hero-inner{width:min(1120px,100%);margin:0 auto;display:grid;grid-template-columns:64px minmax(0,1fr) 64px;gap:22px;align-items:center}
.hero-inner::after{content:"";display:block;width:64px;height:1px}
.hero .seal{
  width:58px;height:58px;margin:0;border:1px solid rgba(210,235,231,.72);border-radius:12px;
  transform:none;color:#e6f4f1;background:rgba(255,255,255,.08);box-shadow:inset 0 0 0 4px rgba(255,255,255,.045);
  font-size:25px
}
.hero-copy{text-align:center;min-width:0}
.hero .latin-brand{margin:0 0 2px;color:#bfe1dd;font:600 12px/1.2 Georgia,"Times New Roman",serif;letter-spacing:.24em}
.hero h1{margin:0;font-size:clamp(25px,3.5vw,40px);line-height:1.25;letter-spacing:.09em;text-shadow:0 2px 18px rgba(0,0,0,.22)}
.hero p{max-width:900px;margin:5px auto 0;color:#d8ebe8;font-size:clamp(13px,1.7vw,16px);letter-spacing:.035em}
.shell{max-width:1320px;padding-top:22px}
.toolbar{background:rgba(251,253,252,.95);border-color:#b9ceca;box-shadow:0 10px 28px rgba(18,61,67,.1)}
.toolbar input{border-color:#afc7c3;background:#fff;color:var(--ink)}
.toolbar input:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(18,107,116,.14)}
button{border-color:#a9c2be;background:#f1f7f6;color:#174c54}
button:hover{background:#dfecea;border-color:#72a6a3}
button:focus-visible,a:focus-visible,summary:focus-visible,input:focus-visible{outline-color:rgba(18,107,116,.4)}
nav a{color:#235d65;border-color:var(--line);background:var(--paper);box-shadow:0 2px 7px rgba(25,69,73,.04)}
nav a:hover{background:#e8f3f1;border-color:#8eb6b2;color:#0e5962}
.card{background:var(--paper);border-color:var(--line);box-shadow:var(--shadow)}
.card h2,.fact h3,.candidate-card h3,.evidence-doc h3,.tree-info h3{color:#164e59}
.card h2{border-bottom-color:#d2dfdd}
.card h2::after{border-bottom-color:#4c9492}
.warning,.hypothesis-note{border-left-color:#b58a42;background:#fdf8ea}
.strongline{background:#e6efed;color:#173f46}
summary{border-color:#cbdad7;background:#fff}
summary::before{color:#1e7479}
summary:hover{border-color:#84aaa6;background:#edf6f4}
.group>summary{background:#e5efed}
.person-name,.node-name-html{color:#173239}
.years,.node-meta-html,.meta{color:#647579}
.title,.node-title-html{color:#2b6970}
.person-body,.source-materials,.transcription,.evidence-text{background:#f0f5f4;color:#253b40}
.tree-controls{border-color:#c8d9d6;background:#edf5f3}
.tree-stage{border-color:#b9ceca;background:
  radial-gradient(circle at 1px 1px,rgba(30,92,96,.13) 1px,transparent 1.4px) 0 0/24px 24px,
  linear-gradient(180deg,#f8fbfa,#e7f0ee)}
.tree-stage:focus-visible{box-shadow:0 0 0 3px rgba(18,107,116,.25)}
.tree-link{stroke:#9eb9b5}.tree-link.mainline{stroke:#2c817f}
.tree-node .node-card{fill:#fbfdfc;stroke:#bfd1ce}
.tree-node:hover .node-card,.tree-node:focus .node-card,.tree-node.mainline .node-card{stroke:#2b8583}
.tree-node.selected .node-card{fill:#dff0ed;stroke:#14747a}
.tree-node.search-hit .node-card{fill:#d9f1ee;stroke:#0d7880}
.node-toggle{fill:#dcebea;stroke:#57928f}.node-toggle-text{fill:#175e65}
.tree-info{background:rgba(251,253,252,.98);border-color:#b8cfcb;box-shadow:0 14px 34px rgba(17,61,67,.16)}
.tree-info,.tree-info *{-webkit-user-select:none;user-select:none}
.record-item,.candidate-card,.evidence-doc,.research-stats div,.fact{border-color:#cfddda;background:#fff}
.record-quote,.same-name-note{background:#edf5f3}
#sources .sources{columns:2 360px;column-gap:28px;padding-left:20px;font-size:12.5px;line-height:1.58}
#sources .sources li{break-inside:avoid-column;margin:0 0 8px;padding:0 0 7px}
#sources .sources p{margin:3px 0;font-size:12px;line-height:1.55}
#sources h3{margin:20px 0 8px;font-size:17px;color:#24545c}
th{color:#174a53;background:linear-gradient(180deg,#eaf2f0,#dfeae8)}
tbody tr:nth-child(even){background:rgba(226,239,236,.4)}
tbody tr:hover{background:#eaf5f2}
.scan-card,.evidence-inventory-wrap{background:#f0f5f3;border-color:#c9d8d5}
.local-proof-gallery figure{background:#dfe9e7;border-color:#bacdca}
.carousel-viewport{background:#e5efed}.carousel-button{background:#155d69}.carousel-counter{color:#315f65}
.carousel-track.no-animation{transition:none}
.carousel-track[data-index="0"]{transform:translateX(0)}
.carousel-track[data-index="1"]{transform:translateX(-100%)}
.carousel-track[data-index="2"]{transform:translateX(-200%)}
.carousel-track[data-index="3"]{transform:translateX(-300%)}
.carousel-track[data-index="4"]{transform:translateX(-400%)}
.carousel-track[data-index="5"]{transform:translateX(-500%)}
.carousel-track[data-index="6"]{transform:translateX(-600%)}
.carousel-track[data-index="7"]{transform:translateX(-700%)}
.carousel-track[data-index="8"]{transform:translateX(-800%)}
.carousel-track[data-index="9"]{transform:translateX(-900%)}
.carousel-track[data-index="10"]{transform:translateX(-1000%)}
.evidence-library{border-top-color:#267a79}
footer{border-top-color:#cbdad7;background:rgba(219,233,230,.64)}
footer .footer-title{color:#244d54}footer .footer-copyright{color:#6b7a7d}footer a{color:#145f69}
.copy-notice{
  position:fixed;left:50%;bottom:24px;z-index:10001;max-width:min(92vw,520px);padding:10px 16px;border-radius:999px;
  background:rgba(12,53,68,.94);color:#f4fbfa;font:13px/1.5 "Noto Sans SC","Microsoft YaHei",sans-serif;
  box-shadow:0 10px 28px rgba(4,32,38,.28);opacity:0;pointer-events:none;transform:translate(-50%,14px);
  transition:opacity .18s ease,transform .18s ease
}
.copy-notice.show{opacity:1;transform:translate(-50%,0)}
[data-evidence-image]{cursor:zoom-in;-webkit-user-drag:none}
@media(max-width:700px){
  .hero{padding:16px 12px}.hero-inner{grid-template-columns:46px minmax(0,1fr) 46px;gap:10px}.hero-inner::after{width:46px}
  .hero .seal{width:44px;height:44px;font-size:20px}.hero h1{font-size:clamp(20px,6vw,28px);letter-spacing:.045em}
  .hero .latin-brand{font-size:10px}.hero p{font-size:12px;line-height:1.55}.shell{padding-top:12px}
  #sources .sources{columns:1;font-size:12.5px}
}

/* ===== v14 品牌标识、页脚与世系树全屏工具栏 ===== */
.hero{padding:25px 30px}
.hero-inner{width:min(1240px,100%);grid-template-columns:minmax(270px,310px) minmax(0,1fr) 48px;gap:34px}
.hero-inner::after{display:none}
.site-logo{
  display:inline-flex;align-items:center;gap:13px;width:max-content;border:0;color:inherit;
  font-family:Georgia,"Times New Roman",serif;line-height:1;text-decoration:none;
  transition:transform .2s ease,color .2s ease
}
.logo-mark{
  display:block;width:62px;height:62px;flex:0 0 62px;border:0;object-fit:contain;
  filter:drop-shadow(0 7px 11px rgba(0,0,0,.18));
  transition:transform .22s ease,filter .22s ease
}
.logo-type{display:flex;flex-direction:column;align-items:flex-start;gap:6px;min-width:0}
.logo-wordmark{font-size:27px;font-weight:700;letter-spacing:0;white-space:nowrap}
.logo-wordmark span:last-child{color:#dc5a50}
.logo-tagline{font:600 10px/1.1 "Noto Sans SC","Microsoft YaHei",sans-serif;letter-spacing:0;white-space:nowrap;opacity:.78}
.site-logo:hover{color:inherit;transform:translateY(-2px)}
.site-logo:hover .logo-mark{transform:rotate(-2deg) scale(1.035);filter:drop-shadow(0 10px 15px rgba(0,0,0,.25)) saturate(1.08)}
.site-logo:active{transform:translateY(0)}
.site-logo-header{color:#d6eeea}
.site-logo-header{padding-right:30px;border-right:1px solid rgba(192,220,215,.28)}
.site-logo-header .logo-wordmark{color:#f3fbfa}
.site-logo-header:hover .logo-wordmark{color:#fff}
.hero-copy{text-align:left;position:relative;padding-left:4px}
.hero-copy::before{content:"";display:block;width:38px;height:3px;margin-bottom:7px;border-radius:2px;background:#d8b56d}
.hero h1{font-size:clamp(25px,3vw,36px);line-height:1.18;letter-spacing:0}
.hero p{margin:5px 0 0;font-size:14px;line-height:1.55;letter-spacing:0}
.theme-toggle{
  justify-self:end;position:relative;display:grid;place-items:center;width:38px;height:38px;padding:0;
  border:1px solid rgba(211,231,227,.3);border-radius:7px;background:rgba(4,35,43,.24);
  color:#eef7f5;overflow:hidden;box-shadow:none
}
.theme-toggle:hover{transform:none;background:rgba(4,35,43,.48);border-color:rgba(226,239,236,.56)}
.theme-icon{position:absolute;inset:0;display:grid;place-items:center;font:20px/1 Georgia,serif;transition:opacity .18s ease,transform .18s ease}
.theme-icon-sun{color:#f1cf7d;opacity:0;transform:scale(.72) rotate(-18deg)}
.theme-icon-moon{color:#d8e9e7;opacity:1;transform:scale(1)}
html[data-theme="dark"] .theme-toggle{background:rgba(255,255,255,.055);border-color:rgba(180,211,207,.25)}
html[data-theme="dark"] .theme-icon-sun{opacity:1;transform:scale(1) rotate(0)}
html[data-theme="dark"] .theme-icon-moon{opacity:0;transform:scale(.72) rotate(18deg)}

footer{margin-top:0;padding:0;text-align:left;border-top:3px solid #a9342d;background:#112f34;color:#d7e6e4}
.footer-inner{width:min(1240px,100%);min-height:158px;margin:0 auto;padding:32px 20px;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:38px}
.footer-brand-group{display:flex;align-items:center;gap:24px;min-width:0}
.site-logo-footer{color:#eef7f5}
.site-logo-footer .logo-mark{width:58px;height:58px;flex-basis:58px;filter:drop-shadow(0 6px 10px rgba(0,0,0,.24))}
.site-logo-footer .logo-wordmark{color:#f1f6f5;font-size:24px}
.site-logo-footer .logo-wordmark span:last-child{color:#dc5a50}
.site-logo-footer .logo-tagline{color:#a9c0bd}
footer .footer-copyright{padding-left:24px;border-left:1px solid rgba(195,219,215,.2);font-size:12px;line-height:1.4;letter-spacing:.09em;color:#9eb3b1;white-space:nowrap}
.footer-meta{padding-left:34px;border-left:1px solid rgba(195,219,215,.2);text-align:right;font:14px/1.6 "Noto Sans SC","Microsoft YaHei",sans-serif}
.footer-email{display:inline-block;border:0;color:#eef6f5;font-weight:600;letter-spacing:.025em}
.footer-email:hover{color:#fff;border:0}
.visitor-count{position:relative;margin-top:6px;padding-left:13px;color:#9fb5b2;font-size:12.5px}
.visitor-count::before{content:"";position:absolute;left:0;top:50%;width:5px;height:5px;border-radius:50%;background:#d4574e;transform:translateY(-50%);box-shadow:0 0 0 3px rgba(212,87,78,.12)}

html{scrollbar-width:none;-ms-overflow-style:none}
html::-webkit-scrollbar,body::-webkit-scrollbar{display:none;width:0;height:0}
.section-rail{
  position:fixed;right:8px;top:50%;z-index:45;display:block;width:42px;height:min(70vh,560px);
  margin:0;padding:0;transform:translateY(-50%);border:0;touch-action:none;cursor:ns-resize
}
.section-rail::before,.section-rail-progress{content:"";position:absolute;left:50%;top:14px;width:2px;transform:translateX(-50%);border-radius:2px;background:rgba(72,111,114,.25);pointer-events:none}
.section-rail::before{height:calc(100% - 28px)}
.section-rail-progress{height:0;background:#247b7d;transition:height .1s linear}
.section-rail-thumb{position:absolute;left:50%;top:14px;z-index:5;width:12px;height:12px;border:2px solid #17636b;border-radius:50%;background:#e3c178;box-shadow:0 0 0 4px rgba(31,116,119,.14);transform:translate(-50%,-50%);transition:top .1s linear;cursor:grab}
.section-rail.dragging .section-rail-progress,.section-rail.dragging .section-rail-thumb{transition:none}
.section-rail.dragging .section-rail-thumb{width:14px;height:14px;box-shadow:0 0 0 6px rgba(31,116,119,.17);cursor:grabbing}
.section-rail-link{position:absolute;left:50%;display:flex;align-items:center;justify-content:center;width:30px;height:20px;margin:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;color:#315f65;transform:translate(-50%,-50%)}
.section-rail-link:hover,.section-rail-link:active{border:0;background:transparent;box-shadow:none;transform:translate(-50%,-50%)}
.section-rail-dot{position:relative;z-index:2;width:7px;height:7px;border:2px solid #87aaa7;border-radius:50%;background:#edf3f2;transition:transform .18s ease,background-color .18s ease,border-color .18s ease}
.section-rail-label{position:absolute;right:30px;padding:4px 8px;border:1px solid #bfd2cf;border-radius:5px;background:rgba(251,253,252,.97);box-shadow:0 5px 14px rgba(15,55,60,.12);font:12px/1.3 "Noto Sans SC","Microsoft YaHei",sans-serif;white-space:nowrap;opacity:0;pointer-events:none;transform:translateX(5px);transition:opacity .16s ease,transform .16s ease}
.section-rail-link:hover .section-rail-label,.section-rail-link:focus-visible .section-rail-label,.section-rail-link.active .section-rail-label{opacity:1;transform:translateX(0)}
.section-rail-link.active .section-rail-dot{width:11px;height:11px;border-color:#165f68;background:#e0bf78;box-shadow:0 0 0 4px rgba(31,116,119,.13)}

html[data-theme="dark"]{
  color-scheme:dark;--bg:#0b1416;--paper:#132124;--paper-deep:#182a2d;--ink:#e4ecea;--muted:#9aadaa;
  --line:#2d4447;--accent:#67bbb5;--gold:#d0aa60;--gold-light:#b89453;--wine:#86cec8;
  --a:#58a77c;--b:#6f9fc0;--c:#c4a354;--d:#b37a8d;--question:#c3a052;
  --shadow:0 13px 34px rgba(0,0,0,.24)
}
html[data-theme="light"]{color-scheme:light}
html[data-theme="dark"] body{background:linear-gradient(180deg,#081316 0,#102124 360px,#0b1719 100%);color:var(--ink)}
html[data-theme="dark"] .hero{background:linear-gradient(135deg,#071f28 0%,#0b3a45 56%,#105450 100%);border-bottom-color:#719d97}
html[data-theme="dark"] .toolbar{background:rgba(17,34,37,.96);border-color:#355154;box-shadow:0 10px 28px rgba(0,0,0,.28)}
html[data-theme="dark"] .toolbar input{border-color:#3b575a;background:#0e1b1e;color:#e6efed}
html[data-theme="dark"] .search-status{color:#9bafac}
html[data-theme="dark"] button{border-color:#3a5a5d;background:#1a3033;color:#c7e5e1}
html[data-theme="dark"] button:hover{background:#254347;border-color:#5d918d}
html[data-theme="dark"] nav a{color:#a9d4cf;border-color:#30494c;background:#142326;box-shadow:none}
html[data-theme="dark"] nav a:hover{background:#1d3538;border-color:#5a8f8a;color:#d7eeeb}
html[data-theme="dark"] .card{background:#132124;border-color:#2c4447;box-shadow:var(--shadow)}
html[data-theme="dark"] .card h2,html[data-theme="dark"] .fact h3,html[data-theme="dark"] .candidate-card h3,html[data-theme="dark"] .evidence-doc h3,html[data-theme="dark"] .tree-info h3{color:#9cd5d0}
html[data-theme="dark"] .warning,html[data-theme="dark"] .hypothesis-note{background:#282619;border-left-color:#c09a50}
html[data-theme="dark"] .strongline{background:#1c3335;color:#d7e8e5}
html[data-theme="dark"] summary,html[data-theme="dark"] .group>summary{border-color:#30494c;background:#17292c;color:#dce9e7}
html[data-theme="dark"] summary:hover{background:#20383b;border-color:#527c78}
html[data-theme="dark"] .person-body,html[data-theme="dark"] .source-materials,html[data-theme="dark"] .transcription,html[data-theme="dark"] .evidence-text{background:#0f1d20;color:#d1ddda}
html[data-theme="dark"] .fact,html[data-theme="dark"] .candidate-card,html[data-theme="dark"] .evidence-doc,html[data-theme="dark"] .research-stats div,html[data-theme="dark"] .record-item{border-color:#30484b;background:#17272a;box-shadow:none}
html[data-theme="dark"] .record-quote,html[data-theme="dark"] .same-name-note{background:#203537;color:#d5e1df}
html[data-theme="dark"] th{color:#c9e2df;background:linear-gradient(180deg,#203538,#192c2f)}
html[data-theme="dark"] td{border-color:#30474a}html[data-theme="dark"] tbody tr:nth-child(even){background:rgba(42,67,69,.32)}html[data-theme="dark"] tbody tr:hover{background:#213638}
html[data-theme="dark"] .tree-controls{border-color:#355053;background:#182c2f}
html[data-theme="dark"] .tree-stage{border-color:#344f52;background:radial-gradient(circle at 1px 1px,rgba(128,174,169,.16) 1px,transparent 1.4px) 0 0/24px 24px,linear-gradient(180deg,#142427,#0e1c1f)}
html[data-theme="dark"] .tree-node .node-card{fill:#17272a;stroke:#3a5658}html[data-theme="dark"] .tree-node.selected .node-card{fill:#234548}html[data-theme="dark"] .tree-node.search-hit .node-card{fill:#2b504c}
html[data-theme="dark"] .node-name-html,html[data-theme="dark"] .node-name{color:#e2ecea;fill:#e2ecea}html[data-theme="dark"] .node-meta-html,html[data-theme="dark"] .node-meta{color:#9aadaa;fill:#9aadaa}html[data-theme="dark"] .node-title-html,html[data-theme="dark"] .node-title{color:#85bfba;fill:#85bfba}
html[data-theme="dark"] .tree-info{background:rgba(18,33,36,.98);border-color:#3a5658;color:#dae6e4}
html[data-theme="dark"] .scan-card,html[data-theme="dark"] .evidence-inventory-wrap,html[data-theme="dark"] .carousel-viewport{background:#17272a;border-color:#30474a}
html[data-theme="dark"] .local-proof-gallery figure{background:#192b2e;border-color:#375154}
html[data-theme="dark"] footer{border-top-color:#a9342d;background:#091a1e}html[data-theme="dark"] footer a{color:#d8e9e7}html[data-theme="dark"] footer .footer-copyright,html[data-theme="dark"] .visitor-count{color:#8fa7a4}
html[data-theme="dark"] .site-logo-footer .logo-wordmark{color:#edf5f4}html[data-theme="dark"] .site-logo-footer .logo-tagline{color:#90aaa7}
html[data-theme="dark"] .section-rail::before{background:rgba(137,177,173,.2)}html[data-theme="dark"] .section-rail-progress{background:#69aaa5}
html[data-theme="dark"] .section-rail-thumb{border-color:#89beba;background:#d4ae62;box-shadow:0 0 0 3px rgba(105,170,165,.18)}
html[data-theme="dark"] .section-rail-dot{border-color:#527875;background:#101f22}html[data-theme="dark"] .section-rail-label{border-color:#385356;background:rgba(18,34,37,.97);color:#cfe3e0;box-shadow:0 5px 14px rgba(0,0,0,.3)}
html[data-theme="dark"] .section-rail-link.active .section-rail-dot{border-color:#8cc2bd;background:#d1ad64;box-shadow:0 0 0 4px rgba(105,170,165,.16)}

.tree-card:fullscreen,.tree-card:-webkit-full-screen{
  width:100vw;height:100vh;margin:0;padding:12px;border:0;border-radius:0;background:var(--paper);
  display:flex;flex-direction:column;overflow:hidden
}
.tree-card:fullscreen .tree-heading-row,.tree-card:-webkit-full-screen .tree-heading-row{display:none}
.tree-card:fullscreen .tree-controls,.tree-card:-webkit-full-screen .tree-controls{
  position:relative;top:auto;z-index:20;flex:0 0 auto;margin:0 0 10px;padding:9px
}
.tree-card:fullscreen .tree-stage,.tree-card:-webkit-full-screen .tree-stage{
  flex:1 1 auto;width:100%;height:auto;min-height:0;border-radius:8px
}

@media(max-width:760px){
  .hero{padding:18px 14px 20px}.hero-inner{display:flex;flex-direction:column;align-items:flex-start;gap:12px}.hero-inner::after{display:none}
  .site-logo-header{padding-right:0;border-right:0}
  .site-logo-header .logo-mark{width:50px;height:50px;flex-basis:50px}
  .site-logo-header .logo-wordmark{font-size:21px}.site-logo-header .logo-tagline{font-size:9px}
  .hero-copy{text-align:left;padding:10px 0 0;width:100%;border-top:1px solid rgba(192,220,215,.2)}.hero-copy::before{width:30px;height:2px;margin-bottom:6px}.hero h1{font-size:clamp(22px,7vw,29px)}.hero p{margin-right:54px;font-size:12px}
  .theme-toggle{position:absolute;right:12px;top:12px}.theme-toggle:hover{transform:none}
  .footer-inner{min-height:0;grid-template-columns:1fr;gap:22px;padding:30px 18px}
  .footer-brand-group{align-items:center;gap:18px;flex-wrap:wrap}.site-logo-footer .logo-mark{width:52px;height:52px;flex-basis:52px}.site-logo-footer .logo-wordmark{font-size:22px}
  footer .footer-copyright{padding-left:18px}.footer-meta{padding:17px 0 0;border-left:0;border-top:1px solid rgba(195,219,215,.18);text-align:left}
  .tree-card:fullscreen,.tree-card:-webkit-full-screen{padding:7px}
  .tree-card:fullscreen .tree-controls,.tree-card:-webkit-full-screen .tree-controls{gap:5px;margin-bottom:7px;padding:7px;max-height:38vh;overflow:auto}
  .tree-card:fullscreen .tree-controls button,.tree-card:-webkit-full-screen .tree-controls button{padding:7px 8px;font-size:12px}
  .card>table{display:block;width:100%;overflow-x:auto;overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch}
  .section-rail{right:1px;width:30px;height:min(66vh,480px)}.section-rail-link{width:24px;height:18px}.section-rail-dot{width:6px;height:6px;border-width:1px}.section-rail-link.active .section-rail-dot{width:9px;height:9px;box-shadow:0 0 0 3px rgba(31,116,119,.12)}.section-rail-label{display:none}
}

@media(max-width:430px){
  .footer-brand-group{display:grid;grid-template-columns:auto 1fr;gap:12px}.site-logo-footer{grid-column:1/-1}footer .footer-copyright{padding:10px 0 0;border-left:0;border-top:1px solid rgba(195,219,215,.18)}
}

/* ===== v15 简洁页头、通用底纹与完整夜间配色 ===== */
html.rail-dragging{scroll-behavior:auto!important}
body{
  background-color:#edf2f0;
  background-image:repeating-linear-gradient(0deg,rgba(28,72,70,.014) 0,rgba(28,72,70,.014) 1px,transparent 1px,transparent 7px),radial-gradient(rgba(29,76,73,.04) .55px,transparent .75px);
  background-size:auto,13px 13px;background-attachment:fixed
}
.hero{background:#174148;border-bottom:1px solid rgba(206,228,224,.24);box-shadow:none}
.hero::before,.hero::after,.hero-copy::before{display:none}
.hero h1{text-shadow:none}.hero p{color:#d2e3e0}
.theme-toggle,.theme-toggle:hover,.theme-toggle:active{
  width:34px;height:34px;padding:0;border:0;background:transparent;box-shadow:none;transform:none
}
.theme-toggle:focus-visible{outline:2px solid rgba(235,207,137,.62);outline-offset:3px}
.theme-icon{font-size:22px}
.theme-icon-moon{color:#e3c171}.theme-icon-sun{color:#f0c35d}
.theme-toggle:hover .theme-icon-moon{transform:scale(1.12)}
html[data-theme="dark"] .theme-toggle,html[data-theme="dark"] .theme-toggle:hover,html[data-theme="dark"] .theme-toggle:active{border:0;background:transparent;box-shadow:none}
html[data-theme="dark"] .theme-toggle:hover .theme-icon-sun{transform:scale(1.12) rotate(0)}
footer{border-top:1px solid #294c50;background:#112f34}
.footer-meta{font-size:12.5px}
.footer-email{color:#afc3c0;font-size:12px;font-weight:400;letter-spacing:0}
.footer-email:hover{color:#d9e7e5}
.visitor-count{font-size:12px}

html[data-theme="dark"] body{
  background-color:#0b171a;
  background-image:repeating-linear-gradient(0deg,rgba(173,203,198,.018) 0,rgba(173,203,198,.018) 1px,transparent 1px,transparent 8px),radial-gradient(rgba(169,201,196,.035) .55px,transparent .75px);
  background-size:auto,14px 14px;background-attachment:fixed;color:#dce7e5
}
html[data-theme="dark"] .hero{background:#0d292e;border-bottom-color:#28494d}
html[data-theme="dark"] footer{background:#091f23;border-top-color:#254247}
html[data-theme="dark"] a{color:#8fcac5;border-bottom-color:#446d6a}
html[data-theme="dark"] a:hover{color:#c2e3df}
html[data-theme="dark"] .card{color:#d8e4e2}
html[data-theme="dark"] .card h2{border-bottom-color:#314b4e}
html[data-theme="dark"] .card h2::after{border-bottom-color:#75aaa5}
html[data-theme="dark"] .person-name,html[data-theme="dark"] .record-head b,html[data-theme="dark"] .relation-item b{color:#e0ece9}
html[data-theme="dark"] .years,html[data-theme="dark"] .meta,html[data-theme="dark"] .tree-stats,html[data-theme="dark"] .zoom-label,html[data-theme="dark"] .record-meta,html[data-theme="dark"] .research-stats span,html[data-theme="dark"] .sources p,html[data-theme="dark"] .local-proof-gallery figcaption,html[data-theme="dark"] .scan-card figcaption,html[data-theme="dark"] .tree-info .info-years,html[data-theme="dark"] .info-uid{color:#9fb2af}
html[data-theme="dark"] .title,html[data-theme="dark"] .tree-info .info-title,html[data-theme="dark"] .record-note,html[data-theme="dark"] .evidence-inventory td:nth-child(5){color:#82beb8}
html[data-theme="dark"] .tree-info .info-section{border-top-color:#314a4d}
html[data-theme="dark"] .research-stats b,html[data-theme="dark"] #sources h3,html[data-theme="dark"] .evidence-inventory-wrap h3{color:#9cd5d0}
html[data-theme="dark"] .evidence-chain article,html[data-theme="dark"] .evidence-status-grid>div,html[data-theme="dark"] .relation-item,html[data-theme="dark"] .office-item{border-color:#31494c;background:#17272a;color:#d6e2e0}
html[data-theme="dark"] .evidence-chain h3,html[data-theme="dark"] .relation-item b{color:#a8d9d4}
html[data-theme="dark"] .office-item span{color:#9bafac}
html[data-theme="dark"] .evidence-doc details{border-color:#30494c;background:#122124}
html[data-theme="dark"] .research-links a,html[data-theme="dark"] .evidence-links a,html[data-theme="dark"] .download-pill{border-color:#3d5c5f;background:#182d30;color:#a9d6d1}
html[data-theme="dark"] .warning-inline,html[data-theme="dark"] .status-note,html[data-theme="dark"] .evidence-warning{border-left-color:#c09a50;background:#2a281c;color:#dcd6bd}
html[data-theme="dark"] .missing-original{border-color:#846f4d;background:#27271e;color:#d4c7a9}
html[data-theme="dark"] .remote-proof .remote-fallback{background:#202f31;color:#d4e1df}
html[data-theme="dark"] .local-proof-gallery img{background:#111d20}
html[data-theme="dark"] .evidence-status-grid span,html[data-theme="dark"] .office-item span{color:#9caeab}
html[data-theme="dark"] .carousel-counter{color:#9bb9b5}
html[data-theme="dark"] .key-genealogy-quote{color:#ff8d82}
html[data-theme="dark"] .footer-email{color:#829b98}
html[data-theme="dark"] .footer-email:hover{color:#c9dcd9}
