.genealogy-workspace {
  --genealogy-ink: #172033;
  --genealogy-muted: #78716c;
  --genealogy-line: #e7e5e4;
  --genealogy-paper: #ffffff;
  --genealogy-wash: #fafaf9;
  --genealogy-accent: #0f766e;
  --genealogy-accent-dark: #115e59;
  max-width: 1540px;
  margin: 0 auto;
  padding: 28px;
  color: var(--genealogy-ink);
  animation: genealogy-rise .32s ease-out both;
}

.genealogy-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 22px; }
.genealogy-header h2 { margin: 0; color: var(--genealogy-ink); font-size: clamp(27px, 3vw, 38px); font-weight: 700; letter-spacing: -.04em; }
.genealogy-header p:not(.management-kicker) { max-width: 620px; margin: 9px 0 0; color: var(--genealogy-muted); font-size: 14px; }
.genealogy-workspace .management-kicker { color: var(--genealogy-accent); }
.genealogy-header-actions { display: flex; align-items: center; gap: 10px; }
.genealogy-search-trigger { display: grid; min-width: 260px; grid-template-columns: 30px 1fr auto; align-items: center; gap: 9px; border: 1px solid var(--genealogy-line); border-radius: 10px; background: #fff; color: #44403c; padding: 7px 9px; transition: border-color .15s ease, box-shadow .15s ease; }
.genealogy-search-trigger:hover { border-color: #99d5cf; box-shadow: 0 0 0 3px rgba(15, 118, 110, .08); }
.genealogy-search-trigger > span:first-child { color: var(--genealogy-accent); font-size: 20px; text-align: center; }.genealogy-search-trigger strong, .genealogy-search-trigger small { display: block; }.genealogy-search-trigger strong { font-size: 12px; }.genealogy-search-trigger small { margin-top: 1px; color: #a8a29e; font-size: 10px; }.genealogy-search-trigger kbd { border: 1px solid #e7e5e4; border-radius: 5px; background: #fafaf9; color: #78716c; padding: 3px 5px; font: 10px ui-sans-serif, system-ui; }
.genealogy-quick-search { display: flex; overflow: hidden; border: 1px solid var(--genealogy-line); border-radius: 10px; background: #fff; transition: border-color .15s ease, box-shadow .15s ease; }
.genealogy-quick-search:focus-within { border-color: #5eead4; box-shadow: 0 0 0 3px rgba(15, 118, 110, .1); }
.genealogy-quick-search input { width: min(290px, 25vw); border: 0; outline: 0; padding: 10px 12px; font-size: 13px; }
.genealogy-quick-search input[type=submit] { width: auto; border-left: 1px solid var(--genealogy-line); background: #faf7f2; color: var(--genealogy-accent); padding-inline: 13px; font-weight: 800; cursor: pointer; }
.genealogy-primary-action, .genealogy-secondary-action { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 9px; padding: 10px 14px; font-size: 13px; font-weight: 800; white-space: nowrap; transition: transform .15s ease, background .15s ease, box-shadow .15s ease; }
.genealogy-primary-action { background: var(--genealogy-accent); color: #fff; box-shadow: 0 8px 18px rgba(15, 118, 110, .16); }
.genealogy-primary-action:hover { background: var(--genealogy-accent-dark); color: #fff; transform: translateY(-1px); }
.genealogy-secondary-action { background: #fff; color: #5c554d; box-shadow: inset 0 0 0 1px var(--genealogy-line); cursor: pointer; }
.genealogy-secondary-action:hover { color: var(--genealogy-accent); box-shadow: inset 0 0 0 1px #c88d84; }

.genealogy-locator { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: end; gap: 11px; margin-bottom: 18px; border: 1px solid var(--genealogy-line); border-radius: 13px; background: #fff; padding: 14px; box-shadow: 0 1px 2px rgba(28, 25, 23, .03); }
.genealogy-province-field, .genealogy-city-field, .genealogy-district-field { grid-column: span 2; }
.genealogy-surname-field, .genealogy-generation-field { grid-column: span 3; }
.genealogy-branch-field, .genealogy-household-field { grid-column: span 5; }
.genealogy-locator .genealogy-secondary-action { grid-column: span 2; }
.genealogy-locator label { display: block; margin: 0 0 6px; color: #8a8178; font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.genealogy-locator select { box-sizing: border-box; width: 100%; min-height: 39px; border: 1px solid #d6d3d1; border-radius: 8px; background: #fff; color: #292524; padding: 8px 28px 8px 10px; font-size: 13px; outline: 0; }
.genealogy-locator select:focus { border-color: #0f766e; box-shadow: 0 0 0 3px rgba(15, 118, 110, .1); }

.genealogy-search-results { overflow: hidden; margin-bottom: 16px; border: 1px solid #dccfc2; border-radius: 13px; background: var(--genealogy-paper); box-shadow: 0 12px 28px rgba(67, 52, 39, .08); animation: genealogy-drop .2s ease-out both; }
.genealogy-search-results > header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--genealogy-line); padding: 12px 16px; }
.genealogy-search-results > header div { display: flex; align-items: baseline; gap: 10px; }.genealogy-search-results > header strong { font-size: 14px; }.genealogy-search-results > header span { color: var(--genealogy-muted); font-size: 11px; }.genealogy-search-results > header a { color: var(--genealogy-accent); font-size: 12px; font-weight: 800; }
.genealogy-search-list { display: grid; max-height: 250px; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: auto; }
.genealogy-search-list > a { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid #f0ebe5; padding: 11px 15px; color: #443d36; transition: background .12s ease; }
.genealogy-search-list > a:nth-child(odd) { border-right: 1px solid #f0ebe5; }.genealogy-search-list > a:hover { background: #fbf6f1; }.genealogy-search-list strong, .genealogy-search-list small { display: block; }.genealogy-search-list strong { font-size: 13px; }.genealogy-search-list small { overflow: hidden; margin-top: 3px; color: #91877d; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }.genealogy-search-list > a > span:last-child { color: #9a8f84; font-size: 11px; }
.genealogy-search-avatar { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; border-radius: 50%; background: #f1e5dc; color: var(--genealogy-accent); font-family: serif; font-weight: 800; }
.genealogy-inline-empty { padding: 22px; color: var(--genealogy-muted); font-size: 13px; text-align: center; }

.genealogy-context-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 12px; border-bottom: 1px solid var(--genealogy-line); padding: 0 2px 12px; }
.genealogy-context-bar > div { display: flex; min-width: 0; align-items: center; gap: 11px; }.genealogy-context-bar strong, .genealogy-context-bar small { display: block; }.genealogy-context-bar strong { overflow: hidden; font-family: "Songti SC", "STSong", serif; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }.genealogy-context-bar small { margin-top: 3px; color: var(--genealogy-muted); font-size: 11px; }
.genealogy-context-mark { display: inline-flex; width: 34px; height: 34px; flex: 0 0 auto; align-items: center; justify-content: center; border: 1px solid #d5b1a9; border-radius: 50%; color: var(--genealogy-accent); font-family: serif; font-size: 13px; font-weight: 800; }
.genealogy-live-state, .genealogy-lock-state { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 9px; font-size: 11px; font-weight: 800; white-space: nowrap; }.genealogy-live-state { background: #edf7ee; color: #367042; }.genealogy-lock-state { background: #fff2df; color: #986119; }.genealogy-live-state::before, .genealogy-lock-state::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }

.genealogy-layout { display: grid; grid-template-columns: minmax(310px, .82fr) minmax(520px, 1.5fr); gap: 14px; align-items: start; }
.genealogy-tree-panel, .genealogy-detail-panel { border: 1px solid var(--genealogy-line); border-radius: 14px; background: var(--genealogy-paper); box-shadow: 0 3px 18px rgba(67, 52, 39, .045); }
.genealogy-tree-panel { position: sticky; top: 18px; overflow: hidden; }
.genealogy-tree-panel > header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--genealogy-line); padding: 14px 16px; }.genealogy-tree-panel > header strong, .genealogy-tree-panel > header small { display: block; }.genealogy-tree-panel > header strong { font-family: "Songti SC", "STSong", serif; font-size: 15px; }.genealogy-tree-panel > header small { margin-top: 2px; color: var(--genealogy-muted); font-size: 10px; }.genealogy-tree-panel > header a { color: var(--genealogy-accent); font-size: 11px; font-weight: 800; }
.genealogy-tree-scroll { height: min(66vh, 720px); overflow: auto; overscroll-behavior: contain; padding: 9px 8px 15px; scrollbar-color: #d6ccc0 transparent; scrollbar-width: thin; }
.genealogy-tree, .genealogy-tree ol { margin: 0; padding: 0; list-style: none; }.genealogy-tree ol { position: relative; margin-left: 19px; padding-left: 13px; }.genealogy-tree ol::before { position: absolute; top: 0; bottom: 11px; left: 0; width: 1px; background: #e2d8cd; content: ""; }
.genealogy-tree-node details > summary { display: flex; align-items: center; list-style: none; }.genealogy-tree-node details > summary::-webkit-details-marker { display: none; }.genealogy-tree-node details > summary::before { width: 14px; flex: 0 0 14px; color: #a0958a; content: "›"; font-size: 17px; line-height: 1; transform: rotate(0); transition: transform .14s ease; }.genealogy-tree-node details[open] > summary::before { transform: rotate(90deg); }
.genealogy-tree-row { display: grid; min-width: 0; flex: 1; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 8px; margin: 2px 0; border-radius: 9px; color: #443d36; padding: 7px 8px; transition: background .13s ease, transform .13s ease; }.genealogy-tree-node > .genealogy-tree-row { margin-left: 14px; }.genealogy-tree-row:hover { background: #f7f1eb; transform: translateX(1px); }.genealogy-tree-row.is-selected { background: #f1e3da; color: #702a22; box-shadow: inset 3px 0 0 var(--genealogy-accent); }
.genealogy-node-icon { display: inline-flex; width: 27px; height: 27px; align-items: center; justify-content: center; border-radius: 8px; background: #eee9e2; color: #766e65; font-family: serif; font-size: 10px; font-weight: 800; }.genealogy-node-icon.has-marker { background: var(--genealogy-accent); color: #fff; }
.genealogy-node-copy { min-width: 0; }.genealogy-node-copy strong, .genealogy-node-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.genealogy-node-copy strong { font-family: "Songti SC", "STSong", serif; font-size: 13px; }.genealogy-node-copy strong span { color: var(--genealogy-accent); font-family: ui-sans-serif, system-ui; font-size: 10px; }.genealogy-node-copy small { margin-top: 2px; color: #9b9187; font-size: 10px; }
.genealogy-reference, .genealogy-marker { border-radius: 999px; background: #fff4e5; color: #986119; padding: 3px 6px; font-size: 9px; font-weight: 800; white-space: nowrap; }.genealogy-marker { background: #f2e3df; color: var(--genealogy-accent); }
.genealogy-tree-summary { display: flex; justify-content: space-between; border-top: 1px solid var(--genealogy-line); background: #faf7f2; padding: 10px 14px; color: var(--genealogy-muted); font-size: 10px; }.genealogy-tree-summary strong { color: var(--genealogy-ink); }

.genealogy-detail-panel { min-height: 620px; overflow: hidden; }
.genealogy-person-header { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 14px; border-bottom: 1px solid var(--genealogy-line); padding: 20px 22px; background: linear-gradient(110deg, #fffdfa, #f9f3ed); }
.genealogy-person-avatar { display: inline-flex; width: 54px; height: 54px; align-items: center; justify-content: center; border: 1px solid #d9b7b0; border-radius: 50%; background: #fff; color: var(--genealogy-accent); font-family: "Songti SC", "STSong", serif; font-size: 23px; font-weight: 800; box-shadow: inset 0 0 0 4px #f7ebe7; }
.genealogy-person-heading span { color: var(--genealogy-accent); font-size: 10px; font-weight: 800; letter-spacing: .06em; }.genealogy-person-heading h3 { margin: 2px 0; font-family: "Songti SC", "STSong", serif; font-size: 25px; letter-spacing: .03em; }.genealogy-person-heading p { margin: 0; color: var(--genealogy-muted); font-size: 11px; }.genealogy-person-actions { display: flex; gap: 7px; }
.genealogy-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-bottom: 1px solid var(--genealogy-line); }.genealogy-facts > div { border-right: 1px solid var(--genealogy-line); padding: 13px 17px; }.genealogy-facts > div:last-child { border-right: 0; }.genealogy-facts dt { color: #91877d; font-size: 10px; }.genealogy-facts dd { margin: 4px 0 0; color: #3f3832; font-family: "Songti SC", "STSong", serif; font-size: 13px; font-weight: 700; }
.genealogy-biography, .genealogy-notes, .genealogy-spouses, .genealogy-children, .genealogy-statistics { border-bottom: 1px solid var(--genealogy-line); padding: 17px 22px; }
.genealogy-section-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }.genealogy-section-heading strong { font-family: "Songti SC", "STSong", serif; font-size: 14px; }.genealogy-section-heading span { color: #9b9187; font-size: 10px; }.genealogy-section-heading a { margin-left: auto; color: var(--genealogy-accent); font-size: 11px; font-weight: 800; }
.genealogy-biography > p { margin: 0; color: #5d554e; font-family: "Songti SC", "STSong", serif; font-size: 13px; line-height: 1.9; white-space: pre-wrap; }.genealogy-biography > p p { margin: 0; }
.genealogy-notes dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 18px; margin: 0; }.genealogy-notes dl div { display: grid; grid-template-columns: 72px 1fr; gap: 8px; }.genealogy-notes dt { color: #938980; font-size: 10px; }.genealogy-notes dd { margin: 0; color: #4b443e; font-size: 11px; }
.genealogy-spouse-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }.genealogy-spouse-list article { position: relative; border-left: 2px solid #d7b4ac; background: #faf6f1; padding: 10px 12px; }.genealogy-spouse-list article div { display: flex; align-items: baseline; gap: 8px; }.genealogy-spouse-list article span { color: var(--genealogy-accent); font-size: 10px; }.genealogy-spouse-list article strong { font-family: "Songti SC", "STSong", serif; font-size: 13px; }.genealogy-spouse-list article p { overflow: hidden; margin: 5px 26px 0 0; color: var(--genealogy-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }.genealogy-spouse-list article > a { position: absolute; right: 10px; bottom: 9px; color: var(--genealogy-accent); font-size: 10px; font-weight: 800; }
.genealogy-child-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }.genealogy-child-list a { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; border-radius: 8px; color: #49423c; padding: 7px 8px; }.genealogy-child-list a:hover { background: #faf3ee; }.genealogy-child-list span { display: inline-flex; width: 23px; height: 23px; align-items: center; justify-content: center; border-radius: 50%; background: #eee8e1; color: #786f66; font-size: 9px; }.genealogy-child-list strong { font-family: "Songti SC", "STSong", serif; font-size: 12px; }.genealogy-child-list small { color: #9a9188; font-size: 10px; }.genealogy-child-list b { color: var(--genealogy-accent); font-weight: 500; }
.genealogy-muted { margin: 0; color: #a0978e; font-size: 11px; }
.genealogy-statistics > div:last-of-type { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }.genealogy-statistics > div:last-of-type span { border-right: 1px solid var(--genealogy-line); padding: 3px 12px; }.genealogy-statistics > div:last-of-type span:first-child { padding-left: 0; }.genealogy-statistics > div:last-of-type span:last-child { border-right: 0; }.genealogy-statistics small, .genealogy-statistics strong { display: block; }.genealogy-statistics small { color: #948a80; font-size: 9px; }.genealogy-statistics strong { margin-top: 3px; font-family: "Songti SC", "STSong", serif; font-size: 18px; }.genealogy-statistics > p { margin: 11px 0 0; color: #9a9188; font-size: 9px; }
.genealogy-detail-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; background: #faf7f2; padding: 13px 20px; }.genealogy-detail-actions summary { color: #665e56; font-size: 11px; font-weight: 800; cursor: pointer; }.genealogy-detail-actions details form { display: flex; gap: 6px; margin-top: 8px; }.genealogy-detail-actions select { max-width: 180px; border: 1px solid var(--genealogy-line); border-radius: 7px; padding: 6px; font-size: 11px; }.genealogy-detail-actions input[type=submit] { border: 0; border-radius: 7px; background: var(--genealogy-accent); color: #fff; padding: 6px 9px; font-size: 10px; font-weight: 800; cursor: pointer; }.genealogy-detail-actions > div { display: flex; gap: 12px; }.genealogy-detail-actions > div a, .genealogy-detail-actions > div button { border: 0; background: transparent; color: #766e65; padding: 0; font-size: 10px; font-weight: 800; cursor: pointer; }.genealogy-detail-actions > div button { color: #b42333; }
.genealogy-detail-empty { display: flex; min-height: 620px; flex-direction: column; align-items: center; justify-content: center; padding: 30px; text-align: center; }.genealogy-detail-empty > span { display: inline-flex; width: 72px; height: 72px; align-items: center; justify-content: center; border: 1px solid #d8c9bd; border-radius: 50%; color: #a55c51; font-family: "Songti SC", "STSong", serif; font-size: 13px; }.genealogy-detail-empty h3 { margin: 17px 0 6px; font-family: "Songti SC", "STSong", serif; font-size: 20px; }.genealogy-detail-empty p { max-width: 330px; margin: 0; color: var(--genealogy-muted); font-size: 12px; line-height: 1.7; }

.genealogy-detail-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--genealogy-line); background: #fff; padding: 0 22px; }.genealogy-detail-tabs button { position: relative; border: 0; background: transparent; color: #78716c; padding: 13px 0 12px; font-size: 12px; font-weight: 800; cursor: pointer; }.genealogy-detail-tabs button::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: transparent; content: ""; }.genealogy-detail-tabs button.is-active { color: var(--genealogy-accent); }.genealogy-detail-tabs button.is-active::after { background: var(--genealogy-accent); }.genealogy-detail-tabs button span { display: inline-flex; min-width: 18px; height: 18px; align-items: center; justify-content: center; margin-left: 3px; border-radius: 999px; background: #f5f5f4; color: #78716c; padding: 0 5px; font-size: 9px; }
[data-family-detail-panel] { animation: genealogy-fade .16s ease both; }[data-family-detail-panel][hidden] { display: none; }
.genealogy-local-branch > header, .genealogy-biography-batch > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--genealogy-line); background: #fafaf9; padding: 18px 22px; }.genealogy-local-branch > header strong, .genealogy-biography-batch > header strong { font-size: 14px; }.genealogy-local-branch > header p, .genealogy-biography-batch > header p { margin: 4px 0 0; color: #78716c; font-size: 11px; }.genealogy-local-branch > header > span, .genealogy-biography-batch > header > span { color: #a8a29e; font-size: 10px; white-space: nowrap; }
.genealogy-local-root { position: relative; display: grid; width: 170px; grid-template-columns: 38px 1fr; align-items: center; gap: 10px; margin: 36px auto 54px; border-bottom: 2px solid #0f766e; padding: 10px 12px; }.genealogy-local-root::after { position: absolute; top: 100%; left: 50%; width: 1px; height: 55px; background: #d6d3d1; content: ""; }.genealogy-local-root > span { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 9px; background: #ccfbf1; color: #115e59; font-weight: 800; }.genealogy-local-root strong, .genealogy-local-root small { display: block; }.genealogy-local-root strong { font-size: 14px; }.genealogy-local-root small { margin-top: 2px; color: #a8a29e; font-size: 10px; }
.genealogy-local-branches { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 14px; margin: 0 22px 30px; padding-top: 20px; }.genealogy-local-branches::before { position: absolute; top: 0; right: 7%; left: 7%; height: 1px; background: #d6d3d1; content: ""; }.genealogy-local-branches a { position: relative; border-top: 2px solid #5eead4; background: #fafaf9; color: #292524; padding: 13px; transition: background .15s ease, transform .15s ease; }.genealogy-local-branches a::before { position: absolute; bottom: 100%; left: 50%; width: 1px; height: 22px; background: #d6d3d1; content: ""; }.genealogy-local-branches a:hover { background: #f0fdfa; transform: translateY(-2px); }.genealogy-local-branches strong, .genealogy-local-branches small { display: block; }.genealogy-local-branches strong { margin-top: 6px; font-size: 14px; }.genealogy-local-branches small { margin-top: 4px; color: #78716c; font-size: 10px; }.genealogy-local-order { color: #0f766e; font-size: 9px; font-weight: 800; }
.genealogy-biography-batch-form { padding: 18px 22px 22px; }.genealogy-biography-batch-form textarea { box-sizing: border-box; width: 100%; min-height: 390px; resize: vertical; border: 1px solid #d6d3d1; border-radius: 9px; background: #fff; color: #292524; padding: 15px; font: 13px/1.8 ui-monospace, SFMono-Regular, Menlo, monospace; outline: none; }.genealogy-biography-batch-form textarea:focus { border-color: #0f766e; box-shadow: 0 0 0 3px rgba(15, 118, 110, .1); }.genealogy-biography-batch-form footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 12px; }.genealogy-biography-batch-form footer span { color: #78716c; font-size: 10px; }.genealogy-biography-batch-form input[type=submit] { border: 0; border-radius: 8px; background: #0f766e; color: #fff; padding: 9px 13px; font-size: 11px; font-weight: 800; cursor: pointer; }
.genealogy-tab-empty { padding: 56px 24px; color: #78716c; text-align: center; }.genealogy-tab-empty strong { color: #44403c; font-size: 13px; }.genealogy-tab-empty p { margin: 5px 0 0; font-size: 11px; }

.genealogy-search-form { display: grid; grid-template-columns: minmax(240px, 1fr) auto; align-items: end; gap: 16px; border-bottom: 1px solid #e7e5e4; background: #fafaf9; padding: 18px 26px; }.genealogy-search-form > div label, .genealogy-search-form legend { display: block; margin-bottom: 7px; color: #57534e; font-size: 11px; font-weight: 800; }.genealogy-search-form input[type=search] { box-sizing: border-box; width: 100%; height: 42px; border: 1px solid #d6d3d1; border-radius: 9px; background: #fff; padding: 9px 12px; font-size: 13px; outline: 0; }.genealogy-search-form input[type=search]:focus { border-color: #0f766e; box-shadow: 0 0 0 3px rgba(15, 118, 110, .1); }.genealogy-search-form fieldset { display: flex; gap: 6px; margin: 0; border: 0; padding: 0; }.genealogy-search-form fieldset label { display: flex; min-width: 126px; align-items: center; gap: 7px; border: 1px solid #e7e5e4; border-radius: 8px; background: #fff; padding: 7px 9px; cursor: pointer; }.genealogy-search-form fieldset label:has(input:checked) { border-color: #5eead4; background: #f0fdfa; }.genealogy-search-form fieldset label:has(input:disabled) { cursor: not-allowed; opacity: .45; }.genealogy-search-form fieldset strong, .genealogy-search-form fieldset small { display: block; }.genealogy-search-form fieldset strong { font-size: 11px; }.genealogy-search-form fieldset small { margin-top: 1px; color: #a8a29e; font-size: 9px; }.genealogy-search-form input[type=radio] { accent-color: #0f766e; }.genealogy-search-form > input[type=submit] { grid-column: 1 / -1; justify-self: end; border: 0; border-radius: 8px; background: #0f766e; color: #fff; padding: 9px 16px; font-size: 12px; font-weight: 800; cursor: pointer; }
.genealogy-modal-search-results { overflow: auto; padding: 0 26px 26px; }.genealogy-modal-search-results > header { display: flex; align-items: center; justify-content: space-between; padding: 16px 0 10px; }.genealogy-modal-search-results > header strong { font-size: 13px; }.genealogy-modal-search-results > header span { color: #a8a29e; font-size: 10px; }.genealogy-modal-search-results > div:not(.genealogy-tab-empty):not(.genealogy-search-prompt) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid #e7e5e4; }.genealogy-modal-search-results a { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid #e7e5e4; color: #292524; padding: 11px 8px; }.genealogy-modal-search-results a:nth-child(odd) { border-right: 1px solid #e7e5e4; }.genealogy-modal-search-results a:hover { background: #f0fdfa; }.genealogy-modal-search-results a strong, .genealogy-modal-search-results a small { display: block; }.genealogy-modal-search-results a strong { font-size: 12px; }.genealogy-modal-search-results a small { overflow: hidden; margin-top: 2px; color: #78716c; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }.genealogy-modal-search-results a b { color: #0f766e; font-size: 10px; white-space: nowrap; }.genealogy-search-prompt { padding: 70px 20px; color: #78716c; text-align: center; }.genealogy-search-prompt span { display: block; color: #0f766e; font-size: 36px; }.genealogy-search-prompt strong { display: block; margin-top: 8px; color: #44403c; font-size: 14px; }.genealogy-search-prompt p { margin: 5px 0 0; font-size: 11px; }

.genealogy-welcome { display: grid; min-height: 390px; grid-template-columns: 130px minmax(260px, 470px) minmax(260px, 390px); align-items: center; justify-content: center; gap: 42px; border: 1px solid var(--genealogy-line); border-radius: 15px; background: radial-gradient(circle at 12% 20%, rgba(159,59,47,.07), transparent 17rem), var(--genealogy-paper); padding: 40px; }.genealogy-welcome-seal { display: flex; width: 112px; height: 112px; align-items: center; justify-content: center; border: 1px solid #c98d84; outline: 1px solid #c98d84; outline-offset: -8px; color: var(--genealogy-accent); font-family: "Songti SC", "STSong", serif; font-size: 25px; letter-spacing: .12em; transform: rotate(-2deg); }.genealogy-welcome h3 { margin: 0 0 8px; font-family: "Songti SC", "STSong", serif; font-size: 27px; }.genealogy-welcome p:not(.management-kicker) { margin: 0; color: var(--genealogy-muted); font-size: 13px; line-height: 1.8; }.genealogy-welcome ol { margin: 0; padding: 0; list-style: none; }.genealogy-welcome li { display: grid; grid-template-columns: 36px 1fr; align-items: center; gap: 10px; border-bottom: 1px solid var(--genealogy-line); padding: 11px 0; color: #625a52; font-size: 12px; }.genealogy-welcome li span { color: var(--genealogy-accent); font-family: serif; font-size: 11px; }
.genealogy-empty { display: flex; min-height: 300px; flex-direction: column; align-items: center; justify-content: center; color: var(--genealogy-muted); text-align: center; }.genealogy-empty > span { color: #c0a69d; font-family: serif; font-size: 32px; }.genealogy-empty strong { margin-top: 8px; font-family: serif; }.genealogy-empty p { margin: 4px 0 12px; font-size: 11px; }.genealogy-empty a { color: var(--genealogy-accent); font-size: 11px; font-weight: 800; }

.genealogy-form-tabs { position: sticky; top: 100px; z-index: 2; display: flex; gap: 22px; border-bottom: 1px solid var(--genealogy-line); background: rgba(250,247,242,.96); padding: 0 26px; backdrop-filter: blur(10px); }.genealogy-form-tabs button { position: relative; border: 0; background: transparent; color: #857b72; padding: 13px 1px; font-size: 12px; font-weight: 800; cursor: pointer; }.genealogy-form-tabs button.is-active { color: var(--genealogy-accent); }.genealogy-form-tabs button.is-active::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--genealogy-accent); content: ""; }
.genealogy-form-section { animation: genealogy-fade .16s ease both; }.genealogy-form-section[hidden] { display: none; }.genealogy-form-context { display: grid; grid-template-columns: 90px 1fr auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--genealogy-line); background: #fffdfa; padding: 13px 26px; }.genealogy-form-context span { color: #8b8178; font-size: 11px; }.genealogy-form-context strong { font-family: "Songti SC", "STSong", serif; font-size: 13px; }.genealogy-form-context small { color: #a0978e; font-size: 10px; }
.genealogy-member-form label, .genealogy-spouse-form label { display: block; margin-bottom: 6px; color: #564f48; font-size: 12px; font-weight: 800; }.genealogy-member-form input:not([type=checkbox]):not([type=submit]), .genealogy-member-form select, .genealogy-member-form textarea, .genealogy-spouse-form input:not([type=checkbox]):not([type=submit]), .genealogy-spouse-form select, .genealogy-spouse-form textarea { box-sizing: border-box; width: 100%; border: 1px solid #d8d0c7; border-radius: 8px; background: #fff; padding: 9px 10px; font-size: 13px; outline: 0; }.genealogy-member-form input:focus, .genealogy-member-form select:focus, .genealogy-member-form textarea:focus, .genealogy-spouse-form input:focus, .genealogy-spouse-form textarea:focus { border-color: #bd796f; box-shadow: 0 0 0 3px rgba(159,59,47,.08); }.genealogy-member-form input:disabled { background: #f3efe9; color: #8b8178; }
.genealogy-field-hint { display: block; margin-top: 5px; color: #9b9187; font-size: 9px; }.genealogy-form-flags { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 4px 26px 28px; }.genealogy-form-flags label { display: flex; align-items: flex-start; gap: 9px; margin: 0; border: 1px solid var(--genealogy-line); border-radius: 9px; background: #fff; padding: 10px; cursor: pointer; }.genealogy-form-flags input { margin-top: 3px; accent-color: var(--genealogy-accent); }.genealogy-form-flags span, .genealogy-form-flags strong, .genealogy-form-flags small { display: block; }.genealogy-form-flags strong { font-size: 11px; }.genealogy-form-flags small { margin-top: 2px; color: #988e84; font-size: 9px; font-weight: 500; }
.genealogy-split-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--genealogy-line); background: #fffdfa; padding: 16px 24px; }.genealogy-split-summary span { border-right: 1px solid var(--genealogy-line); padding: 0 12px; color: #948a80; font-size: 9px; }.genealogy-split-summary span:first-child { padding-left: 0; }.genealogy-split-summary span:last-child { border-right: 0; }.genealogy-split-summary strong { display: block; margin-top: 3px; color: #443d36; font-family: serif; font-size: 13px; }.genealogy-split-warning { margin: 0 26px 22px; border-left: 3px solid #d49a49; background: #fff7e9; padding: 11px 13px; }.genealogy-split-warning strong { color: #865b1a; font-size: 11px; }.genealogy-split-warning p { margin: 4px 0 0; color: #8c724b; font-size: 10px; line-height: 1.6; }

@keyframes genealogy-rise { from { opacity: 0; transform: translateY(7px); } }
@keyframes genealogy-drop { from { opacity: 0; transform: translateY(-5px); } }
@keyframes genealogy-fade { from { opacity: 0; } }

@media (max-width: 1180px) {
  .genealogy-header { align-items: flex-start; flex-direction: column; }.genealogy-header-actions { width: 100%; }.genealogy-search-trigger { min-width: 0; flex: 1; }.genealogy-quick-search { flex: 1; }.genealogy-quick-search input { width: 100%; }
  .genealogy-layout { grid-template-columns: minmax(280px, .75fr) minmax(450px, 1.25fr); }
  .genealogy-person-header { grid-template-columns: 52px 1fr; }.genealogy-person-actions { grid-column: 1 / -1; }.genealogy-person-actions a { flex: 1; }
}

@media (max-width: 900px) {
  .genealogy-workspace { padding: 20px; }.genealogy-layout { grid-template-columns: 1fr; }.genealogy-tree-panel { position: static; }.genealogy-tree-scroll { height: 420px; }.genealogy-search-list { grid-template-columns: 1fr; }.genealogy-search-list > a:nth-child(odd) { border-right: 0; }.genealogy-welcome { grid-template-columns: 100px 1fr; }.genealogy-welcome ol { grid-column: 1 / -1; }.genealogy-search-form { grid-template-columns: 1fr; }.genealogy-search-form > input[type=submit] { grid-column: auto; }.genealogy-modal-search-results > div:not(.genealogy-tab-empty):not(.genealogy-search-prompt) { grid-template-columns: 1fr; }.genealogy-modal-search-results a:nth-child(odd) { border-right: 0; }
}

@media (max-width: 640px) {
  .genealogy-workspace { padding: 15px; }.genealogy-header h2 { font-size: 27px; }.genealogy-header-actions { align-items: stretch; flex-direction: column; }.genealogy-locator { grid-template-columns: repeat(2, minmax(0, 1fr)); }.genealogy-locator > div { grid-column: span 1; }.genealogy-locator .genealogy-branch-field, .genealogy-locator .genealogy-household-field, .genealogy-locator .genealogy-generation-field, .genealogy-locator .genealogy-secondary-action { grid-column: 1 / -1; }.genealogy-context-bar { align-items: flex-start; }.genealogy-context-bar strong { white-space: normal; }
  .genealogy-person-header { padding: 17px; }.genealogy-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }.genealogy-facts > div:nth-child(2) { border-right: 0; }.genealogy-facts > div:nth-child(-n+2) { border-bottom: 1px solid var(--genealogy-line); }.genealogy-spouse-list, .genealogy-child-list, .genealogy-notes dl { grid-template-columns: 1fr; }.genealogy-biography, .genealogy-notes, .genealogy-spouses, .genealogy-children, .genealogy-statistics { padding: 15px 17px; }.genealogy-statistics > div:last-of-type { grid-template-columns: repeat(2, 1fr); gap: 12px 0; }.genealogy-statistics > div:last-of-type span:nth-child(2) { border-right: 0; }.genealogy-detail-actions { align-items: flex-start; flex-direction: column; }.genealogy-welcome { min-height: 0; grid-template-columns: 1fr; gap: 24px; padding: 30px 24px; }.genealogy-welcome-seal { width: 82px; height: 82px; }.genealogy-welcome ol { grid-column: auto; }.genealogy-form-context { grid-template-columns: 1fr; }.genealogy-form-context small { display: none; }.genealogy-form-flags { grid-template-columns: 1fr; }.genealogy-split-summary { grid-template-columns: 1fr; gap: 10px; }.genealogy-split-summary span { border-right: 0; padding: 0; }.genealogy-detail-tabs { gap: 14px; overflow-x: auto; padding: 0 17px; white-space: nowrap; }.genealogy-local-branch > header, .genealogy-biography-batch > header { flex-direction: column; }.genealogy-local-branches { grid-template-columns: 1fr; }.genealogy-biography-batch-form footer { align-items: stretch; flex-direction: column; }.genealogy-search-form fieldset { flex-direction: column; }.genealogy-search-form fieldset label { min-width: 0; }.genealogy-modal-search-results { padding-inline: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .genealogy-workspace, .genealogy-search-results, .genealogy-form-section { animation: none; }
  .genealogy-primary-action, .genealogy-tree-row, .genealogy-tree-node details > summary::before { transition: none; }
}

/* 与后台其他管理页面保持同一套青绿 / stone 视觉语言。 */
.genealogy-search-results {
  border-color: var(--genealogy-line);
  box-shadow: 0 10px 25px rgba(28, 25, 23, .08);
}
.genealogy-search-list > a:nth-child(odd) { border-right-color: #f1f0ee; }
.genealogy-search-list > a:hover { background: #f0fdfa; }
.genealogy-search-list small, .genealogy-search-list > a > span:last-child { color: #a8a29e; }
.genealogy-search-avatar {
  border-radius: 9px;
  background: #ecfdf5;
  font-family: inherit;
}
.genealogy-context-bar strong,
.genealogy-tree-panel > header strong,
.genealogy-node-copy strong,
.genealogy-person-heading h3,
.genealogy-facts dd,
.genealogy-section-heading strong,
.genealogy-biography > p,
.genealogy-spouse-list article strong,
.genealogy-child-list strong,
.genealogy-statistics strong,
.genealogy-detail-empty h3,
.genealogy-welcome h3,
.genealogy-form-context strong,
.genealogy-split-summary strong,
.genealogy-empty strong {
  font-family: inherit;
}
.genealogy-context-mark {
  border-color: #99d5cf;
  border-radius: 9px;
  background: #ecfdf5;
  font-family: inherit;
}
.genealogy-tree-panel, .genealogy-detail-panel {
  box-shadow: 0 1px 2px rgba(28, 25, 23, .03);
}
.genealogy-tree-scroll { scrollbar-color: #d6d3d1 transparent; }
.genealogy-tree ol::before { background: #e7e5e4; }
.genealogy-tree-row:hover { background: #f0fdfa; }
.genealogy-tree-row.is-selected { background: #ccfbf1; color: #115e59; }
.genealogy-node-icon {
  background: #f5f5f4;
  color: #78716c;
  font-family: inherit;
}
.genealogy-node-copy small { color: #a8a29e; }
.genealogy-marker { background: #ccfbf1; }
.genealogy-tree-summary, .genealogy-detail-actions { background: #fafaf9; }
.genealogy-person-header { background: #fafaf9; }
.genealogy-person-avatar {
  border-color: #99d5cf;
  border-radius: 12px;
  background: #ecfdf5;
  font-family: inherit;
  box-shadow: none;
}
.genealogy-person-heading h3 { letter-spacing: -.02em; }
.genealogy-facts dt,
.genealogy-notes dt,
.genealogy-statistics small,
.genealogy-statistics > p,
.genealogy-section-heading span { color: #a8a29e; }
.genealogy-biography > p { color: #57534e; }
.genealogy-spouse-list article {
  border-left-color: #5eead4;
  background: #f0fdfa;
}
.genealogy-child-list a:hover { background: #f0fdfa; }
.genealogy-child-list span {
  background: #f5f5f4;
  color: #78716c;
}
.genealogy-detail-empty > span {
  border-color: #99d5cf;
  border-radius: 12px;
  background: #ecfdf5;
  color: var(--genealogy-accent);
  font-family: inherit;
}
.genealogy-welcome {
  background: radial-gradient(circle at 12% 20%, rgba(15, 118, 110, .07), transparent 17rem), #fff;
}
.genealogy-welcome-seal {
  border-color: #5eead4;
  outline-color: #5eead4;
  color: var(--genealogy-accent);
  font-family: inherit;
}
.genealogy-welcome li span, .genealogy-empty > span { font-family: inherit; }
.genealogy-form-tabs { background: rgba(250, 250, 249, .96); }
.genealogy-form-context, .genealogy-split-summary { background: #fff; }
.genealogy-member-form input:focus,
.genealogy-member-form select:focus,
.genealogy-member-form textarea:focus,
.genealogy-spouse-form input:focus,
.genealogy-spouse-form textarea:focus {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .1);
}
.genealogy-member-form input:disabled { background: #f5f5f4; color: #78716c; }

/* Select2：与后台表单尺寸、焦点和青绿色状态保持一致。 */
.genealogy-workspace .select2-container,
.genealogy-member-form .select2-container,
.genealogy-spouse-form .select2-container,
.genealogy-detail-actions .select2-container {
  width: 100% !important;
  font-size: 13px;
}
.select2-container--default .genealogy-select2-selection.select2-selection--single {
  height: 39px;
  border: 1px solid #d6d3d1;
  border-radius: 8px;
  background: #fff;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.select2-container--default.select2-container--focus .genealogy-select2-selection.select2-selection--single,
.select2-container--default.select2-container--open .genealogy-select2-selection.select2-selection--single {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .1);
}
.select2-container--default .genealogy-select2-selection .select2-selection__rendered {
  overflow: hidden;
  color: #292524;
  line-height: 37px;
  padding-right: 34px;
  padding-left: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.select2-container--default .genealogy-select2-selection .select2-selection__placeholder { color: #a8a29e; }
.select2-container--default .genealogy-select2-selection .select2-selection__arrow { width: 30px; height: 37px; }
.select2-container--default .genealogy-select2-selection .select2-selection__arrow b {
  border-color: #78716c transparent transparent;
  border-width: 4px 4px 0;
}
.select2-container--default.select2-container--open .genealogy-select2-selection .select2-selection__arrow b {
  border-color: transparent transparent #0f766e;
  border-width: 0 4px 4px;
}
.select2-container--default .genealogy-select2-selection .select2-selection__clear {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 27px;
  height: 37px;
  margin: 0;
  color: #a8a29e;
  font-size: 17px;
  line-height: 35px;
}
.select2-container--default .genealogy-select2-selection .select2-selection__clear:hover { color: #0f766e; }
.genealogy-select2-dropdown.select2-dropdown {
  overflow: hidden;
  border: 1px solid #d6d3d1;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(28, 25, 23, .14);
}
.genealogy-select2-dropdown .select2-search--dropdown { padding: 8px; }
.genealogy-select2-dropdown .select2-search--dropdown .select2-search__field {
  height: 36px;
  border: 1px solid #d6d3d1;
  border-radius: 7px;
  color: #292524;
  padding: 7px 9px;
  font-size: 13px;
  outline: none;
}
.genealogy-select2-dropdown .select2-search--dropdown .select2-search__field:focus {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .1);
}
.genealogy-select2-dropdown .select2-results__options { max-height: 280px; padding: 4px; }
.genealogy-select2-dropdown .select2-results__option {
  margin: 1px 0;
  border-radius: 6px;
  color: #44403c;
  padding: 8px 9px;
  font-size: 13px;
}
.genealogy-select2-dropdown .select2-results__option--highlighted.select2-results__option--selectable {
  background: #0f766e;
  color: #fff;
}
.genealogy-select2-dropdown .select2-results__option--selected { background: #ccfbf1; color: #115e59; }
.genealogy-select2-dropdown .select2-results__message { color: #a8a29e; text-align: center; }
.genealogy-detail-actions .select2-container { min-width: 210px; }
.genealogy-detail-actions .select2-container--default .genealogy-select2-selection.select2-selection--single { height: 32px; }
.genealogy-detail-actions .select2-container--default .genealogy-select2-selection .select2-selection__rendered { line-height: 30px; }
.genealogy-detail-actions .select2-container--default .genealogy-select2-selection .select2-selection__arrow { height: 30px; }
