:root {
  --red: #9e2b25;
  --red-deep: #7c1f1a;
  --gold: #c8a45c;
  --gold-soft: #e7d3a6;
  --paper: #faf6ef;
  --paper-2: #f3ece0;
  --ink: #2c2622;
  --muted: #8a7f74;
  --line: #e5dccb;
  --green: #1f7a4d;
  --shadow: 0 2px 12px rgba(120, 70, 30, 0.08);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  font-size: 15px;
}
a { color: inherit; text-decoration: none; }

/* Header */
.site-header {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-deep) 100%);
  color: #fff;
  padding: 22px 18px 18px;
  position: relative;
  text-align: center;
  box-shadow: var(--shadow);
}
.brand-main { font-size: 22px; font-weight: 800; letter-spacing: 2px; }
.brand-sub { font-size: 14px; opacity: 0.92; margin-top: 4px; letter-spacing: 1px; }
.brand-slogan { font-size: 12.5px; opacity: 0.78; margin-top: 6px; }
.account-btn {
  position: absolute; top: 14px; right: 14px;
  background: rgba(255,255,255,0.16); color: #fff; border: 1px solid rgba(255,255,255,0.4);
  border-radius: 16px; padding: 4px 12px; font-size: 12.5px; cursor: pointer;
}
.account-btn:hover { background: rgba(255,255,255,0.28); }
.help-btn {
  position: absolute; top: 12px; right: 116px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,0.16); color: #fff; border: 1px solid rgba(255,255,255,0.4);
  font-size: 15px; font-weight: 700; cursor: pointer; line-height: 1; padding: 0;
}
.help-btn:hover { background: rgba(255,255,255,0.28); }

