:root {
    --site-bg: #f4f6f9;
    --site-surface: #ffffff;
    --site-surface-soft: #f8fafc;
    --site-text: #152033;
    --site-muted: #64748b;
    --site-border: rgba(15, 23, 42, 0.09);
    --site-border-strong: rgba(15, 23, 42, 0.16);
    --site-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
    --site-shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.06);
    --site-primary: #0f172a;
    --site-accent: #2563eb;
    --site-success: #16a34a;
    --site-warning: #d97706;
    --site-danger: #dc2626;
    --site-radius-lg: 24px;
    --site-radius-md: 18px;
    --site-radius-sm: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: linear-gradient(180deg, #f7f8fb 0%, #f2f5f8 100%);
    color: var(--site-text);
    font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}
img {
    max-width: 100%;
    display: block;
}
pre {
    white-space: pre-wrap;
    word-break: break-word;
}

.navbar {
    background: linear-gradient(90deg, #111827, #1f2937 55%, #111827);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
}
.site-navbar-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
    flex-wrap: nowrap;
}
.navbar-brand {
    font-weight: 800;
    letter-spacing: 0.03em;
    flex: 0 0 auto;
    white-space: nowrap;
    margin-right: 0;
}
.site-nav-shell {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1 1 0;
    overflow: hidden;
}
.site-nav-scroll {
    min-width: 0;
    overflow: hidden;
    flex: 1 1 auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
}
.site-nav-scroll::-webkit-scrollbar {
    display: none;
}
.site-nav-list {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    width: max-content;
}
.site-nav-list .nav-item,
.site-nav-list .nav-link {
    flex: 0 0 auto;
    white-space: nowrap;
}
.site-nav-list .nav-link {
    padding-left: .62rem !important;
    padding-right: .62rem !important;
}
.site-nav-next {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 38px;
    flex: 0 0 42px;
    padding: 0;
    margin-left: -1px;
    border: 0;
    border-radius: 0;
    background: linear-gradient(90deg, rgba(17, 24, 39, 0), #111827 48%);
    color: #fff;
    font-size: 1.05rem;
    position: relative;
    z-index: 2;
}
.site-nav-next:hover,
.site-nav-next:focus {
    background: linear-gradient(90deg, rgba(31, 41, 55, 0), #334155 48%);
}
.site-account-area {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex: 0 0 auto;
    white-space: nowrap;
    position: relative;
    z-index: 3;
}
.site-account-link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    max-width: 180px;
}
.site-account-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-link {
    opacity: 0.88;
    transition: opacity .2s ease;
}
.nav-link:hover,
.nav-link:focus {
    opacity: 1;
}

.shishu-search-results {
    display: grid;
    gap: 0.75rem;
}

.shishu-search-result {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 0.9rem 1rem;
    border: 1px solid var(--site-border);
    border-radius: 14px;
    background: var(--site-surface-soft);
}

.shishu-search-snippet {
    line-height: 1.7;
}

.shishu-search-hit {
    background: #fff3a3;
    color: inherit;
    border-radius: 4px;
    padding: 0 0.12em;
}

.book-relation-content-editor {
    min-height: 5.5rem;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-y: auto;
}

.book-relation-content-editor:empty::before {
    content: attr(data-placeholder);
    color: #94a3b8;
}

.shishu-content-hit {
    font-weight: 800;
    background: #fff3a3;
    color: #0f172a;
    border-radius: 4px;
    padding: 0 0.12em;
}

.shishu-search-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.shishu-search-location-row {
    margin-bottom: .45rem;
}

.shishu-search-snippet-clamp {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.shishu-search-result-main {
    min-width: 0;
}

.shishu-location-chip {
    border: 1px solid rgba(217, 119, 6, 0.25);
    border-radius: 999px;
    background: rgba(255, 243, 163, 0.8);
    color: #7c2d12;
    font-size: 0.78rem;
    line-height: 1;
    padding: 0.35rem 0.55rem;
    cursor: pointer;
}

.shishu-location-chip:hover {
    background: #fde68a;
}

.shishu-match-list {
    display: grid;
    gap: 0.8rem;
}

.shishu-match-item {
    border: 1px solid var(--site-border);
    border-radius: 14px;
    background: var(--site-surface-soft);
    padding: 0.85rem 1rem;
}

.shishu-match-meta {
    color: var(--site-muted);
    font-size: 0.84rem;
    margin-bottom: 0.4rem;
}

.card {
    background: var(--site-surface);
    border: 1px solid var(--site-border);
    border-radius: var(--site-radius-lg);
    box-shadow: var(--site-shadow-soft);
    overflow: hidden;
}
.card-header {
    background: linear-gradient(180deg, #ffffff, #fbfdff);
    border-bottom: 1px solid var(--site-border);
    padding: 1rem 1.25rem;
}
.card-body {
    padding: 1.25rem;
}
.table-responsive,
.alert,
.badge,
.modal-content {
    border-radius: var(--site-radius-md);
}

.btn {
    border-radius: var(--site-radius-sm);
    font-weight: 600;
}
.form-control,
.form-select,
textarea.form-control {
    border-radius: 14px;
    padding: .85rem 1rem;
    border-color: rgba(15, 23, 42, 0.12);
    background: #fff;
}
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 .2rem rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.34);
}

.flash-stack .alert {
    box-shadow: var(--site-shadow-soft);
    border: 1px solid var(--site-border);
}
.empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--site-muted);
}
.section-eyebrow,
.section-kicker,
.eyebrow {
    font-size: .82rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #64748b;
}
.page-title,
.page-header-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -.02em;
    margin-bottom: .5rem;
}
.page-header-subtitle,
.soft-muted {
    color: var(--site-muted);
    font-size: 1rem;
    line-height: 1.8;
}

