/* ============================================================
   韩氏家族网 - 国风样式表
   主色：#9E2020  朱砂红  次色：#C49A6C  古铜金
   背景：#F8F4E9  宣纸白  辅色：#F5EEDC  古绢黄
   ============================================================ */

:root {
    --primary: #9E2020;
    --primary-dark: #7A1818;
    --primary-light: #B83A3A;
    --secondary: #C49A6C;
    --secondary-light: #E0C59B;
    --bg: #F8F4E9;
    --bg-alt: #F5EEDC;
    --card-bg: #FFFFFF;
    --text: #222222;
    --text-light: #8B7D6B;
    --text-muted: #B5A998;
    --border: #E8DCC8;
    --border-light: #F0E6D4;
    --red: #9E2020;
    --red-dark: #7A1818;
    --red-light: #C44545;
    --green: #4F7A4A;
    --shadow: 0 2px 12px rgba(80, 50, 20, 0.08);
    --shadow-lg: 0 8px 30px rgba(80, 50, 20, 0.12);
    --radius: 10px;
    --serif: "STKaiti", "KaiTi", "楷体", "STSong", "SimSun", "宋体", "Source Han Serif SC", serif;
    --sans: "Microsoft YaHei", "微软雅黑", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

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

html, body {
    font-family: var(--sans);
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    font-size: 15px;
}

a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--red-dark); }

img { max-width: 100%; display: block; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ============================================================
   首页 - 顶部导航
   ============================================================ */
.site-header {
    background: #FFFFFF;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 10000;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}
.brand-seal {
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: #FFFFFF;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--serif);
    font-size: 24px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(158, 32, 32, 0.3);
}

/* 顶部导航 - 品牌印章 */
.brand-text h1 {
    font-family: var(--serif);
    font-size: 20px;
    color: var(--text);
    line-height: 1.2;
}
.brand-text span {
    font-size: 12px;
    color: var(--text-light);
    letter-spacing: 2px;
}
.site-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}
.site-nav a {
    color: var(--text);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 15px;
    transition: all .2s;
}
.site-nav a:hover {
    color: var(--primary);
    background: var(--bg-alt);
}
.site-nav a.active {
    color: var(--primary);
    font-weight: bold;
}
.site-nav .nav-login,
.nav .nav-login {
    background: var(--primary);
    color: #FFFFFF !important;
    padding: 8px 20px !important;
    border-radius: 6px;
    margin-left: 8px;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    font-weight: 500;
    transition: background .15s;
}
.site-nav .nav-login:hover,
.nav .nav-login:hover {
    background: var(--primary-dark);
    color: #FFFFFF !important;
}
/* 旧版 .nav 容器中的登录按钮也需要红色样式（即使没有 .nav-login 类） */
.nav > a[href*="/user/login"]:not(.nav-login) {
    background: var(--primary);
    color: #FFFFFF !important;
    padding: 8px 20px !important;
    border-radius: 6px;
    margin-left: 8px;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    font-weight: 500;
    transition: background .15s;
}
.nav > a[href*="/user/login"]:not(.nav-login):hover {
    background: var(--primary-dark);
    color: #FFFFFF !important;
}

/* ============================================================
   登录弹出卡片
   ============================================================ */
.login-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity .2s ease;
}
.login-popup-card {
    position: absolute;
    min-width: 320px;
    max-width: 360px;
    background: #FFFFFF;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
    animation: loginPopupIn .2s ease-out;
}
@keyframes loginPopupIn {
    from { transform: translateY(-8px) scale(0.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}
.login-popup-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #FFFFFF;
}
.login-popup-title {
    font-weight: bold;
    font-size: 15px;
    letter-spacing: 1px;
}
.login-popup-close {
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    opacity: 0.85;
    transition: opacity .15s;
}
.login-popup-close:hover {
    opacity: 1;
}
.login-popup-form {
    padding: 18px;
}
.login-popup-row {
    margin-bottom: 12px;
}
.login-popup-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
    background: #FAFAFA;
}
.login-popup-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(158, 32, 32, 0.1);
    background: #FFFFFF;
}
.login-popup-actions {
    margin-top: 16px;
}
.login-popup-btn {
    width: 100%;
    padding: 10px;
    background: var(--primary);
    color: #FFFFFF;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: bold;
    letter-spacing: 4px;
    cursor: pointer;
    transition: background .15s, box-shadow .15s;
}
.login-popup-btn:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(158, 32, 32, 0.3);
}
.login-popup-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.login-popup-msg {
    margin-top: 10px;
    font-size: 13px;
    text-align: center;
    min-height: 18px;
}
.login-popup-msg.ok { color: #27AE60; }
.login-popup-msg.err { color: #E74C3C; }
.login-popup-foot {
    margin-top: 14px;
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
}
.login-popup-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    margin-left: 4px;
}
.login-popup-link:hover {
    text-decoration: underline;
}

/* 弹窗注册 - 协议勾选区 */
.login-popup-agreements {
    margin: 12px 0 8px;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #eee;
}
.login-popup-agreement-row {
    margin-bottom: 6px;
}
.login-popup-agreement-row:last-child {
    margin-bottom: 0;
}
.login-popup-agreement-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: #555;
    cursor: pointer;
    line-height: 1.5;
}
.login-popup-agree-check {
    width: 14px;
    height: 14px;
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
}
.login-popup-agreement-label a {
    color: #2563eb;
    text-decoration: underline;
    cursor: pointer;
}
.login-popup-agreement-err {
    display: none;
    color: #dc2626;
    font-size: 12px;
    margin-top: 6px;
    padding: 6px 8px;
    background: #fef2f2;
    border-radius: 4px;
}

/* ============================================================
   鼠标定位确认弹窗（删除照片等操作）
   ============================================================ */
.pa-confirm-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity .15s ease;
}
.pa-confirm-card {
    position: absolute;
    min-width: 240px;
    max-width: 300px;
    background: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16), 0 3px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
    animation: paConfirmIn .15s ease-out;
}
@keyframes paConfirmIn {
    from { transform: scale(0.96); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.pa-confirm-body {
    padding: 16px 18px 8px;
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
}
.pa-confirm-actions {
    display: flex;
    gap: 10px;
    padding: 8px 18px 16px;
    justify-content: flex-end;
}
.pa-confirm-btn {
    padding: 7px 20px;
    border: 1px solid var(--border, #e0d6c0);
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
    background: #FAFAFA;
    color: var(--text);
}
.pa-confirm-btn:hover { background: #F0EBE0; }
.pa-confirm-btn-confirm {
    background: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
}
.pa-confirm-btn-confirm:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* ============================================================
   通用确认弹窗 sfConfirm（替代浏览器原生 confirm）
   定位：鼠标/点击位置四方向，优先靠左
   ============================================================ */
.sf-confirm-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity .15s ease;
}
.sf-confirm-card {
    position: absolute;
    min-width: 240px;
    max-width: 300px;
    background: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16), 0 3px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
    animation: sfConfirmIn .15s ease-out;
}
@keyframes sfConfirmIn {
    from { transform: scale(0.96); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.sf-confirm-body {
    padding: 16px 18px 8px;
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
.sf-confirm-actions {
    display: flex;
    gap: 10px;
    padding: 8px 18px 16px;
    justify-content: flex-end;
}
.sf-confirm-btn {
    padding: 7px 20px;
    border: 1px solid var(--border, #e0d6c0);
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
    background: #FAFAFA;
    color: var(--text);
}
.sf-confirm-btn:hover { background: #F0EBE0; }
.sf-confirm-btn-confirm {
    background: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
}
.sf-confirm-btn-confirm:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}
.sf-confirm-btn-danger {
    background: #c0392b;
    color: #FFFFFF;
    border-color: #c0392b;
}
.sf-confirm-btn-danger:hover {
    background: #a93226;
    border-color: #a93226;
}
.sf-confirm-input-wrap {
    padding: 0 18px 4px;
}
.sf-confirm-input-label {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 4px;
}
.sf-confirm-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid var(--border, #e0d6c0);
    border-radius: 5px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text);
    resize: vertical;
    min-height: 60px;
    outline: none;
    transition: border-color .15s;
}
.sf-confirm-input:focus {
    border-color: var(--primary);
}


/* ============================================================
   首页 - Hero 区
   ============================================================ */
.hero {
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
    padding: 70px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(196, 154, 108, 0.15) 0%, transparent 70%);
    border-radius: 50%;
}
.hero::after {
    content: "";
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(158, 32, 32, 0.06) 0%, transparent 70%);
    border-radius: 50%;
}
.hero-inner {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
}
.hero-seal {
    width: 100px;
    height: 100px;
    margin: 0 auto 28px;
    background: var(--primary);
    color: #FFFFFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--serif);
    font-size: 48px;
    font-weight: bold;
    box-shadow: 0 8px 30px rgba(158, 32, 32, 0.35);
    border: 4px solid #FFFFFF;
}

.hero-title {
    font-family: var(--serif);
    font-size: 44px;
    color: var(--text);
    font-weight: bold;
    margin-bottom: 20px;
    letter-spacing: 4px;
}
.hero-sub {
    color: var(--text-light);
    font-size: 16px;
    line-height: 2;
    margin-bottom: 36px;
}
.hero-btn {
    display: inline-block;
    padding: 14px 42px;
    background: var(--primary);
    color: #FFFFFF;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    transition: all .25s;
    box-shadow: 0 4px 16px rgba(158, 32, 32, 0.3);
}
.hero-btn:hover {
    background: var(--primary-dark);
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(158, 32, 32, 0.4);
}

/* ============================================================
   首页 - 统计数据
   ============================================================ */
.stats-section {
    padding: 0 0 50px;
}
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: -30px;
    position: relative;
    z-index: 2;
}
.stat-card-item {
    background: #FFFFFF;
    border-radius: var(--radius);
    padding: 28px 20px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: transform .25s, box-shadow .25s;
}
.stat-card-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.stat-card-item .stat-num {
    display: block;
    font-family: var(--serif);
    font-size: 42px;
    color: var(--primary);
    font-weight: bold;
    line-height: 1.1;
}
.stat-card-item .stat-label {
    display: block;
    color: var(--text-light);
    font-size: 14px;
    margin-top: 8px;
}
.stat-card-item .stat-label em {
    font-style: normal;
    color: var(--text-muted);
    font-size: 12px;
    margin-left: 2px;
}

/* ============================================================
   首页 - 通用区块标题
   ============================================================ */
.section-head {
    text-align: center;
    margin-bottom: 36px;
}
.section-head h2 {
    font-family: var(--serif);
    font-size: 28px;
    color: var(--text);
    margin-bottom: 8px;
}
.section-head p {
    color: var(--text-light);
    font-size: 15px;
}
.section-head.with-link {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    text-align: left;
}
.section-head.with-link h2 {
    margin-bottom: 6px;
}
.view-all {
    font-size: 14px;
    color: var(--primary);
    white-space: nowrap;
}
.view-all:hover {
    color: var(--primary-dark);
}

/* ============================================================
   首页 - 韩氏分支
   ============================================================ */
.branches-section {
    padding: 50px 0;
    background: #FFFFFF;
}
.branches-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}
.branch-card {
    background: #FFFFFF;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 32px;
    display: flex;
    gap: 24px;
    transition: transform .25s, box-shadow .25s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
}
.branch-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--secondary);
}
.branch-card-left {
    flex: 1;
    min-width: 0;
}
.branch-title {
    font-family: var(--serif);
    font-size: 22px;
    color: var(--text);
    margin-bottom: 10px;
    font-weight: 600;
}
.branch-desc-row {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 16px;
}
.branch-pin {
    margin-right: 4px;
}
.branch-genchars {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.genchars-label {
    font-size: 13px;
    color: var(--text-light);
    font-family: var(--serif);
}
.genchar-chip {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    background: var(--bg-alt);
    color: var(--primary);
    font-family: var(--serif);
    font-size: 16px;
    border-radius: 50%;
    border: 1px solid var(--border);
}
.branch-stats {
    display: flex;
    gap: 28px;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--border);
    margin-bottom: 10px;
}
.stat-block {
    text-align: center;
}
.stat-num {
    display: block;
    font-size: 22px;
    font-weight: 600;
    color: var(--primary);
    font-family: var(--serif);
    line-height: 1.2;
}
.stat-label {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 2px;
}
.branch-gens {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}
.branch-card-right {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: 100px;
}
.branch-seal-ornament {
    width: 72px;
    height: 72px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(158, 32, 32, 0.3);
    position: relative;
}
.branch-seal-ornament::after {
    content: '';
    position: absolute;
    inset: 4px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
}
.seal-char {
    font-family: var(--serif);
    font-size: 32px;
    color: #FFFFFF;
    font-weight: bold;
}
.branch-member-icon {
    color: var(--secondary);
    opacity: 0.6;
}
.branch-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    gap: 12px;
}
.branch-gens {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
    flex-shrink: 0;
}
.branch-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tag-item {
    display: inline-block;
    padding: 3px 10px;
    background: var(--bg-alt);
    color: var(--primary);
    font-family: var(--serif);
    font-size: 12px;
    border-radius: 4px;
    border: 1px solid var(--border);
    white-space: nowrap;
}
.tag-admin {
    color: var(--green);
    border-color: var(--green);
    background: #F0F7EE;
}
.tag-claim {
    color: var(--primary);
    border-color: var(--primary);
    background: #FDF2F2;
}
.tag-entry {
    color: var(--secondary);
    border-color: var(--secondary);
    background: #FBF5EC;
    font-family: var(--sans);
}

/* ============================================================
   首页 - 最新动态
   ============================================================ */
.news-section {
    padding: 50px 0;
    background: var(--bg);
}
.news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}
.news-card {
    background: #FFFFFF;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 24px 26px;
    transition: transform .25s, box-shadow .25s;
}
.news-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}
.news-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.news-cat {
    display: inline-block;
    align-self: flex-start;
    padding: 3px 12px;
    background: var(--bg-alt);
    color: var(--primary);
    font-size: 12px;
    border-radius: 4px;
    font-weight: bold;
}
.news-body h4 {
    font-family: var(--serif);
    font-size: 19px;
    color: var(--text);
    line-height: 1.4;
}
.news-desc {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}
.news-date {
    color: var(--text-muted);
    font-size: 13px;
}
.news-more {
    font-size: 13px;
    color: var(--primary);
    font-weight: bold;
}
.news-more:hover {
    color: var(--primary-dark);
}
.news-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-light);
    padding: 40px 0;
    background: #FFFFFF;
    border-radius: var(--radius);
    border: 1px dashed var(--border);
}

/* ============================================================
   首页 - 页脚
   ============================================================ */
.site-footer {
    background: var(--primary-dark);
    color: #E8D9C0;
    padding: 30px 0;
    margin-top: 0;
}
.footer-inner {
    text-align: center;
}
.footer-inner p {
    font-size: 14px;
    color: #E8D9C0;
}
.footer-links {
    margin-top: 8px !important;
    font-size: 13px !important;
}
.footer-links span {
    display: inline-block;
    margin: 0 10px;
    color: #C9B896;
}
.footer-links span a {
    color: #C9B896;
    text-decoration: none;
}
.footer-links span a:hover {
    color: #fff;
    text-decoration: underline;
}
.footer-sub {
    font-family: var(--serif);
    letter-spacing: 8px;
    font-size: 16px !important;
    margin-top: 8px;
    color: #D4C0A0 !important;
}
/* 网站统计条（底部访问量信息） */
.site-stats-bar {
    text-align: center;
    padding: 10px 0;
    font-size: 13px;
    color: #8B7D6B;
}

/* ============================================================
   以下为其他页面通用样式（保留）
   ============================================================ */

