/* ============================================================
 * 「我的家谱V2.0」主样式表
 * 新中式国风极简 | 低饱和水墨配色 | 大量留白 | 大字体
 * 无冗余花哨装饰 | 素雅庄重 | 现代简约
 * ============================================================ */

/* --- CSS变量 --- */
:root {
  --ink: #3c3628;
  --ink-light: #6b5e4f;
  --ink-lighter: #9a8e80;
  --paper: #faf8f5;
  --paper-white: #ffffff;
  --accent: #8b7355;
  --accent-light: #c5b19e;
  --accent-pale: #ede6db;
  --border: #e5ded6;
  --border-light: #f0ebe3;
  --bg-soft: #f3efe9;
  --bg-card: #ffffff;
  --success: #5b8c5a;
  --danger: #b84c4c;
  --warning: #b8863e;
  --info: #6b8a9a;
  --font-xl: 1.35rem;
  --font-lg: 1.15rem;
  --font-md: 1rem;
  --font-sm: 0.9rem;
  --radius: 6px;
  --radius-lg: 12px;
  --shadow: 0 2px 12px rgba(60,54,40,.06);
  --shadow-hover: 0 4px 20px rgba(60,54,40,.1);
  --max-width: 1200px;
  --header-h: 60px;
}

/* --- 全局重置 --- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 18px; scroll-behavior: smooth; }
body {
  font-family: "PingFang SC","Noto Serif SC","Source Han Serif CN","STSong",Georgia,"宋体",serif;
  font-size: var(--font-lg);
  line-height: 1.85;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--ink); }
img { max-width: 100%; height: auto; }
input,select,textarea,button { font-family: inherit; font-size: inherit; }

/* --- 顶部导航 --- */
.site-header {
  background: var(--paper-white);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h); display: flex; align-items: center;
}
.header-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 0 24px;
  width: 100%; display: flex; align-items: center; justify-content: space-between;
}
.logo-link { display: flex; align-items: center; gap: 8px; color: var(--ink) !important; }
.logo-img {
  width: 36px; height: 36px; object-fit: contain; border-radius: 4px;
}
.logo-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; background: var(--accent); color: #fff;
  border-radius: 50%; font-size: 1.1rem; font-weight: 500;
}
.logo-text { font-size: var(--font-xl); font-weight: 500; letter-spacing: 2px; }
.main-nav { display: flex; align-items: center; gap: 24px; }
.nav-link { color: var(--ink-light); font-size: var(--font-md); padding: 4px 0; transition: color .2s; }
.nav-link:hover { color: var(--accent); }

/* ========== 头像系统 ========== */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%; overflow: hidden;
  background: var(--bg-soft); color: var(--ink-lighter);
  font-size: 1.2rem; font-weight: 500; flex-shrink: 0;
  border: 1px solid var(--border);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 36px; height: 36px; font-size: 0.9rem; }
.avatar-lg { width: 80px; height: 80px; font-size: 2rem; }
.avatar-placeholder {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; color: var(--ink-lighter);
  background: var(--bg-soft);
}
.nav-register {
  background: var(--accent); color: #fff !important; padding: 6px 20px !important;
  border-radius: 20px; font-size: var(--font-sm);
}
.nav-link.nav-register:hover { background: #7a6348; }
.nav-admin { color: var(--warning) !important; font-weight: 500; }
.nav-logout { color: var(--ink-lighter); font-size: var(--font-sm); }
.mobile-menu-btn { display: none; background: none; border: none; font-size: 1.5rem; color: var(--ink); cursor: pointer; padding: 4px 8px; }

/* --- 主内容区 --- */
.main-content { flex: 1; padding: 32px 24px 64px; max-width: var(--max-width); margin: 0 auto; width: 100%; }

/* --- 页脚 --- */
.site-footer {
  background: var(--paper-white); border-top: 1px solid var(--border);
  padding: 24px; text-align: center;
}
.footer-inner p { color: var(--ink-lighter); font-size: var(--font-sm); margin: 4px 0; letter-spacing: 4px; }

/* --- 通用卡片 --- */
.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 32px; margin-bottom: 20px; box-shadow: var(--shadow); transition: box-shadow .2s;
}
.card:hover { box-shadow: var(--shadow-hover); }
.card-title {
  font-size: var(--font-xl); font-weight: 500; color: var(--ink); margin-bottom: 20px;
  padding-bottom: 16px; border-bottom: 1px solid var(--border-light); letter-spacing: 2px;
}
.card-subtitle { font-size: var(--font-sm); color: var(--ink-lighter); margin-bottom: 24px; }