/* Help panel */
.help-wrap { font-size: 14px; line-height: 1.7; }
.help-lead { background: #fff7e9; border: 1px solid var(--gold-soft); border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; color: var(--ink); }
.help-sec { margin-bottom: 14px; }
.help-sec h4 { margin: 0 0 6px; color: var(--red); font-size: 14.5px; }
.help-sec ul { margin: 0; padding-left: 2px; list-style: none; }
.help-sec li { margin-bottom: 4px; }
.help-sec label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.help-sec input[type=checkbox] { margin-top: 4px; }
.help-sec p { margin: 4px 0; color: var(--ink); }

/* Top nav */
.top-nav {
  display: flex; gap: 6px; overflow-x: auto; padding: 10px 12px;
  background: var(--paper-2); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.top-nav::-webkit-scrollbar { display: none; }
.nav-item {
  flex: 0 0 auto; padding: 7px 16px; border-radius: 18px;
  background: #fff; border: 1px solid var(--line); color: var(--ink);
  font-size: 14px; cursor: pointer; white-space: nowrap;
}
.nav-item.active { background: var(--red); color: #fff; border-color: var(--red); }

/* Container */
.container { max-width: 760px; margin: 0 auto; padding: 14px 14px 40px; }

/* Cards */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.section-title {
  display: flex; align-items: center; gap: 8px; margin: 18px 2px 10px;
  font-size: 16px; font-weight: 700; color: var(--red-deep);
}
.section-title::before {
  content: ""; width: 4px; height: 16px; background: var(--gold); border-radius: 2px;
}
.section-more { margin-left: auto; font-size: 12.5px; color: var(--muted); font-weight: 400; }

/* Banner / quick entries */
.banner {
  background: linear-gradient(135deg, #fff7e9, #fbeede);
  border: 1px solid var(--gold-soft); border-radius: 14px;
  padding: 16px; text-align: center; margin-bottom: 14px;
}
.banner h2 { margin: 0 0 6px; color: var(--red); font-size: 18px; }
.banner p { margin: 0; color: var(--muted); font-size: 13px; }
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.quick-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 10px; text-align: center; cursor: pointer; box-shadow: var(--shadow);
}
.quick-card .qc-icon { font-size: 24px; }
.quick-card .qc-label { margin-top: 6px; font-size: 14px; color: var(--ink); font-weight: 600; }

/* List items */
.list-item { border-bottom: 1px dashed var(--line); padding: 12px 2px; cursor: pointer; }
.list-item:last-child { border-bottom: none; }
.list-item h3 { margin: 0 0 4px; font-size: 15.5px; color: var(--ink); }
.list-item .meta { font-size: 12px; color: var(--muted); }
.pin-badge {
  display: inline-block; background: var(--red); color: #fff; font-size: 11px;
  padding: 1px 7px; border-radius: 8px; margin-right: 6px; vertical-align: middle;
}
.tag {
  display: inline-block; background: var(--paper-2); color: var(--muted);
  font-size: 11.5px; padding: 1px 8px; border-radius: 8px; margin-right: 6px;
}
.status-pending { color: var(--gold); }
.status-rejected { color: var(--red); }

/* Finance */
.fin-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; background: #fff; box-shadow: var(--shadow); cursor: pointer; }
.fin-project { font-weight: 700; font-size: 15.5px; color: var(--red-deep); }
.fin-stats { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.fin-stat { flex: 1; min-width: 90px; background: var(--paper); border-radius: 10px; padding: 8px 10px; text-align: center; }
.fin-stat .lab { font-size: 11.5px; color: var(--muted); }
.fin-stat .val { font-size: 16px; font-weight: 700; margin-top: 2px; }
.fin-stat.income .val { color: var(--red); }
.fin-stat.expense .val { color: var(--ink); }
.fin-stat.balance .val { color: var(--green); }

.donation-board { margin-top: 10px; }
.donation-board .db-title { font-size: 13px; color: var(--gold); font-weight: 700; margin-bottom: 6px; }
.donation-list { display: flex; flex-wrap: wrap; gap: 6px; }
.donation-chip {
  display: flex; align-items: center; gap: 6px; background: #fff8ec;
  border: 1px solid var(--gold-soft); border-radius: 16px; padding: 3px 10px; font-size: 12.5px;
}
.donation-chip .amt { color: var(--red); font-weight: 700; }
.empty { color: var(--muted); text-align: center; padding: 24px 0; font-size: 13.5px; }

/* Detail */
.detail-back { color: var(--muted); font-size: 13px; cursor: pointer; margin-bottom: 8px; display: inline-block; }
.detail-title { font-size: 19px; font-weight: 800; color: var(--red-deep); margin: 6px 0 8px; }
.detail-meta { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
.detail-body { white-space: pre-wrap; word-break: break-word; font-size: 15px; }
.detail-cover { width: 100%; border-radius: 12px; margin: 10px 0; }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.tbl th, .tbl td { border: 1px solid var(--line); padding: 7px 8px; text-align: left; }
.tbl th { background: var(--paper-2); color: var(--muted); font-weight: 600; }
.tbl .amt-in { color: var(--red); }
.tbl .amt-out { color: var(--ink); }
.receipt-img { max-width: 60px; max-height: 50px; border-radius: 6px; cursor: pointer; }

/* Buttons */
.btn-primary {
  background: var(--red); color: #fff; border: none; border-radius: 10px;
  padding: 10px 16px; font-size: 14.5px; cursor: pointer; width: 100%; margin-top: 8px;
}
.btn-primary:hover { background: var(--red-deep); }
.btn-ghost {
  background: #fff; color: var(--red); border: 1px solid var(--red);
  border-radius: 10px; padding: 8px 14px; font-size: 13.5px; cursor: pointer;
}
.btn-ghost:hover { background: #fdf0ee; }
.btn-line {
  background: #fff; color: var(--ink); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 14px; font-size: 13.5px; cursor: pointer;
}
.btn-danger { color: var(--red); border-color: var(--red); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.subtitle { font-size: 14.5px; font-weight: 800; color: var(--red-deep); margin: 18px 0 8px; padding-left: 10px; border-left: 4px solid var(--gold); }
.btn-ghost.sm { padding: 4px 10px; font-size: 12.5px; }
.card-tools { display: flex; gap: 6px; margin-top: 10px; justify-content: flex-end; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Footer */
.site-footer {
  background: var(--paper-2); border-top: 1px solid var(--line);
  text-align: center; padding: 18px 14px 26px; color: var(--muted); font-size: 12.5px;
}
.admin-entry { display: inline-block; margin-top: 8px; color: var(--red); font-weight: 600; }

/* Modal */
.modal-mask {
  position: fixed; inset: 0; background: rgba(40, 25, 15, 0.45);
  display: flex; align-items: flex-end; justify-content: center; z-index: 100;
}
@media (min-width: 600px) { .modal-mask { align-items: center; } }
.modal {
  background: #fff; width: 100%; max-width: 460px; border-radius: 16px 16px 0 0;
  padding: 16px 18px 20px; animation: slideUp .2s ease;
  max-height: 86vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
@media (min-width: 600px) { .modal { border-radius: 16px; } }
@keyframes slideUp { from { transform: translateY(30px); opacity: .6 } to { transform: translateY(0); opacity: 1 } }
.modal-lg { max-width: 600px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.modal-close { background: none; border: none; font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer; }
.input {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14.5px; margin-bottom: 10px; font-family: inherit;
}
.input:focus { outline: none; border-color: var(--gold); }
.modal-msg { color: var(--red); font-size: 13px; min-height: 18px; margin-bottom: 6px; }
.modal-switch { text-align: center; font-size: 13px; color: var(--muted); margin-top: 10px; cursor: pointer; }
.modal-switch span { color: var(--red); }

/* Forms in modal */
.form-row { margin-bottom: 10px; }
.form-row label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.form-row input, .form-row textarea, .form-row select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14.5px; font-family: inherit;
}
.form-row textarea { min-height: 90px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
@media (max-width: 420px) { .form-grid { grid-template-columns: 1fr; } }
.form-actions { display: flex; gap: 10px; margin-top: 12px; }
.form-actions .btn-primary { margin-top: 0; }

/* 留言板（宗亲互动） */
.gb-tabs { display: flex; margin-top: 6px; }
.gb-tab {
  flex: 1; text-align: center; padding: 10px 0; font-size: 14.5px; font-weight: 600;
  background: var(--paper-2); color: var(--muted); border: 1px solid var(--line);
  cursor: pointer; user-select: none;
}
.gb-tab:first-child { border-radius: 10px 0 0 10px; }
.gb-tab:last-child { border-radius: 0 10px 10px 0; }
.gb-tab.active { background: var(--red-deep); color: #fff; border-color: var(--red-deep); }
.gb-sub { text-align: center; color: var(--ink); font-size: 14px; margin: 14px 0 10px; }
.gb-list {
  background: #fff; border: 1px solid var(--line); border-top: 4px dashed var(--red-deep);
  border-radius: 8px; padding: 6px 14px; min-height: 90px;
}
.gb-empty { text-align: center; color: var(--muted); padding: 28px 0; font-size: 13.5px; }
.gb-item { padding: 10px 2px; border-bottom: 1px dashed var(--line); }
.gb-item:last-child { border-bottom: none; }
.gb-item-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13.5px; }
.gb-item-head b { color: var(--red-deep); }
.gb-time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.gb-del { color: var(--red); cursor: pointer; margin-left: 8px; font-size: 12px; }
.gb-item-body { margin-top: 3px; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.gb-form { margin-top: 16px; }
.gb-form-title { font-weight: 700; color: var(--red-deep); font-size: 14.5px; margin-bottom: 8px; }
.gb-textarea { min-height: 90px; resize: vertical; }
.gb-actions { display: flex; justify-content: flex-end; }
.gb-submit {
  background: var(--red); color: #fff; border: none; border-radius: 8px;
  padding: 9px 22px; font-size: 14.5px; font-weight: 600; cursor: pointer;
}
.gb-submit:hover { background: var(--red-deep); }

/* 家族源流 · 家庭树列表 */
.fam-tip { font-size: 12.5px; color: var(--muted); margin: 2px 2px 12px; line-height: 1.6; }
.fam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.fam-card {
  background: linear-gradient(135deg, #fff7e9, #fbeede);
  border: 1px solid var(--gold-soft); border-radius: 14px; padding: 16px 16px 14px;
  cursor: pointer; transition: box-shadow .15s, transform .15s, border-color .15s;
}
.fam-card:hover { box-shadow: 0 6px 20px rgba(120,70,30,.14); transform: translateY(-2px); border-color: var(--gold); }
.fam-name { font-size: 16px; font-weight: 800; color: var(--red-deep); }
.fam-note { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.5; min-height: 18px; }
.fam-meta { font-size: 12.5px; color: var(--gold); margin-top: 10px; font-weight: 600; }

/* 家族源流 · 关系树状图（父上子下 · 连线分支） */
.tree {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 10px 22px; box-shadow: var(--shadow);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.tree ul {
  list-style: none; margin: 0; padding: 26px 0 0; position: relative;
  display: flex; justify-content: center;
}
.tree > ul { padding-top: 0; }
.tree li { position: relative; display: flex; flex-direction: column; align-items: center; padding: 26px 7px 0; }
.tree > ul > li { padding-top: 0; }
.tree > ul > li::before, .tree > ul > li::after { display: none; }
/* 子节点连接线：横向汇流线 + 纵向下落线 */
.tree li::before, .tree li::after {
  content: ''; position: absolute; top: 0; right: 50%;
  width: 50%; height: 26px; border-top: 2px solid var(--gold-soft);
}
.tree li::after { right: auto; left: 50%; border-left: 2px solid var(--gold-soft); }
.tree li:only-child { padding-top: 0; }
.tree li:only-child::before, .tree li:only-child::after { display: none; }
.tree li:first-child::before, .tree li:last-child::after { border-top: 0 none; }
.tree li:last-child::before { border-right: 2px solid var(--gold-soft); border-radius: 0 10px 0 0; }
.tree li:first-child::after { border-radius: 10px 0 0 0; }
/* 父节点底部到汇流线的竖线 */
.tree ul ul::before {
  content: ''; position: absolute; top: 0; left: 50%;
  width: 0; height: 26px; border-left: 2px solid var(--gold-soft);
}
/* 成员节点卡片：人名 + 简介 + 加子女按钮 */
.tree-node {
  width: 168px; flex: 0 0 auto; display: flex; align-items: stretch; gap: 6px;
  background: linear-gradient(135deg, #fff7e9, #fbeede);
  border: 1px solid var(--gold-soft); border-radius: 12px;
  padding: 10px 10px 9px; transition: box-shadow .15s, transform .15s, border-color .15s;
}
.tree-node:hover { box-shadow: 0 4px 16px rgba(120,70,30,.14); transform: translateY(-1px); border-color: var(--gold); }
.tn-main { min-width: 0; flex: 1; text-align: center; }
.tn-name { font-weight: 700; font-size: 14.5px; color: var(--red-deep); }
.tn-name .tn-gen { font-size: 11px; color: var(--gold); font-weight: 600; margin-left: 4px; }
.tn-deceased { font-size: 11px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.tn-add {
  align-self: center; flex: 0 0 auto; width: 24px; height: 24px; line-height: 22px;
  text-align: center; border-radius: 50%; background: #fff; border: 1px solid var(--gold);
  color: var(--red-deep); font-size: 16px; font-weight: 700; cursor: pointer; user-select: none;
  transition: background .12s, transform .12s;
}
.tn-add:hover { background: var(--gold); color: #fff; transform: scale(1.08); }
/* 空家庭树：点击创建始祖 */
.tree-placeholder {
  display: block; text-align: center; color: var(--gold); cursor: pointer;
  border: 2px dashed var(--gold-soft); border-radius: 14px; padding: 30px 12px;
  font-size: 14px; font-weight: 600; background: #fff;
  transition: background .12s, border-color .12s;
}
.tree-placeholder:hover { background: #fffaf0; border-color: var(--gold); }
.tn-branch {
  display: inline-block; font-size: 11px; line-height: 1.6;
  color: #fff; background: var(--gold); border-radius: 8px;
  padding: 0 9px; margin-top: 4px;
}
.tn-intro {
  font-size: 11.5px; color: var(--muted); margin-top: 4px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* 沈氏祖茔 · 网上拜祭 */
.worship-box { background: #fff8ec; border: 1px solid var(--gold-soft); border-radius: 14px; padding: 14px; margin: 14px 0; text-align: center; }
.worship-title { font-weight: 700; color: var(--red-deep); font-size: 14.5px; margin-bottom: 10px; }
.worship-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.worship-btn {
  flex: 1; min-width: 92px; background: #fff; border: 1px solid var(--gold);
  color: var(--red-deep); border-radius: 12px; padding: 12px 8px; font-size: 14.5px;
  font-weight: 600; cursor: pointer; font-family: inherit;
  transition: transform .12s, background .12s;
}
.worship-btn:hover { background: #fdf0ee; }
.worship-btn:active { transform: scale(.95); }
.worship-btn .wc { display: inline-block; margin-left: 4px; font-size: 12.5px; color: var(--muted); font-weight: 400; }
.worship-hint { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* 沈氏祖茔 · 祈福留言 */
.pray-sec { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-top: 14px; }
.pray-title { font-weight: 700; color: var(--red-deep); font-size: 14.5px; margin-bottom: 10px; }
.pray-form { margin-top: 12px; }
.pray-textarea { min-height: 70px; resize: vertical; }
.pray-item { padding: 10px 2px; border-bottom: 1px dashed var(--line); }
.pray-item:last-child { border-bottom: none; }
.pray-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13.5px; }
.pray-head b { color: var(--red-deep); }
.pray-body { margin-top: 3px; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.mod-card {
  display: flex; gap: 12px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; margin-bottom: 10px; cursor: pointer; box-shadow: var(--shadow);
}
.mod-img { width: 92px; height: 92px; object-fit: cover; border-radius: 10px; flex: 0 0 auto; }
.mod-info { flex: 1; min-width: 0; }
.mod-title { font-weight: 700; font-size: 15.5px; color: var(--red-deep); }
.mod-subtitle { font-size: 13px; color: var(--gold); margin-top: 2px; }
.mod-preview { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.6; }
.detail-subtitle { color: var(--gold); font-size: 14px; margin: -4px 0 8px; }

/* Replies */
.reply { background: var(--paper); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.reply .r-meta { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.reply-box { margin-top: 12px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%);
  background: rgba(40,25,15,.92); color: #fff; padding: 10px 18px; border-radius: 22px;
  font-size: 13.5px; z-index: 200; max-width: 80%;
}

/* Image preview lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.8); display:flex; align-items:center; justify-content:center; z-index: 300; }
.lightbox img { max-width: 92%; max-height: 88%; border-radius: 8px; }

/* ===== 财务活动详情（收支明细 + 捐资榜 分区版式） ===== */
.fin-tip { text-align: center; font-size: 12.5px; color: var(--muted); margin: -6px 0 12px; }
.fin-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 12px; }
.fin-head h2 { margin: 0; font-size: 18px; color: var(--red-deep); }
.row-tools { display: inline-flex; gap: 8px; flex: 0 0 auto; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px; cursor: pointer;
  background: var(--paper); color: var(--gold); font-size: 14px; border: 1px solid var(--line);
}
.icon-btn:hover { background: var(--gold); color: #fff; }
.icon-btn.danger { color: #b04a3a; }
.icon-btn.danger:hover { background: #b04a3a; color: #fff; }
.fin-sec {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 2px dashed var(--line); border-bottom: 2px dashed var(--line);
  padding: 8px 2px; margin: 16px 0 8px;
}
.fs-title { font-weight: 700; font-size: 14.5px; color: var(--red-deep); }
.fs-total { font-style: normal; font-weight: 400; font-size: 12.5px; color: var(--muted); margin-left: 8px; }
.btn-mini {
  background: var(--red-deep); color: #fff; border: none; border-radius: 8px;
  padding: 6px 14px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.btn-mini:hover { filter: brightness(1.1); }
.entry-row {
  display: flex; align-items: flex-start; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; margin-bottom: 8px;
}
.entry-main { flex: 1 1 auto; min-width: 0; }
.entry-line { font-size: 14px; color: var(--ink); }
.entry-line b.amt-in { color: #b04a3a; margin-left: 4px; }
.entry-line b.amt-out { color: #2f6b3a; margin-left: 4px; }
.entry-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.entry-sub .lnk { color: var(--gold); cursor: pointer; text-decoration: underline; }
.chip { flex: 0 0 auto; font-size: 11.5px; border-radius: 6px; padding: 2px 8px; margin-top: 2px; }
.chip-in { background: #f7e6e2; color: #b04a3a; }
.chip-out { background: #e6efe7; color: #2f6b3a; }
.gen { font-size: 12px; color: var(--muted); }

/* ===== 弹窗表单（截图版式：单列紧凑） ===== */
.form-row .req { color: #b04a3a; font-style: normal; margin-left: 2px; }
.receipt-row { display: flex; gap: 8px; align-items: center; }
.receipt-row .input { flex: 1 1 auto; min-width: 0; }
.upload-btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 12px; font-size: 13px; cursor: pointer; color: var(--ink); white-space: nowrap;
}
.upload-btn:hover { border-color: var(--gold); color: var(--red-deep); }
.field-hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.form-actions .btn-primary { flex: 0 0 88px; margin-top: 0; }
.form-actions .btn-line { flex: 0 0 72px; }

/* ===== 家族事务（首页精展示卡片） ===== */
.aff-card {
  display: flex; gap: 12px; align-items: stretch;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; margin-bottom: 10px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .05s;
}
.aff-card:hover { border-color: var(--gold); box-shadow: 0 3px 12px rgba(150,40,30,.08); }
.aff-card:active { transform: scale(.997); }
.aff-cover { width: 84px; height: 84px; object-fit: cover; border-radius: 9px; flex: 0 0 auto; background: #f3ede4; }
.aff-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.aff-title { font-size: 15.5px; font-weight: 700; color: var(--ink); line-height: 1.35; }
.aff-preview { font-size: 13px; color: var(--muted); margin-top: 5px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.aff-info .meta { margin-top: auto; padding-top: 7px; }

/* ===== 折叠：查看更多 / 下拉显示更多 ===== */
.more-items { display: block; }
.more-toggle {
  display: block; text-align: center; cursor: pointer; user-select: none;
  margin: 6px 0 2px; padding: 11px 12px; border-radius: 10px;
  background: var(--paper); border: 1px dashed var(--line); color: var(--red-deep);
  font-size: 13.5px; font-weight: 600; letter-spacing: .5px;
  transition: border-color .15s, background .15s;
}
.more-toggle:hover { border-color: var(--gold); background: #fff8f2; }
.more-toggle .mt-show .mt-d { display: inline; }
.more-toggle .mt-show .mt-m { display: none; }
.more-toggle .mt-hide { display: none; }
.more-toggle.on .mt-show { display: none; }
.more-toggle.on .mt-hide { display: inline; }
@media (max-width: 600px) {
  .more-toggle .mt-show .mt-d { display: none; }
  .more-toggle .mt-show .mt-m { display: inline; }
  .more-toggle { padding: 13px 12px; }
}

/* ===== 族谱 / 家族成员 ===== */
.mem-card { display: flex; gap: 12px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .05s; }
.mem-card:hover { border-color: var(--gold); box-shadow: 0 3px 12px rgba(150,40,30,.08); }
.mem-card:active { transform: scale(.997); }
.mem-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: #f0e9df; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.mem-avatar-empty { display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; color: #fff; background: var(--red-deep); }
.mem-info { flex: 1 1 auto; min-width: 0; }
.mem-name { font-size: 15.5px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mem-gen { font-size: 11.5px; font-weight: 600; color: var(--gold); background: #fbf3e6; border: 1px solid #efdfc4; padding: 1px 7px; border-radius: 20px; }
.mem-deceased { font-size: 11.5px; font-weight: 600; color: #9a8f86; background: #f1ece6; border: 1px solid #e3dccd; padding: 1px 7px; border-radius: 20px; }
.mem-branch { font-size: 13px; color: var(--red-deep); margin-top: 3px; }
.mem-bio { font-size: 13px; color: var(--muted); margin-top: 5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