.auth-fullscreen-body {
    overflow-x: hidden;
    background: #1f2933;
}

.auth-fullscreen-body .navbar {
    display: none;
}

.auth-fullscreen-body main.container {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    padding: 0;
    margin: 0 !important;
}

.auth-fullscreen-body .flash-stack {
    position: fixed;
    z-index: 20;
    top: 1rem;
    left: 50%;
    width: min(640px, calc(100vw - 2rem));
    transform: translateX(-50%);
}

.auth-login-scene {
    position: relative;
    min-height: 100vh;
    display: grid;
    align-items: center;
    overflow: hidden;
    padding: clamp(2rem, 6vw, 6rem);
    background:
        radial-gradient(circle at 16% 18%, rgba(70, 103, 118, 0.38), transparent 28%),
        radial-gradient(circle at 86% 22%, rgba(207, 176, 120, 0.26), transparent 25%),
        linear-gradient(120deg, #111923 0%, #1d2a34 48%, #33424c 100%);
    perspective: 1200px;
}

.auth-login-scene::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(8, 13, 20, 0.82) 0%, rgba(13, 20, 29, 0.56) 34%, rgba(13, 20, 29, 0.2) 100%),
        repeating-linear-gradient(90deg, rgba(125, 211, 252, 0.08) 0 1px, transparent 1px 42px),
        repeating-linear-gradient(0deg, rgba(125, 211, 252, 0.05) 0 1px, transparent 1px 42px);
    opacity: 0.95;
    mix-blend-mode: screen;
    animation: authGridFlow 9s linear infinite;
    pointer-events: none;
}

.auth-login-scene::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(112deg, transparent 0 30%, rgba(125, 211, 252, 0.02) 39%, rgba(255,255,255,0.42) 47%, rgba(207, 176, 120, 0.2) 52%, transparent 62%),
        radial-gradient(ellipse at 74% 50%, rgba(125, 211, 252, 0.18), transparent 30%);
    opacity: 0.72;
    animation: authGlowDrift 6.5s ease-in-out infinite alternate;
    pointer-events: none;
}

.auth-ink-layer {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, transparent 0%, rgba(125, 211, 252, 0.18) 48%, transparent 50%),
        radial-gradient(ellipse at 78% 55%, rgba(255,255,255,0.16), transparent 20%),
        radial-gradient(ellipse at 12% 86%, rgba(0, 0, 0, 0.34), transparent 31%);
    background-size: auto, auto, auto;
    filter: blur(0.2px);
    opacity: 0.88;
    animation: authScanLine 5.8s ease-in-out infinite, authTextureSlide 18s linear infinite alternate;
    pointer-events: none;
}

.auth-rubbing-panel {
    position: absolute;
    inset: -12vh -12vw;
    transform: rotateX(8deg) rotateY(-13deg) rotateZ(-2deg) scale(1.08);
    transform-origin: center;
    background:
        linear-gradient(90deg, rgba(9, 13, 22, 0.2), rgba(9, 13, 22, 0.08) 38%, rgba(255,255,255,0.05)),
        url('/static/images/login-rubbing-bg.png') center / cover no-repeat;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow:
        0 60px 170px rgba(0, 0, 0, 0.5),
        0 0 80px rgba(125, 211, 252, 0.15),
        inset 0 0 180px rgba(0, 0, 0, 0.62);
    filter: saturate(0.78) contrast(1.12) brightness(0.62);
    opacity: 0.92;
    animation: authPlateFloat 10s ease-in-out infinite alternate;
}