/* --- 表单 --- */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; font-size: var(--font-md); color: var(--ink-light); margin-bottom: 8px;
  font-weight: 500;
}
.form-input {
  width: 100%; padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--paper-white); color: var(--ink); font-size: var(--font-lg);
  transition: border-color .2s, box-shadow .2s; outline: none;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139,115,85,.08); }
.form-input::placeholder { color: var(--ink-lighter); }
textarea.form-input { min-height: 120px; resize: vertical; line-height: 1.8; }
select.form-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b5e4f' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
.form-hint { font-size: var(--font-sm); color: var(--ink-lighter); margin-top: 6px; }
.form-error { font-size: var(--font-sm); color: var(--danger); margin-top: 6px; }

/* --- 按钮 --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 32px; border: none; border-radius: var(--radius);
  font-size: var(--font-lg); font-weight: 500; cursor: pointer;
  transition: all .2s; letter-spacing: 2px; line-height: 1;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #7a6348; }
.btn-secondary { background: var(--bg-soft); color: var(--ink-light); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border-light); }
.btn-outline { background: transparent; color: var(--accent); border: 1px solid var(--accent-light); }
.btn-outline:hover { background: var(--accent-pale); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 8px 18px; font-size: var(--font-sm); }
.btn-lg { padding: 18px 48px; font-size: var(--font-xl); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* --- 面包屑 --- */
.breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 28px; font-size: var(--font-sm); color: var(--ink-lighter); }
.breadcrumb a { color: var(--accent); }
.breadcrumb .sep { color: var(--accent-light); }

/* --- 分页 --- */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 32px; }
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 12px; border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--ink-light); font-size: var(--font-md);
  transition: all .2s;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination .disabled { color: var(--ink-lighter); pointer-events: none; }

/* --- 空状态 --- */
.empty-state {
  text-align: center; padding: 80px 24px; color: var(--ink-lighter);
}
.empty-state .icon { font-size: 4rem; margin-bottom: 16px; display: block; }
.empty-state p { font-size: var(--font-lg); margin-bottom: 20px; }

/* --- Toast提示 --- */
.toast-container { position: fixed; top: 80px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 14px 24px; border-radius: var(--radius); color: #fff; font-size: var(--font-md);
  animation: toastIn .3s ease; max-width: 360px; box-shadow: var(--shadow-hover);
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--info); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* --- 栅格 --- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* --- Flex工具 --- */
.flex { display: flex; }
.flex-center { align-items: center; justify-content: center; }
.flex-between { align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

/* --- 文字工具 --- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--ink-lighter); }
.text-accent { color: var(--accent); }
.text-sm { font-size: var(--font-sm); }
.text-lg { font-size: var(--font-xl); }
.font-medium { font-weight: 500; }

/* --- 间距 --- */
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; } .mb-32 { margin-bottom: 32px; }
.p-16 { padding: 16px; } .p-24 { padding: 24px; } .p-32 { padding: 32px; }

/* ==================== 页面样式 ==================== */

