/* 纪念堂 - 主样式：素雅、庄重、克制 */
:root {
    --ink: #2f3b36;
    --ink-2: #3f4f47;
    --ink-3: #6b7a72;
    --gold: #b8985a;
    --bg: #f5f3ef;
    --card: #ffffff;
    --line: #e6e2da;
    --text: #33383a;
    --muted: #8b8f8c;
    --radius: 12px;
    --shadow: 0 4px 22px rgba(47, 59, 54, .07);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.75;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--ink-2); text-decoration: none; }
a:hover { color: var(--gold); }
img { max-width: 100%; display: block; }
input, textarea, select, button { font-family: inherit; font-size: inherit; }

.serif { font-family: "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif; }

/* ---------- 布局 ---------- */
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 820px; margin: 0 auto; padding: 0 20px; }

/* ---------- 顶栏 ---------- */
.topbar {
    background: rgba(47, 59, 54, .96);
    color: #e8e6e1;
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 1px 0 rgba(255,255,255,.06);
}
.topbar .container { display: flex; align-items: center; height: 60px; gap: 22px; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 19px; letter-spacing: 4px; color: #fff; font-weight: 500; }
.logo .mark {
    width: 30px; height: 30px; border: 1.5px solid var(--gold); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--gold);
    letter-spacing: 0;
}
.logo:hover { color: #fff; }
.nav { display: flex; gap: 20px; font-size: 14.5px; }
.nav a { color: #cfcdc7; padding: 4px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a.active { color: #fff; border-color: var(--gold); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 14px; }
.top-right a { color: #cfcdc7; }
.top-right a:hover { color: var(--gold); }
.menu-toggle { display: none; background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    background: linear-gradient(160deg, #3f4f47 0%, #2f3b36 60%, #26302c 100%);
    color: #efece6;
    padding: 74px 0 68px;
    text-align: center;
    overflow: hidden;
}
.hero::before {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(circle at 50% 40%, rgba(184,152,90,.18), transparent 62%);
}
.hero .container { position: relative; }
.hero h1 { font-size: 40px; letter-spacing: 8px; font-weight: 500; margin-bottom: 14px; }
.hero p { color: #bfc4bd; font-size: 15.5px; letter-spacing: 1.5px; }

.search-box { margin: 34px auto 0; max-width: 620px; display: flex; background: #fff; border-radius: 40px; padding: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.search-box input { flex: 1; border: none; background: none; padding: 11px 20px; font-size: 15px; outline: none; color: var(--text); }
.search-box button { border: none; background: var(--ink); color: #fff; padding: 11px 30px; border-radius: 40px; cursor: pointer; letter-spacing: 2px; }
.search-box button:hover { background: var(--gold); }

.hero-stats { margin-top: 30px; display: flex; justify-content: center; gap: 46px; flex-wrap: wrap; }
.hero-stats div b { display: block; font-size: 26px; color: var(--gold); font-weight: 500; letter-spacing: 1px; }
.hero-stats div span { font-size: 13px; color: #a9b0a8; letter-spacing: 1px; }

/* ---------- 区块 ---------- */
.section { padding: 52px 0; }
.section.alt { background: #efece6; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 26px; }
.sec-head h2 { font-size: 21px; font-weight: 500; letter-spacing: 3px; color: var(--ink); display: flex; align-items: center; gap: 12px; }
.sec-head h2::before { content: ""; width: 3px; height: 18px; background: var(--gold); border-radius: 2px; }
.sec-head .more { font-size: 13.5px; color: var(--muted); }

/* ---------- 纪念馆卡片 ---------- */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.mcard {
    background: var(--card); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s;
    display: flex; flex-direction: column;
}
.mcard:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(47,59,54,.14); }
.mcard .portrait { height: 190px; background: #dedad2 center/cover no-repeat; position: relative; }
.mcard .portrait img { width: 100%; height: 100%; object-fit: cover; }
.mcard .portrait .years {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 10px;
    background: linear-gradient(transparent, rgba(30,38,34,.8)); color: #fff; font-size: 12.5px; letter-spacing: .5px;
}
.mcard .body { padding: 14px 15px 16px; }
.mcard .nm { font-size: 16.5px; color: var(--ink); letter-spacing: 1.5px; margin-bottom: 6px; }
.mcard .ep {
    font-size: 13px; color: var(--muted); height: 42px; overflow: hidden;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.mcard .meta { display: flex; gap: 14px; font-size: 12px; color: #a5a9a3; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }

/* ---------- 详情页 ---------- */
.m-hero { position: relative; padding: 54px 0 44px; background: linear-gradient(150deg, #3f4f47, #26302c); color: #eee; text-align: center; }
.m-hero .portrait-wrap {
    width: 132px; height: 132px; margin: 0 auto 18px; border-radius: 50%;
    border: 3px solid rgba(184,152,90,.7); overflow: hidden; background: #55635b;
    box-shadow: 0 8px 26px rgba(0,0,0,.3);
}
.m-hero .portrait-wrap img { width: 100%; height: 100%; object-fit: cover; }
.m-hero h1 { font-size: 32px; letter-spacing: 7px; font-weight: 500; }
.m-hero .years { color: #b6bcb4; font-size: 14px; margin-top: 8px; letter-spacing: 1px; }
.m-hero .epitaph { margin: 18px auto 0; max-width: 640px; color: #ddd8cd; font-size: 15.5px; letter-spacing: 1px; line-height: 2; }
.m-hero .ops { margin-top: 24px; display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

.btn {
    display: inline-block; padding: 9px 22px; border-radius: 30px; font-size: 14px;
    background: var(--ink); color: #fff; border: 1px solid var(--ink); cursor: pointer; letter-spacing: 1px;
    transition: all .2s;
}
.btn:hover { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn.ghost { background: transparent; color: #ddd; border-color: rgba(255,255,255,.45); }
.btn.ghost:hover { background: rgba(255,255,255,.12); color: #fff; border-color: var(--gold); }
.btn.light { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.light:hover { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn.sm { padding: 6px 15px; font-size: 13px; }
.btn.danger { background: #a4524e; border-color: #a4524e; }
.btn.danger:hover { background: #8d423e; border-color: #8d423e; }

/* 面板 */
.panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 28px; margin-bottom: 22px; }
.panel h3 { font-size: 17px; font-weight: 500; letter-spacing: 2px; color: var(--ink); margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.panel h3::before { content: ""; width: 3px; height: 15px; background: var(--gold); border-radius: 2px; }
.panel p.bio { white-space: pre-wrap; color: #4a4f4c; line-height: 2; }

.info-table { width: 100%; border-collapse: collapse; }
.info-table td { padding: 9px 4px; border-bottom: 1px dashed var(--line); font-size: 14.5px; vertical-align: top; }
.info-table td:first-child { width: 92px; color: var(--muted); }
.info-table tr:last-child td { border-bottom: none; }

/* 时间轴 */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 22px; }
.tl-item::before {
    content: ""; position: absolute; left: -24px; top: 7px; width: 9px; height: 9px;
    border-radius: 50%; background: #fff; border: 2px solid var(--gold);
}
.tl-date { font-size: 13px; color: var(--gold); letter-spacing: 1px; }
.tl-title { font-size: 15.5px; color: var(--ink); margin: 2px 0 4px; }
.tl-content { font-size: 14px; color: #6a6f6c; white-space: pre-wrap; }

/* 相册 */
.album { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.album .item { position: relative; border-radius: 8px; overflow: hidden; background: #ddd9d1; aspect-ratio: 1/1; }
.album .item img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.album .item:hover img { transform: scale(1.05); }
.album .item .cap { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(30,38,34,.72); color: #fff; font-size: 12px; padding: 5px 8px; }

/* 影音 */
.media-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.media-item { border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.media-item .cap { font-size: 14px; color: var(--ink); margin-bottom: 8px; }
.media-item video, .media-item audio { width: 100%; border-radius: 6px; }

/* 亲属 */
.rel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.rel-item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.rel-item .av { width: 46px; height: 46px; border-radius: 50%; overflow: hidden; background: #ddd9d1; flex-shrink: 0; }
.rel-item .av img { width: 100%; height: 100%; object-fit: cover; }
.rel-item .txt b { display: block; font-size: 15px; color: var(--ink); font-weight: 500; letter-spacing: 1px; }
.rel-item .txt span { font-size: 12.5px; color: var(--gold); }

/* 追思 */
.tribute-bar { display: flex; gap: 14px; margin-bottom: 20px; }
.tribute-btn {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: #fdfcfa;
    cursor: pointer; transition: all .2s;
}
.tribute-btn:hover { border-color: var(--gold); background: #fff; transform: translateY(-2px); }
.tribute-btn .ic { font-size: 22px; }
.tribute-btn .n { font-size: 13px; color: var(--muted); }
.tribute-btn b { font-size: 17px; color: var(--gold); font-weight: 500; }

.condolence { padding: 16px 0; border-bottom: 1px dashed var(--line); }
.condolence:last-child { border-bottom: none; }
.condolence .hd { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.condolence .hd b { font-size: 14.5px; color: var(--ink); font-weight: 500; }
.condolence .hd .rel { font-size: 12px; color: #fff; background: var(--gold); padding: 1px 8px; border-radius: 10px; }
.condolence .hd .tm { margin-left: auto; font-size: 12px; color: #a9adaa; }
.condolence .ct { font-size: 14.5px; color: #4d5250; white-space: pre-wrap; line-height: 1.9; }

/* 表单 */
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-size: 13.5px; color: #5c625e; margin-bottom: 6px; }
.form-row label .req { color: #b4574e; }
.form-row input[type=text], .form-row input[type=password], .form-row input[type=date],
.form-row input[type=number], .form-row select, .form-row textarea {
    width: 100%; padding: 10px 13px; border: 1px solid var(--line); border-radius: 8px;
    background: #fdfcfa; outline: none; transition: border-color .2s;
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus { border-color: var(--ink-3); background: #fff; }
.form-row textarea { min-height: 96px; resize: vertical; line-height: 1.8; }
.form-row .hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.hint-inline { font-size: 12px; color: #a5a9a3; font-weight: normal; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 20px; }
.radio-inline { display: flex; gap: 18px; padding: 8px 0; font-size: 14px; }
.radio-inline label { display: inline-flex; align-items: center; gap: 5px; margin: 0; }

/* 提示 */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; }
.alert.success { background: #edf5ee; color: #3c6b45; border: 1px solid #d5e8d8; }
.alert.error { background: #fbeceb; color: #9c4a45; border: 1px solid #f0d6d3; }
.alert.info { background: #eef2f6; color: #46617c; border: 1px solid #d8e3ee; }

.empty { text-align: center; padding: 46px 20px; color: var(--muted); font-size: 14.5px; }
.empty .ic { font-size: 36px; display: block; margin-bottom: 10px; opacity: .5; }

.pager { display: flex; justify-content: center; gap: 8px; margin-top: 30px; }
.pager a { padding: 7px 14px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 14px; }
.pager a.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.pager a:hover { border-color: var(--gold); }

/* 页脚 */
.footer { background: #26302c; color: #9aa19a; padding: 40px 0 26px; margin-top: 40px; font-size: 13.5px; }
.footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; }
.footer h4 { color: #e2dfd8; font-size: 15px; letter-spacing: 2px; margin-bottom: 12px; font-weight: 500; }
.footer a { color: #9aa19a; display: block; padding: 3px 0; }
.footer a:hover { color: var(--gold); }
.footer .bottom { border-top: 1px solid rgba(255,255,255,.08); margin-top: 26px; padding-top: 18px; text-align: center; font-size: 13px; }

/* ---------- 布局辅助 ---------- */
.m-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

/* ---------- 家族树 ---------- */
.tree { text-align: center; }
.t-layer-label { font-size: 12.5px; color: #a5a9a3; letter-spacing: 2px; margin: 8px 0 6px; }
.t-layer { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.t-link { width: 1px; height: 26px; background: #d8d3c9; margin: 0 auto; }
.tnode {
    width: 96px; padding: 12px 8px; border: 1px solid var(--line); border-radius: 10px;
    background: #fdfcfa; display: block; transition: all .2s;
}
.tnode:hover { border-color: var(--gold); background: #fff; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(47,59,54,.1); }
.tnode.center { border-color: var(--gold); background: #fff; box-shadow: 0 0 0 2px rgba(184,152,90,.22); }
.tnode.center .tnm { font-size: 16px; }
.tav {
    width: 44px; height: 44px; border-radius: 50%; overflow: hidden; margin: 0 auto 8px;
    background: #ddd9d1; display: flex; align-items: center; justify-content: center;
    color: #9aa19a; font-size: 18px;
}
.tav img { width: 100%; height: 100%; object-fit: cover; }
.tnm { font-size: 14.5px; color: var(--ink); letter-spacing: 1px; }
.tyr { font-size: 11.5px; color: #a5a9a3; margin-top: 2px; }
.tgen { font-size: 11px; color: var(--gold); }
.trel { font-size: 11px; color: #fff; background: var(--gold); display: inline-block; padding: 0 7px; border-radius: 9px; margin-top: 4px; }
.t-join { align-self: center; color: #c5c0b6; font-size: 14px; }

/* ---------- 省市县选择 ---------- */
.region-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.region-picker select, .region-picker input { width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fdfcfa; outline: none; font-size: 14px; }
.region-picker select:focus, .region-picker input:focus { border-color: var(--ink-3); background: #fff; }
.region-picker .rp-full { grid-column: 1 / -1; }

/* ---------- 祭扫节令 ---------- */
.fest-bar {
    display: flex; align-items: center; gap: 14px; margin-bottom: 20px;
    padding: 14px 20px; border-radius: 10px;
    background: linear-gradient(135deg, #3f4f47, #2f3b36); color: #efece6;
    box-shadow: 0 6px 20px rgba(47, 59, 54, .18);
}
.fest-bar.soft { background: #fff; border: 1px solid var(--line); color: var(--ink); box-shadow: var(--shadow); }
.fest-bar .fb-icon { font-size: 26px; }
.fest-bar .fb-text b { display: block; font-size: 15.5px; letter-spacing: 1px; font-weight: 500; }
.fest-bar .fb-text span { font-size: 13px; opacity: .85; }
.fest-bar.soft .fb-text span { color: var(--muted); opacity: 1; }

/* ---------- 供桌 ---------- */
.offer-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.offer-btn {
    display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 6px;
    border: 1px solid var(--line); border-radius: 10px; background: #fdfcfa; cursor: pointer;
    transition: all .2s; font-family: inherit;
}
.offer-btn:hover { border-color: var(--gold); background: #fff; transform: translateY(-2px); box-shadow: 0 6px 14px rgba(47, 59, 54, .08); }
.offer-btn .oi { font-size: 22px; line-height: 1; }
.offer-btn .oname { font-size: 13px; color: var(--ink); }
.offer-btn .ocnt { font-size: 12px; color: var(--gold); }

.offer-form { background: #faf8f4; border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 16px; }
.offer-form .of-title { font-size: 13.5px; color: #5c625e; margin-bottom: 8px; }
.offer-form .of-title b { color: var(--ink); }
.offer-form .of-title span { color: var(--muted); font-size: 12.5px; margin-left: 6px; }
.offer-form input { padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; outline: none; }

.offers { display: flex; flex-direction: column; gap: 10px; }
.offer-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fdfcfa; }
.offer-item.new { animation: offerIn .5s ease; border-color: var(--gold); }
@keyframes offerIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.offer-item .oi { font-size: 24px; line-height: 1; }
.offer-item .obody { flex: 1; min-width: 0; }
.offer-item .ohead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; }
.offer-item .ohead b { color: var(--ink); font-weight: 500; }
.offer-item .oname-sm { font-size: 12px; color: var(--muted); }
.offer-item .ofest { font-size: 11.5px; color: #fff; background: var(--gold); padding: 0 7px; border-radius: 9px; }
.offer-item .otime { margin-left: auto; font-size: 12px; color: #a5a9a3; }
.offer-item .omsg { font-size: 13.5px; color: #5c625e; margin-top: 4px; line-height: 1.7; }

/* 移动端 */
@media (max-width: 900px) {
    .grid { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .m-layout { grid-template-columns: 1fr; }
    .album { grid-template-columns: repeat(3, 1fr); }
    .rel-grid { grid-template-columns: repeat(2, 1fr); }
    .media-list { grid-template-columns: 1fr; }
    .footer .cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .hero h1 { font-size: 27px; letter-spacing: 4px; }
    .hero-stats { gap: 26px; }
    .form-grid { grid-template-columns: 1fr; }
    .nav {
        display: none; position: absolute; top: 60px; left: 0; right: 0;
        background: #26302c; flex-direction: column; padding: 10px 20px 16px; gap: 10px;
    }
    .nav.show { display: flex; }
    .menu-toggle { display: block; }
    .top-right { gap: 10px; font-size: 13px; }
    .m-hero h1 { font-size: 25px; letter-spacing: 4px; }
    .tnode { width: 80px; padding: 10px 6px; }
    .tav { width: 38px; height: 38px; font-size: 15px; }
    .t-layer { gap: 8px; }
    .t-link { height: 18px; }
    .grid-3 { grid-template-columns: 1fr; }
    .region-picker { grid-template-columns: 1fr 1fr; }
    .region-picker .rp-area { grid-column: 1 / -1; }
    .offer-bar { grid-template-columns: repeat(4, 1fr); gap: 8px; }
    .offer-btn { padding: 10px 4px; }
    .offer-btn .oi { font-size: 19px; }
    .offer-btn .oname { font-size: 12px; }
}