/* ===== 旧版导航（其他页面使用） ===== */
.header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, var(--primary-light) 100%);
    color: #FFFFFF;
    box-shadow: 0 2px 12px rgba(120, 30, 20, 0.35);
    position: relative;
}
.header::before {
    content: "";
    position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
    background: linear-gradient(90deg, transparent, var(--secondary), transparent);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo-seal {
    width: 46px; height: 46px;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
    color: var(--primary-dark);
    border: 2px solid #FFFFFF;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--serif);
    font-size: 28px; font-weight: bold;
    box-shadow: 0 0 0 2px var(--secondary), 0 2px 8px rgba(0,0,0,.25);
}
.logo-text h1 { font-family: var(--serif); font-size: 22px; color: #FFFFFF; line-height: 1.2; }
.logo-text span { font-size: 12px; color: #F4D9A8; letter-spacing: 2px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; position: relative; }
.nav a {
    color: #FFFFFF;
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 15px;
    transition: all .2s;
}
.nav a:hover { background: rgba(255,255,255,.18); color: #FFFFFF; }

/* ===== 通用页面 ===== */
main.container { padding-top: 28px; padding-bottom: 40px; min-height: 60vh; }
.page-title {
    font-family: var(--serif);
    font-size: 26px;
    color: var(--primary-dark);
    text-align: center;
    margin-bottom: 24px;
    position: relative;
    padding-bottom: 14px;
}
.page-title::after {
    content: "";
    position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
    width: 80px; height: 3px;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    border-radius: 2px;
}
.back-link { display: inline-block; margin-bottom: 18px; color: var(--primary); }
.back-link:hover { color: var(--red); }
.empty-tip { text-align: center; color: var(--text-light); padding: 40px 0; font-size: 15px; }

/* ===== 家族介绍 / hero ===== */
.family-intro, .hero-old {
    background:
        linear-gradient(135deg, rgba(196,154,108,.08), rgba(158,32,32,.04)),
        var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px 34px;
    margin-bottom: 26px;
    box-shadow: var(--shadow);
    position: relative;
}
.family-title { font-family: var(--serif); font-size: 30px; color: var(--red); text-align: center; margin-bottom: 14px; }
.family-generation { text-align: center; margin-bottom: 14px; }
.family-generation .label { color: var(--text-light); }
.family-generation .generation-text {
    font-family: var(--serif);
    font-size: 20px;
    color: var(--primary);
    letter-spacing: 6px;
    font-weight: bold;
}
.family-desc { color: var(--text); text-indent: 2em; line-height: 2; }

/* 印章效果 */
.seal-box {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 64px; height: 64px;
    background: var(--red);
    color: #FFF8F0;
    font-family: var(--serif);
    font-size: 32px; font-weight: bold;
    border: 3px solid var(--red);
    border-radius: 6px;
    box-shadow: 0 0 0 2px #FFF8F0, 0 0 0 4px var(--red);
    transform: rotate(-4deg);
}

/* ===== 统计卡片 ===== */
.stats, .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}
.stat-item, .stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-top: 3px solid var(--secondary);
    border-radius: var(--radius);
    padding: 22px 18px;
    text-align: center;
    box-shadow: var(--shadow);
}
.stat-item .stat-num {
    display: block;
    font-family: var(--serif);
    font-size: 34px;
    color: var(--red);
    font-weight: bold;
    line-height: 1.2;
}
.stat-item .stat-label { display: block; color: var(--text-light); font-size: 14px; margin-top: 4px; }

/* ===== 区块 ===== */
.block {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 26px;
    margin-bottom: 26px;
    box-shadow: var(--shadow);
}
.block-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--bg-alt); padding-bottom: 12px; margin-bottom: 16px; }
.block-head h3 { font-family: var(--serif); font-size: 20px; color: var(--primary-dark); }
.block-head .more { font-size: 14px; }

/* 公告列表（首页） */
.announce-list { list-style: none; }
.announce-list li { border-bottom: 1px dashed var(--border); }
.announce-list li:last-child { border-bottom: none; }
.announce-list a { display: flex; align-items: center; padding: 10px 4px; gap: 8px; }
.announce-list .cat { color: var(--secondary); font-size: 13px; white-space: nowrap; }
.announce-list .title { flex: 1; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.announce-list .date { color: var(--text-light); font-size: 13px; }

/* 公告列表（独立页） */
.announce-cards { display: flex; flex-direction: column; gap: 18px; }
.announce-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-left: 4px solid var(--secondary);
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--shadow);
}
.announce-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.announce-card-head .cat { color: var(--secondary); font-size: 13px; }
.announce-card-head h3 { font-family: var(--serif); font-size: 19px; color: var(--primary-dark); flex: 1; min-width: 60%; }
.announce-card-head .date { color: var(--text-light); font-size: 13px; }
.announce-content { color: var(--text-light); line-height: 1.9; }
.read-more { display: inline-block; margin-top: 10px; color: var(--primary); font-size: 14px; }

/* 分类标签 */
.category-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.cat-tab {
    padding: 6px 18px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text);
    font-size: 14px;
    transition: all .2s;
}
.cat-tab:hover { border-color: var(--secondary); color: var(--primary); }
.cat-tab.active { background: var(--primary); border-color: var(--primary); color: #FFF8F0; }

/* ===== 相册 ===== */
.photo-grid, .photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}
.photo-grid-full { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.photo-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .25s, box-shadow .25s;
}
.photo-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.photo-thumb { width: 100%; height: 170px; overflow: hidden; background: var(--bg-alt); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-title { display: block; padding: 10px 12px; text-align: center; color: var(--text); }
.photo-meta { padding: 12px 14px; }
.photo-meta h4 { font-family: var(--serif); font-size: 17px; color: var(--primary-dark); margin-bottom: 6px; }
.photo-desc { color: var(--text-light); font-size: 13px; line-height: 1.6; }
.photo-extra { display: flex; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--text-light); }