/* --- 首页 --- */
.hero-section { text-align: center; padding: 80px 24px 64px; }
.hero-title {
  font-size: 2.8rem; font-weight: 400; color: var(--ink);
  letter-spacing: 12px; margin-bottom: 16px; line-height: 1.4;
}
.hero-subtitle {
  font-size: var(--font-xl); color: var(--ink-lighter); letter-spacing: 4px; margin-bottom: 32px;
}
.hero-actions { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.hero-sep {
  width: 60px; height: 1px; background: var(--accent-light); margin: 48px auto;
}
.stat-row {
  display: flex; justify-content: center; gap: 64px; margin-top: 32px;
}
.stat-item { text-align: center; }
.stat-num { font-size: 1.8rem; color: var(--accent); font-weight: 300; }
.stat-label { font-size: var(--font-sm); color: var(--ink-lighter); letter-spacing: 2px; }

/* --- 登录/注册 --- */
.auth-container { max-width: 460px; margin: 48px auto; }
.auth-container .card { padding: 40px; }
.auth-switch { text-align: center; margin-top: 24px; font-size: var(--font-sm); color: var(--ink-lighter); }
.social-login { text-align: center; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border-light); }
.social-login .btn { font-size: var(--font-md); }

/* --- 家族详情 --- */
.family-header { margin-bottom: 32px; }
.family-name { font-size: 2rem; font-weight: 400; letter-spacing: 4px; margin-bottom: 8px; }
.family-surname { font-size: var(--font-lg); color: var(--ink-lighter); }
.family-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border-light); margin-bottom: 24px; }
.family-tabs a {
  padding: 14px 28px; color: var(--ink-lighter); font-size: var(--font-md);
  border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .2s;
}
.family-tabs a:hover, .family-tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }

/* --- 后台管理 Tab --- */
.admin-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border-light); margin-bottom: 24px; flex-wrap: wrap; }
.admin-tab-item {
  padding: 12px 24px; color: var(--ink-lighter); font-size: var(--font-sm);
  border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .2s;
  white-space: nowrap;
}
.admin-tab-item:hover, .admin-tab-item.active { color: var(--accent); border-bottom-color: var(--accent); }

/* --- 日志子Tab --- */
.log-sub-tabs { display: flex; gap: 4px; }
.log-sub-tab-item {
  display: inline-block; padding: 8px 20px; border-radius: var(--radius) var(--radius) 0 0;
  font-size: var(--font-sm); color: var(--ink-lighter); background: var(--bg-soft);
  transition: all .2s; text-decoration: none;
}
.log-sub-tab-item:hover { color: var(--ink); background: var(--border); }
.log-sub-tab-item.active { color: var(--paper-white); background: var(--accent); font-weight: 500; }

.family-meta { display: flex; gap: 32px; flex-wrap: wrap; margin-bottom: 24px; }
.family-meta-item { color: var(--ink-lighter); font-size: var(--font-sm); }
.family-meta-item strong { color: var(--ink); margin-left: 4px; }
.family-desc { line-height: 2; color: var(--ink-light); }
.poem-block {
  background: var(--bg-soft); border-left: 3px solid var(--accent-light);
  padding: 20px 24px; border-radius: 0 var(--radius) var(--radius) 0;
  font-size: var(--font-lg); line-height: 2.2; color: var(--ink);
}

/* --- 世系图 --- */
:root {
  --cinnabar: #c04040;      /* 朱砂红 · 始祖边框 */
  --ochre: #8b5e3c;         /* 赭石 · 连线 */
  --ochre-light: #b8996e;   /* 赭石浅 · 配偶连线 */
  --ink-wash: #4a4235;      /* 墨色 · 节点文字 */
  --rice-paper: #faf6ef;    /* 宣纸色 · 节点底色 */
  --node-male-border: #6b8a7a;   /* 青碧 · 男 */
  --node-female-border: #b8868b; /* 绛紫 · 女 */
}
.genealogy-container { position: relative; }
.genealogy-tree-wrapper {
  width: 100%; height: 70vh; min-height: 500px; border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; position: relative;
  background: #fdfbf7;
  background-image:
    linear-gradient(var(--border-light) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-light) 1px, transparent 1px);
  background-size: 32px 32px;
}
.genealogy-svg { width: 100%; height: 100%; }
.genealogy-controls { display: flex; gap: 8px; margin-bottom: 16px; }
.genealogy-controls .btn { padding: 10px 18px; }