.auth-rubbing-panel::before,
.auth-rubbing-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.auth-rubbing-panel::before {
    background:
        linear-gradient(115deg, transparent 0 38%, rgba(255,255,255,0.16) 46%, transparent 55%),
        repeating-linear-gradient(90deg, rgba(125, 211, 252, 0.08) 0 1px, transparent 1px 16px);
    mix-blend-mode: screen;
    opacity: 0.72;
    animation: authPlateLight 5.5s ease-in-out infinite alternate;
}

.auth-rubbing-panel::after {
    box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.16), inset 0 0 70px rgba(125, 211, 252, 0.12);
}

.auth-login-shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
    gap: clamp(2rem, 7vw, 7rem);
    align-items: center;
    width: min(1440px, 100%);
    margin: 0 auto;
}

.auth-intro {
    color: #f8fafc;
    max-width: 760px;
    text-shadow: 0 16px 46px rgba(2, 6, 23, 0.34);
}

.auth-intro-kicker {
    display: inline-flex;
    padding: 0.45rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    font-size: 0.88rem;
    margin-bottom: 1.1rem;
}

.auth-intro h1 {
    font-family: "Microsoft YaHei", "PingFang SC", "Noto Serif SC", "STSong", serif;
    font-size: clamp(3.2rem, 5vw, 6.8rem);
    line-height: 1.05;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: 0;
}

.auth-intro-subtitle {
    color: rgba(248, 250, 252, 0.84);
    font-size: clamp(1.25rem, 2vw, 2rem);
    font-weight: 400;
    letter-spacing: 0.28em;
    margin-bottom: 1.6rem;
}

.auth-intro p {
    max-width: 560px;
    color: rgba(226, 232, 240, 0.82);
    font-size: 1.08rem;
    line-height: 1.9;
}

.auth-intro-marks {
    display: flex;
    gap: 0.8rem;
    margin-top: 2rem;
}

.auth-intro-marks span {
    width: 3.2rem;
    height: 3.2rem;
    display: grid;
    place-items: center;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.12);
    color: rgba(248, 250, 252, 0.86);
    font-family: 'FangSong', 'STFangsong', serif;
    font-size: 1.35rem;
}

.auth-login-card {
    border: 1px solid rgba(255, 255, 255, 0.48);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 34px 110px rgba(2, 6, 23, 0.34), 0 0 42px rgba(125, 211, 252, 0.08);
    backdrop-filter: blur(24px);
    padding: clamp(1.8rem, 4vw, 3rem);
    clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 24px, 100% 100%, 24px 100%, 0 calc(100% - 24px));
}

.auth-register-card {
    width: min(620px, 100%);
}

.auth-card-top {
    margin-bottom: 1.6rem;
}

.auth-card-top h2 {
    color: var(--site-text);
    font-size: 1.75rem;
    font-weight: 850;
}

@keyframes authGlowDrift {
    from { transform: translate3d(9vmax, 0, 0) scale(1); opacity: 0.32; }
    to { transform: translate3d(-10vmax, 1.5vmax, 0) scale(1.04); opacity: 0.78; }
}

@keyframes authTextureSlide {
    from { transform: translateX(-2.5%) translateY(0); }
    to { transform: translateX(2.5%) translateY(-1.5%); }
}

@keyframes authGridFlow {
    from { background-position: 0 0, 0 0, 0 0; }
    to { background-position: 0 0, 84px 0, 0 102px; }
}

@keyframes authPlateFloat {
    from { transform: rotateX(8deg) rotateY(-13deg) rotateZ(-2deg) scale(1.08) translate3d(0, 0, 0); }
    to { transform: rotateX(10deg) rotateY(-9deg) rotateZ(-1deg) scale(1.12) translate3d(-1.2rem, -0.8rem, 0); }
}

@keyframes authPlateLight {
    from { transform: translateX(-10%); opacity: 0.32; }
    to { transform: translateX(10%); opacity: 0.78; }
}

@keyframes authScanLine {
    0%, 100% { background-position: 0 -24vh, 0 0, 0 0; }
    50% { background-position: 0 84vh, 0 0, 0 0; }
}

@media (max-width: 992px) {
    .auth-login-scene {
        min-height: 100vh;
    }
    .auth-login-shell {
        grid-template-columns: 1fr;
    }
    .auth-rubbing-panel {
        inset: -10vh -24vw;
        opacity: 0.54;
    }
    .auth-intro {
        max-width: 100%;
    }
}

@media (max-width: 576px) {
    .auth-login-scene {
        padding: 1.2rem;
    }
    .auth-intro h1 {
        font-size: 2rem;
    }
    .auth-intro-subtitle {
        font-size: 1rem;
        letter-spacing: 0.18em;
    }
    .auth-intro-marks {
        display: none;
    }
    .auth-login-card {
        border-radius: 22px;
        padding: 1.25rem;
    }
    .auth-rubbing-panel {
        inset: -8vh -38vw;
        opacity: 0.44;
    }
}
.section-block {
    margin-top: 2rem;
}
.section-heading,
.page-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.section-heading h3,
.page-toolbar h2 {
    margin: 0;
    font-weight: 700;
}