/* 大图查看弹窗 */
.photo-modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.82);
    z-index: 9999;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 30px;
}
.photo-modal img { max-width: 90%; max-height: 80vh; border: 4px solid #FFF8F0; border-radius: 4px; box-shadow: 0 8px 40px rgba(0,0,0,.5); }
.photo-modal p { color: #FFF8F0; margin-top: 14px; font-size: 16px; font-family: var(--serif); }
.photo-modal-close {
    position: absolute; top: 20px; right: 30px;
    background: none; border: none; color: #FFF8F0;
    font-size: 42px; line-height: 1; cursor: pointer;
}

/* ===== 成员卡片 ===== */
.member-grid, .member-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
    align-items: start;
}
.member-card {
    display: flex; align-items: flex-start; gap: 14px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s;
}
.member-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--secondary); }
.member-avatar {
    width: 58px; height: 58px; flex-shrink: 0;
    background: linear-gradient(135deg, var(--secondary), var(--primary-light));
    color: #FFF8F0;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--serif); font-size: 26px; font-weight: bold;
    box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 3px var(--secondary);
}
.member-info { flex: 1; min-width: 0; }
.member-name { font-family: var(--serif); font-size: 18px; color: var(--primary-dark); }
.member-meta { display: flex; gap: 10px; font-size: 13px; color: var(--text-light); margin: 2px 0; }
.member-meta .gender { color: var(--red); }
.member-birth { font-size: 13px; color: var(--text-light); }
.member-relations { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.member-relations .rel-row { font-size: 12px; color: var(--text-light); line-height: 1.8; }
.member-relations .rel-label { display: inline-block; min-width: 36px; color: var(--secondary); font-weight: bold; margin-right: 4px; }
.member-relations .rel-link { color: var(--primary-dark); text-decoration: none; border-bottom: 1px dotted var(--primary-light); }
.member-relations .rel-link:hover { color: var(--red); border-bottom-color: var(--red); }

/* ===== 紧凑成员卡片（参考图样式） ===== */
.member-grid-compact {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
/* 全族成员页（/members）一行显示4个 */
.members-flat-wrap .member-grid-compact {
    grid-template-columns: repeat(4, 1fr);
}
.member-card-compact {
    display: flex; align-items: center; gap: 14px;
    background: #FAF6ED;
    border: 1px solid #E8DFCE;
    border-radius: 12px;
    padding: 14px 18px;
    box-shadow: none;
    transition: background .2s, border-color .2s;
    min-height: 64px;
}
.member-card-compact:hover {
    transform: none;
    box-shadow: none;
    background: #F5EEDE;
    border-color: #D6C9AB;
}
.member-avatar-gender {
    width: 48px; height: 48px; flex-shrink: 0;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    box-shadow: none;
}
.avatar-male {
    background: #F1DFD6;
    color: #9E2020;
}
.avatar-female {
    background: #F2E8CE;
    color: #B8932A;
}
.member-avatar-gender.has-avatar {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px solid rgba(255,255,255,0.6);
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.member-card-compact .member-info { line-height: 1.4; }
.member-name-row {
    display: flex; align-items: baseline; gap: 6px;
    margin-bottom: 2px;
}
.member-card-compact .member-name {
    font-family: var(--serif);
    font-size: 17px;
    color: #2A1F1A;
    margin: 0;
}
.member-zi {
    font-size: 12px;
    color: #8A7A65;
}
.member-spouse {
    font-size: 12px;
    color: #9E2020;
    text-decoration: none;
    border-bottom: 1px dotted #C9A0A0;
    margin-left: 2px;
}
.member-spouse:hover {
    color: #B82828;
    border-bottom-color: #B82828;
}
.member-card-compact .member-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #8A7A65;
    margin: 0 0 2px 0;
}
.member-card-compact .member-meta .sep { color: #C8B898; }
.member-card-compact .zi-char { color: #8A7A65; }
.member-card-compact .member-birth {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #8A7A65;
    margin: 0;
}
.member-card-compact .member-birth .sep { color: #C8B898; }
.member-card-compact .member-birth .gender {
    color: #8A7A65;
    font-weight: normal;
}

/* ===== 成员详情 ===== */
.detail-page, .member-detail { max-width: 920px; }
.member-profile {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px 30px;
    margin-bottom: 22px;
    box-shadow: var(--shadow);
}
.member-head { display: flex; align-items: center; gap: 18px; padding-bottom: 18px; border-bottom: 2px solid var(--bg-alt); margin-bottom: 18px; }
.member-head .member-avatar { width: 76px; height: 76px; font-size: 34px; }
.member-title h2 { font-family: var(--serif); font-size: 26px; color: var(--red); }
.member-title .sub { color: var(--text-light); font-size: 14px; }
.member-attrs { list-style: none; }
.member-attrs li { display: flex; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.member-attrs li:last-child { border-bottom: none; }
.member-attrs .lbl { width: 90px; color: var(--text-light); flex-shrink: 0; }
.member-attrs .val { color: var(--text); flex: 1; }
.member-attrs .val.bio { line-height: 1.9; }

.member-relations {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 26px;
    box-shadow: var(--shadow);
}
.member-relations h3 { font-family: var(--serif); font-size: 20px; color: var(--primary-dark); margin-bottom: 16px; }
.relation-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.relation-block { background: var(--bg-alt); border-radius: var(--radius); padding: 14px 16px; }
.relation-block h4 { font-size: 15px; color: var(--primary); margin-bottom: 8px; }
.relation-list { list-style: none; }
.relation-list li { padding: 4px 0; }
.relation-list li a { display: inline-flex; align-items: center; gap: 6px; }
.gend-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 11px;
    color: #fff;
    flex-shrink: 0;
}
.gend-icon.gend-m { background: #2E86AB; }
.gend-icon.gend-f { background: #D63384; }
.gend-icon.gend-m::before { content: "♂"; }
.gend-icon.gend-f::before { content: "♀"; }
.relation-block .empty { color: var(--text-light); font-size: 13px; }

/* ===== 公告详情 ===== */
.announce-detail {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px 36px;
    margin-bottom: 22px;
    box-shadow: var(--shadow);
}
.announce-detail-head { text-align: center; border-bottom: 2px solid var(--bg-alt); padding-bottom: 16px; margin-bottom: 20px; }
.announce-detail-head .cat { color: var(--secondary); font-size: 14px; }
.announce-detail-head h1 { font-family: var(--serif); font-size: 28px; color: var(--red); margin: 6px 0; }
.announce-meta { color: var(--text-light); font-size: 13px; }
.announce-detail-body { color: var(--text); line-height: 2; font-size: 16px; }
.related-block { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; box-shadow: var(--shadow); }
.related-block h3 { font-family: var(--serif); font-size: 18px; color: var(--primary-dark); margin-bottom: 12px; }
.related-list { list-style: none; }
.related-list li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.related-list li:last-child { border-bottom: none; }
.related-list .date { color: var(--text-light); font-size: 13px; }

/* ===== 筛选栏 ===== */
.filter-bar {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 22px;
    box-shadow: var(--shadow);
}
.filter-bar input, .filter-bar select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 4px; font-size: 14px; background: #FFF; color: var(--text); }
.filter-bar input { flex: 1; min-width: 180px; }
.filter-bar input:focus, .filter-bar select:focus { outline: none; border-color: var(--secondary); }

/* ===== 按钮 ===== */
.btn, .btn-primary {
    display: inline-block;
    padding: 8px 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #FFF8F0;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all .2s;
    text-align: center;
    line-height: 1.5;
}
.btn:hover, .btn-primary:hover { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: #FFF8F0; transform: translateY(-1px); }
.btn-ghost, .btn-secondary {
    background: var(--card-bg);
    color: var(--primary);
    border: 1px solid var(--border);
}
.btn-ghost:hover, .btn-secondary:hover { background: var(--bg-alt); color: var(--primary); border-color: var(--secondary); }
.btn-sm { padding: 4px 12px; font-size: 13px; }
.btn-danger { background: linear-gradient(135deg, var(--red-dark), var(--red)); color: #FFF8F0; }
.btn-danger:hover { background: linear-gradient(135deg, var(--red), var(--red-light)); color: #FFF8F0; }

/* ===== 表单 ===== */
.form-page { max-width: 720px; }
.form-intro { color: var(--text-light); margin-bottom: 22px; text-align: center; }
.auth-form, .register-form {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 32px;
    box-shadow: var(--shadow);
}
.form-row { margin-bottom: 18px; }
.form-row label { display: block; margin-bottom: 6px; color: var(--primary-dark); font-size: 14px; font-weight: bold; }
.form-row .req { color: var(--red); }
.form-row input, .form-row select, .form-row textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
    font-family: var(--sans);
    background: #FFF;
    color: var(--text);
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { outline: none; border-color: var(--secondary); box-shadow: 0 0 0 2px rgba(196,154,108,.15); }
.form-row textarea { resize: vertical; min-height: 90px; }
.form-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.form-actions .link { color: var(--primary); font-size: 14px; }
.form-msg { font-size: 14px; }
.form-msg.ok { color: var(--green); }
.form-msg.err { color: var(--red); }

/* 找回密码步骤指示器 */
.reset-steps { display:flex; gap:0; margin:20px 0; }
.reset-step { flex:1; display:flex; align-items:center; gap:8px; padding:10px 12px; font-size:14px; color:var(--text-light); border-bottom:2px solid var(--border); }
.reset-step.active { color:var(--primary); border-bottom-color:var(--primary); font-weight:bold; }
.reset-step.done { color:var(--green); border-bottom-color:var(--green); }
.reset-step .step-num { display:inline-flex; align-items:center; justify-content:center; width:22px; height:22px; border-radius:50%; background:var(--border); color:#fff; font-size:12px; }
.reset-step.active .step-num { background:var(--primary); }
.reset-step.done .step-num { background:var(--green); }
@media (max-width:640px) {
    .reset-steps { flex-direction:column; gap:4px; }
    .reset-step { border-bottom:1px solid var(--border); border-left:3px solid transparent; padding:8px 10px; }
    .reset-step.active { border-left-color:var(--primary); border-bottom:1px solid var(--border); }
    .reset-step.done { border-left-color:var(--green); }
}

/* ===== 分页 ===== */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin-top: 28px; }
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--card-bg);
    color: var(--text);
    font-size: 14px;
}
.pagination a:hover { border-color: var(--secondary); color: var(--primary); background: var(--bg-alt); }
.pagination .page-num.active, .pagination .active { background: var(--primary); border-color: var(--primary); color: #FFF8F0; }
.pagination .page-info { color: var(--text-light); border: none; background: transparent; }
.pagination .page-btn { font-weight: 500; }

/* SMTP配置网格 */
.smtp-config-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px 24px; margin-bottom:20px; }
.smtp-config-grid .form-row { margin-bottom:0; }
.smtp-test-section { border-top:1px dashed var(--border); padding-top:16px; margin-top:8px; }
.smtp-test-section h4 { margin:0 0 10px; font-size:15px; }
.section-divider { border:none; border-top:1px solid var(--border); margin:32px 0; }

/* 邮件管理子Tab */
.email-sub-tabs { display:flex; gap:0; border-bottom:2px solid var(--border); margin-bottom:20px; }
.email-sub-tabs .sub-tab-btn {
    background:none; border:none; padding:10px 20px; cursor:pointer;
    font-size:14px; font-weight:500; color:var(--text-light);
    border-bottom:2px solid transparent; margin-bottom:-2px; transition:all .2s;
}
.email-sub-tabs .sub-tab-btn:hover { color:var(--primary); }
.email-sub-tabs .sub-tab-btn.active {
    color:var(--primary); border-bottom-color:var(--primary); font-weight:600;
}
.email-sub-tabs .sub-tab-btn:focus { outline:none; }

/* 前往配置链接 */
.link-config {
    color:var(--primary); text-decoration:none; font-weight:500; margin-left:6px;
}
.link-config:hover { text-decoration:underline; }

@media (max-width:768px) {
    .email-sub-tabs .sub-tab-btn { padding:8px 14px; font-size:13px; }
}
.test-email-row { display:flex; gap:10px; align-items:center; }
.test-email-row input { flex:1; }
@media (max-width:768px) {
    .smtp-config-grid { grid-template-columns:1fr; }
}

/* 群发邮件 */
.massmail-scope { margin-bottom:16px; }
.massmail-scope .form-label { display:block; font-weight:bold; margin-bottom:8px; }
.scope-options { display:flex; gap:20px; flex-wrap:wrap; }
.scope-options label { display:flex; align-items:center; gap:6px; cursor:pointer; font-size:14px; }
.massmail-recipients { border:1px solid var(--border); border-radius:8px; padding:16px; margin:16px 0; max-height:400px; overflow-y:auto; }
.massmail-recipients h4 { margin:0 0 10px; font-size:15px; }
.recipient-actions { display:flex; gap:8px; margin-bottom:10px; }
.recipient-list { max-height:250px; overflow-y:auto; border:1px solid var(--border); border-radius:6px; }
.recipient-item { display:flex; align-items:center; gap:8px; padding:8px 12px; border-bottom:1px solid var(--border); font-size:14px; }
.recipient-item:last-child { border-bottom:none; }
.recipient-item input[type="checkbox"] { width:16px; height:16px; cursor:pointer; }
.recipient-item .r-email { flex:1; }
.recipient-item .r-user { color:var(--text-light); font-size:12px; min-width:80px; }
.recipient-item .r-source { color:var(--text-light); font-size:12px; background:var(--bg-alt); padding:2px 8px; border-radius:10px; }

/* ===== 族谱树 ===== */
.tree-page .tree-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow); }
.tree-toolbar .filter-label { font-size: 14px; color: var(--text-light); }
.tree-toolbar select { padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px; }
.tree-tip { margin-left: auto; font-size: 13px; color: var(--text-light); }
.tree-canvas-wrap { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
#tree-svg { background: var(--bg); }
#tree-svg .link { fill: none; stroke: var(--primary-light); stroke-width: 1.5; }
#tree-svg .node circle { fill: var(--secondary); stroke: var(--primary); stroke-width: 1.5; }
#tree-svg .node.node-root circle { fill: var(--red); stroke: var(--red-dark); }
#tree-svg .node text { font-family: var(--serif); font-size: 13px; fill: var(--text); }
#tree-svg .node.node-root text { font-size: 15px; fill: var(--red); font-weight: bold; }
#tree-svg .matched { fill: var(--red) !important; }
#tree-svg .dimmed { opacity: .25; }
.node-modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 9998; display: flex; align-items: center; justify-content: center; }
.node-modal-inner { background: var(--card-bg); border-radius: var(--radius); padding: 24px 28px; max-width: 420px; width: 90%; box-shadow: var(--shadow-lg); position: relative; }
.node-modal-inner h4 { font-family: var(--serif); font-size: 20px; color: var(--red); margin-bottom: 12px; }
.node-info { list-style: none; margin-bottom: 16px; }
.node-info li { padding: 5px 0; border-bottom: 1px dashed var(--border); color: var(--text); }
.node-modal-close { position: absolute; top: 8px; right: 14px; background: none; border: none; font-size: 28px; color: var(--text-light); cursor: pointer; }

/* ===== 旧版页脚 ===== */
.footer { background: var(--primary-dark); color: #F4D9A8; margin-top: 40px; }
.footer-bottom { text-align: center; padding: 22px 0; font-size: 13px; }
.footer-bottom p { color: #E8C99A; }

/* ============================================================
   后台管理
   ============================================================ */
.admin-layout { display: flex; min-height: 100vh; background: var(--bg); }

/* 侧边栏 */
.admin-sidebar {
    width: 230px;
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: #FFF8F0;
    min-height: 100vh;
    position: sticky;
    top: 0;
    align-self: flex-start;
    box-shadow: 2px 0 12px rgba(120, 30, 20, 0.25);
}
.admin-sidebar h2 {
    font-family: var(--serif);
    font-size: 20px;
    text-align: center;
    padding: 22px 16px 18px;
    border-bottom: 1px solid rgba(255,255,255,.15);
    color: #FFF8F0;
}
.admin-sidebar a {
    display: block;
    color: #F4D9A8;
    padding: 12px 22px;
    font-size: 15px;
    border-left: 3px solid transparent;
    transition: all .2s;
}
.admin-sidebar a:hover { background: rgba(255,255,255,.12); color: #FFF8F0; border-left-color: var(--secondary); }
.admin-sidebar a.active {
    background: rgba(255,255,255,.18);
    color: #FFF8F0;
    border-left-color: var(--secondary-light);
    font-weight: bold;
}

/* 主区域 */
.admin-main { flex: 1; min-width: 0; padding: 24px 30px; }
.admin-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--bg-alt);
}
.admin-header h1 { font-family: var(--serif); font-size: 24px; color: var(--primary-dark); }
.admin-header .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* 后台统计卡片 */
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 28px; }
.admin-stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 20px;
    box-shadow: var(--shadow);
    display: flex; align-items: center; gap: 16px;
}
.admin-stat-card .ico {
    width: 52px; height: 52px; flex-shrink: 0;
    background: linear-gradient(135deg, var(--secondary), var(--primary-light));
    color: #FFF8F0;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
}
.admin-stat-card .num { font-family: var(--serif); font-size: 30px; color: var(--red); font-weight: bold; line-height: 1.1; }
.admin-stat-card .lbl { color: var(--text-light); font-size: 14px; }

/* 后台双栏面板 */
.admin-panel { display: grid; grid-template-columns: 1fr; gap: 22px; }
.admin-panel.cols-2 { grid-template-columns: 360px 1fr; align-items: start; }

/* 后台卡片容器 */
.admin-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 26px;
    box-shadow: var(--shadow);
    margin-bottom: 22px;
}
.admin-card h3 { font-family: var(--serif); font-size: 18px; color: var(--primary-dark); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--bg-alt); }

/* 后台设置页 Tab 导航 */
.settings-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 18px;
    border-bottom: 2px solid var(--bg-alt);
}
.settings-tabs .tab-btn {
    padding: 10px 22px;
    font-size: 14px;
    font-family: var(--serif);
    color: var(--text-light);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all 0.2s;
}
.settings-tabs .tab-btn:hover { color: var(--primary-dark); }
.settings-tabs .tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* 后台表格 */
.admin-table-wrap { overflow-x: auto; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: var(--card-bg);
}
.admin-table th, .admin-table td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.admin-table th {
    background: var(--bg-alt);
    color: var(--primary-dark);
    font-weight: bold;
    font-family: var(--serif);
    font-size: 15px;
}
.admin-table tbody tr:hover { background: #FBF6EC; }
.admin-table .ops { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-table .thumb { width: 56px; height: 42px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); }
.admin-table .empty-row td { text-align: center; color: var(--text-light); padding: 30px 0; }

/* 状态标签 */
.tag { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; line-height: 1.7; }
.tag-green { background: #E3F0E0; color: var(--green); }
.tag-red { background: #F6E0DC; color: var(--red); }
.tag-gray { background: #ECECEC; color: var(--text-light); }
.tag-gold { background: #F8EEC8; color: var(--primary); }

/* 后台表单 */
.admin-form .form-row { margin-bottom: 16px; }
.admin-form .form-row label { display: block; margin-bottom: 6px; color: var(--primary-dark); font-weight: bold; font-size: 14px; }
.admin-form .form-row .req { color: var(--red); }
.admin-form .form-row input, .admin-form .form-row select, .admin-form .form-row textarea {
    width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 4px; font-size: 14px; background: #FFF; color: var(--text); font-family: var(--sans);
}
.admin-form .form-row input:focus, .admin-form .form-row select:focus, .admin-form .form-row textarea:focus { outline: none; border-color: var(--secondary); box-shadow: 0 0 0 2px rgba(196,154,108,.15); }
.admin-form .form-row textarea { resize: vertical; min-height: 100px; }
.admin-form .form-row .hint { color: var(--text-light); font-size: 12px; margin-top: 4px; }
.admin-form .form-actions { margin-top: 22px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ============ 贡献点配置页 - 横向多列布局 ============ */
/* 每个修改框跟在文字后面，input 宽度 120px，多个为一排自动换行 */
.admin-form.contrib-form .contrib-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 24px;
}
.admin-form.contrib-form .contrib-grid .form-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    flex-wrap: nowrap;
}
.admin-form.contrib-form .contrib-grid .form-row label {
    display: inline;
    margin-bottom: 0;
    white-space: nowrap;
    color: var(--primary-dark);
    font-weight: bold;
    font-size: 14px;
}
.admin-form.contrib-form .contrib-grid .form-row input {
    width: 120px;
    padding: 5px 10px;
    font-size: 14px;
}
.admin-form.contrib-form .contrib-grid .form-row .hint {
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 0;
    white-space: nowrap;
}

/* 后台审核弹窗 */
.review-modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 9998; display: flex; align-items: center; justify-content: center; }
.review-modal-inner { background: var(--card-bg); border-radius: var(--radius); padding: 24px 28px; width: 90%; max-width: 420px; box-shadow: var(--shadow-lg); }
.review-modal-inner h3 { font-family: var(--serif); font-size: 19px; color: var(--primary-dark); margin-bottom: 14px; }
.review-modal-inner .form-row { margin-bottom: 14px; }
.review-modal-inner textarea { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 4px; min-height: 80px; resize: vertical; font-family: var(--sans); }
.review-modal-inner .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 10px; }

/* ===== 用户下拉菜单 ===== */
/* 浅色导航 (site-nav) 用户下拉 */
.site-nav .user-menu { position: relative; margin-left: 8px; }
.site-nav .user-menu-trigger {
    background: var(--primary);
    color: #FFFFFF !important;
    padding: 8px 18px !important;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 15px;
}
.site-nav .user-menu-trigger:hover { background: var(--primary-dark); }
.site-nav .user-menu-trigger .avatar {
    width: 20px; height: 20px;
    background: #FFFFFF;
    color: var(--primary);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
}
.site-nav .user-menu-trigger .caret {
    display: inline-block;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid rgba(255,255,255,.8);
    margin-left: 2px;
    transition: transform .2s;
}
.site-nav .user-menu:hover .user-menu-trigger .caret { transform: rotate(180deg); }
.site-nav .user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 180px;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    padding: 6px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all .18s ease;
}
.site-nav .user-menu:hover .user-dropdown,
.site-nav .user-menu:focus-within .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.site-nav .user-dropdown::before {
    content: "";
    position: absolute;
    top: -6px;
    right: 18px;
    width: 12px; height: 12px;
    background: #FFFFFF;
    border-left: 1px solid var(--border);
    border-top: 1px solid var(--border);
    transform: rotate(45deg);
    pointer-events: none; /* 防止小三角挡住菜单项点击 */
}
.site-nav .user-dropdown a {
    display: block;
    padding: 9px 14px;
    color: var(--text) !important;
    font-size: 14px;
    border-radius: 5px;
    background: transparent !important;
    margin: 0;
}
.site-nav .user-dropdown a:hover {
    background: var(--bg-alt) !important;
    color: var(--primary) !important;
}
.site-nav .user-dropdown .menu-divider {
    height: 1px;
    background: var(--border-light);
    margin: 6px 4px;
}
.site-nav .user-dropdown .menu-logout:hover {
    color: #D9363E !important;
}

/* 深色导航 (.header .nav) 用户下拉 */
.nav .user-menu { position: relative; }
.nav .user-menu-trigger {
    padding: 8px 16px;
    border-radius: 4px;
    color: #FFFFFF;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 15px;
}
.nav .user-menu-trigger:hover { background: rgba(255,255,255,.18); }
.nav .user-menu-trigger .avatar {
    width: 20px; height: 20px;
    background: rgba(255,255,255,.2);
    color: #FFFFFF;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
}
.nav .user-menu-trigger .caret {
    display: inline-block;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid rgba(255,255,255,.7);
    transition: transform .2s;
}
.nav .user-menu:hover .user-menu-trigger .caret { transform: rotate(180deg); }
.nav .user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 180px;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    padding: 6px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all .18s ease;
}
.nav .user-menu:hover .user-dropdown,
.nav .user-menu:focus-within .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav .user-dropdown::before {
    content: "";
    position: absolute;
    top: -6px;
    right: 18px;
    width: 12px; height: 12px;
    background: #FFFFFF;
    border-left: 1px solid var(--border);
    border-top: 1px solid var(--border);
    transform: rotate(45deg);
    pointer-events: none; /* 防止小三角挡住菜单项点击 */
}
.nav .user-dropdown a {
    display: block;
    padding: 9px 14px;
    color: var(--text) !important;
    font-size: 14px;
    border-radius: 5px;
    background: transparent !important;
    margin: 0;
}
.nav .user-dropdown a:hover {
    background: var(--bg-alt) !important;
    color: var(--primary) !important;
}
.nav .user-dropdown .menu-divider {
    height: 1px;
    background: var(--border-light);
    margin: 6px 4px;
}
.nav .user-dropdown .menu-logout:hover { color: #D9363E !important; }

/* ===== 顶部系统消息铃铛 ===== */
/* 触发器 .notice-bell-trigger 嵌在 .user-menu 内部，绝对定位到卡片右上角 */
/* 下拉面板 .notice-dropdown-panel 是 .user-menu 的兄弟节点，绝对定位在卡片下方 */
.site-nav .user-menu > .notice-bell-trigger,
.nav .user-menu > .notice-bell-trigger {
    position: absolute;
    top: -8px;
    right: -8px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #D9363E;
    color: #FFFFFF;
    cursor: pointer;
    user-select: none;
    transition: background .18s ease;
    overflow: visible;
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.site-nav .user-menu > .notice-bell-trigger:hover,
.nav .user-menu > .notice-bell-trigger:hover { background: #B82B2B; }
.site-nav .user-menu > .notice-bell-trigger.is-open,
.nav .user-menu > .notice-bell-trigger.is-open { background: #B82B2B; }
.site-nav .user-menu > .notice-bell-trigger .bell-icon,
.nav .user-menu > .notice-bell-trigger .bell-icon {
    font-size: 14px;
    line-height: 1;
}
.site-nav .user-menu > .notice-bell-trigger .notice-badge,
.nav .user-menu > .notice-bell-trigger .notice-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #FFD700;
    color: #9E2020;
    font-size: 10px;
    font-weight: 700;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0,0,0,.25);
    pointer-events: none;
    z-index: 3;
    line-height: 1;
    border: 1px solid #FFFFFF;
}

/* 下拉面板：固定定位在视口中，JS 动态计算位置 */
.site-nav .notice-dropdown-panel,
.nav .notice-dropdown-panel {
    position: fixed;
    width: 360px;
    max-width: calc(100vw - 20px);
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 10px 32px rgba(0,0,0,.18);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
    overflow: hidden;
}
.site-nav .notice-dropdown-panel.is-open,
.nav .notice-dropdown-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.notice-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-alt);
}
.notice-dropdown-title {
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
}
.notice-mark-all {
    font-size: 13px;
    color: var(--primary);
    cursor: pointer;
    text-decoration: none;
}
.notice-mark-all:hover { text-decoration: underline; }
.notice-list {
    max-height: 360px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.notice-item {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    text-decoration: none;
    color: var(--text);
    background: #FFFFFF;
    transition: background .15s ease;
    align-items: flex-start;
}
.notice-item:last-child { border-bottom: none; }
.notice-item:hover { background: var(--bg-alt); }
.notice-item.unread { background: rgba(217, 54, 62, .04); }
.notice-item.unread:hover { background: rgba(217, 54, 62, .08); }
.notice-item.unread .notice-item-title { font-weight: 600; }
.notice-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #D9363E;
    margin-top: 6px;
}
.notice-item-body {
    flex: 1;
    min-width: 0;
}
.notice-item-title {
    font-size: 14px;
    line-height: 1.4;
    color: var(--text);
    word-break: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.notice-item-content {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.4;
    word-break: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.notice-item-meta {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}
.notice-empty,
.notice-loading {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}
.notice-dropdown-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-alt);
    text-align: center;
}
.notice-view-all {
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}
.notice-view-all:hover { text-decoration: underline; }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
    .site-nav { gap: 2px; }
    .site-nav a { padding: 6px 10px; font-size: 14px; }
    .site-nav .nav-login { padding: 6px 14px !important; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .branches-grid { grid-template-columns: 1fr; }
    .branch-card { flex-direction: column; }
    .branch-card-right { flex-direction: row; width: auto; justify-content: space-between; margin-top: 16px; }
    .branch-seal-ornament { width: 56px; height: 56px; }
    .seal-char { font-size: 24px; }
    .branch-stats { gap: 18px; }
    .stat-num { font-size: 18px; }
    .branch-card-footer { flex-direction: column; align-items: flex-start; }
    .news-grid { grid-template-columns: 1fr; }
    .hero-title { font-size: 32px; }
    .hero-seal { width: 80px; height: 80px; font-size: 38px; }
    .admin-panel.cols-2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; min-height: auto; position: relative; }
    .admin-sidebar h2 { padding: 14px; }
    .admin-sidebar a { display: inline-block; width: auto; padding: 8px 14px; border-left: none; border-bottom: 3px solid transparent; }
    .admin-sidebar a.active { border-left: none; border-bottom-color: var(--secondary-light); }
    .admin-main { padding: 16px; }
    .admin-header h1 { font-size: 20px; }
    .member-grid, .member-cards { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .photo-grid, .photos-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .header-inner { flex-direction: column; height: auto; padding: 4px 10px 0; gap: 0; overflow: hidden; } /* 品牌在上、栏目在下 */
    .site-nav { overflow: hidden; max-width: 100%; } /* hidden 防止导航溢出导致滚动 */
    .site-header { overflow: hidden; } /* hidden 防止顶部导航上下滚动 */
    .nav { justify-content: center; overflow: hidden; max-width: 100%; }
}
@media (max-width: 560px) {
    .container { padding: 0 14px; }
    .stats-row { grid-template-columns: 1fr 1fr; }
    .hero-title { font-size: 26px; letter-spacing: 2px; }
    .hero-seal { width: 70px; height: 70px; font-size: 32px; }
    .hero-sub { font-size: 14px; }
    .relation-grid { grid-template-columns: 1fr; }
    .admin-table th, .admin-table td { padding: 8px 10px; font-size: 13px; }
    .brand-text h1 { font-size: 17px; }
    .brand-text span { display: none; }
    .branch-card { padding: 20px; }
    .branch-title { font-size: 18px; }
    .genchar-chip { width: 26px; height: 26px; line-height: 26px; font-size: 14px; }
    .branch-stats { gap: 18px; }
    .stat-num { font-size: 18px; }
    .branch-card-right { width: auto; flex-direction: row; }
    .branch-member-icon svg { width: 32px; height: 32px; }
    
    /* ===== 手机端导航栏优化：品牌在上、栏目在下不换行 ===== */
    .header-inner {
        flex-direction: column;
        height: auto;
        padding: 4px 10px 2px;
        gap: 0;
        flex-wrap: nowrap;
        overflow: hidden;
    }
    /* 浅色导航（族谱树等页面）*/
    .site-header .header-inner {
        flex-direction: column;
        flex-wrap: nowrap;
        padding: 4px 10px 2px;
        gap: 0;
        overflow: hidden;
    }
    /* 品牌行：图章+站名，单行 */
    .brand {
        gap: 6px;
        width: 100%;
        justify-content: flex-start;
        height: 30px;
    }
    .brand-seal {
        width: 24px;
        height: 24px;
        font-size: 16px;
        border-radius: 4px;
    }
    .brand-text h1 { font-size: 15px; line-height: 1; }
    .brand-text span { display: none; }
    /* 栏目行：不换行，横向单行排列 */
    .site-nav {
        gap: 2px;
        flex-wrap: nowrap;
        overflow: hidden;
        width: 100%;
        height: 32px;
        align-items: center;
        justify-content: flex-start;
    }
    .site-nav a {
        padding: 5px 8px;
        font-size: 13px;
        border-radius: 4px;
    }
    .site-nav .nav-login {
        padding: 5px 12px !important;
        font-size: 13px;
        margin-left: 4px;
    }
    .site-nav .user-menu { margin-left: 4px; overflow: visible !important; }
    .site-nav .user-menu-trigger {
        padding: 5px 10px !important;
        font-size: 13px;
        gap: 4px;
        overflow: visible !important; /* 确保未读消息徽章不被裁剪 */
    }
    .site-nav .user-menu-trigger .avatar {
        width: 18px;
        height: 18px;
        font-size: 11px;
    }
    .site-nav .user-menu-trigger .caret { border-width: 4px; }
    .site-nav .user-menu-trigger span:last-child { white-space: nowrap; }

    /* ===== 手机端头像下拉框：不依赖 hover，改用点击切换 ===== */
    /* 屏蔽 hover/focus-within 触发，避免触屏 tap 后焦点丢失导致下拉框瞬间消失 */
    .site-nav .user-menu:hover .user-dropdown,
    .site-nav .user-menu:focus-within .user-dropdown {
        opacity: 0;
        visibility: hidden;
        transform: translateY(-6px);
    }
    /* 仅当 JS 显式添加 .is-open 时才显示 */
    .site-nav .user-menu.is-open .user-dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    .site-nav .user-menu.is-open .user-menu-trigger .caret { transform: rotate(180deg); }

    /* 手机端下拉框：position: fixed 脱离 header overflow 限制，确保在最上层 */
    .site-nav .user-dropdown {
        position: fixed;
        top: 68px; /* 品牌行30 + 栏目行32 + padding 6 */
        right: 10px;
        left: auto;
        min-width: 200px;
        z-index: 99999; /* 手机端最高层，确保在最上层 */
    }
    .site-nav .user-dropdown a {
        padding: 12px 16px;
        font-size: 15px;
        border-radius: 6px;
    }
    .site-nav .user-dropdown .menu-divider {
        margin: 8px 4px;
    }

    /* 深色导航（首页等页面）也做相同处理 */
    .nav .user-menu:hover .user-dropdown,
    .nav .user-menu:focus-within .user-dropdown {
        opacity: 0;
        visibility: hidden;
        transform: translateY(-6px);
    }
    .nav .user-menu.is-open .user-dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    .nav .user-menu.is-open .user-menu-trigger .caret { transform: rotate(180deg); }
    .nav .user-dropdown {
        position: fixed;
        top: 68px; /* 品牌行30 + 栏目行32 + padding 6 */
        right: 10px;
        left: auto;
        min-width: 200px;
        z-index: 99999; /* 手机端最高层，确保在最上层 */
    }
    .nav .user-dropdown a {
        padding: 12px 16px;
        font-size: 15px;
        border-radius: 6px;
    }
    .nav .user-dropdown .menu-divider {
        margin: 8px 4px;
    }
    /* 深色导航（首页等页面）*/
    .logo-seal {
        width: 32px;
        height: 32px;
        font-size: 20px;
        border-width: 1.5px;
    }
    .logo { gap: 6px; }
    .logo-text h1 { font-size: 16px; line-height: 1.1; }
    .logo-text span { display: none; }
    .nav { gap: 1px; }
    .nav a {
        padding: 5px 7px;
        font-size: 13px;
        border-radius: 3px;
    }
    .nav .user-menu { overflow: visible !important; }
    .nav .user-menu-trigger {
        padding: 5px 10px !important;
        font-size: 13px;
        gap: 4px;
        overflow: visible !important; /* 确保未读消息徽章不被裁剪 */
    }
    .nav .user-menu-trigger .avatar {
        width: 18px;
        height: 18px;
        font-size: 11px;
    }
    .nav .user-menu-trigger .caret { border-width: 4px; }

    /* ===== 手机端系统消息铃铛 ===== */
    .site-nav .user-menu > .notice-bell-trigger,
    .nav .user-menu > .notice-bell-trigger {
        top: -6px;
        right: -6px;
        width: 22px;
        height: 22px;
    }
    .site-nav .user-menu > .notice-bell-trigger .bell-icon,
    .nav .user-menu > .notice-bell-trigger .bell-icon { font-size: 12px; }
    .site-nav .user-menu > .notice-bell-trigger .notice-badge,
    .nav .user-menu > .notice-bell-trigger .notice-badge {
        min-width: 14px;
        height: 14px;
        font-size: 9px;
        padding: 0 3px;
    }
    /* 手机端下拉面板：fixed 定位，避开 header overflow:hidden */
    .site-nav .notice-dropdown-panel,
    .nav .notice-dropdown-panel {
        top: 68px;
        right: 10px;
        left: auto;
        width: 300px;
        max-width: calc(100vw - 20px);
        z-index: 99999;
    }
    .notice-list { max-height: 50vh; }
    .notice-item { padding: 10px 14px; }
    .notice-dropdown-header,
    .notice-dropdown-footer { padding: 10px 14px; }

    /* ===== 手机端族谱树优化 ===== */
    /* 头部容器：上8 左右2 下8 的间距 */
    .tree-section { padding: 0 0 40px; }
    .tree-section .container { padding: 0 2px; }
    .tree-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 12px 12px 10px;
        margin: 8px 0 2px 0;
        background: linear-gradient(180deg, #FFFBF5 0%, #FFFFFF 100%);
        border: 1px solid var(--border-light);
        border-radius: 10px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    }
    /* 左侧区域：名称 + 简介 */
    .tree-header-left {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding-bottom: 10px;
        border-bottom: 1px dashed var(--border-light);
    }
    /* 手机端隐藏姓氏图章 */
    .tree-header-left::before {
        display: none !important;
        content: none !important;
    }
    .tree-title {
        font-size: 19px;
        margin-bottom: 4px;
        line-height: 1.3;
    }
    .tree-sub {
        font-size: 13px;
        line-height: 1.5;
        letter-spacing: 0.5px;
    }
    /* 工具栏：更大的触摸区域 */
    .tree-toolbar {
        width: 100%;
        gap: 8px;
        padding: 10px 0 0;
        flex-wrap: wrap;
    }
    .tree-btn {
        flex: 1;
        min-height: 38px;
        padding: 8px 10px;
        font-size: 14px;
        text-align: center;
        justify-content: center;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
    }
    .tree-btn-back {
        flex: 1 0 100%;
        min-height: 40px;
        font-size: 14px !important;
        padding: 8px 12px !important;
    }
    .tree-select {
        flex: 1;
        min-height: 38px;
        padding: 8px 10px;
        font-size: 14px;
        min-width: 0;
        border-radius: 8px;
    }
    .tree-canvas-wrap {
        padding: 10px;
        min-height: 380px;
        max-height: 55vh;
    }
    #tree-svg { min-height: 380px; }
    /* 手机端成员卡片缩小 */
    .member-card { font-size: 11px; }
    .member-card .card-name { font-size: 13px; }
    .member-card .card-bio { font-size: 10px; }
    .card-gen-tag { font-size: 9px; padding: 1px 4px; }
    .card-spouse-tag { font-size: 9px; padding: 1px 4px; }
    .member-card .card-dates { font-size: 9px; }
    .member-card .card-actions { gap: 2px; }
    .member-card .action-btn { width: 20px; height: 20px; font-size: 10px; }
    .tree-legend {
        flex-wrap: wrap;
        gap: 6px;
        font-size: 12px;
        padding: 6px 10px;
    }
    /* ===== 手机端底部统计栏 ===== */
    .site-stats-bar {
        font-size: 12px;
        padding: 8px 10px;
        text-align: center;
        line-height: 1.6;
    }
    /* ===== 手机端页脚 ===== */
    .footer { padding: 16px 0; }
    .footer p { font-size: 12px; }
    /* ===== 手机端弹窗优化 ===== */
    .node-modal-inner {
        padding: 16px;
        width: 94%;
        max-width: 360px;
        max-height: 85vh;
        overflow-y: auto;
    }
    .node-modal-inner h4 { font-size: 17px; margin-bottom: 10px; }
    .node-modal-inner .form-input,
    .node-modal-inner .form-select,
    .node-modal-inner textarea {
        font-size: 16px;
        padding: 7px 10px;
    }
    .node-modal-inner .btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    /* ===== 手机端分支详情页 ===== */
    .branch-banner { padding: 20px 0 30px; }
    .banner-card {
        flex-direction: column;
        text-align: center;
        padding: 18px 20px;
        gap: 14px;
    }
    .banner-seal { width: 56px; height: 56px; font-size: 26px; }
    .banner-title { font-size: 22px; }
    .banner-desc { font-size: 14px; line-height: 1.6; }
    .banner-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    .banner-stat { padding: 14px 8px; }
    .banner-stat-num { font-size: 24px; }
    .banner-stat-label { font-size: 12px; }
    /* ===== 手机端成员页 ===== */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 12px 12px;
        margin-bottom: 14px;
    }
    .filter-bar input,
    .filter-bar select {
        width: 100%;
        padding: 10px 12px;
        font-size: 15px;
        min-height: 40px;
    }
    .filter-bar input { flex: none; min-width: 0; }
    .filter-bar .tag-item {
        display: block;
        text-align: center;
        padding: 8px 12px;
        font-size: 14px;
    }
    .filter-bar .tree-btn {
        display: block;
        width: 100%;
        padding: 10px 12px;
        font-size: 15px;
        text-align: center;
        min-height: 40px;
    }
    .filter-bar .tree-btn:first-of-type { margin-bottom: 6px; }
    .member-grid-compact {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .members-flat-wrap .member-grid-compact {
        grid-template-columns: 1fr;
    }
    .member-card-compact {
        padding: 12px 14px;
        gap: 12px;
        min-height: 56px;
    }
    .member-avatar-gender {
        width: 44px; height: 44px;
        font-size: 20px;
    }
    .member-name-row .member-name { font-size: 15px; }
    .member-card-compact .member-meta { font-size: 12px; }
    .member-card-compact .member-birth { font-size: 11px; }
    .member-card-compact .zi-char { font-size: 12px; }
    .member-grid, .member-cards { grid-template-columns: 1fr; gap: 10px; }
    .photo-grid, .photos-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    /* ===== 手机端页面标题 ===== */
    .page-title { font-size: 18px; margin-bottom: 12px; padding-bottom: 8px; }
    .page-title::after { width: 40px; }
    .section-head h2 { font-size: 17px; }
    .section-head p { font-size: 13px; }
    /* ===== 手机端搜索条 ===== */
    .search-bar input { font-size: 14px; height: 38px; }
    .search-bar button { height: 38px; font-size: 13px; padding: 0 14px; }

    /* ===== 防止iOS Safari点击输入框自动放大页面 =====
         iOS Safari 在输入框字体 < 16px 时会自动放大页面，
         退出输入后不会自动缩回。统一设为 16px 解决此问题。*/
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="number"],
    input[type="tel"],
    input[type="url"],
    input[type="search"],
    input[type="date"],
    input[type="time"],
    input[type="datetime-local"],
    select,
    textarea {
        font-size: 16px !important;
        min-height: 32px;
    }
}

/* ============================================================
   分支详情页
   ============================================================ */

/* Banner 区域 */
.branch-banner {
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
    padding: 40px 0 16px;
}
.banner-card {
    display: flex;
    align-items: center;
    gap: 24px;
    background: #FFFFFF;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 28px 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}
.banner-seal {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    background: var(--primary);
    color: #FFFFFF;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--serif);
    font-size: 32px;
    font-weight: bold;
    box-shadow: 0 4px 14px rgba(158, 32, 32, 0.3);
}
.banner-info { flex: 1; }
.banner-title {
    font-family: var(--serif);
    font-size: 28px;
    color: var(--text);
    margin-bottom: 8px;
}
.banner-desc {
    color: var(--text-light);
    font-size: 15px;
    line-height: 1.8;
}

/* 统计卡片 */
.banner-stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.banner-stat {
    background: #FFFFFF;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 22px 16px;
    text-align: center;
    box-shadow: var(--shadow);
}
.banner-stat-num {
    display: block;
    font-family: var(--serif);
    font-size: 36px;
    color: var(--primary);
    font-weight: bold;
    line-height: 1.1;
}
.banner-stat-label {
    display: block;
    color: var(--text-light);
    font-size: 14px;
    margin-top: 6px;
}

/* 成员贡献排名 */
.banner-ranking {
    background: #FFFFFF;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 16px 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.ranking-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border-light);
}
.ranking-label {
    color: var(--primary);
    font-weight: bold;
    font-size: 15px;
}
.ranking-sub {
    color: var(--text-light);
    font-size: 12px;
}
.ranking-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.ranking-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    background: var(--bg-alt);
    border: 1px solid var(--border-light);
    transition: transform .15s ease, box-shadow .15s ease;
    text-decoration: none;
    cursor: pointer;
}
.ranking-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.ranking-item-link:hover .rank-name {
    color: var(--primary);
}
.ranking-item.rank-1 {
    background: linear-gradient(135deg, #FFF9E6 0%, #FFF0C2 100%);
    border: 1px solid #F5D06B;
    box-shadow: 0 4px 12px rgba(245, 176, 65, 0.25);
}
.ranking-item.rank-2 {
    background: linear-gradient(135deg, #F7F7F7 0%, #ECECEC 100%);
    border: 1px solid #BDC3C7;
    box-shadow: 0 4px 12px rgba(189, 195, 199, 0.25);
}
.ranking-item.rank-3 {
    background: linear-gradient(135deg, #FDF0E6 0%, #F9DFC6 100%);
    border: 1px solid #E8A87C;
    box-shadow: 0 4px 12px rgba(205, 127, 50, 0.25);
}
.ranking-item.rank-1 .rank-name,
.ranking-item.rank-2 .rank-name,
.ranking-item.rank-3 .rank-name {
    color: var(--primary-dark);
    font-weight: 700;
}
.ranking-item.rank-1 .rank-points {
    color: #B7950B;
}
.ranking-item.rank-2 .rank-points {
    color: #7F8C8D;
}
.ranking-item.rank-3 .rank-points {
    color: #A0522D;
}
.rank-name {
    color: var(--text);
    font-weight: 500;
    font-size: 14px;
}
.rank-points {
    color: var(--primary);
    font-weight: bold;
    font-size: 14px;
}
.rank-points em {
    font-style: normal;
    font-size: 11px;
    color: inherit;
    opacity: 0.7;
    font-weight: normal;
    margin-left: 1px;
}
.ranking-empty {
    text-align: center;
    color: var(--text-light);
    padding: 16px;
    font-size: 14px;
}

/* 字辈 */
.banner-generation {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #FFFFFF;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 16px 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.banner-gen-label {
    color: var(--primary);
    font-weight: bold;
    font-size: 15px;
    flex-shrink: 0;
}
.banner-gen-chars {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.banner-gen-char {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-alt);
    color: var(--primary);
    font-family: var(--serif);
    font-size: 18px;
    font-weight: bold;
    border-radius: 6px;
    border: 1px solid var(--border);
}

/* 查看族谱按钮 */
.banner-actions {
    text-align: center;
    margin-bottom: 0;
}
.banner-btn {
    display: inline-block;
    padding: 12px 40px;
    background: var(--primary);
    color: #FFFFFF;
    border-radius: 8px;
    font-size: 15px;
    font-weight: bold;
    box-shadow: 0 4px 14px rgba(158, 32, 32, 0.3);
    transition: all .25s;
}
.banner-btn:hover {
    background: var(--primary-dark);
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(158, 32, 32, 0.4);
}

/* 内容区 */
.branch-content {
    padding: 16px 0 60px;
    background: var(--bg);
}
.content-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    grid-template-rows: auto auto;
    gap: 24px;
    align-items: start;
}
.content-left { grid-column: 1; grid-row: 1; }
.content-right { grid-column: 2; grid-row: 1 / span 2; }
.branch-log-card { grid-column: 1; grid-row: 2; }
.content-left, .content-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0; /* 允许 grid 项收缩到内容以下，防止手机端溢出 */
}

/* 面板卡片 */
.panel-card {
    background: #FFFFFF;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 2px solid var(--bg-alt);
}
.panel-head h3 {
    font-family: var(--serif);
    font-size: 20px;
    color: var(--primary-dark);
}
.panel-more {
    font-size: 13px;
    color: var(--primary);
}
.panel-body {
    padding: 20px 24px;
}

/* 性别统计 */
.gender-stats {
    display: flex;
    gap: 14px;
    font-size: 13px;
}
.gender-male, .gender-female {
    padding: 4px 12px;
    background: var(--bg-alt);
    border-radius: 14px;
}
.gender-male { color: var(--primary); }
.gender-female { color: #B85C7C; }
.gender-stats strong {
    font-weight: bold;
    font-size: 14px;
    margin-left: 2px;
}

/* 世代成员 */
.gen-block {
    padding: 12px 0;
    border-bottom: 1px dashed var(--border);
}
.gen-block:last-child {
    border-bottom: none;
}
.gen-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.gen-title {
    font-family: var(--serif);
    font-size: 16px;
    color: var(--primary);
    font-weight: bold;
}
.gen-count {
    font-size: 13px;
    color: var(--text-light);
}
.gen-toggle {
    margin-left: auto;
    font-size: 13px;
    color: var(--primary);
    cursor: pointer;
}
.gen-members {
    font-size: 14px;
    max-height: 30px;
    overflow: hidden;
    transition: max-height .3s ease;
}
.gen-members.expanded {
    max-height: none;
    overflow: visible;
}
/* 成员列表页：胶囊式折叠高度（显示约 2 行） */
.gen-members.gen-members-grid {
    max-height: 60px;
}
.gen-members.gen-members-grid.expanded {
    max-height: none;
}
.member-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.member-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 14px;
    font-size: 13px;
    text-decoration: none;
    line-height: 1.4;
    transition: background .15s, border-color .15s;
}
.member-pill.pill-male {
    background: #F1DFD6;
    color: #7A1818;
    border: 1px solid #E5C6B8;
}
.member-pill.pill-male:hover {
    background: #E8CEC2;
}
.member-pill.pill-female {
    background: #F2E8CE;
    color: #8A6520;
    border: 1px solid #E5D7B0;
}
.member-pill.pill-female:hover {
    background: #E8DAB8;
}

/* 相册缩略图 */
.photo-thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.photo-thumb-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-alt);
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform .2s, box-shadow .2s;
}
a.photo-thumb-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}
.photo-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.photo-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-muted);
}
.photo-thumb-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4px 6px;
    background: rgba(0,0,0,0.5);
    color: #FFFFFF;
    font-size: 12px;
    text-align: center;
}

