
:root{
  --bg:#f7f5ef; --paper:#fffdf8; --ink:#1f2933; --muted:#6b7280; --line:#d7c7a2;
  --accent:#7b4f24; --accent2:#b98240; --soft:#efe7d6; --danger:#b91c1c; --ok:#047857;
  --shadow: 0 18px 50px rgba(31,41,51,.12);
}
*{box-sizing:border-box} body{margin:0;background:var(--bg);color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans SC","PingFang SC",Arial,sans-serif;}
a{color:var(--accent)}
.header{position:sticky;top:0;z-index:20;background:rgba(255,253,248,.94);backdrop-filter:blur(10px);border-bottom:1px solid #eadfc8;display:flex;align-items:center;gap:18px;padding:14px 24px;}
.logo{font-weight:800;letter-spacing:.02em;font-size:20px;color:var(--accent)} .sub{font-size:13px;color:var(--muted)}
.nav{margin-left:auto;display:flex;gap:8px;flex-wrap:wrap}.nav a,.btn{border:1px solid #d7c7a2;background:#fffdf8;border-radius:999px;padding:8px 13px;color:var(--ink);text-decoration:none;cursor:pointer;font-size:14px}.btn:hover,.nav a:hover{background:var(--soft)}.btn.primary{background:var(--accent);color:white;border-color:var(--accent)}.btn.danger{color:var(--danger);border-color:#fecaca}.btn.small{font-size:12px;padding:5px 9px}.btn:disabled{opacity:.45;cursor:not-allowed}
.layout{display:grid;grid-template-columns:310px 1fr;min-height:calc(100vh - 65px)}.sidebar{border-right:1px solid #eadfc8;background:#fbf8f0;padding:18px;overflow:auto;max-height:calc(100vh - 65px);position:sticky;top:65px}.main{padding:22px;overflow:hidden}.search{width:100%;padding:12px 14px;border:1px solid #d7c7a2;border-radius:14px;background:white;font-size:15px}.hint{font-size:12px;color:var(--muted);line-height:1.5}.person-list{margin-top:14px;display:flex;flex-direction:column;gap:8px}.person-item{padding:10px 12px;border:1px solid #eadfc8;background:white;border-radius:14px;cursor:pointer}.person-item:hover,.person-item.active{border-color:var(--accent2);background:#fff7e8}.person-item .en{font-weight:700}.person-item .cn{font-size:13px;color:var(--muted)}
.card{background:var(--paper);border:1px solid #eadfc8;border-radius:22px;box-shadow:var(--shadow);padding:20px;margin-bottom:18px}.card h2,.card h3{margin:0 0 12px}.grid{display:grid;gap:16px}.grid.two{grid-template-columns:340px 1fr}.grid.three{grid-template-columns:repeat(3,1fr)}
.portrait{width:100%;aspect-ratio:1/1.15;border-radius:18px;background:#efe7d6;display:flex;align-items:center;justify-content:center;overflow:hidden;color:#8b7558;text-align:center;font-weight:700}.portrait img{width:100%;height:100%;object-fit:cover}.meta{display:flex;gap:8px;flex-wrap:wrap;margin:8px 0}.tag{font-size:12px;padding:4px 8px;border-radius:999px;background:var(--soft);color:#5a4630}.tag.ok{background:#dcfce7;color:#166534}.tag.warn{background:#fef3c7;color:#92400e}.tag.bad{background:#fee2e2;color:#991b1b}.bio{line-height:1.75;font-size:15px;white-space:pre-wrap}.tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:14px}.tab{border:1px solid #d7c7a2;background:#fffdf8;border-radius:12px;padding:8px 12px;cursor:pointer}.tab.active{background:var(--accent);color:white;border-color:var(--accent)}
.svg-wrap{width:100%;min-height:520px;border:1px solid #eadfc8;border-radius:22px;background:linear-gradient(180deg,#fffdf8,#fbf7ed);overflow:auto;padding:8px}.lineage-svg{min-width:920px}.node rect{fill:white;stroke:#c9aa70;stroke-width:1.4}.node.current rect{fill:#7b4f24;stroke:#7b4f24}.node.current text{fill:white}.node text{font-size:13px;fill:#1f2933;font-weight:600}.node .cn{font-size:12px;fill:#6b7280;font-weight:400}.node.current .cn{fill:#f7ead4}.edge{stroke:#a98952;stroke-width:1.6;fill:none}.edge.dashed{stroke-dasharray:5 4}.photo-circle{fill:#efe7d6;stroke:#c9aa70;stroke-width:1}.node-img{clip-path:circle(18px at 26px 26px)}
.table{width:100%;border-collapse:collapse;background:white;border-radius:14px;overflow:hidden}.table th,.table td{border-bottom:1px solid #eee3cd;padding:9px 10px;text-align:left;font-size:13px;vertical-align:top}.table th{background:#f3ead8;color:#5a4630}.table tr:hover td{background:#fff8e9}.controls{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin:10px 0}.select,input,textarea{border:1px solid #d7c7a2;border-radius:12px;background:white;padding:9px 10px;font:inherit}.select{min-width:160px} textarea{width:100%;min-height:120px;line-height:1.5}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.form-row label{font-size:12px;color:var(--muted);display:block;margin:0 0 5px}.form-row input,.form-row select,.form-row textarea{width:100%}.split{display:grid;grid-template-columns:360px 1fr;gap:16px}.notice{background:#fff8e6;border:1px solid #f2d6a0;border-radius:14px;padding:12px;font-size:14px;line-height:1.6}.footer-note{font-size:12px;color:var(--muted);margin-top:8px}.hidden{display:none!important}.scrollbox{max-height:430px;overflow:auto;border:1px solid #eadfc8;border-radius:14px;background:white}.pill-list{display:flex;flex-wrap:wrap;gap:7px}.pill{border:1px solid #d7c7a2;border-radius:999px;padding:6px 9px;background:white;font-size:12px;cursor:pointer}.pill:hover{background:#fff7e8}
@media(max-width:900px){.layout{grid-template-columns:1fr}.sidebar{position:relative;top:auto;max-height:none}.grid.two,.grid.three,.split,.form-grid{grid-template-columns:1fr}.main{padding:12px}.header{align-items:flex-start}.nav{margin-left:0}.lineage-svg{min-width:780px}}
.subcard{margin-top:18px;background:rgba(255,255,255,0.04)}
.photo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px;margin-top:12px}
.photo-card{border:1px solid rgba(255,255,255,.16);border-radius:14px;padding:10px;background:rgba(255,255,255,.05)}
.photo-card img{width:100%;height:150px;object-fit:cover;border-radius:10px;background:#111}
.photo-card .title{font-size:12px;margin:8px 0;line-height:1.25;word-break:break-word}
.photo-card .meta{font-size:11px;color:var(--muted);line-height:1.25;min-height:28px}
.proposal{margin-top:12px;font-size:13px;line-height:1.6;word-break:break-word}
.proposal pre{white-space:pre-wrap;background:rgba(0,0,0,.22);padding:12px;border-radius:12px;max-height:360px;overflow:auto}
.btn.small{font-size:12px;padding:5px 8px}