.hero-panel {
    background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(248,250,252,.96));
    border: 1px solid var(--site-border);
    border-radius: 32px;
    box-shadow: var(--site-shadow);
    padding: clamp(1.5rem, 3vw, 3.25rem);
    position: relative;
    overflow: hidden;
}
.hero-panel::after {
    content: "";
    position: absolute;
    inset: auto -10% -35% auto;
    width: 340px;
    height: 340px;
    background: radial-gradient(circle, rgba(37,99,235,.09), transparent 65%);
    pointer-events: none;
}
.hero-search {
    margin-top: 1.75rem;
}
.hero-search-hint {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-top: 1rem;
}
.hero-search-hint-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: .35rem .8rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, .08);
    color: #1d4ed8;
    font-size: .88rem;
    font-weight: 700;
}
.hero-search .input-group {
    background: #fff;
    border-radius: 18px;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}
.hero-search .form-control {
    border: 0;
    box-shadow: none;
    padding-left: 1.2rem;
}
.hero-search .btn {
    min-width: 110px;
    border-radius: 0;
}

.stat-grid {
    display: grid;
    gap: 1rem;
}
.stat-grid-home {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.home-stats-card .card-body {
    padding: 1.4rem;
}
.stat-tile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: linear-gradient(180deg, #fff, #f8fafc);
    border: 1px solid var(--site-border);
    border-radius: 18px;
    padding: 1rem 1.1rem;
}
.stat-label {
    color: var(--site-muted);
    font-weight: 600;
}
.stat-value {
    min-width: 52px;
    height: 52px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: 0 10px 22px rgba(37,99,235,.22);
}

.quick-links {
    display: grid;
    gap: 1rem;
}
.quick-link-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid var(--site-border);
    border-radius: 18px;
    padding: 1rem 1.15rem;
    background: linear-gradient(180deg, #fff, #f8fafc);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.quick-link-card:hover {
    transform: translateY(-2px);
    border-color: rgba(37,99,235,.24);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}
.quick-link-title {
    font-size: 1.05rem;
    font-weight: 700;
}
.quick-link-desc {
    color: var(--site-muted);
    font-size: .95rem;
    margin-top: .25rem;
}

.home-rubbing-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
}
.home-rubbing-card {
    background: var(--site-surface);
    border: 1px solid var(--site-border);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: var(--site-shadow-soft);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.home-rubbing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--site-shadow);
    border-color: rgba(37,99,235,.22);
}
.home-rubbing-cover {
    background: linear-gradient(135deg, #eef2ff, #f8fafc);
    aspect-ratio: 1 / .72;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.home-rubbing-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.home-rubbing-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 2rem;
    color: #94a3b8;
}
.home-rubbing-body {
    padding: 1rem 1rem 1.15rem;
}
.home-rubbing-title {
    font-weight: 800;
    font-size: 1.05rem;
    margin-bottom: .55rem;
}
.home-rubbing-meta {
    display: grid;
    gap: .35rem;
    color: var(--site-muted);
    font-size: .92rem;
}
.more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 1.4rem;
}