/* 公告列表 */
.branch-announce-list {
    list-style: none;
}
.branch-announce-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border);
    flex-wrap: wrap;
}
.branch-announce-list li:last-child {
    border-bottom: none;
}
.ann-cat {
    font-size: 12px;
    color: var(--primary);
    background: var(--bg-alt);
    padding: 2px 8px;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
}
.ann-title {
    color: var(--text);
    font-size: 14px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ann-title:hover { color: var(--primary); }

/* 分支详情响应式 */
@media (max-width: 900px) {
    /* 手机端单列：content-left → content-right → branch-log-card（日志在最下方） */
    .content-grid {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    .content-left, .content-right {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    .banner-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    .banner-stat { padding: 14px 8px; }
    .banner-stat-num { font-size: 24px; }
    .banner-stat-label { font-size: 12px; }
    .banner-card { flex-direction: column; text-align: center; }
    .photo-thumbs { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
    .banner-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .banner-stat { padding: 12px 6px; }
    .banner-stat-num { font-size: 20px; }
    .banner-stat-label { font-size: 11px; }
    .photo-thumbs { grid-template-columns: repeat(2, 1fr); }
    .banner-title { font-size: 22px; }
    .banner-seal { width: 56px; height: 56px; font-size: 26px; }

    /* 手机端面板内边距收紧 */
    .panel-head { padding: 12px 14px; }
    .panel-head h3 { font-size: 16px; }
    .panel-body { padding: 10px 12px; }
    .branch-log-card .panel-body { padding: 6px 10px 10px; }

    /* 日志项：触屏版 - 时间+用户第一行，描述独占第二行
       使用 .branch-log-card 父级提升特异性（0,3,0），覆盖桌面端 .branch-log-item .xxx（0,2,0） */
    .branch-log-card .branch-log-list .branch-log-item {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 2px 6px;
        padding: 10px 4px;
        border-bottom: 1px dashed rgba(0,0,0,0.08);
    }
    .branch-log-card .branch-log-list .log-time {
        width: auto;
        min-width: 0;
        flex: 0 1 auto;
        font-size: 11px;
        color: var(--text-light);
        white-space: normal;
        word-break: break-all;
    }
    .branch-log-card .branch-log-list .log-user {
        font-size: 12px;
        white-space: normal;
        flex: 1 1 auto;
        min-width: 0;
        word-break: break-all;
    }
    .branch-log-card .branch-log-list .log-desc {
        flex: 1 1 100%;
        min-width: 0;
        font-size: 13px;
        line-height: 1.6;
        white-space: normal;
        padding-top: 3px;
        /* 覆盖桌面端 inline-flex + 截断，改为块级让 icon/文字/pts 自然换行 */
        display: block;
        overflow: visible;
        text-overflow: clip;
        word-break: break-word;
    }
    .branch-log-card .branch-log-list .log-icon {
        font-size: 14px;
        vertical-align: middle;
        margin-right: 2px;
    }
    .branch-log-card .branch-log-list .log-pts {
        font-size: 11px;
        padding: 1px 6px;
        margin-left: 4px;
        display: inline-block;
        vertical-align: middle;
        white-space: nowrap;
    }
    /* 查看更多日志按钮：全宽触屏友好 */
    .branch-log-card .panel-foot {
        padding: 12px 14px !important;
    }
    .branch-log-card .view-more-logs-btn {
        display: block;
        width: 100%;
        padding: 10px 16px;
        font-size: 14px;
        text-align: center;
        min-height: 40px;
        line-height: 24px;
        border-radius: 6px;
    }

    /* 动态列表项：缩略图缩小，文字区收缩 */
    .branch-feed-list .branch-feed-item { flex-wrap: wrap; }
    .branch-feed-list .feed-thumb { width: 56px; height: 42px; }
    .branch-feed-list .feed-info { flex: 1 1 calc(100% - 68px); min-width: 0; }
    .branch-feed-list .feed-title { font-size: 14px; }

    /* 管理员项：允许换行 */
    .admin-item { flex-wrap: wrap; gap: 8px; }
    .admin-info { flex: 1 1 calc(100% - 52px); min-width: 0; }

    /* 生日预告项：已有 flex-wrap，收紧间距 */
    .bd-tip-link { padding: 8px 2px; gap: 4px 6px; }
    .bd-tip-name { max-width: 70px; }

    /* 排名项：缩小 */
    .ranking-item { padding: 6px 8px; font-size: 13px; }
    .ranking-item .rank-points em { font-size: 11px; }

    /* 字辈编辑面板输入框收缩 */
    .gen-edit-add input { width: 100%; }
    .gen-edit-inner { padding: 14px 12px; }

    /* 成员列表页：胶囊式移动端优化 */
    .member-pills { gap: 5px; }
    .member-pill {
        padding: 3px 8px;
        font-size: 12px;
        border-radius: 12px;
    }
    .gen-members.gen-members-grid { max-height: 60px; }

    /* 底部统计与版权：手机端紧凑显示 */
    .site-footer { padding: 18px 0; }
    .footer-inner p { font-size: 12px; line-height: 1.6; }
    .site-stats-bar {
        padding: 8px 10px;
        font-size: 11px;
        line-height: 1.8;
        word-break: break-all;
    }
}

/* ============================================================
   族谱树页面
   ============================================================ */

.tree-section {
    background: var(--bg);
    padding: 30px 0 60px;
    overflow: hidden;
}

.tree-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 24px;
}
.tree-header-left {
    display: flex;
    flex-direction: column;
}
.tree-title {
    font-family: var(--serif);
    font-size: 30px;
    color: var(--primary-dark);
    margin-bottom: 4px;
}
.tree-sub {
    color: var(--text-light);
    font-size: 14px;
    letter-spacing: 2px;
}

.tree-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.tree-select {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #FFFFFF;
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    outline: none;
    transition: border-color .2s;
}
.tree-select:focus, .tree-select:hover {
    border-color: var(--primary);
}
.tree-btn {
    padding: 8px 18px;
    border: 1px solid var(--primary);
    border-radius: 6px;
    background: #FFFFFF;
    color: var(--primary);
    font-size: 13px;
    cursor: pointer;
    transition: all .2s;
}
.tree-btn:hover {
    background: var(--primary);
    color: #FFFFFF;
}
/* 返回家族首页按钮：主色填充，突出显示 */
.tree-btn-back {
    background: var(--primary);
    color: #FFFFFF;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.tree-btn-back:hover {
    background: var(--primary-dark);
    color: #FFFFFF;
}
/* 申请加入家族按钮：标题内显示，主色填充，较小字号 */
.tree-btn-join {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-left: 12px;
    padding: 4px 12px;
    border: 1px solid var(--primary);
    border-radius: 20px;
    background: var(--primary);
    color: #FFFFFF;
    font-size: 12px;
    font-family: var(--sans);
    cursor: pointer;
    text-decoration: none;
    transition: all .2s;
    line-height: 1.5;
}
.tree-btn-join:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #FFFFFF;
}
/* 审核中标签：标题内显示的灰色徽章 */
.tree-join-tag {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-left: 12px;
    padding: 3px 10px;
    border-radius: 20px;
    background: #fff8e1;
    color: #8a6d3b;
    font-size: 12px;
    font-family: var(--sans);
    border: 1px solid #ffe082;
}

/* ===== 默认 PC 端：card-layer 隐藏，防止空容器拦截 SVG 鼠标事件 ===== */
#tree-card-layer {
    display: none;
    touch-action: none;
}

/* 画布 */
.tree-canvas-wrap {
    background: #FFFFFF;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    overflow: hidden;
    position: relative;
    width: 100%;
    max-width: 100%;
    min-height: 500px;
    max-height: 80vh;
    touch-action: none;
}
#tree-svg {
    display: block;
    min-height: 500px;
    margin: 0 auto;
    touch-action: none;
}