/* 节点矩形 */
.node-rect {
  fill: var(--rice-paper); stroke: var(--accent-light); stroke-width: 1.8;
  rx: 8; ry: 8; transition: all .25s; cursor: pointer;
  filter: drop-shadow(0 1px 3px rgba(60,54,40,.08));
}
.node-rect:hover { fill: #f5efe4; stroke: var(--accent); filter: drop-shadow(0 2px 6px rgba(60,54,40,.14)); }
.node-rect.male { stroke: var(--node-male-border); }
.node-rect.female { stroke: var(--node-female-border); }

/* 始祖节点——朱砂红边框 */
.node-rect.ancestor {
  stroke: var(--cinnabar); stroke-width: 2.4;
  fill: #fef5f5;
}
.node-rect.ancestor:hover { stroke: var(--cinnabar); fill: #fde8e8; }

.node-text { font-size: 16px; fill: var(--ink-wash); pointer-events: none; font-weight: 500; letter-spacing: 1px; }
.node-sub { font-size: 11px; fill: var(--ink-lighter); pointer-events: none; letter-spacing: 0.5px; }

/* 连线——赭石色 */
.link-line {
  stroke: var(--ochre); stroke-width: 1.8; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
  opacity: .72;
}

/* 配偶连线——双线 */
.link-spouse {
  stroke: var(--ochre-light); stroke-width: 1.2; fill: none;
  stroke-dasharray: none;
}
.link-spouse-outer {
  stroke: var(--ochre-light); stroke-width: 1.2; fill: none;
  transform: translateY(-3px);
}
.link-spouse-inner {
  stroke: var(--ochre-light); stroke-width: 1.2; fill: none;
  transform: translateY(3px);
}

/* 配偶标签 */
.spouse-label {
  font-size: 11px; fill: var(--ink-lighter); pointer-events: none;
  text-anchor: middle; letter-spacing: 1px;
}

/* 世代标记水印 */
.generation-marker {
  font-size: 10px; fill: var(--accent-light); pointer-events: none;
  text-anchor: end; letter-spacing: 2px; opacity: .6;
}

.node-menu { position: absolute; background: var(--paper-white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-hover); padding: 8px 0; z-index: 50; display: none; min-width: 140px; }
.node-menu.show { display: block; }
.node-menu a, .node-menu button {
  display: block; width: 100%; padding: 10px 20px; text-align: left; border: none;
  background: none; color: var(--ink-light); font-size: var(--font-sm); cursor: pointer;
}
.node-menu a:hover, .node-menu button:hover { background: var(--bg-soft); color: var(--accent); }

/* --- 节点表单弹窗 --- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(60,54,40,.4); z-index: 200;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .2s;
}
.modal-content {
  background: var(--paper-white); border-radius: var(--radius-lg); padding: 36px;
  max-width: 580px; width: 90%; max-height: 85vh; overflow-y: auto; box-shadow: 0 10px 40px rgba(60,54,40,.15);
}
.modal-title { font-size: var(--font-xl); font-weight: 500; margin-bottom: 24px; letter-spacing: 2px; }
.modal-close {
  position: absolute; top: 16px; right: 20px; background: none; border: none;
  font-size: 1.5rem; color: var(--ink-lighter); cursor: pointer;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- 表格 --- */
.table-wrapper { overflow-x: auto; }
table {
  width: 100%; border-collapse: collapse; font-size: var(--font-md);
}
thead th {
  padding: 16px 20px; text-align: left; background: var(--bg-soft);
  color: var(--ink-light); font-weight: 500; border-bottom: 2px solid var(--border);
  white-space: nowrap; letter-spacing: 1px;
}
tbody td {
  padding: 16px 20px; border-bottom: 1px solid var(--border-light); color: var(--ink);
}
tbody tr:hover { background: var(--bg-soft); }
tbody tr:last-child td { border-bottom: none; }

/* --- 标签/徽章 --- */
.badge {
  display: inline-block; padding: 4px 14px; border-radius: 20px; font-size: var(--font-sm);
  font-weight: 500; letter-spacing: 1px;
}
.badge-success { background: #e8f0e7; color: var(--success); }
.badge-warning { background: #f5ede2; color: var(--warning); }
.badge-danger { background: #f5e8e8; color: var(--danger); }
.badge-info { background: #e8eef2; color: var(--info); }
.badge-default { background: var(--bg-soft); color: var(--ink-lighter); }

/* ==================== 后台仪表盘 ==================== */
/* --- 头部 --- */
.dashboard-header { margin-bottom: 8px; }
.dashboard-title { font-size: var(--font-xl); font-weight: 400; letter-spacing: 2px; margin-bottom: 4px; }
.dashboard-subtitle { font-size: var(--font-sm); color: var(--ink-lighter); margin-bottom: 16px; }

/* --- Section 标题 --- */
.section-heading {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--font-md); font-weight: 500; color: var(--ink); letter-spacing: 1px;
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}
.section-heading-sm { font-size: var(--font-sm); margin-bottom: 12px; padding-bottom: 8px; }
.section-icon { font-size: 1rem; }
.section-more {
  margin-left: auto; font-size: var(--font-sm); font-weight: 400; color: var(--accent);
  letter-spacing: 0;
}
.section-more:hover { color: var(--ink); }
.pending-summary-badge {
  margin-left: auto; font-size: 11px; padding: 3px 12px; border-radius: 20px;
  background: #fef8e8; color: var(--warning); border: 1px solid #f0d89c;
  letter-spacing: 0; font-weight: 400;
}

/* --- 双栏布局 --- */
.dashboard-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px;
}
.dashboard-left { min-width: 0; }
.dashboard-right { min-width: 0; }

/* --- 统计卡片（5列） --- */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px; margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px 18px; display: flex; align-items: center; gap: 14px;
  transition: all .2s; position: relative; overflow: hidden;
}
.stat-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.stat-card:hover { border-color: var(--accent-light); box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-card-icon { font-size: 1.8rem; flex-shrink: 0; line-height: 1; }
.stat-card-body { min-width: 0; }
.stat-card-body .stat-num { font-size: 1.6rem; font-weight: 400; color: var(--ink); line-height: 1.2; }
.stat-card-body .stat-label { font-size: 11px; color: var(--ink-lighter); letter-spacing: 1px; margin-top: 2px; }
.stat-card-body .stat-sub { font-size: 10px; color: var(--ink-lighter); margin-top: 1px; }
.stat-card-body .stat-sub strong { color: var(--accent); }

.stat-card-users::after { background: #7eb8a0; }
.stat-card-families::after { background: #b8996e; }
.stat-card-nodes::after { background: #8b7355; }
.stat-card-logins::after { background: #6b8a9a; }
.stat-card-notifications::after { background: #b8863e; }

/* --- 快捷操作网格 --- */
.quick-actions-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.quick-action-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border-light);
  background: var(--bg-card); transition: all .2s; text-decoration: none;
}
.quick-action-item:hover {
  border-color: var(--accent-light); background: #fdfbf7; box-shadow: var(--shadow);
}
.qa-icon {
  width: 38px; height: 38px; border-radius: var(--radius); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.qa-icon-primary { background: var(--accent); color: #fff; }
.qa-icon-accent { background: var(--accent-pale); }
.qa-icon-warning { background: #fef3e2; }
.qa-icon-muted { background: var(--bg-soft); }
.qa-text { min-width: 0; }
.qa-text strong {
  display: block; font-size: var(--font-sm); color: var(--ink); font-weight: 500;
  line-height: 1.3;
}
.qa-text small {
  display: block; font-size: 11px; color: var(--ink-lighter); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.quick-action-item:hover .qa-text strong { color: var(--accent); }

/* --- 待处理列表 --- */
.pending-list { display: flex; flex-direction: column; gap: 8px; }
.pending-item-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border-light);
  background: var(--bg-card); transition: all .2s; cursor: pointer;
}
.pending-item-card:hover { border-color: var(--accent-light); box-shadow: var(--shadow); }
.pending-item-card.pending-urgent {
  border-color: #f0d89c; background: #fffdf5;
}
.pending-item-card.pending-urgent:hover { border-color: var(--warning); }
.pending-item-card.pending-none { opacity: .6; cursor: default; }
.pending-item-card.pending-none:hover { border-color: var(--border-light); box-shadow: none; }
.pending-item-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pending-item-icon { font-size: 1.3rem; flex-shrink: 0; }
.pending-item-title { font-size: var(--font-sm); font-weight: 500; color: var(--ink); line-height: 1.3; }
.pending-item-desc { font-size: 11px; color: var(--ink-lighter); margin-top: 1px; }
.pending-item-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.pending-item-num {
  font-size: 1.3rem; font-weight: 500; color: var(--ink-lighter);
  min-width: 28px; text-align: center;
}
.pending-urgent .pending-item-num { color: var(--warning); }
.pending-item-arrow { font-size: var(--font-sm); color: var(--accent-light); transition: transform .2s; }
.pending-item-card:not(.pending-none):hover .pending-item-arrow { transform: translateX(3px); }
.pending-none .pending-item-arrow { opacity: 0; }

/* --- 紧凑卡片 --- */
.card-compact { padding: 0; overflow: hidden; }
.card-compact .table-wrapper { margin: 0; }
.table-compact thead th { padding: 12px 16px; font-size: 11px; }
.table-compact tbody td { padding: 10px 16px; font-size: var(--font-sm); }

/* --- 迷你通知列表 --- */
.notify-mini-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-bottom: 1px solid var(--border-light); gap: 12px;
}
.notify-mini-item:last-child { border-bottom: none; }
.notify-mini-item:hover { background: var(--bg-soft); }
.notify-mini-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.notify-mini-title {
  font-size: var(--font-sm); color: var(--ink); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.notify-mini-time { font-size: 11px; color: var(--ink-lighter); white-space: nowrap; flex-shrink: 0; }
.empty-mini { padding: 40px 20px; text-align: center; color: var(--ink-lighter); font-size: var(--font-sm); }

/* --- 私密社群聊天 --- */
.chat-container { display: flex; flex-direction: column; height: 60vh; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; background: var(--bg-soft); }
.chat-msg { max-width: 75%; padding: 12px 18px; border-radius: var(--radius-lg); position: relative; }
.chat-msg.me { align-self: flex-end; background: var(--accent); color: #fff; }
.chat-msg.other { align-self: flex-start; background: var(--paper-white); border: 1px solid var(--border); color: var(--ink); }
.chat-msg .sender { font-size: var(--font-sm); margin-bottom: 4px; opacity: .7; }
.chat-msg .time { font-size: 11px; opacity: .5; margin-top: 4px; text-align: right; }
.chat-input { display: flex; gap: 8px; padding: 16px; border-top: 1px solid var(--border); background: var(--paper-white); }
.chat-input input { flex: 1; }

/* --- 样式2: 纯列表式家族卡片 --- */
.family-list { display: grid; gap: 20px; }
.family-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px 32px; transition: all .2s; display: flex; justify-content: space-between; align-items: center;
}
.family-card:hover { border-color: var(--accent-light); box-shadow: var(--shadow-hover); }
.family-card-left h3 { font-size: var(--font-lg); font-weight: 500; margin-bottom: 4px; }
.family-card-left p { font-size: var(--font-sm); color: var(--ink-lighter); }
.family-card-right { text-align: right; }
.family-card-right .surname-badge {
  display: inline-block; padding: 8px 18px; background: var(--accent-pale);
  color: var(--accent); border-radius: 20px; font-size: var(--font-md); letter-spacing: 2px;
}

/* --- 筛选栏 --- */
.filter-bar {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 24px; padding: 20px 24px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
}
.filter-bar .form-input { width: auto; min-width: 180px; }
.filter-bar label { font-size: var(--font-sm); color: var(--ink-lighter); }

/* --- 隐私提示 --- */
.privacy-tip {
  display: flex; align-items: center; gap: 8px; padding: 12px 18px; background: var(--accent-pale);
  border-radius: var(--radius); font-size: var(--font-sm); color: var(--accent); margin-bottom: 20px;
}



/* --- 主页聚合面板 --- */
.post-feed-item {
  display: block; padding: 14px 18px; border: 1px solid var(--border-light); border-radius: var(--radius);
  background: var(--bg-card); transition: all .15s; text-decoration: none; color: inherit;
}
.post-feed-item:hover { border-color: var(--accent-light); box-shadow: var(--shadow); }
.post-feed-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.post-feed-title { font-size: var(--font-sm); font-weight: 500; color: var(--ink); }
.post-feed-body { margin-top: 2px; }

.pending-item {
  display: flex; justify-content: space-between; align-items: center; padding: 8px 0;
  border-bottom: 1px solid var(--border-light); text-decoration: none; color: inherit; transition: color .15s;
}
.pending-item:last-child { border-bottom: none; }
.pending-item:hover { color: var(--accent); }

.quick-link {
  display: block; padding: 8px 12px; border-radius: var(--radius); color: var(--ink-light);
  font-size: var(--font-sm); text-decoration: none; transition: all .15s;
}
.quick-link:hover { background: var(--bg-soft); color: var(--accent); }

/* --- 问祖 · 血缘关系结果 --- */
.kinship-result-card {
  text-align: center; padding: 48px 36px !important;
  border: 2px solid var(--accent-light);
}
.kinship-icon { font-size: 3rem; margin-bottom: 16px; }
.kinship-term {
  font-size: 2.2rem; font-weight: 300; color: var(--cinnabar, #c04040);
  letter-spacing: 8px; margin-bottom: 12px;
}
.kinship-desc { font-size: var(--font-md); color: var(--ink-light); margin-bottom: 20px; line-height: 1.8; }
.kinship-path {
  display: inline-block; padding: 16px 24px; background: var(--bg-soft); border-radius: var(--radius);
  font-size: var(--font-sm); color: var(--ink-lighter); line-height: 2; text-align: left;
}
.kinship-path strong { color: var(--ink); }

/* --- 跨族谱问祖 --- */
.wenzu-person-section {
  padding: 16px 20px; margin-bottom: 4px; border-radius: var(--radius);
  background: var(--bg-soft); border: 1px solid var(--border-light);
}
.wenzu-section-title {
  font-size: var(--font-md); font-weight: 500; margin-bottom: 12px; letter-spacing: 1px;
  color: var(--accent);
}
.wenzu-person-info { margin-top: 4px; }
.wenzu-family-select, .wenzu-person-select { width: 100%; }
.wenzu-connector {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 0;
}
.wenzu-connector-line {
  width: 60px; height: 1px; background: var(--accent-light);
}
.wenzu-connector-icon { font-size: 1.2rem; }
.kinship-cross-badge {
  display: inline-block; margin-top: 16px; padding: 6px 16px;
  background: #fef8e8; border: 1px solid var(--warning); border-radius: 20px;
  font-size: 12px; color: var(--warning); letter-spacing: 1px;
}

/* --- 管理员自定义滚动条 --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--accent-light); border-radius: 3px; }

/* --- 通知铃铛 --- */
.notification-bell {
  position: relative; cursor: pointer; display: inline-flex; align-items: center;
}
.bell-icon {
  font-size: 1.3rem; line-height: 1; transition: transform .2s;
}
.notification-bell:hover .bell-icon { transform: scale(1.15); }
.bell-badge {
  position: absolute; top: -6px; right: -10px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 10px; background: var(--danger); color: #fff;
  font-size: 11px; line-height: 18px; text-align: center;
  font-weight: 600; display: none;
}
.bell-badge.has-unread { display: inline-block; }
.notification-dropdown {
  display: none; position: absolute; top: 100%; right: -10px;
  margin-top: 10px; width: 360px; max-height: 480px;
  background: var(--paper-white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: 0 8px 32px rgba(60,54,40,.12);
  z-index: 500; overflow: hidden; flex-direction: column;
}
.notification-dropdown.show { display: flex; }
.dropdown-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border-light);
}
.dropdown-title { font-size: var(--font-md); font-weight: 500; letter-spacing: 1px; }
.dropdown-markall {
  background: none; border: none; color: var(--accent); font-size: var(--font-sm);
  cursor: pointer; padding: 2px 8px; border-radius: var(--radius);
}
.dropdown-markall:hover { background: var(--accent-pale); }
.dropdown-list { overflow-y: auto; max-height: 360px; }
.dropdown-empty {
  padding: 40px 20px; text-align: center; color: var(--ink-lighter); font-size: var(--font-sm);
}
.dropdown-item {
  display: block; padding: 14px 20px; border-bottom: 1px solid var(--border-light);
  cursor: pointer; transition: background .15s; text-decoration: none; color: inherit;
}
.dropdown-item:hover { background: var(--bg-soft); }
.dropdown-item.unread { background: #fdf9f0; }
.dropdown-item.unread::before {
  content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger); margin-right: 8px; vertical-align: middle; flex-shrink: 0;
}
.dropdown-item-header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
}
.dropdown-item-title { font-size: var(--font-sm); font-weight: 500; color: var(--ink); line-height: 1.4; }
.dropdown-item-time { font-size: 11px; color: var(--ink-lighter); white-space: nowrap; }
.dropdown-item-content { font-size: 12px; color: var(--ink-lighter); margin-top: 4px; line-height: 1.5; }
.dropdown-item-badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 10px;
  background: var(--accent-pale); color: var(--accent); margin-top: 4px;
}
.dropdown-footer { padding: 10px 20px; text-align: center; border-top: 1px solid var(--border-light); }
.dropdown-footer a { font-size: var(--font-sm); color: var(--accent); }

/* --- 通知页面 --- */
.notif-page-card { max-width: 780px; margin: 0 auto; }
.notif-page-item {
  padding: 20px 24px; border-bottom: 1px solid var(--border-light); cursor: pointer;
  transition: background .15s;
}
.notif-page-item:hover { background: var(--bg-soft); }
.notif-page-item.unread { background: #fdf9f0; border-left: 3px solid var(--accent); }

/* --- 响应式 --- */
@media (max-width: 1024px) {
  .stat-cards { grid-template-columns: repeat(3, 1fr); }
  .stat-card:last-child { grid-column: span 3; }
}
@media (max-width: 768px) {
  html { font-size: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .main-nav { display: none; }
  .main-nav.open { display: flex; flex-direction: column; position: absolute; top: var(--header-h); left: 0; right: 0; background: var(--paper-white); padding: 16px 24px; border-bottom: 1px solid var(--border); gap: 12px; box-shadow: var(--shadow); }
  .mobile-menu-btn { display: block; }
  .hero-title { font-size: 2rem; letter-spacing: 6px; }
  .hero-subtitle { font-size: var(--font-md); }
  .family-header { flex-direction: column; }
  .family-tabs { overflow-x: auto; }
  .family-tabs a { padding: 10px 16px; font-size: var(--font-sm); white-space: nowrap; }
  .card { padding: 24px; }
  .auth-container .card { padding: 24px; }
  .filter-bar { flex-direction: column; }
  .filter-bar .form-input { width: 100%; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .stat-card:last-child { grid-column: span 2; }
  .dashboard-row { grid-template-columns: 1fr; }
  .quick-actions-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .hero-title { font-size: 1.6rem; letter-spacing: 3px; }
  .hero-actions { flex-direction: column; }
  .btn { width: 100%; }
  .table-wrapper { font-size: var(--font-sm); }
  thead th, tbody td { padding: 10px 12px; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .stat-card:last-child { grid-column: span 2; }
  .quick-actions-grid { grid-template-columns: 1fr; }
  .admin-tab-item { padding: 8px 14px; font-size: 12px; }
}