.info-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .58rem .85rem;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid var(--site-border);
    margin: 0 .5rem .6rem 0;
    font-size: .92rem;
    color: var(--site-text);
}
.family-overview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.family-overview-grid-single {
    grid-template-columns: 1fr;
}
.family-tree-shell {
    display: grid;
    gap: 1.25rem;
}
.family-tree-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-bottom: .25rem;
}
.family-tree-stage {
    background: radial-gradient(circle at top, rgba(37,99,235,.06), rgba(255,255,255,1) 45%);
    border: 1px dashed rgba(15, 23, 42, 0.14);
    border-radius: 24px;
    padding: 1.5rem;
    min-height: 360px;
    overflow: auto;
}
.family-tree-embed-frame-wrap {
    border: 1px dashed rgba(15, 23, 42, 0.14);
    border-radius: 24px;
    overflow: hidden;
    background: #fff;
    min-height: 880px;
    overflow: auto;
    position: relative;
}
.family-tree-embed-frame {
    width: 100%;
    min-height: 880px;
    border: 0;
    display: block;
    background: #fff;
    transform-origin: top center;
    transition: transform .18s ease;
}
.family-tree-viewport {
    min-width: 760px;
    padding: .5rem 0 1rem;
}
.tree {
    min-width: 1000px;
    display: flex;
    justify-content: center;
    transform-origin: top center;
    transition: transform .18s ease;
}
.tree ul {
    position: relative;
    padding-top: 40px;
    display: flex;
    justify-content: center;
}
.tree li {
    list-style: none;
    position: relative;
    text-align: center;
    padding: 40px 14px 0 14px;
}
.tree li::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 40px;
    border-left: 2px solid #86a9ff;
    transform: translateX(-50%);
}
.tree li::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    border-top: 2px solid #86a9ff;
}
.tree li:first-child::after {
    left: 50%;
    width: 50%;
}
.tree li:last-child::after {
    width: 50%;
}
.tree li:only-child::before,
.tree li:only-child::after {
    display: none;
}
.tree li:only-child {
    padding-top: 0;
}
.tree ul ul::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 40px;
    border-left: 2px solid #86a9ff;
    transform: translateX(-50%);
}
.family-unit {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 24px 10px 8px;
    border: 1px dashed rgba(37, 99, 235, 0.2);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    position: relative;
}
.family-node {
    width: 244px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 22px;
    padding: 1rem 1.1rem;
    text-align: left;
    box-shadow: var(--site-shadow-soft);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.family-node:hover {
    transform: translateY(-2px);
}
.family-node.active {
    border-color: rgba(37,99,235,.42);
    box-shadow: 0 18px 36px rgba(37,99,235,.16);
}
.family-node-core {
    border-color: rgba(37,99,235,.36);
}
.family-node-muted {
    background: linear-gradient(180deg, #ffffff, #f9fafb);
}
.family-node-role {
    display: inline-flex;
    align-items: center;
    padding: .22rem .56rem;
    border-radius: 999px;
    background: rgba(37,99,235,.08);
    color: #1d4ed8;
    font-size: .78rem;
    font-weight: 700;
    margin-bottom: .75rem;
}
.family-node-name {
    font-size: 1.12rem;
    font-weight: 800;
    margin-bottom: .35rem;
}
.family-node-meta {
    color: var(--site-muted);
    font-size: .92rem;
    line-height: 1.6;
}
.family-orphan-row {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1.2rem 1.6rem;
}
.family-orphan-zone {
    width: 100%;
    border-top: 1px dashed rgba(15, 23, 42, 0.12);
    padding-top: 1rem;
}
.family-orphan-title {
    text-align: center;
    color: var(--site-muted);
    font-size: .9rem;
    margin-bottom: .85rem;
}
.family-editor-shell .family-tree-stage {
    min-height: 260px;
}
.family-editor-tip {
    text-align: center;
    color: var(--site-muted);
    font-size: .92rem;
    margin-bottom: .9rem;
}
.family-editor-node-shell {
    position: relative;
    padding-top: 2rem;
}
.family-card-shell-side {
    position: relative;
}
.family-editor-actions {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: .4rem;
    opacity: .96;
    transition: opacity .18s ease, transform .18s ease, box-shadow .18s ease;
    z-index: 2;
    flex-wrap: wrap;
    justify-content: center;
    min-width: max-content;
}
.family-editor-node-shell:hover .family-editor-actions,
.family-editor-node-shell:focus-within .family-editor-actions {
    opacity: 1;
    transform: translateX(-50%) translateY(-1px);
}
.family-editor-actions .btn {
    border-radius: 999px;
    padding: .18rem .55rem;
    font-size: .76rem;
    line-height: 1.2;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}
.family-tree-node-side {
    width: 224px;
}
.person-detail-box {
    border: 1px solid var(--site-border);
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff, #fbfdff);
    padding: 1.25rem;
}
.person-detail-label {
    display: inline-block;
    margin-bottom: .65rem;
    padding: .28rem .7rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: .8rem;
    font-weight: 800;
}
.person-detail-title {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: .25rem;
}
.person-detail-text {
    color: var(--site-text);
    line-height: 1.9;
    margin-bottom: 0;
}

.page-toolbar + .card,
.page-toolbar + .row,
.page-toolbar + .table-responsive {
    margin-top: .25rem;
}

.upload-area,
.paper-item {
    border: 1px dashed rgba(15, 23, 42, 0.16);
    border-radius: 18px;
    padding: 1rem;
    background: #f8fafc;
}

.table {
    background: var(--site-surface);
    border-radius: 20px;
    overflow: hidden;
}
.table thead th {
    border-bottom-width: 1px;
}
.badge {
    padding: .45rem .65rem;
    font-weight: 700;
}

@media (max-width: 991.98px) {
    .site-navbar-inner {
        max-width: 100%;
        padding-left: .8rem;
        padding-right: .8rem;
        gap: 1rem;
    }
    .site-role-badge,
    .site-logout-link {
        display: none;
    }
    .site-account-link {
        max-width: 140px;
    }
    .hero-panel {
        border-radius: 24px;
        padding: 1.4rem;
    }
    .family-tree-viewport {
        min-width: 420px;
    }
    .home-rubbing-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .site-account-link {
        max-width: 112px;
    }
    .page-title,
    .page-header-title {
        font-size: 2rem;
    }
    .card,
    .hero-panel,
    .family-tree-stage,
    .person-detail-box,
    .home-rubbing-card {
        border-radius: 18px;
    }
    .home-rubbing-grid {
        grid-template-columns: 1fr;
    }
    .family-overview-grid {
        grid-template-columns: 1fr;
    }
    .family-tree-viewport {
        min-width: 320px;
    }
    .family-tree-embed-frame-wrap,
    .family-tree-embed-frame {
        min-height: 760px;
    }
    .tree {
        min-width: 640px;
    }
    .tree ul {
        padding-top: 24px;
    }
    .tree li {
        padding: 24px 10px 0 10px;
    }
    .tree li::before,
    .tree ul ul::before {
        height: 24px;
    }
    .family-unit {
        flex-direction: column;
        align-items: center;
        padding-top: 12px;
    }
    .family-editor-actions {
        opacity: 1;
        position: static;
        justify-content: center;
        margin-bottom: .45rem;
        transform: none;
        flex-wrap: wrap;
        min-width: 0;
    }
    .family-editor-node-shell {
        padding-top: 0;
    }
    .family-node {
        width: min(260px, 100%);
    }
}

/* v17 首页检索 / 古文字检索 */
.hero-search-modern .hero-search-row,
.search-shell-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px 140px;
    gap: 1rem;
    align-items: center;
}

.hero-search-modern .hero-search-row {
    padding: .8rem;
    background: rgba(255, 255, 255, .78);
    border: 1px solid rgba(148, 163, 184, .32);
    border-radius: 22px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .08),
                inset 0 1px 0 rgba(255, 255, 255, .9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease;
}

.hero-search-modern .hero-search-row:hover,
.hero-search-modern .hero-search-row:focus-within {
    border-color: rgba(37, 99, 235, .38);
    box-shadow: 0 16px 38px rgba(15, 23, 42, .11),
                0 0 0 4px rgba(37, 99, 235, .06);
    transform: translateY(-2px);
}

.search-shell-row.search-shell-row-simple {
    grid-template-columns: minmax(0, 1fr) 220px 140px;
}

.hero-search-modern .form-control,
.hero-search-modern .form-select,
.search-shell-row .form-control,
.search-shell-row .form-select {
    min-width: 0;
    width: 100%;
    height: 56px;
}

.hero-search-modern .form-control,
.hero-search-modern .form-select {
    background-color: rgba(248, 250, 252, .92);
    border-color: rgba(148, 163, 184, .34);
    border-radius: 14px;
    transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.hero-search-modern .form-control:focus,
.hero-search-modern .form-select:focus {
    background-color: #fff;
    border-color: rgba(37, 99, 235, .58);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.hero-search-modern .hero-search-submit,
.search-shell-submit {
    width: 100%;
    min-width: 0;
    height: 56px;
    border-radius: 16px;
}

.hero-search-modern .hero-search-select,
.zixing-mode-select {
    min-width: 0;
}

.search-shell-card .card-body {
    padding: 1.5rem;
}

.search-result-list {
    display: grid;
    gap: .85rem;
}

.search-result-card {
    position: relative;
    border: 1px solid rgba(15, 23, 42, 0.11);
    border-left: 4px solid rgba(37, 99, 235, 0.72);
    border-radius: 14px;
    background: linear-gradient(180deg, #fff, #fbfdff);
    padding: 1rem 1.15rem;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.search-result-card:hover {
    transform: translateY(-3px);
    border-color: rgba(37, 99, 235, 0.3);
    border-left-color: #2563eb;
    background: #fff;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.11);
}

.search-result-main {
    display: grid;
    gap: .55rem;
}

.search-result-topline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.search-result-title {
    color: var(--site-text);
    font-size: clamp(1.08rem, 1.6vw, 1.35rem);
    font-weight: 800;
    line-height: 1.3;
    min-width: 0;
}

.search-result-title:hover {
    color: var(--site-accent);
}

.search-result-action {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: .28rem .72rem;
}

.search-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem 1.5rem;
}
.search-result-meta-family .search-result-meta-item {
    min-width: 180px;
}

.search-result-meta-item {
    display: inline-flex;
    align-items: baseline;
    gap: .55rem;
    min-width: 140px;
    font-size: .92rem;
}

.search-result-meta-item span,
.search-result-body-label {
    color: #334155;
    font-weight: 800;
    white-space: nowrap;
}

.search-result-meta-item strong {
    color: var(--site-text);
    font-weight: 800;
}

.search-result-body-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: .75rem;
    align-items: baseline;
}

.search-result-body-text {
    color: #334155;
    font-size: .95rem;
    line-height: 1.7;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-hit {
    background: #fff1a8;
    color: inherit;
    padding: 0 .12em;
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(217, 119, 6, 0.08);
}

.zixing-search-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.zixing-search-sidebar {
    position: sticky;
    top: 96px;
}

.zixing-side-group {
    display: grid;
    gap: .85rem;
}

.zixing-side-title {
    font-size: 1rem;
    font-weight: 700;
}

.zixing-mode-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border: 1px solid var(--site-border);
    border-radius: 16px;
    background: linear-gradient(180deg, #fff, #f8fafc);
    color: var(--site-text);
    font-weight: 700;
    padding: .7rem 1rem;
}

.zixing-mode-link.active {
    background: var(--site-primary);
    color: #fff;
    border-color: var(--site-primary);
}

.zixing-mode-link.is-disabled {
    opacity: .45;
    cursor: not-allowed;
}

.zixing-side-tip {
    color: var(--site-muted);
    font-size: .92rem;
    line-height: 1.7;
    margin: 0;
}

.zixing-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: .9rem;
}

.zixing-result-card {
    border: 1px solid var(--site-border);
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.zixing-result-card:hover {
    transform: translateY(-3px);
    border-color: rgba(37, 99, 235, 0.28);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
}

.zixing-result-thumb {
    height: 108px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f6f8fb;
    padding: .7rem;
    border-bottom: 1px solid var(--site-border);
}

.zixing-result-thumb img {
    max-height: 82px;
    max-width: 100%;
    width: auto;
    object-fit: contain;
}

.zixing-thumb-empty {
    color: var(--site-muted);
    font-size: .9rem;
}

.zixing-result-body {
    padding: .72rem .85rem .85rem;
}

.zixing-result-title {
    font-size: 1.02rem;
    font-weight: 800;
    margin-bottom: .42rem;
    line-height: 1.2;
}

.zixing-result-meta {
    color: var(--site-muted);
    line-height: 1.45;
    font-size: .86rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.zixing-result-link a {
    color: var(--site-accent);
    font-weight: 700;
}

.zixing-fill-toolbar {
    position: sticky;
    top: 0.75rem;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--site-border);
    border-radius: var(--site-radius-md);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--site-shadow-soft);
    backdrop-filter: blur(12px);
}

.zixing-fill-list {
    display: grid;
    gap: 0.9rem;
}

.zixing-fill-row {
    position: relative;
    display: grid;
    grid-template-columns: 96px minmax(180px, 0.8fr) minmax(360px, 1.4fr);
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--site-border);
    border-radius: var(--site-radius-md);
    background: var(--site-surface);
    box-shadow: var(--site-shadow-soft);
}

.zixing-fill-row.is-selected {
    border-color: #64748b;
    box-shadow: 0 0 0 2px rgba(100, 116, 139, .12), var(--site-shadow-soft);
}

.zixing-row-select {
    position: absolute;
    top: .8rem;
    left: .8rem;
    z-index: 2;
    width: 1.1rem;
    height: 1.1rem;
}

.zixing-batch-select {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    font-size: .9rem;
}

.zixing-fill-preview {
    width: 96px;
    height: 96px;
    display: grid;
    place-items: center;
    border: 1px solid var(--site-border);
    border-radius: 14px;
    background: #f8fafc;
}

.zixing-fill-preview img {
    max-width: 86px;
    max-height: 86px;
    object-fit: contain;
}

.zixing-fill-id {
    color: var(--site-text);
    font-weight: 800;
    font-size: 1.05rem;
}

.zixing-fill-fields {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.zixing-fill-pagination {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.zixing-fill-page-jump {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.zixing-fill-page-jump .form-control {
    width: 5.2rem;
    padding: 0.45rem 0.65rem;
}

.zixing-check-form {
    display: grid;
    grid-template-columns: minmax(180px, 260px) auto auto auto;
    gap: 0.75rem;
    align-items: end;
}

.zixing-check-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 38px;
    color: var(--site-muted);
}

.zixing-segment-form {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(260px, 1.5fr) 110px auto;
    gap: 0.9rem;
    align-items: end;
}

.zixing-segment-submit {
    display: flex;
    justify-content: flex-end;
}

.zixing-draw-panel {
    border: 1px solid var(--site-border);
    border-radius: var(--site-radius-md);
    background: #f8fafc;
    overflow: hidden;
}

.zixing-draw-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem;
    border-bottom: 1px solid var(--site-border);
    background: rgba(255, 255, 255, 0.78);
}

.zixing-draw-stage {
    position: relative;
    min-height: 360px;
    display: grid;
    place-items: center;
    padding: 1rem;
    overflow: auto;
}

.zixing-draw-stage canvas {
    display: none;
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: var(--site-shadow-soft);
    cursor: crosshair;
    touch-action: none;
}

.zixing-draw-empty {
    color: var(--site-muted);
    border: 1px dashed var(--site-border);
    border-radius: var(--site-radius-md);
    padding: 2rem 3rem;
    background: #fff;
}

@media (max-width: 992px) {
    .zixing-search-layout {
        grid-template-columns: 1fr;
    }

    .zixing-search-sidebar {
        position: static;
    }

    .zixing-fill-row {
        grid-template-columns: 96px minmax(0, 1fr);
    }

    .zixing-fill-fields {
        grid-column: 1 / -1;
    }

    .zixing-check-form,
    .zixing-segment-form {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .hero-search-modern .hero-search-row,
    .search-shell-row,
    .search-shell-row.search-shell-row-simple {
        grid-template-columns: 1fr;
    }

    .hero-search-modern .hero-search-row {
        gap: .7rem;
        padding: .65rem;
        border-radius: 18px;
    }

    .search-result-card {
        border-width: 1px;
        border-left-width: 4px;
        padding: .9rem;
    }

    .search-result-topline {
        display: grid;
    }

    .search-result-action {
        width: 100%;
    }

    .search-result-body-row {
        grid-template-columns: 1fr;
        gap: .2rem;
    }

    .zixing-result-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: .75rem;
    }

    .zixing-result-thumb {
        height: 96px;
    }

    .zixing-fill-row,
    .zixing-fill-fields {
        grid-template-columns: 1fr;
    }

    .zixing-fill-preview {
        width: 100%;
    }

    .zixing-check-form,
    .zixing-segment-form {
        grid-template-columns: 1fr;
    }

    .zixing-segment-submit {
        justify-content: stretch;
    }

    .zixing-segment-submit .btn {
        width: 100%;
    }

    .stat-grid-home {
        grid-template-columns: 1fr;
    }
}
.family-search-form {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .65rem;
}

.family-search-input {
    flex: 0 1 520px;
    min-width: 220px;
    border-color: rgba(100, 116, 139, .28);
    background: #f8fafc;
}

.family-search-input:focus {
    background: #fff;
    border-color: #64748b;
    box-shadow: 0 0 0 .2rem rgba(100, 116, 139, .12);
}

.family-search-button {
    flex: 0 0 auto;
    min-width: 4.8rem;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .family-search-form {
        align-items: stretch;
        flex-wrap: wrap;
    }
    .family-search-input {
        flex: 1 0 100%;
        min-width: 0;
    }
}
.management-card > [data-management-section] {
    height: 480px;
    min-height: 480px;
    position: relative;
    border-top: 1px solid rgba(15, 23, 42, .07);
}

.management-scroll-body {
    height: 100%;
    overflow: auto;
    padding: 0 1.25rem 1.25rem;
    scrollbar-gutter: stable;
}

.management-paged-body {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem;
    overflow: hidden;
}

.management-table-area {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    scrollbar-gutter: stable;
}

#usersSection {
    height: 600px;
    min-height: 600px;
}

.management-table-area .table {
    font-size: .9rem;
}

.management-table-area .table > :not(caption) > * > * {
    padding-top: .48rem;
    padding-bottom: .48rem;
}

.management-pagination {
    flex: 0 0 auto;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .8rem;
    padding-top: .75rem;
    color: #64748b;
    font-size: .88rem;
}

.management-user-search {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(220px, 460px) auto auto;
    gap: .55rem;
    margin-bottom: .8rem;
}

.management-reason-cell { min-width: 190px; max-width: 300px; }
.management-action-cell { min-width: 270px; }
.management-empty {
    height: 100%;
    display: grid;
    place-items: center;
    color: #64748b;
}
[data-management-section].is-loading::after {
    content: "正在刷新...";
    position: absolute;
    inset: 0;
    z-index: 5;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .72);
    color: #334155;
    font-weight: 700;
}
.management-toast {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 1080;
    padding: .75rem 1rem;
    border-radius: 8px;
    background: #166534;
    color: #fff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .2);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: .2s ease;
}
.management-toast.is-visible { opacity: 1; transform: translateY(0); }
.management-toast.is-error { background: #b91c1c; }
@media (max-width: 767.98px) {
    .management-card > [data-management-section] { height: 520px; min-height: 520px; }
    #usersSection { height: 620px; min-height: 620px; }
    .management-user-search { grid-template-columns: 1fr auto; }
}