/* 树连线 - 正交折线样式 */
.tree-link {
    fill: none;
    stroke: #B06A4A;
    stroke-width: 1.5px;
}
.tree-spouse-link {
    fill: none;
    stroke: #B06A4A;
    stroke-width: 1.5px;
}
.tree-spouse-label {
    fill: #FFFFFF;
    font-size: 12px;
    font-weight: bold;
    font-family: var(--serif);
    pointer-events: none;
}

/* SVG连线容器 */
#tree-svg path {
    stroke-linecap: butt;
    stroke-linejoin: miter;
}

/* 成员卡片（族谱树专用 - 限定在 tree-canvas-wrap 内） */
.tree-canvas-wrap .member-card {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    padding: 0;
    display: block;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
    position: relative;
    box-sizing: border-box;
    overflow: visible;
    background: #FFFBF5;
}
.tree-canvas-wrap .member-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(176, 106, 74, 0.22);
}
/* 男性卡片：淡米色底 + 古铜棕细边 */
.tree-canvas-wrap .member-card.card-male {
    background: #FFFBF5;
    border: 1.5px solid #B07A56;
    box-shadow: 0 2px 6px rgba(176, 106, 74, 0.08);
    color: #5A2C1A;
}
/* 女性卡片：淡粉米色底 + 淡粉红细边 */
.tree-canvas-wrap .member-card.card-female {
    background: #FFFBF5;
    border: 1.5px solid #D9A7A7;
    box-shadow: 0 2px 6px rgba(217, 167, 167, 0.08);
    color: #6B3A3A;
}
/* 始祖/根卡片：朱红底 + 金边 */
.tree-canvas-wrap .member-card.card-root {
    background: linear-gradient(135deg, #9E2020 0%, #7A1818 100%);
    border: 2px solid #C49A6C;
    box-shadow: 0 4px 14px rgba(158, 32, 32, 0.35);
    color: #FFFFFF;
}
.tree-canvas-wrap .member-card.dimmed {
    opacity: 0.3;
    filter: grayscale(60%);
}

/* 卡片内容排版 */
.card-content {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 6px 8px 8px;
    box-sizing: border-box;
    text-align: center;
}

/* 左上角：第几世 胶囊标签 */
.card-gen-tag {
    position: absolute;
    top: 6px;
    left: 6px;
    background: #B06A4A;
    color: #FFFFFF;
    font-size: 10px;
    line-height: 1;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
    font-family: var(--sans);
    letter-spacing: 0.3px;
    z-index: 2;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.card-female .card-gen-tag {
    background: #C87979;
}
.card-gen-tag-root {
    background: #C49A6C;
    color: #3D1515;
    font-weight: 700;
}

/* 右上角：性别符号 ♂ ♀ */
.card-gender {
    position: absolute;
    top: 3px;
    right: 5px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    font-weight: bold;
    z-index: 2;
    font-family: "Segoe UI Symbol", "Symbola", sans-serif;
}
.card-gender-male {
    color: #4A7BA0;
    background: rgba(74, 123, 160, 0.08);
    border: 1px solid rgba(74, 123, 160, 0.3);
}
.card-gender-female {
    color: #D98FA0;
    background: rgba(217, 143, 160, 0.08);
    border: 1px solid rgba(217, 143, 160, 0.3);
}

/* 中央姓名 */
.card-name {
    font-family: var(--serif);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    line-height: 1.1;
    margin-top: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.card-root .card-name {
    color: #FFFFFF;
    font-size: 16px;
    letter-spacing: 3px;
    margin-top: 18px;
}

/* 字辈字符：姓名下方单独大字辈 */
.card-gen-char {
    font-family: var(--serif);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.1;
    margin-top: 2px;
    opacity: 0.7;
    letter-spacing: 1px;
}
.card-root .card-gen-char {
    color: #F1DDB0;
}
.card-gen-label {
    font-size: 9px;
    opacity: 0.6;
    margin-right: 3px;
    font-weight: 400;
}

/* 生卒日期：生辰 / 卒年分两行 */
.card-dates {
    font-size: 10px;
    line-height: 1.2;
    margin-top: 4px;
    opacity: 0.75;
    font-family: var(--sans);
    text-align: center;
    width: 100%;
}
.card-birth {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.card-death {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    margin-top: 1px;
}
.card-root .card-dates {
    color: #F1DDB0;
}

/* 字号行：独立一行显示，与日期互不遮挡 */
.card-zi {
    font-family: var(--serif);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    margin-top: 2px;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    letter-spacing: 0.5px;
}
.card-zi-label {
    font-size: 9px;
    opacity: 0.6;
    margin-right: 3px;
    font-weight: 400;
}

/* 日期行前缀"生"字 */
.card-date-label {
    font-size: 9px;
    opacity: 0.6;
    margin-right: 3px;
    font-weight: 400;
}

/* 右下角"故"字标记（已去世） */
.card-death-mark {
    position: absolute;
    bottom: 4px;
    right: 5px;
    background: #8B4543;
    color: #FFFFFF;
    font-size: 11px;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 3px;
    font-weight: 700;
    font-family: var(--serif);
    letter-spacing: 1px;
    z-index: 2;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.card-female .card-death-mark {
    background: #9E4A4A;
}
.card-root .card-death-mark {
    background: rgba(139, 69, 67, 0.85);
}

/* 兼容旧类名（避免其他页面引用时出错） */
.card-header {
    display: none;
}
.card-gen-badge {
    display: none;
}

/* 图例 */
.tree-legend {
    position: absolute;
    right: 24px;
    bottom: 16px;
    display: flex;
    gap: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    font-size: 12px;
    color: var(--text-light);
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.legend-male, .legend-female, .legend-spouse {
    width: 16px;
    height: 12px;
    border-radius: 3px;
}
.legend-male {
    background: linear-gradient(135deg, #E8A87C, #C49A6C);
    border: 1px solid var(--primary);
}
.legend-female {
    background: linear-gradient(135deg, #F5E6D3, #E8D5B7);
    border: 1px solid var(--secondary);
}
.legend-spouse {
    background: var(--primary);
    border-radius: 1px;
}

/* 节点详情弹窗 */
.node-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.node-modal-inner {
    background: #FFFFFF;
    border-radius: 12px;
    width: 360px;
    max-width: 90%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}
.node-modal-close {
    position: absolute;
    top: 12px; right: 14px;
    font-size: 22px;
    color: var(--text-muted);
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
}
.node-modal-close:hover { color: var(--text); }

/* 锚定到成员卡附近时的弹窗定位（覆盖默认的 flex 居中） */
.node-modal.modal-anchored {
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0;
}
.node-modal.modal-anchored .node-modal-inner {
    margin: 0;
}

.modal-card-head {
    padding: 28px 24px 20px;
    text-align: center;
    position: relative;
}
.modal-card-head.head-male {
    background: linear-gradient(135deg, #E8A87C 0%, #C49A6C 100%);
    color: #FFFFFF;
}
.modal-card-head.head-female {
    background: linear-gradient(135deg, #F5E6D3 0%, #E8D5B7 100%);
    color: var(--text);
}
.modal-card-head h4 {
    font-family: var(--serif);
    font-size: 24px;
    margin-bottom: 6px;
}
.modal-gen {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.35);
}
.node-info {
    list-style: none;
    padding: 16px 24px;
    margin: 0;
}
.node-info li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
    color: var(--text);
    display: flex;
    gap: 8px;
}
.node-info li:last-child { border-bottom: none; }
.info-label {
    color: var(--text-muted);
    flex-shrink: 0;
    min-width: 50px;
}
.node-modal .btn {
    display: block;
    margin: 0 24px 24px;
    text-align: center;
}

/* 响应式 */
@media (max-width: 900px) {
    .tree-header { flex-direction: column; align-items: flex-start; }
    .tree-legend { position: fixed; bottom: 0; left: 0; right: 0; margin: 0; z-index: 100; border-radius: 0; justify-content: center; }
    /* ===== 手机端：边框显示在卡片/配字之上，但不超过导航（z-index < 导航 10000）===== */
    .tree-canvas-wrap::after {
        content: '';
        position: absolute;
        top: 0; left: 0; right: 0; bottom: 0;
        border: 1px solid var(--border-light);
        border-radius: var(--radius);
        pointer-events: none;
        z-index: 10;
    }
}
@media (max-width: 560px) {
    .tree-title { font-size: 19px; }
    .tree-sub { font-size: 12px; letter-spacing: 0.5px; }
    .tree-toolbar { gap: 6px; }
    .tree-select { padding: 8px 10px; font-size: 14px; }
    .tree-btn { padding: 8px 10px; font-size: 14px; }
    .tree-section { padding: 0 0 30px; }
    .tree-canvas-wrap { padding: 0; min-height: 400px; max-height: 65vh; position: relative; }
    /* ===== 手机端 z-index 层级：卡片在连线之上 =====
         用户要求：成员卡片在画线的上一层（卡片盖住进入卡内的线段，
         线条视觉上「连接到」卡片边缘而非穿过卡片）。
         cardLayer z-index:2（上层） — 卡片在上
         SVG      z-index:1（下层） — 连线 + 配字在底
         SVG 设 pointer-events:none 不拦截触摸 → 手势由 wrap 上的 IIFE 统一处理，
         卡片点击不受影响（cardLayer 容器 pe:none，但 .tree-card-absolute pe:auto）。*/
    #tree-svg { min-height: 400px; position: relative; z-index: 1; pointer-events: none; }
    /* 手机端：绝对定位 HTML 卡片层（替代 SVG foreignObject，兼容 iOS Safari）*/
    #tree-card-layer {
        display: block !important; /* 覆盖全局的 display:none */
        position: absolute;
        top: 0;
        left: 0;
        /* ===== 修复：改为 100% 覆盖整个 wrap，宽高为 0 会导致移动端浏览器坐标计算异常 ===== */
        width: 100%;
        height: 100%;
        pointer-events: none;
        transform-origin: 0 0;
        z-index: 2;
        overflow: visible;
    }
    #tree-card-layer .tree-card-absolute {
        position: absolute;
        pointer-events: auto;
        width: 96px;
        height: 76px;
        box-sizing: border-box;
        /* ===== 修复：设置为 relative，让内部操作按钮以此容器为定位基准 ===== */
        position: absolute; /* 确保 absolute 定位 */
    }
    /* ===== 新增：手机端操作按钮容器必须有 relative，作为内部 absolute 按钮的定位上下文 ===== */
    #tree-card-layer .card-action-btns-dom {
        position: absolute;
        left: 0;
        top: 0;
        /* 扩展容器尺寸，让卡片外的方向按钮（4方向添加）不会被裁剪 */
        width: 96px;
        height: 76px;
        overflow: visible;
        pointer-events: auto;
        z-index: 10;
    }
    /* ===== 新增：手机端 member-card 需占满父容器（否则会比外层小，按钮错位）===== */
    #tree-card-layer .tree-card-absolute > .member-card {
        width: 100% !important;
        height: 100% !important;
        display: block !important;
    }
    /* 手机端：foreignObject 内卡片强制固定像素尺寸 + box-sizing: border-box
       真实手机 DPR 缩放下，width:100% 会让 foreignObject 内部 HTML 参考系错乱，
       导致所有卡片堆在 SVG 左上角 (0,0)。改为固定像素 96×76 与 JS 端 NODE_W/NODE_H 严格对齐。 */
    .tree-canvas-wrap .member-card {
        width: 96px !important;
        height: 76px !important;
        box-sizing: border-box !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .tree-canvas-wrap .member-card .card-content {
        padding: 3px 5px 4px !important;
        box-sizing: border-box !important;
    }
    /* 手机端：压缩各元素间距，确保姓名/字辈/字号/生日全部显示 */
    .tree-canvas-wrap .member-card .card-name { font-size: 12px !important; margin-top: 14px !important; letter-spacing: 1px !important; }
    .tree-canvas-wrap .member-card .card-gen-char { font-size: 10px !important; margin-top: 1px !important; }
    .tree-canvas-wrap .member-card .card-zi { font-size: 9px !important; margin-top: 1px !important; }
    .tree-canvas-wrap .member-card .card-dates { font-size: 8px !important; margin-top: 2px !important; }
    .tree-canvas-wrap .member-card .card-gen-tag { font-size: 8px !important; padding: 2px 5px !important; top: 4px !important; left: 4px !important; }
    .tree-canvas-wrap .member-card .card-gender { top: 2px !important; right: 3px !important; width: 14px !important; height: 14px !important; font-size: 9px !important; line-height: 14px !important; }

    /* ===== 手机端弹窗：底部抽屉式（独立于PC端）===== */
    /* PC端 .node-modal 是 flex 居中，手机端改为底部弹出 */
    .node-modal {
        align-items: flex-end !important;
        justify-content: center !important;
        padding: 0 !important;
    }
    .node-modal.modal-anchored {
        align-items: flex-end !important;
        justify-content: center !important;
        padding: 0 !important;
    }
    .node-modal-inner {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 80vh !important;
        border-radius: 16px 16px 0 0 !important;
        padding: 16px 14px 20px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.2) !important;
        margin: 0 !important;
    }
    .node-modal-close {
        top: 10px !important;
        right: 12px !important;
        font-size: 26px !important;
        width: 36px !important;
        height: 36px !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    /* 抽屉顶部拖拽指示条 */
    .node-modal-inner::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: #ddd;
        border-radius: 2px;
        margin: 0 auto 12px;
    }
    /* 表单两列改一列 */
    .node-modal-inner .form-row-2col {
        flex-direction: column !important;
        gap: 6px !important;
    }
    .node-modal-inner .form-row-2col > div {
        gap: 3px !important;
    }
    /* 表单输入框触屏友好 */
    .node-modal-inner .form-input,
    .node-modal-inner .form-textarea {
        font-size: 15px !important;
        padding: 9px 12px !important;
        min-height: 44px;
    }
    .node-modal-inner .form-textarea { min-height: 60px; }
    .node-modal-inner .form-label {
        font-size: 13px !important;
    }
    /* 性别单选按钮触屏友好 */
    .node-modal-inner .form-radio {
        font-size: 14px !important;
        gap: 6px !important;
    }
    .node-modal-inner .form-radio input[type="radio"] {
        width: 18px !important;
        height: 18px !important;
    }
    /* 操作按钮触屏友好 */
    .node-modal-inner .form-row-actions {
        gap: 12px !important;
        padding-top: 10px !important;
    }
    .node-modal-inner .btn {
        padding: 12px 18px !important;
        font-size: 15px !important;
        min-height: 44px;
        flex: 1;
        justify-content: center;
    }
    /* 头部区域 */
    .node-modal-inner .add-modal-head {
        padding-bottom: 8px !important;
        margin-bottom: 10px !important;
    }
    .node-modal-inner .add-modal-head h4 {
        font-size: 18px !important;
    }
    .node-modal-inner .add-modal-sub {
        font-size: 13px !important;
    }
    /* gen-text 世代字辈显示 */
    .node-modal-inner .gen-text {
        min-height: 36px !important;
        font-size: 14px !important;
        padding: 7px 10px !important;
    }
    /* 消息提示 */
    .node-modal-inner .add-modal-msg {
        font-size: 13px !important;
        padding: 8px 12px !important;
        margin-bottom: 10px !important;
    }
    /* 详情卡片头部 */
    .node-modal-inner .modal-card-head {
        padding: 20px 16px 14px !important;
    }
    .node-modal-inner .modal-card-head h4 {
        font-size: 20px !important;
    }
    .node-modal-inner .node-info {
        padding: 12px 0 !important;
    }
    .node-modal-inner .node-info li {
        font-size: 14px !important;
        padding: 6px 0 !important;
    }
}

/* ===== 561-900px 中端断点：启用手机端卡片结构 + 连线对齐 =====
   之前 (max-width:560px) 才开 #tree-card-layer / member-card 96×76，
   (max-width:900px) 又开 .tree-canvas-wrap position:relative 但没配套 cardLayer，
   导致 JS isMobile=真（≤900）却拿不到 CSS 写死的 96×76 固定卡片尺寸，
   卡片按 PC 默认尺寸渲染，与 96×76 的连线锚点严重错位。
   修复：把 wrap 相对定位、cardLayer 显示、96×76 卡片固定像素这一整套前移到 ≤900px。 */
@media (min-width: 561px) and (max-width: 900px) {
    .tree-section { padding: 0 0 30px; }
    .tree-canvas-wrap { padding: 0; min-height: 400px; max-height: 65vh; position: relative; }
    #tree-svg { min-height: 400px; position: relative; z-index: 1; pointer-events: none; }
    #tree-card-layer {
        display: block !important;
        position: absolute;
        top: 0; left: 0;
        width: 100%; height: 100%;
        pointer-events: none;
        transform-origin: 0 0;
        z-index: 2;
        overflow: visible;
    }
    #tree-card-layer .tree-card-absolute {
        position: absolute;
        pointer-events: auto;
        width: 96px; height: 76px;
        box-sizing: border-box;
    }
    #tree-card-layer .card-action-btns-dom {
        position: absolute;
        left: 0; top: 0;
        width: 96px; height: 76px;
        overflow: visible;
        pointer-events: auto;
        z-index: 10;
    }
    #tree-card-layer .tree-card-absolute > .member-card {
        width: 100% !important;
        height: 100% !important;
        display: block !important;
    }
    .tree-canvas-wrap .member-card {
        width: 96px !important; height: 76px !important;
        box-sizing: border-box !important;
        padding: 0 !important; margin: 0 !important;
    }
    .tree-canvas-wrap .member-card .card-content {
        padding: 3px 5px 4px !important;
        box-sizing: border-box !important;
    }
    .tree-canvas-wrap .member-card .card-name { font-size: 12px !important; margin-top: 14px !important; letter-spacing: 1px !important; }
    .tree-canvas-wrap .member-card .card-gen-char { font-size: 10px !important; margin-top: 1px !important; }
    .tree-canvas-wrap .member-card .card-zi { font-size: 9px !important; margin-top: 1px !important; }
    .tree-canvas-wrap .member-card .card-dates { font-size: 8px !important; margin-top: 2px !important; }
    .tree-canvas-wrap .member-card .card-gen-tag { font-size: 8px !important; padding: 2px 5px !important; top: 4px !important; left: 4px !important; }
    .tree-canvas-wrap .member-card .card-gender { top: 2px !important; right: 3px !important; width: 14px !important; height: 14px !important; font-size: 9px !important; line-height: 14px !important; }
}

/* ============================================================
   分支动态 - 列表页 / 详情页 / 弹窗 / 目录管理
   ============================================================ */

/* ---- 分支主页：动态列表（替换原公告列表） ---- */
.branch-feed-list { list-style: none; padding: 0; margin: 0; }
.branch-feed-list .branch-feed-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border);
    align-items: flex-start;
}
.branch-feed-list .branch-feed-item:last-child { border-bottom: none; }
.branch-feed-list .feed-thumb {
    flex-shrink: 0;
    width: 64px; height: 48px;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg-alt);
}
.branch-feed-list .feed-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.branch-feed-list .feed-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.branch-feed-list .feed-cat {
    align-self: flex-start;
    font-size: 11px;
    color: var(--primary);
    background: var(--bg-alt);
    padding: 1px 6px;
    border-radius: 3px;
    white-space: nowrap;
}
.branch-feed-list .feed-title {
    color: var(--text);
    font-size: 14px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.branch-feed-list .feed-title:hover { color: var(--primary); }
.branch-feed-list .feed-meta {
    font-size: 12px;
    color: var(--text-light);
}

/* ---- 动态列表页头部 ---- */
.feed-page-head {
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    padding: 18px 0 20px;
}
.feed-page-head .back-link {
    display: inline-block;
    color: var(--text-light);
    font-size: 13px;
    text-decoration: none;
    margin-bottom: 10px;
}
.feed-page-head .back-link:hover { color: var(--primary); }
.feed-head-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.feed-page-title {
    margin: 0;
    color: var(--primary-dark);
    font-family: var(--serif);
    font-size: 24px;
}
.feed-page-sub {
    margin: 4px 0 0;
    color: var(--text-light);
    font-size: 13px;
}
.feed-publish-btn {
    flex-shrink: 0;
    padding: 9px 20px;
    font-size: 14px;
}

/* ---- 动态列表页主体 ---- */
.feed-page-main { padding: 22px 0 40px; }

/* 分类目录筛选条 */
.feed-cat-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.feed-cat-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
}
.feed-cat-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #FFFFFF;
    color: var(--text);
    font-size: 13px;
    text-decoration: none;
    transition: all .15s ease;
}
.feed-cat-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.feed-cat-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #FFFFFF;
}
.feed-cat-count {
    font-size: 11px;
    background: rgba(0,0,0,0.08);
    padding: 0 6px;
    border-radius: 10px;
    line-height: 16px;
}
.feed-cat-tab.active .feed-cat-count {
    background: rgba(255,255,255,0.25);
}
.feed-cat-mgr-btn { flex-shrink: 0; }

/* 动态卡片列表 */
.feed-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.feed-card {
    display: flex;
    gap: 18px;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow .2s ease, border-color .2s ease;
}
.feed-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    border-color: var(--primary);
}
.feed-card-cover {
    flex-shrink: 0;
    width: 200px;
    height: 150px;
    overflow: hidden;
    background: var(--bg-alt);
}
.feed-card-cover img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}
.feed-card:hover .feed-card-cover img { transform: scale(1.04); }
.feed-card-body {
    flex: 1;
    padding: 16px 22px 14px 22px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.feed-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.feed-card-head .feed-cat {
    font-size: 12px;
    color: var(--primary);
    background: var(--bg-alt);
    padding: 2px 8px;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
}
.feed-card-head h3 {
    margin: 0;
    font-size: 17px;
    color: var(--text);
    font-family: var(--serif);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.feed-card-head a:hover h3 { color: var(--primary); }
.feed-card-summary {
    margin: 0 0 10px;
    color: var(--text-light);
    font-size: 13px;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.feed-card-meta {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
    color: var(--text-light);
}
/* 操作按钮 */
.feed-card-actions {
    margin-left: auto;
    display: flex;
    gap: 6px;
}
.feed-act-btn {
    border: 1px solid var(--border);
    background: #FFFFFF;
    color: var(--text-light);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all .15s;
}
.feed-edit-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.feed-del-btn:hover {
    border-color: var(--red);
    color: var(--red);
}
/* 分页 */
.feed-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 28px;
    flex-wrap: wrap;
}
.feed-page-btn {
    display: inline-block;
    min-width: 34px;
    height: 34px;
    line-height: 34px;
    padding: 0 10px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text);
    background: #FFFFFF;
    text-decoration: none;
    transition: all .15s;
}
.feed-page-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.feed-page-current {
    background: var(--primary);
    color: #FFFFFF !important;
    border-color: var(--primary);
    font-weight: bold;
}
.feed-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-light);
    background: #FFFFFF;
    border: 1px dashed var(--border);
    border-radius: 8px;
}

/* ---- 通用弹窗 ---- */
.feed-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.feed-modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
}
.feed-modal-box {
    position: relative;
    background: var(--bg-ancient, #F5EEDC);
    border-radius: 8px;
    width: 90%;
    max-width: 820px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.feed-modal-box-sm { max-width: 540px; }
.feed-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: #FFFFFF;
}
.feed-modal-head h3 {
    margin: 0;
    color: var(--primary-dark);
    font-family: var(--serif);
    font-size: 18px;
}
.feed-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: var(--text-light);
    cursor: pointer;
    padding: 0 4px;
}
.feed-modal-close:hover { color: var(--primary); }
.feed-modal-body {
    padding: 18px 20px;
    overflow-y: auto;
    flex: 1;
}

/* ---- 发布表单 ---- */
.feed-form-row { margin-bottom: 14px; }
.feed-form-row > label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
}
.feed-form-row .req { color: var(--primary); }
.feed-form-row input[type="text"],
.feed-form-row select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #FFFFFF;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
}
.feed-form-row input[type="text"]:focus,
.feed-form-row select:focus {
    border-color: var(--primary);
}
.feed-form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 18px;
}
.cover-upload-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.cover-preview {
    display: inline-flex;
    align-items: center;
}
.cover-preview img {
    width: 48px; height: 36px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid var(--border);
}
.cover-preview .uploading {
    font-size: 12px;
    color: var(--text-light);
}
.cover-clear {
    color: var(--primary) !important;
    font-size: 16px;
    padding: 0 4px !important;
}

/* 富文本编辑器容器 */
.feed-editor-wrap {
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    background: #FFFFFF;
}
#feedToolbar {
    border-bottom: 1px solid var(--border);
    background: #FFFFFF;
}
#feedEditor {
    min-height: 280px;
    max-height: 420px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
#feedEditor .w-e-text-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}
#feedEditor .w-e-scroll {
    flex: 1;
    display: flex;
    flex-direction: column;
}
#feedEditor [data-slate-editor] {
    flex: 1;
    min-height: 100%;
}
#feedEditor p { margin: 0.5em 0; line-height: 1.75; }
#feedEditor img { max-width: 100%; height: auto; border-radius: 4px; }

/* 表单操作区 */
.feed-form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
.feed-form-msg { font-size: 13px; color: var(--text-light); }
.feed-form-msg.ok { color: #27AE60; }
.feed-form-msg.err { color: #E74C3C; }

/* ---- 分类目录管理弹窗 ---- */
.cat-add-row {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    align-items: center;
    flex-wrap: wrap;
}
.cat-add-row input {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #FFFFFF;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
}
.cat-add-row input:first-child { flex: 1; min-width: 180px; }
.cat-add-row input:focus { border-color: var(--primary); }
.cat-mgr-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.cat-mgr-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border);
}
.cat-mgr-item:last-child { border-bottom: none; }
.cat-mgr-name {
    flex: 1;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
}
.cat-mgr-count {
    font-size: 12px;
    color: var(--text-light);
}
.cat-mgr-ops {
    display: flex;
    gap: 4px;
}
.cat-mgr-ops .cat-del { color: #C0392B !important; }
.cat-mgr-ops .cat-del:hover { color: #E74C3C !important; }
.cat-empty {
    padding: 20px 0;
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
}
.cat-mgr-tip {
    margin: 12px 0 0;
    padding: 8px 12px;
    background: rgba(158,32,32,0.05);
    border-left: 3px solid var(--primary);
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.6;
}

/* ---- 动态详情页 ---- */
.feed-detail-page { padding: 22px 0 40px; max-width: 880px; }
.feed-crumb {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 18px;
}
.feed-crumb a {
    color: var(--text-light);
    text-decoration: none;
}
.feed-crumb a:hover { color: var(--primary); }
.feed-crumb .sep { margin: 0 6px; }
.feed-crumb .current { color: var(--text); }

.feed-detail-card {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 28px 34px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}
.feed-detail-head {
    border-bottom: 1px solid var(--border);
    padding-bottom: 18px;
    margin-bottom: 20px;
}
.feed-cat-lg {
    display: inline-block;
    font-size: 12px;
    color: var(--primary);
    background: var(--bg-alt);
    padding: 3px 10px;
    border-radius: 3px;
    margin-bottom: 10px;
}
.feed-detail-title {
    margin: 0 0 12px;
    font-size: 26px;
    color: var(--primary-dark);
    font-family: var(--serif);
    line-height: 1.4;
}
.feed-detail-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-light);
    flex-wrap: wrap;
}
.feed-detail-meta .meta-update { color: var(--text-light); font-style: italic; }
.feed-detail-ops {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.feed-detail-cover {
    margin: 0 0 20px;
    border-radius: 6px;
    overflow: hidden;
    max-height: 420px;
}
.feed-detail-cover img {
    width: 100%;
    height: auto;
    display: block;
}
.feed-detail-body {
    color: var(--text);
    font-size: 15px;
    line-height: 1.85;
}
.feed-detail-body p { margin: 0.8em 0; }
.feed-detail-body img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 10px 0;
}
.feed-detail-body h1,
.feed-detail-body h2,
.feed-detail-body h3,
.feed-detail-body h4 {
    color: var(--primary-dark);
    font-family: var(--serif);
    margin: 1.2em 0 0.6em;
}
.feed-detail-body blockquote {
    margin: 1em 0;
    padding: 8px 16px;
    border-left: 3px solid var(--primary);
    background: var(--bg-alt);
    color: var(--text-light);
    font-style: italic;
}

/* 相关动态 */
.feed-related {
    margin-top: 30px;
}
.feed-related-title {
    margin: 0 0 14px;
    color: var(--primary-dark);
    font-family: var(--serif);
    font-size: 18px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.feed-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.feed-related-item {
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    text-decoration: none;
    transition: box-shadow .2s ease, border-color .2s ease;
}
.feed-related-item:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    border-color: var(--primary);
}
.feed-related-cover {
    width: 100%;
    height: 110px;
    overflow: hidden;
    background: var(--bg-alt);
}
.feed-related-cover img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.feed-related-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--text-light);
}
.feed-related-info {
    padding: 8px 12px 10px;
}
.feed-related-info h4 {
    margin: 0 0 4px;
    font-size: 14px;
    color: var(--text);
    font-family: var(--serif);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.feed-related-item:hover h4 { color: var(--primary); }
.feed-related-date {
    font-size: 12px;
    color: var(--text-light);
}

/* ---- 响应式 ---- */
@media (max-width: 760px) {
    .feed-head-row { flex-direction: column; align-items: flex-start; }
    .feed-publish-btn { width: 100%; }
    .feed-card { flex-direction: column; }
    .feed-card-cover { width: 100%; min-height: 160px; }
    .feed-card-body { padding: 14px 16px; }
    .feed-form-row-2col { grid-template-columns: 1fr; }
    .feed-detail-card { padding: 18px 16px; }
    .feed-detail-title { font-size: 22px; }
    .feed-related-grid { grid-template-columns: 1fr; }
    .feed-modal-box { width: 96%; }
}

/* ===== 分支详情页：管理员面板 ===== */
.admin-apply-tip {
    background: linear-gradient(135deg, #FEF3E2 0%, #FDF6EC 100%);
    border: 1px solid #E8D5B7;
    border-left: 3px solid var(--primary);
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text);
}
.admin-apply-tip .tip-icon {
    font-size: 18px;
    line-height: 1.3;
    flex-shrink: 0;
}
.admin-apply-tip .tip-text { flex: 1; }
.admin-apply-tip .tip-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dashed var(--primary);
}
.admin-apply-tip .tip-link:hover {
    color: var(--primary-dark);
    border-bottom-style: solid;
}

.admin-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.admin-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all .15s ease;
}
.admin-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(158, 32, 32, 0.1);
}
.admin-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #9E2020 0%, #7A1919 100%);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--serif);
    font-size: 18px;
    font-weight: bold;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(158, 32, 32, 0.2);
}
.admin-info { flex: 1; min-width: 0; }
.admin-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    font-family: var(--serif);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.admin-gen-badge {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, #9E2020 0%, #B83232 100%);
    color: #FFFFFF;
    font-size: 11px;
    font-weight: normal;
    border-radius: 10px;
    font-family: var(--kai);
    letter-spacing: 0.5px;
}
.admin-sub {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 3px;
}

/* ===== 家族操作日志卡片 ===== */
.branch-log-card .panel-body { padding: 6px 12px 10px; }
.branch-log-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.branch-log-list.full .branch-log-item {
    padding: 10px 4px;
    border-bottom: 1px dashed var(--bg-alt);
    flex-wrap: wrap;
    gap: 8px 14px;
}
.branch-log-list.full .log-desc { flex: 1 1 100%; }
.branch-log-item {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 6px 2px;
    border-bottom: 1px dashed rgba(0,0,0,0.05);
    font-size: 13px;
    line-height: 1.5;
}
.branch-log-item:last-child { border-bottom: none; }
.branch-log-item .log-time {
    color: var(--text-light);
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 110px;
}
.branch-log-item .log-user {
    color: var(--primary);
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.branch-log-item .log-desc {
    color: var(--text);
    flex: 1;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.branch-log-item .log-icon { flex-shrink: 0; }
.branch-log-item .log-pts {
    display: inline-block;
    padding: 1px 8px;
    margin-left: 4px;
    border-radius: 10px;
    background: linear-gradient(135deg, #FEF3E2 0%, #FDF6EC 100%);
    color: var(--secondary);
    font-weight: bold;
    font-size: 12px;
    border: 1px solid #E8D5B7;
    flex-shrink: 0;
}

/* 独立日志页头部 */
.logs-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 18px 0 14px;
    flex-wrap: wrap;
    gap: 10px;
}
.logs-page-head h2 {
    font-family: var(--serif);
    font-size: 22px;
    color: var(--primary-dark);
    margin: 0;
}
.logs-page-head .back-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
}
.logs-page-head .back-link:hover { color: var(--primary); }
.page-section { padding: 8px 0 40px; }
.breadcrumb {
    font-size: 13px;
    color: var(--text-light);
    margin: 14px 0 6px;
}
.breadcrumb a { color: var(--text-light); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { margin: 0 6px; }
.breadcrumb .current { color: var(--text); }

/* ===== 网站底部统计栏 ===== */
.site-stats-bar {
    text-align: center;
    padding: 10px 0;
    font-size: 13px;
    color: #8B7D6B;
    line-height: 1.8;
}
.site-stats-bar .stat-item {
    display: inline;
    margin: 0 2px;
}
.site-stats-bar .stat-item em {
    font-style: normal;
    font-weight: 600;
    color: var(--primary);
    font-family: Georgia, 'Times New Roman', serif;
    margin: 0 2px;
}
.site-stats-bar .stat-sep {
    color: #C4B598;
    margin: 0 4px;
}
@media (max-width: 600px) {
    .site-stats-bar { font-size: 12px; line-height: 2; }
}

/* ===== 分支列表页 V2 布局 ===== */
.branches-page {
    padding: 20px 0 60px;
}

/* 页面横幅 */
.page-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #FBF9F5 0%, #F3ECDD 100%);
    border: 1px solid #E5D4B7;
    border-radius: 12px;
    padding: 28px 32px;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 20px;
}
.page-banner-left {
    flex: 1;
    min-width: 240px;
}
.page-title {
    margin: 0 0 6px;
    font-family: var(--serif);
    font-size: 28px;
    color: var(--text);
    font-weight: 700;
}
.page-subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--text-light);
}
.page-banner-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.summary-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 22px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.summary-num {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}
.summary-label {
    font-size: 12px;
    color: var(--text-light);
}
.action-wrap {
    display: flex;
    align-items: center;
}
.link-primary {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}
.link-primary:hover { text-decoration: underline; }
.tag-muted {
    background: var(--bg-alt) !important;
    color: var(--text-light) !important;
}

/* 卡片网格 V2 */
.branches-grid-v2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

/* 分支卡片 V2 */
.branch-card-v2 {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 22px 24px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.25s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.branch-card-v2:hover {
    border-color: var(--primary);
    box-shadow: 0 6px 20px rgba(140, 94, 52, 0.1);
    transform: translateY(-2px);
}
.branch-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
}
.branch-seal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), #8B4513);
    color: #fff;
    font-family: var(--serif);
    font-size: 24px;
    font-weight: 700;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(140, 94, 52, 0.3);
    flex-shrink: 0;
}
.branch-title-v2 {
    margin: 0 0 4px;
    font-family: var(--serif);
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}
.branch-region-tag {
    display: inline-block;
    background: var(--bg-alt);
    color: var(--text-light);
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
}

.branch-desc-v2 {
    margin: 0;
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.7;
    min-height: 44px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================================
 * 全局照片灯箱 pv-lightbox（家族相册 / 成员相册共用）
 * ============================================================ */
.pv-lightbox { position: fixed; z-index: 2200; display: none; }
.pv-lightbox.show { display: block; }
/* PC端隐藏手机灯箱：pv-lightbox.js 同时给 #pvLightboxMobile 加 .show，不隐藏会盖住 PC 灯箱 */
@media (min-width: 901px) {
    .pv-lightbox-mobile.show { display: none !important; }
}
.pv-lightbox-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.88); }
.pv-lightbox-content { position: fixed; inset: 0; display: flex; align-items: stretch; justify-content: center; padding: 30px; gap: 20px; overflow: auto; }
.pv-lightbox-main {
    flex: 1; max-width: 70%; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; position: relative;
}
.pv-img-wrap { position: relative; display: inline-block; max-width: 100%; }
.pv-lightbox-main img { max-width: 100%; max-height: 70vh; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); display: block; }
.pv-arrow {
    position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%;
    background: rgba(0,0,0,0.45); color: #fff; border: 1px solid rgba(255,255,255,0.25); cursor: pointer; font-size: 22px;
    display: flex; align-items: center; justify-content: center; user-select: none; z-index: 5;
    transition: background .15s, transform .15s; font-family: inherit;
}
.pv-arrow:hover { background: rgba(192,57,43,0.85); transform: translateY(-50%) scale(1.05); }
.pv-arrow.left { left: -70px; }
.pv-arrow.right { right: -70px; }
.pv-arrow:disabled { opacity: 0.25; cursor: not-allowed; transform: translateY(-50%); background: rgba(0,0,0,0.3); }
.pv-arrow:disabled:hover { transform: translateY(-50%); background: rgba(0,0,0,0.3); }
.pv-subtitle-box {
    position: absolute; left: 0; right: 0; bottom: 14px; height: 110px; overflow: hidden; margin: 0 30px; pointer-events: none;
    mask-image: linear-gradient(to bottom, transparent 0%, #000 20%, #000 80%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 20%, #000 80%, transparent 100%);
}
.pv-subtitle-scroll { display: flex; flex-direction: column; gap: 6px; will-change: transform; }
.pv-subtitle-item {
    align-self: flex-start; max-width: 75%; padding: 5px 14px; background: rgba(0,0,0,0.7); border-radius: 14px;
    color: #fff; font-size: 13px; line-height: 1.4; text-shadow: 0 1px 3px rgba(0,0,0,0.85);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0;
}
.pv-subtitle-item .s-name { color: #ffd88a; margin-right: 8px; font-weight: 600; }
.pv-subtitle-empty { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); font-size: 12px; color: rgba(255,255,255,0.55); font-style: italic; }
.pv-lightbox-caption { color: #fff; font-size: 14px; margin-top: 12px; text-align: center; max-width: 90%; }
.pv-lightbox-actions { display: flex; align-items: center; gap: 18px; margin-top: 14px; color: #fff; font-size: 14px; }
.pv-lightbox-actions .lb-like { cursor: pointer; user-select: none; display: inline-flex; align-items: center; gap: 4px; padding: 6px 14px; background: rgba(255,255,255,0.1); border-radius: 20px; transition: background .15s; }
.pv-lightbox-actions .lb-like:hover { background: rgba(255,255,255,0.2); }
.pv-lightbox-actions .lb-like.active { background: rgba(231,76,60,0.8); color: #fff; }
.pv-lightbox-actions .lb-view { display: inline-flex; align-items: center; gap: 4px; padding: 6px 14px; background: rgba(255,255,255,0.1); border-radius: 20px; }
.pv-lightbox-actions .lb-comments { cursor: pointer; user-select: none; display: inline-flex; align-items: center; gap: 4px; padding: 6px 14px; background: rgba(255,255,255,0.1); border-radius: 20px; transition: background .15s, color .15s; }
.pv-lightbox-actions .lb-comments:hover { background: rgba(255,255,255,0.22); color: #ffd88a; }
.pv-lightbox-actions .lb-comments.open { background: rgba(192,57,43,0.8); color: #fff; }
.pv-lightbox-close { position: absolute; top: 20px; right: 30px; background: none; border: none; color: #fff; font-size: 36px; cursor: pointer; z-index: 10; }
.pv-photo-index { position: absolute; top: 24px; left: 36px; color: #fff; font-size: 13px; opacity: 0.85; z-index: 3; background: rgba(0,0,0,0.3); padding: 4px 12px; border-radius: 12px; }
.pv-thumb-wrap { width: 100%; max-width: 70%; margin-top: 18px; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.pv-thumb-count { color: #fff; font-size: 13px; opacity: 0.85; background: rgba(0,0,0,0.35); padding: 4px 10px; border-radius: 12px; flex-shrink: 0; min-width: 52px; text-align: center; font-weight: 500; }
.pv-thumb-arrow { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.2); cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .15s, transform .15s, opacity .15s; font-family: inherit; padding: 0; }
.pv-thumb-arrow:hover:not(:disabled) { background: rgba(192,57,43,0.8); transform: scale(1.08); }
.pv-thumb-arrow:disabled { opacity: 0.3; cursor: not-allowed; }
.pv-thumb-viewport { flex: 1; overflow: hidden; border-radius: 8px; background: rgba(0,0,0,0.15); padding: 4px; }
.pv-thumbstrip { display: flex; gap: 8px; overflow-x: auto; scroll-behavior: smooth; padding: 2px; width: 100%; max-width: 100%; }
.pv-thumbstrip::-webkit-scrollbar { height: 0; display: none; }
.pv-thumb { flex-shrink: 0; width: 64px; height: 64px; border-radius: 6px; overflow: hidden; border: 2px solid rgba(255,255,255,0.2); cursor: pointer; transition: border-color .15s, transform .15s, opacity .15s; opacity: 0.7; background: rgba(0,0,0,0.3); box-sizing: border-box; }
.pv-thumb:hover { opacity: 1; transform: translateY(-1px); border-color: rgba(255,255,255,0.55); }
.pv-thumb.active { opacity: 1; border-color: #C0392B; box-shadow: 0 0 0 2px rgba(192,57,43,0.35); transform: translateY(-2px); }
.pv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-lightbox-side { width: 360px; max-width: 30%; background: #fff; border-radius: 12px; display: none; flex-direction: column; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
.pv-lightbox-side.open { display: flex; animation: pv-side-in .25s ease-out; }
@keyframes pv-side-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.pv-side-head { padding: 14px 18px; border-bottom: 1px solid var(--border); font-family: var(--serif); font-size: 16px; color: var(--primary-dark); font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
.pv-side-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-light); line-height: 1; padding: 0; }
.pv-side-close:hover { color: var(--primary); }
.pv-side-comments { flex: 1; overflow-y: auto; padding: 10px 18px; }
.pv-side-comment { padding: 10px 0; border-bottom: 1px dashed var(--border); }
.pv-side-comment:last-child { border-bottom: none; }
.pv-side-comment .c-user { font-size: 13px; font-weight: 600; color: var(--primary-dark); margin-bottom: 4px; display: flex; justify-content: space-between; align-items: center; }
.pv-side-comment .c-user .c-time { font-weight: normal; font-size: 11px; color: var(--text-light); }
.pv-side-comment .c-content { font-size: 13px; color: var(--text); line-height: 1.5; white-space: pre-wrap; word-break: break-word; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.pv-side-comment .c-content .c-text { flex: 1; }
.pv-side-comment .c-delete { flex-shrink: 0; font-size: 11px; color: var(--text-light); cursor: pointer; background: none; border: 1px solid var(--border); padding: 2px 8px; border-radius: 10px; font-family: inherit; opacity: 0.7; transition: all .15s; white-space: nowrap; }
.pv-side-comment .c-delete:hover { opacity: 1; color: #fff; background: #C0392B; border-color: #C0392B; }
.pv-side-empty { text-align: center; color: var(--text-light); padding: 30px 10px; font-size: 13px; }
.pv-side-input { padding: 12px 14px; border-top: 1px solid var(--border); background: #fafafa; }
.pv-side-input textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 13px; resize: vertical; min-height: 56px; max-height: 120px; font-family: inherit; }
.pv-side-input textarea:focus { outline: none; border-color: var(--primary); }
.pv-side-input .row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.pv-side-input .row .tip { font-size: 11px; color: var(--text-light); }
.pv-side-input button { padding: 6px 18px; background: var(--primary); color: #fff; border: none; border-radius: 6px; font-size: 13px; cursor: pointer; font-family: inherit; }
.pv-side-input button:hover { background: #B03030; }
.pv-side-input button:disabled { background: #bbb; cursor: not-allowed; }
.pv-side-input .login-tip { font-size: 12px; color: var(--text-light); text-align: center; padding: 4px 0; }
.pv-side-input .login-tip a { color: var(--primary); text-decoration: none; }
.pv-side-input .login-tip a:hover { text-decoration: underline; }

/* 评论回复按钮、回复卡片、回复标签 */
.pv-side-comment .c-reply-btn { flex-shrink: 0; font-size: 11px; color: var(--primary); cursor: pointer; background: none; border: 1px solid var(--border); padding: 2px 8px; border-radius: 10px; font-family: inherit; opacity: 0.85; transition: all .15s; white-space: nowrap; }
.pv-side-comment .c-reply-btn:hover { opacity: 1; color: #fff; background: var(--primary); border-color: var(--primary); }
.pv-side-comment .c-reply-to { font-size: 11px; color: var(--text-light); font-weight: normal; margin-left: 6px; }
.pv-side-comment.pv-comment-reply { border-left: 2px solid #f0ebe0; padding-left: 8px; margin-top: 2px; }
.pv-reply-card { margin-top: 8px; padding: 8px; background: #FBF8F0; border-radius: 6px; border: 1px solid var(--border); }
.pv-reply-card textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 5px; padding: 6px 10px; font-size: 13px; resize: vertical; min-height: 44px; max-height: 100px; font-family: inherit; }
.pv-reply-card textarea:focus { outline: none; border-color: var(--primary); }
.pv-reply-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.pv-reply-cancel { padding: 4px 12px; font-size: 12px; border: 1px solid var(--border); border-radius: 5px; background: #FAFAFA; color: var(--text); cursor: pointer; }
.pv-reply-cancel:hover { background: #f0f0f0; }
.pv-reply-submit { padding: 4px 14px; font-size: 12px; border: none; border-radius: 5px; background: var(--primary); color: #fff; cursor: pointer; }
.pv-reply-submit:hover { background: #B03030; }
.pv-reply-submit:disabled { background: #bbb; cursor: not-allowed; }

/* 点赞 hover tooltip */
.pv-liker-tooltip { position: fixed; z-index: 10001; display: none; min-width: 160px; max-width: 260px; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.12); padding: 10px 14px; font-size: 12px; color: var(--text); animation: pvTooltipIn .15s ease-out; }
@keyframes pvTooltipIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
.pv-liker-tooltip-title { font-weight: 600; color: var(--primary-dark); margin-bottom: 6px; }
.pv-liker-tooltip-list { display: flex; flex-wrap: wrap; gap: 4px 8px; line-height: 1.6; }
.pv-liker-tooltip-item { color: var(--text); }
.pv-liker-tooltip-item::after { content: '、'; color: var(--text-light); }
.pv-liker-tooltip-item:last-child::after { content: ''; }
.pv-liker-tooltip-loading, .pv-liker-tooltip-empty { color: var(--text-light); text-align: center; padding: 4px 0; }
@media (max-width: 900px) {
    .pv-lightbox-content { flex-direction: column; padding: 20px 10px; }
    .pv-lightbox-main { max-width: 100%; }
    .pv-lightbox-side { width: 100%; max-width: 100%; max-height: 45vh; }
    .pv-arrow { width: 40px; height: 40px; font-size: 18px; }
    .pv-arrow.left { left: 4px; }
    .pv-arrow.right { right: 4px; }
    .pv-subtitle-box { margin: 0 10px; }
}

/* ===== 手机端触屏灯箱样式 ===== */
@media (max-width: 560px) {
    .pv-lightbox-content { padding: 0; gap: 0; }
    .pv-lightbox-main { width: 100%; padding: 36px 8px 8px; }
    /* 图片更大，占满屏幕大部分高度 */
    .pv-lightbox-main img { max-height: 62vh; border-radius: 4px; }
    /* 隐藏左右箭头按钮（用滑动代替） */
    .pv-arrow { display: none !important; }
    /* 隐藏缩略图栏（手机端空间有限） */
    .pv-thumb-wrap { display: none !important; }
    /* 紧凑布局：caption + actions */
    .pv-lightbox-caption { font-size: 12px; margin-top: 8px; max-width: 100%; padding: 0 4px; }
    .pv-lightbox-actions { gap: 10px; margin-top: 8px; font-size: 12px; justify-content: center; flex-wrap: wrap; }
    .pv-lightbox-actions .lb-like,
    .pv-lightbox-actions .lb-view,
    .pv-lightbox-actions .lb-comments { padding: 5px 10px; font-size: 12px; }
    /* 关闭按钮变大易点 */
    .pv-lightbox-close { top: 8px; right: 10px; font-size: 32px; width: 44px; height: 44px; line-height: 44px; text-align: center; }
    /* 照片索引位置 */
    .pv-photo-index { top: 12px; left: 50%; transform: translateX(-50%); padding: 4px 12px; font-size: 12px; }
    /* 字幕区在手机端隐藏，避免遮挡图片 */
    .pv-subtitle-box { display: none !important; }
    /* 侧边评论面板：手机端从底部弹出 */
    .pv-lightbox-side { width: 100%; max-width: 100%; max-height: 70vh; border-radius: 12px 12px 0 0; }
    .pv-lightbox-content { flex-direction: column; }
    /* 滑动提示动画 */
    .pv-swipe-hint {
        position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
        color: rgba(255,255,255,0.6); font-size: 12px; pointer-events: none;
        z-index: 2201; padding: 6px 16px; background: rgba(0,0,0,0.4);
        border-radius: 14px; animation: pv-fade-out 2s ease-out forwards;
    }
    @keyframes pv-fade-out { 0% { opacity: 0.9; } 70% { opacity: 0.9; } 100% { opacity: 0; } }
}

.branch-gen-v2 {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.branch-gen-label {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 6px;
    min-width: 36px;
}
.branch-gen-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

.branch-stats-v2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg);
    border-radius: 8px;
    padding: 12px 6px;
    gap: 6px;
}
.branch-stats-v2 .bs-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.branch-stats-v2 .bs-num {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}
.branch-stats-v2 .bs-label {
    font-size: 11px;
    color: var(--text-light);
}
.branch-stats-v2 .bs-divider {
    width: 1px;
    height: 24px;
    background: var(--border-light);
}

.branch-card-foot {
    display: flex;
    justify-content: flex-end;
    padding-top: 2px;
    border-top: 1px dashed var(--border-light);
    margin-top: 2px;
    padding-top: 10px;
}
.view-detail-btn {
    font-size: 13px;
    color: var(--primary);
    font-weight: 500;
}
.branch-card-v2:hover .view-detail-btn {
    text-decoration: underline;
}

/* 分页 */
.pagination-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 32px;
}
.pg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.2s;
}
a.pg-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.pg-btn.pg-current {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}
.pg-btn.pg-disabled {
    background: var(--bg-alt);
    border-color: var(--border-light);
    color: var(--text-muted);
    cursor: not-allowed;
}
.pg-info {
    font-size: 13px;
    color: var(--text-light);
    margin-left: 12px;
}

@media (max-width: 768px) {
    .page-banner { padding: 20px; }
    .page-title { font-size: 22px; }
    .branches-grid-v2 { grid-template-columns: 1fr; }
    .summary-num { font-size: 20px; }
    .pg-info { margin-left: 0; width: 100%; text-align: center; margin-top: 8px; }
}

/* ============================================================
 * 首页 - 最新动态列表（响应式）
 * ============================================================ */
.home-news-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.home-news-list .news-item {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
    transition: all .2s ease;
    height: 100%;
}

.home-news-list .news-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.home-news-list .news-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--text-light);
}

.home-news-list .news-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.home-news-list .news-type-announcement {
    background: rgba(193, 57, 44, 0.1);
    color: #c1392c;
}

.home-news-list .news-type-branch_feed {
    background: rgba(74, 122, 74, 0.1);
    color: #4a7a4a;
}

.home-news-list .news-cat-badge {
    color: var(--text-muted);
}

.home-news-list .news-date {
    margin-left: auto;
}

.home-news-list .news-date-icon {
    margin-right: 2px;
}

.home-news-list .news-item-title {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 10px;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-news-list .news-title-link {
    text-decoration: none;
    color: var(--text);
}

.home-news-list .news-title-link:hover .news-item-title {
    color: var(--primary);
}

.home-news-list .news-summary {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-light);
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 单图布局：左图右文 */
.home-news-list .news-item-cover-block {
    display: flex;
    gap: 14px;
    margin-bottom: 12px;
}

.home-news-list .news-cover-link {
    flex-shrink: 0;
    width: 120px;
    height: 90px;
    border-radius: 6px;
    overflow: hidden;
    display: block;
    background: var(--bg-alt);
}

.home-news-list .news-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}

.home-news-list .news-item:hover .news-cover {
    transform: scale(1.05);
}

.home-news-list .news-text-block {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.home-news-list .news-text-block .news-item-title {
    -webkit-line-clamp: 2;
    margin-bottom: 8px;
}

.home-news-list .news-text-block .news-summary {
    -webkit-line-clamp: 3;
    margin-bottom: 0;
}

/* 多图缩略图 */
.home-news-list .news-thumb-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}

.home-news-list .news-thumb-link {
    display: block;
    aspect-ratio: 1;
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg-alt);
}

.home-news-list .news-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.home-news-list .news-foot {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
    display: flex;
    justify-content: flex-end;
}

.home-news-list .news-readmore {
    font-size: 13px;
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
    transition: color .15s;
}

.home-news-list .news-readmore:hover {
    color: var(--primary-dark);
}

.home-news-list .news-arrow {
    margin-left: 3px;
    transition: transform .15s;
}

.home-news-list .news-readmore:hover .news-arrow {
    transform: translateX(3px);
}

.home-news-list .news-empty {
    grid-column: 1 / -1;
    padding: 40px;
    text-align: center;
    color: var(--text-light);
    background: #fff;
    border: 1px dashed var(--border);
    border-radius: 10px;
}

.home-news-list .news-empty-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.home-news-list .news-empty-text {
    font-size: 14px;
}

/* 响应式：手机端单列 */
@media (max-width: 768px) {
    .home-news-list {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .home-news-list .news-item {
        padding: 14px 16px;
    }

    .home-news-list .news-item-title {
        font-size: 16px;
    }

    .home-news-list .news-summary {
        font-size: 13px;
    }

    .home-news-list .news-cover-link {
        width: 100px;
        height: 75px;
    }

    .home-news-list .news-thumb-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
    }
}

/* 小屏微调 */
@media (max-width: 480px) {
    .home-news-list .news-item-cover-block {
        gap: 10px;
    }

    .home-news-list .news-cover-link {
        width: 90px;
        height: 68px;
    }

    .home-news-list .news-item-title {
        font-size: 15px;
        -webkit-line-clamp: 3;
    }
}
