/* =========================================================================
   网墓 · 网上纪念馆  前端设计系统
   宣纸底色 / 墨色文字 / 铜金点缀 / 宋体标题
   ========================================================================= */

:root {
    --ink: #241f1a;
    --ink-2: #3d352c;
    --ink-3: #5b5145;
    --muted: #8b7f6f;
    --paper: #f7f3eb;
    --paper-2: #efe8da;
    --card: #fffdf8;
    --line: #e5dcca;
    --line-strong: #d5c8b1;
    --bronze: #8c6a43;
    --bronze-2: #6f5335;
    --bronze-3: #b08f63;
    --cinnabar: #9b3d31;
    --shadow-sm: 0 1px 2px rgba(52, 40, 24, .05);
    --shadow: 0 10px 26px -18px rgba(52, 40, 24, .5), 0 2px 6px rgba(52, 40, 24, .04);
    --shadow-lg: 0 34px 60px -34px rgba(52, 40, 24, .55);
    --radius: 12px;
    --wrap: 1120px;
    --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", SimSun, serif;
    --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.75;
    color: var(--ink-2);
    background-color: var(--paper);
    background-image:
        radial-gradient(1200px 520px at 50% -180px, #fdfaf2 0%, rgba(253, 250, 242, 0) 70%),
        repeating-linear-gradient(0deg, rgba(160, 140, 110, .028) 0 1px, transparent 1px 4px);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--bronze-2); text-decoration: none; }
a:hover { color: var(--bronze); }
h1, h2, h3, h4 { margin: 0; font-weight: 700; color: var(--ink); }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }

::selection { background: rgba(176, 143, 99, .28); }

:focus-visible {
    outline: 2px solid rgba(140, 106, 67, .45);
    outline-offset: 2px;
    border-radius: 4px;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }
.wrap--narrow { max-width: 820px; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------- 页头 */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(247, 243, 235, .88);
    -webkit-backdrop-filter: blur(14px) saturate(1.1);
    backdrop-filter: blur(14px) saturate(1.1);
    border-bottom: 1px solid rgba(213, 200, 177, .65);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 18px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-seal {
    width: 32px; height: 32px; border-radius: 7px; flex: none;
    background: linear-gradient(160deg, #ac4a3c, var(--cinnabar));
    color: #fdf6ec; font-family: var(--serif); font-size: 15px; font-weight: 700;
    display: grid; place-items: center; letter-spacing: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3), 0 6px 14px -10px rgba(120, 40, 30, .9);
}
.brand-name { font-family: var(--serif); font-size: 19px; font-weight: 700; letter-spacing: .12em; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: .22em; margin-left: 2px; }

.nav { display: flex; align-items: center; gap: 4px; font-size: 14px; }
.nav a { padding: 8px 12px; border-radius: 8px; color: var(--ink-2); transition: .18s; }
.nav a:hover { background: rgba(255, 255, 255, .8); color: var(--bronze-2); }
.nav .nav-cta {
    margin-left: 6px; padding: 9px 18px; border-radius: 999px; color: #fdf8ef;
    background: linear-gradient(180deg, #9a764b, #7d5c38);
    box-shadow: 0 10px 20px -14px rgba(90, 65, 35, .95);
}
.nav .nav-cta:hover { color: #fff; filter: brightness(1.06); background: linear-gradient(180deg, #a37e51, #85623c); }
.nav-user { color: var(--muted); font-size: 13px; padding: 0 4px; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav form { display: inline; margin: 0; }
.nav button.linklike {
    background: none; border: 0; font: inherit; color: var(--muted); cursor: pointer; padding: 8px 10px; border-radius: 8px;
}
.nav button.linklike:hover { color: var(--cinnabar); background: rgba(255, 255, 255, .7); }

/* 移动端菜单（原生 details，无需 JS） */
.mnav { display: none; position: relative; }
.mnav summary {
    list-style: none; cursor: pointer; padding: 8px 14px; font-size: 14px;
    border: 1px solid var(--line-strong); border-radius: 9px; color: var(--ink-2); background: rgba(255, 255, 255, .6);
}
.mnav summary::-webkit-details-marker { display: none; }
.mnav[open] summary { border-color: var(--bronze-3); }
.mnav-panel {
    position: absolute; right: 0; top: calc(100% + 10px); min-width: 200px; padding: 8px;
    background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
    display: grid;
}
.mnav-panel a, .mnav-panel button {
    display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 8px;
    font-size: 14px; color: var(--ink-2); text-decoration: none; background: none; border: 0; font-family: inherit; cursor: pointer;
}
.mnav-panel a:hover, .mnav-panel button:hover { background: var(--paper-2); }
.mnav-sep { height: 1px; background: var(--line); margin: 6px 8px; }

@media (max-width: 860px) {
    .nav { display: none; }
    .mnav { display: block; }
}

/* ---------------------------------------------------------------- 主体 */
.site-main { min-height: 60vh; padding-bottom: 8px; }

.alert {
    max-width: var(--wrap); margin: 18px auto 0; padding: 13px 18px;
    border-radius: 10px; font-size: 14px; border: 1px solid transparent; display: flex; gap: 10px; align-items: flex-start;
}
.alert-success { background: #f1f6ef; border-color: #cddcc6; color: #3d583d; }
.alert-info { background: #f2f1fa; border-color: #d4d1e6; color: #46406a; }
.alert-error { background: #fbf1ef; border-color: #e8cdc7; color: #8a3728; }
.alert ul { margin: 0; padding-left: 18px; }

/* ---------------------------------------------------------------- 按钮 */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5em;
    padding: 11px 22px; border-radius: 999px; font-size: 15px; font-family: inherit;
    border: 1px solid transparent; cursor: pointer; transition: .2s; line-height: 1.2;
    text-decoration: none; white-space: nowrap;
}
.btn-primary {
    background: linear-gradient(180deg, #9a764b, #7d5c38); color: #fdf8ef;
    box-shadow: 0 12px 24px -16px rgba(90, 65, 35, .95), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary:hover { color: #fff; filter: brightness(1.06); transform: translateY(-1px); }
.btn-ghost { background: rgba(255, 255, 255, .6); border-color: var(--line-strong); color: var(--ink-2); }
.btn-ghost:hover { background: #fff; border-color: var(--bronze-3); color: var(--bronze-2); }
.btn-soft { background: var(--paper-2); border-color: var(--line); color: var(--ink-2); }
.btn-soft:hover { background: #fff; }
.btn-cinnabar { background: linear-gradient(180deg, #aa4a3b, #8f3427); color: #fdf3ef; box-shadow: 0 12px 24px -16px rgba(120, 40, 30, .9); }
.btn-cinnabar:hover { color: #fff; filter: brightness(1.06); }
.btn-sm { padding: 8px 15px; font-size: 13.5px; }
.btn-lg { padding: 14px 30px; font-size: 16px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------------------------------------------------------------- 首页 Hero */
.hero { position: relative; overflow: hidden; padding: 86px 0 0; text-align: center; }
.hero::before {
    content: ""; position: absolute; inset: 0; z-index: 0;
    background:
        radial-gradient(760px 320px at 50% -6%, rgba(255, 253, 246, .95), rgba(255, 253, 246, 0) 72%),
        radial-gradient(420px 240px at 88% 12%, rgba(176, 143, 99, .10), transparent 70%),
        radial-gradient(420px 240px at 8% 20%, rgba(140, 106, 67, .09), transparent 70%);
}
.hero > .wrap { position: relative; z-index: 2; }
.hero-eyebrow {
    display: inline-flex; align-items: center; gap: 10px;
    font-size: 12px; letter-spacing: .34em; color: var(--bronze);
    padding: 6px 16px; border: 1px solid rgba(176, 143, 99, .38); border-radius: 999px;
    background: rgba(255, 255, 255, .55); margin-bottom: 26px;
}
.hero h1 {
    font-family: var(--serif); font-size: clamp(30px, 4.4vw, 47px); line-height: 1.36;
    letter-spacing: .05em; font-weight: 700; margin: 0 auto 18px; max-width: 15em;
}
.hero h1 em { font-style: normal; color: var(--bronze-2); position: relative; }
.hero h1 em::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 6px;
    background: linear-gradient(90deg, transparent, rgba(176, 143, 99, .38), transparent); border-radius: 50%;
}
.hero-lede { max-width: 34em; margin: 0 auto 30px; color: var(--ink-3); font-size: 16px; line-height: 1.95; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-note { margin-top: 18px; font-size: 12.5px; color: var(--muted); letter-spacing: .06em; }

.hero-art { position: relative; z-index: 1; margin-top: 44px; height: 150px; pointer-events: none; }
.hero-art svg { width: 100%; height: 100%; display: block; }

/* 数据条 */
.stats {
    display: grid; grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
    background: rgba(255, 253, 248, .55);
}
.stat { padding: 24px 10px; text-align: center; position: relative; }
.stat + .stat::before { content: ""; position: absolute; left: 0; top: 26%; bottom: 26%; width: 1px; background: var(--line); }
.stat b { display: block; font-family: var(--serif); font-size: 30px; color: var(--ink); letter-spacing: .02em; }
.stat span { font-size: 12px; color: var(--muted); letter-spacing: .18em; }

/* ---------------------------------------------------------------- 区块 */
.section { padding: 60px 0; }
.section--tight { padding: 42px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 28px; }
.section-head h2 { font-family: var(--serif); font-size: 25px; letter-spacing: .07em; }
.section-head p { margin: 8px 0 0; color: var(--muted); font-size: 13.5px; }
.section-head .more { font-size: 13px; color: var(--bronze-2); white-space: nowrap; padding-bottom: 4px; }
.section-head .more:hover { text-decoration: underline; text-underline-offset: 4px; }

.ornament {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    color: var(--bronze-3); font-size: 12px; letter-spacing: .3em; margin: 16px 0 0;
}
.ornament::before, .ornament::after {
    content: ""; height: 1px; width: 58px;
    background: linear-gradient(90deg, transparent, var(--line-strong));
}
.ornament::after { background: linear-gradient(270deg, transparent, var(--line-strong)); }

/* ---------------------------------------------------------------- 纪念馆卡片 */
.grid-mem { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.mem-card {
    display: flex; flex-direction: column; background: var(--card);
    border: 1px solid var(--line); border-radius: 13px; overflow: hidden;
    box-shadow: var(--shadow-sm); transition: transform .24s, box-shadow .24s, border-color .24s;
}
.mem-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.mem-thumb {
    aspect-ratio: 4 / 3; overflow: hidden; background: linear-gradient(155deg, #f0e9dc, #e2d7c3);
    display: grid; place-items: center; position: relative;
}
.mem-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.mem-card:hover .mem-thumb img { transform: scale(1.035); }
.mem-thumb .candle { font-size: 30px; filter: saturate(.75); opacity: .85; }
.mem-body { padding: 14px 16px 16px; }
.mem-name { font-family: var(--serif); font-size: 17px; letter-spacing: .06em; color: var(--ink); }
.mem-title { font-size: 12.5px; color: var(--muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mem-dates { font-size: 12px; color: var(--bronze-3); margin-top: 8px; letter-spacing: .05em; }

.empty {
    grid-column: 1 / -1; text-align: center; padding: 58px 20px; color: var(--muted);
    border: 1px dashed var(--line-strong); border-radius: 14px; background: rgba(255, 253, 248, .5);
}
.empty strong { display: block; font-family: var(--serif); font-size: 17px; color: var(--ink-2); margin-bottom: 6px; }

/* ---------------------------------------------------------------- 特色 / 步骤 */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature {
    padding: 28px 26px; background: var(--card); border: 1px solid var(--line);
    border-radius: 14px; box-shadow: var(--shadow-sm);
}
.feature .glyph {
    width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center;
    background: linear-gradient(160deg, #f6efe2, #eadfcc); border: 1px solid var(--line);
    font-size: 20px; margin-bottom: 16px;
}
.feature h3 { font-size: 16.5px; font-family: var(--serif); letter-spacing: .05em; margin-bottom: 8px; }
.feature p { margin: 0; font-size: 14px; color: var(--ink-3); line-height: 1.85; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: step; }
.step {
    position: relative; padding: 26px 24px 24px; background: var(--card);
    border: 1px solid var(--line); border-radius: 14px;
}
.step .num {
    font-family: var(--serif); font-size: 12px; letter-spacing: .22em; color: var(--bronze-3);
    display: block; margin-bottom: 10px;
}
.step h3 { font-size: 16px; font-family: var(--serif); margin-bottom: 8px; letter-spacing: .04em; }
.step p { margin: 0; font-size: 13.8px; color: var(--ink-3); line-height: 1.8; }

/* ---------------------------------------------------------------- FAQ */
.faq { max-width: 820px; margin: 0 auto; }
.faq details {
    background: var(--card); border: 1px solid var(--line); border-radius: 12px;
    padding: 0 20px; margin-bottom: 10px; box-shadow: var(--shadow-sm);
}
.faq details[open] { border-color: var(--line-strong); }
.faq summary {
    list-style: none; cursor: pointer; padding: 17px 0; font-weight: 600; font-size: 15px;
    color: var(--ink); display: flex; justify-content: space-between; align-items: center; gap: 14px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--bronze-3); font-size: 19px; font-weight: 400; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq .faq-body { padding: 0 0 18px; margin: 0; color: var(--ink-3); font-size: 14.5px; line-height: 1.9; }

/* ---------------------------------------------------------------- CTA 横幅 */
.cta-band {
    position: relative; overflow: hidden; text-align: center; padding: 54px 26px;
    border-radius: 18px; border: 1px solid rgba(176, 143, 99, .35);
    background:
        radial-gradient(600px 240px at 50% 0%, rgba(255, 255, 255, .08), transparent 70%),
        linear-gradient(155deg, #3b3329, #272119 62%, #1e1914);
    color: #ede2ce; box-shadow: var(--shadow-lg);
}
.cta-band h2 { font-family: var(--serif); color: #f6eddd; font-size: 25px; letter-spacing: .09em; margin-bottom: 12px; }
.cta-band p { color: rgba(237, 226, 206, .78); font-size: 14.5px; margin-bottom: 26px; }
.cta-band .btn-ghost { background: transparent; border-color: rgba(237, 226, 206, .45); color: #f0e6d5; }
.cta-band .btn-ghost:hover { background: rgba(255, 255, 255, .1); border-color: rgba(237, 226, 206, .8); color: #fff; }

/* ---------------------------------------------------------------- 面包屑 */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); padding: 20px 0 0; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--bronze-2); }
.crumbs .sep { opacity: .5; }
.crumbs [aria-current] { color: var(--ink-2); }

/* ---------------------------------------------------------------- 纪念馆详情 */
.detail { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 26px; align-items: start; padding: 14px 0 0; }
@media (max-width: 940px) { .detail { grid-template-columns: 1fr; } }

.panel {
    background: var(--card); border: 1px solid var(--line); border-radius: 14px;
    padding: 22px 24px; box-shadow: var(--shadow-sm);
}
.panel + .panel { margin-top: 18px; }
.panel h2 {
    display: flex; align-items: center; gap: 9px;
    font-family: var(--serif); font-size: 17px; letter-spacing: .09em; margin-bottom: 16px;
}
.panel h2::before {
    content: ""; width: 4px; height: 15px; border-radius: 3px; flex: none;
    background: linear-gradient(180deg, var(--bronze-3), var(--bronze));
}
.panel-foot { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }

/* 墓碑 */
.stone-wrap { text-align: center; padding: 6px 0 2px; }
.stone {
    position: relative; width: 214px; margin: 0 auto; padding: 34px 20px 26px;
    border-radius: 107px 107px 8px 8px;
    background:
        linear-gradient(158deg, #e9e2d5 0%, #d3c7b3 40%, #bdae95 100%);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, .8),
        inset 0 -14px 22px rgba(90, 70, 45, .14),
        0 22px 34px -22px rgba(60, 45, 25, .55);
    color: #3a322a;
}
.stone::after {
    content: ""; position: absolute; inset: 9px; pointer-events: none;
    border-radius: 98px 98px 4px 4px; border: 1px solid rgba(255, 255, 255, .55);
}
.stone--rounded { border-radius: 26px 26px 8px 8px; }
.stone--rounded::after { border-radius: 20px 20px 4px 4px; }
.stone--cross { border-radius: 84px 84px 6px 6px; }
.stone--garden { border-radius: 107px 107px 8px 8px; background: linear-gradient(158deg, #e7e6d8, #ccd0b9 45%, #b3b99e 100%); }
.stone-avatar {
    width: 74px; height: 74px; margin: 0 auto 12px; border-radius: 50%; overflow: hidden;
    border: 2px solid rgba(255, 255, 255, .85); box-shadow: 0 8px 18px -12px rgba(50, 38, 20, .9);
    background: #cfc3ae; display: grid; place-items: center; font-size: 26px;
}
.stone-avatar img { width: 100%; height: 100%; object-fit: cover; }
.stone-epitaph-main { font-family: var(--serif); font-size: 20px; letter-spacing: .18em; text-shadow: 0 1px 0 rgba(255, 255, 255, .7); }
.stone-epitaph-sub { font-family: var(--serif); font-size: 13px; letter-spacing: .12em; margin-top: 8px; opacity: .85; }
.stone-name { font-family: var(--serif); font-size: 26px; letter-spacing: .2em; margin-top: 4px; text-shadow: 0 1px 0 rgba(255, 255, 255, .7); }
.stone-dates { font-size: 12px; letter-spacing: .1em; margin-top: 10px; color: #5c5145; }
.stone-base {
    width: 250px; height: 16px; margin: -2px auto 0; border-radius: 4px;
    background: linear-gradient(180deg, #c6b9a2, #a89a80);
    box-shadow: 0 12px 20px -14px rgba(60, 45, 25, .8);
}
.stone--garden + .stone-base { background: linear-gradient(180deg, #bcc0a5, #9fa48a); }

.font-song .stone-epitaph-main, .font-song .stone-name { font-family: "Songti SC", STSong, SimSun, serif; }
.font-hei .stone-epitaph-main, .font-hei .stone-name { font-family: "PingFang SC", "Microsoft YaHei", sans-serif; letter-spacing: .12em; }
.font-kai .stone-epitaph-main, .font-kai .stone-name { font-family: "Kaiti SC", "KaiTi", STKaiti, serif; }

.candle-row { display: flex; justify-content: center; gap: 12px; margin: 16px 0 4px; }
.candle { font-size: 26px; filter: saturate(.7); }
.flame { animation: flicker 2.4s infinite alternate ease-in-out; transform-origin: 50% 90%; }
.flame:nth-child(2) { animation-delay: 1.1s; }
@keyframes flicker {
    0% { transform: scale(1) rotate(-1deg); opacity: .92; }
    60% { transform: scale(1.06) rotate(1deg); opacity: 1; }
    100% { transform: scale(1.02) rotate(-.5deg); opacity: .95; }
}
@media (prefers-reduced-motion: reduce) { .flame { animation: none; } }

.stone-meta { margin-top: 20px; }
.stone-meta .name { font-family: var(--serif); font-size: 21px; letter-spacing: .08em; color: var(--ink); }
.stone-meta .dates { font-size: 13px; color: var(--muted); margin-top: 5px; letter-spacing: .06em; }
.stone-meta .counts { display: flex; justify-content: center; gap: 22px; margin-top: 16px; font-size: 12.5px; color: var(--muted); }
.stone-meta .counts b { display: block; font-family: var(--serif); font-size: 18px; color: var(--ink-2); }

/* 信息键值 */
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; margin: 0; font-size: 14px; }
.kv > div { display: flex; gap: 8px; min-width: 0; }
.kv .k { color: var(--muted); flex: none; }
.kv .v { color: var(--ink-2); overflow-wrap: anywhere; }
.kv .full { grid-column: 1 / -1; }

.bio-text { font-size: 15px; line-height: 2; color: var(--ink-2); white-space: pre-line; margin: 16px 0 0; }

/* 年表 */
.timeline { list-style: none; margin: 0; padding: 0 0 0 20px; border-left: 1px solid var(--line-strong); display: grid; gap: 18px; }
.timeline li { position: relative; }
.timeline li::before {
    content: ""; position: absolute; left: -25px; top: 7px; width: 9px; height: 9px; border-radius: 50%;
    background: var(--card); border: 2px solid var(--bronze-3);
}
.timeline .t-date { font-size: 12px; color: var(--bronze-3); letter-spacing: .12em; }
.timeline .t-title { font-family: var(--serif); font-size: 15.5px; color: var(--ink); margin-top: 2px; }
.timeline .t-desc { font-size: 13.8px; color: var(--ink-3); margin-top: 2px; }

/* 照片墙 */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

/* 记录列表 */
.record-list { list-style: none; margin: 0; padding: 0; }
.record-list li {
    display: flex; align-items: flex-start; gap: 10px; padding: 11px 0;
    border-bottom: 1px dashed var(--line); font-size: 14px;
}
.record-list li:last-child { border-bottom: 0; }
.record-list .ico { font-size: 17px; line-height: 1.4; flex: none; }
.record-list .txt { flex: 1; min-width: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.record-list .txt .quote { color: var(--ink-3); }
.record-list .time { flex: none; font-size: 12px; color: var(--muted); white-space: nowrap; }
.record-list .who { color: var(--bronze-2); }

/* 留言 */
.msg-list { display: grid; gap: 14px; margin-bottom: 18px; }
.msg { padding-bottom: 13px; border-bottom: 1px dashed var(--line); }
.msg:last-child { border-bottom: 0; }
.msg .content { font-size: 14.5px; color: var(--ink-2); line-height: 1.85; overflow-wrap: anywhere; }
.msg .meta { font-size: 12px; color: var(--muted); margin-top: 6px; }
.msg .meta .who { color: var(--bronze-2); }

.whisper-list { display: grid; gap: 6px; max-height: 190px; overflow-y: auto; padding-right: 4px; margin-bottom: 14px; }
.whisper-list div { font-size: 13.5px; color: var(--ink-3); font-style: italic; }

/* ---------------------------------------------------------------- 表单 */
.form-card {
    background: var(--card); border: 1px solid var(--line); border-radius: 16px;
    padding: 30px 32px; box-shadow: var(--shadow-sm);
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field > label { font-size: 13.5px; color: var(--ink-2); font-weight: 600; letter-spacing: .02em; }
.field .req { color: var(--cinnabar); margin-left: 2px; }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .select, .textarea {
    width: 100%; padding: 11px 13px; font: inherit; font-size: 14.5px; color: var(--ink);
    background: #fffefb; border: 1px solid var(--line-strong); border-radius: 9px;
    transition: border-color .18s, box-shadow .18s, background .18s;
}
.input::placeholder, .textarea::placeholder { color: #b3a897; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--bronze-3); }
.input:focus, .select:focus, .textarea:focus {
    outline: none; border-color: var(--bronze); background: #fff;
    box-shadow: 0 0 0 3px rgba(140, 106, 67, .12);
}
.textarea { resize: vertical; min-height: 96px; line-height: 1.8; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238b7f6f' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; }
.file-input { font-size: 13px; color: var(--ink-3); padding: 9px 12px; background: #fffefb; border: 1px dashed var(--line-strong); border-radius: 9px; width: 100%; }
.file-input::file-selector-button {
    font: inherit; font-size: 13px; margin-right: 12px; padding: 0; border: 0; background: none; color: var(--bronze-2); cursor: pointer;
}
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; color: var(--ink-3); line-height: 1.7; }
.check input { margin-top: 3px; accent-color: var(--bronze); }
.form-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 24px; }
.form-note { font-size: 12.5px; color: var(--muted); }
fieldset { border: 0; padding: 0; margin: 0 0 26px; min-width: 0; }
legend {
    font-family: var(--serif); font-size: 15px; letter-spacing: .1em; color: var(--ink);
    padding: 0 0 12px; display: flex; align-items: center; gap: 9px;
}
legend::before { content: ""; width: 4px; height: 14px; border-radius: 3px; background: var(--bronze-3); }

/* ---------------------------------------------------------------- 认证页 */
.auth {
    display: grid; grid-template-columns: 1.02fr .98fr; overflow: hidden;
    margin: 42px 0 62px; border: 1px solid var(--line); border-radius: 20px;
    background: var(--card); box-shadow: var(--shadow);
}
.auth-side {
    position: relative; padding: 52px 44px; display: flex; flex-direction: column; justify-content: space-between;
    color: #efe4d1;
    background:
        radial-gradient(520px 280px at 18% 8%, rgba(255, 255, 255, .09), transparent 68%),
        radial-gradient(420px 260px at 92% 96%, rgba(176, 143, 99, .18), transparent 70%),
        linear-gradient(158deg, #3d352b, #272119 58%, #1d1813);
}
.auth-side .quote { font-family: var(--serif); font-size: 24px; line-height: 1.85; letter-spacing: .1em; color: #f7eeda; }
.auth-side .quote small { display: block; font-family: var(--sans); font-size: 12.5px; letter-spacing: .22em; color: rgba(239, 228, 209, .55); margin-top: 20px; }
.auth-side .seal-mark {
    width: 46px; height: 46px; border-radius: 9px; display: grid; place-items: center;
    font-family: var(--serif); font-size: 20px; color: #fbf2e2;
    background: rgba(155, 61, 49, .88); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}
.auth-main { padding: 46px 44px 40px; }
.auth-main h1 { font-family: var(--serif); font-size: 24px; letter-spacing: .08em; margin-bottom: 6px; }
.auth-main .sub { font-size: 13.5px; color: var(--muted); margin-bottom: 26px; }
.auth-form { display: grid; gap: 16px; }
.auth-alt { margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--line); font-size: 13.5px; color: var(--muted); text-align: center; }
.auth-alt a { color: var(--bronze-2); }
.divider-text { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 12px; letter-spacing: .16em; margin: 24px 0 18px; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.inline-row { display: flex; gap: 10px; }
.inline-row .input { flex: 1; }
.code-btn {
    flex: none; padding: 0 16px; border-radius: 9px; font-size: 13.5px; font-family: inherit;
    border: 1px solid var(--line-strong); background: var(--paper-2); color: var(--ink-2); cursor: pointer; transition: .18s;
}
.code-btn:hover { background: #fff; border-color: var(--bronze-3); }
.code-btn[disabled] { opacity: .6; cursor: default; }
.sms-tip { font-size: 12.5px; color: var(--muted); min-height: 18px; margin: 6px 0 0; }
.sms-tip.ok { color: #4e6b4f; }
.sms-tip.err { color: var(--cinnabar); }

@media (max-width: 880px) {
    .auth { grid-template-columns: 1fr; margin: 26px 0 44px; }
    .auth-side { padding: 32px 28px; }
    .auth-side .quote { font-size: 19px; }
    .auth-main { padding: 32px 26px 30px; }
}

/* ---------------------------------------------------------------- 祭扫 */
.offer-cat + .offer-cat { margin-top: 18px; }
.offer-cat h2 { font-family: var(--serif); font-size: 16px; letter-spacing: .09em; margin-bottom: 12px; color: var(--ink-2); }
.offer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.offer {
    display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 8px;
    background: #fffefb; border: 1px solid var(--line-strong); border-radius: 12px;
    cursor: pointer; font-family: inherit; font-size: 13.5px; color: var(--ink-2); transition: .2s;
}
.offer:hover { background: #fdf8ee; border-color: var(--bronze-3); transform: translateY(-2px); box-shadow: var(--shadow); }
.offer:active { transform: translateY(0); }
.offer .ico { font-size: 27px; line-height: 1; filter: saturate(.8); }
.offer .nm { letter-spacing: .04em; }
.recent-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; font-size: 12.5px;
    background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px; color: var(--ink-3);
}

/* ---------------------------------------------------------------- 我的 */
.my-list { display: grid; gap: 12px; }
.my-item {
    display: flex; align-items: center; gap: 16px; padding: 16px 20px;
    background: var(--card); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow-sm);
}
.my-item .thumb {
    width: 58px; height: 58px; border-radius: 11px; overflow: hidden; flex: none;
    background: linear-gradient(155deg, #f0e9dc, #e2d7c3); display: grid; place-items: center; font-size: 22px;
}
.my-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.my-item .info { flex: 1; min-width: 0; }
.my-item .info .nm { font-family: var(--serif); font-size: 16px; letter-spacing: .05em; color: var(--ink); }
.my-item .info .sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.my-item .info .reason { font-size: 12.5px; color: var(--cinnabar); margin-top: 5px; }
@media (max-width: 620px) {
    .my-item { flex-wrap: wrap; }
    .my-item .btn { width: 100%; }
}

.badge { display: inline-block; font-size: 11.5px; padding: 2px 9px; border-radius: 999px; letter-spacing: .04em; margin-top: 6px; }
.badge-pub { background: #eef5ec; color: #3f5f3f; border: 1px solid #cfe0c8; }
.badge-pending { background: #fdf5e4; color: #8a6414; border: 1px solid #ecdcb4; }
.badge-reject { background: #fbeeeb; color: #9a3a2a; border: 1px solid #e9cbc4; }
.badge-draft { background: #f1efea; color: #6f6659; border: 1px solid #ddd6ca; }

/* ---------------------------------------------------------------- 静态内容页 */
.page-head { text-align: center; padding: 52px 0 8px; }
.page-head h1 { font-family: var(--serif); font-size: clamp(26px, 3.6vw, 34px); letter-spacing: .1em; }
.page-head p { color: var(--muted); font-size: 14px; margin-top: 12px; }
.prose { max-width: 780px; margin: 0 auto; padding: 30px 0 50px; font-size: 15.5px; line-height: 2; color: var(--ink-2); }
.prose h2 { font-family: var(--serif); font-size: 21px; letter-spacing: .06em; margin: 38px 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.prose h3 { font-family: var(--serif); font-size: 16.5px; margin: 26px 0 10px; color: var(--ink-2); }
.prose p { margin: 0 0 15px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 1.4em; }
.prose li { margin-bottom: 7px; }
.prose strong { color: var(--ink); }
.prose .note { background: var(--paper-2); border-left: 3px solid var(--bronze-3); padding: 14px 18px; border-radius: 0 8px 8px 0; font-size: 14px; color: var(--ink-3); }
.prose .updated { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 40px; }

/* ---------------------------------------------------------------- 分页 */
.pager { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; margin: 34px 0 10px; }
.pager a, .pager span {
    min-width: 37px; height: 37px; padding: 0 11px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 13.5px; color: var(--ink-2); background: var(--card);
    border: 1px solid var(--line-strong); border-radius: 9px; transition: .18s;
}
.pager a:hover { border-color: var(--bronze-3); background: #fff; color: var(--bronze-2); }
.pager .is-active { background: linear-gradient(180deg, #9a764b, #7d5c38); border-color: var(--bronze-2); color: #fdf8ef; font-weight: 600; }
.pager .is-disabled { opacity: .38; }
.pager .dots { border: 0; background: none; color: var(--muted); min-width: 22px; }

/* ---------------------------------------------------------------- 页脚 */
.site-footer {
    margin-top: 72px; border-top: 1px solid var(--line); padding: 46px 0 26px; font-size: 13px; color: var(--muted);
    background: linear-gradient(180deg, rgba(255, 255, 255, .35), rgba(239, 232, 218, .5));
}
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 34px; padding-bottom: 30px; }
.footer-brand { font-family: var(--serif); font-size: 18px; color: var(--ink); letter-spacing: .1em; margin-bottom: 10px; }
.footer-about { font-size: 13px; line-height: 1.9; color: var(--muted); max-width: 34em; }
.footer-col h3 { font-size: 12.5px; letter-spacing: .18em; color: var(--ink-3); font-weight: 600; margin-bottom: 12px; }
.footer-col a { display: block; padding: 5px 0; color: var(--muted); font-size: 13px; }
.footer-col a:hover { color: var(--bronze-2); }
.footer-bottom {
    border-top: 1px solid var(--line); padding-top: 18px; display: flex; justify-content: space-between;
    gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted);
}
.footer-bottom a { color: var(--muted); }
.footer-bottom a:hover { color: var(--bronze-2); }

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 980px) {
    .grid-mem { grid-template-columns: repeat(3, 1fr); }
    .form-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
    body { font-size: 14.5px; }
    .grid-mem { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .features, .steps { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(3, 1fr); }
    .stat b { font-size: 24px; }
    .hero { padding-top: 62px; }
    .hero-art { height: 96px; margin-top: 30px; }
    .section { padding: 44px 0; }
    .form-grid, .form-grid--3 { grid-template-columns: 1fr; }
    .form-card { padding: 22px 20px; }
    .panel { padding: 18px 18px; }
    .offer-grid { grid-template-columns: repeat(3, 1fr); }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .kv { grid-template-columns: 1fr; }
    .photo-grid { grid-template-columns: repeat(3, 1fr); }
    .section-head { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 460px) {
    .grid-mem { grid-template-columns: 1fr; }
    .offer-grid { grid-template-columns: repeat(2, 1fr); }
    .stone { width: 190px; }
    .stone-base { width: 220px; }
    .auth-main { padding: 26px 20px; }
    .btn { padding: 10px 18px; }
}

@media print {
    .site-header, .site-footer, .btn, .hero-actions, .mnav { display: none !important; }
    body { background: #fff; }
}

/* ==================================================================
   v2 追加：夜间模式 / 节日皮肤 / 灯箱 / 海报 / 祭扫动画 / 动态墙 / 家族
   ================================================================== */

/* ---------- 夜间模式 ---------- */
html[data-theme="dark"] {
    --ink: #e8dfd0;
    --ink-2: #d3c7b4;
    --ink-3: #bfb19c;
    --muted: #9a8d7b;
    --paper: #191512;
    --paper-2: #211c17;
    --card: #241f19;
    --line: #383025;
    --line-strong: #4a4030;
    --bronze: #c49a63;
    --bronze-2: #d9b276;
    --bronze-3: #a98954;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 10px 26px -18px rgba(0, 0, 0, .8), 0 2px 6px rgba(0, 0, 0, .3);
    --shadow-lg: 0 34px 60px -34px rgba(0, 0, 0, .9);
}
html[data-theme="dark"] body { background: var(--paper); }
html[data-theme="dark"] .site-header,
html[data-theme="dark"] .hero { background: #1d1813; }
html[data-theme="dark"] .panel,
html[data-theme="dark"] .mem-card { background: var(--card); }
html[data-theme="dark"] .hero-title,
html[data-theme="dark"] .section-head h1 { color: #f0e6d2; }
html[data-theme="dark"] .stone { background: linear-gradient(180deg, #3a342c 0%, #2c2721 100%); color: #e8dfd0; }
html[data-theme="dark"] img { filter: brightness(.92); }

.theme-toggle {
    display: inline-flex; align-items: center; gap: 2px;
    border: 1px solid var(--line-strong); background: var(--card);
    color: var(--ink-2); border-radius: 999px; padding: 3px 9px;
    cursor: pointer; font-size: 13px; line-height: 1.4;
}
.theme-toggle:hover { border-color: var(--bronze); color: var(--bronze); }
.theme-toggle--nav { margin-left: 8px; }
html[data-theme="dark"] .tt-moon { display: none; }
html:not([data-theme="dark"]) .tt-sun { display: none; }

#theme-toggle {
    position: fixed; right: 18px; bottom: 18px; z-index: 60;
    width: 42px; height: 42px; justify-content: center; padding: 0;
    font-size: 17px; box-shadow: var(--shadow);
}

/* ---------- 节日皮肤 ---------- */
.fest-weather {
    position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden;
}
.fest-weather::before {
    content: ""; position: absolute; inset: -50% 0 0 0;
}
.fest-qingming .fest-weather::before {
    background:
        repeating-linear-gradient(102deg,
            transparent 0 46px,
            rgba(140, 160, 175, .18) 46px 48px);
    animation: fest-rain 0.9s linear infinite;
    opacity: .5;
}
@keyframes fest-rain {
    from { transform: translateY(-120px); }
    to { transform: translateY(120px); }
}
.fest-dongzhi .fest-weather::before {
    background-image:
        radial-gradient(2.5px 2.5px at 12% 22%, rgba(255,255,255,.85) 50%, transparent 51%),
        radial-gradient(2px 2px at 32% 62%, rgba(255,255,255,.7) 50%, transparent 51%),
        radial-gradient(3px 3px at 55% 30%, rgba(255,255,255,.8) 50%, transparent 51%),
        radial-gradient(2px 2px at 74% 72%, rgba(255,255,255,.75) 50%, transparent 51%),
        radial-gradient(2.5px 2.5px at 88% 44%, rgba(255,255,255,.8) 50%, transparent 51%),
        radial-gradient(2px 2px at 8% 82%, rgba(255,255,255,.7) 50%, transparent 51%),
        radial-gradient(2.5px 2.5px at 44% 92%, rgba(255,255,255,.8) 50%, transparent 51%),
        radial-gradient(2px 2px at 66% 10%, rgba(255,255,255,.7) 50%, transparent 51%);
    background-size: 380px 380px;
    animation: fest-snow 24s linear infinite;
    opacity: .65;
}
@keyframes fest-snow {
    from { background-position: 0 -380px; }
    to { background-position: 60px 0; }
}
.fest-gongji .fest-weather {
    background: radial-gradient(ellipse at 50% 120%, rgba(155, 61, 49, .18), transparent 60%);
}
.fest-note {
    position: fixed; top: 68px; right: 18px; z-index: 55;
    font-family: var(--serif); font-size: 13px; letter-spacing: .3em;
    color: var(--muted); border: 1px solid var(--line-strong);
    padding: 6px 10px 6px 13px; border-radius: 4px;
    background: color-mix(in srgb, var(--card) 85%, transparent);
    writing-mode: vertical-rl;
}

/* ---------- 首页祭扫动态墙 ---------- */
.section-activity { background: var(--paper-2); }
.activity-wall {
    display: grid; gap: 10px; margin-top: 18px;
}
.activity-item {
    display: flex; align-items: center; gap: 12px;
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 12px 16px;
    text-decoration: none; color: var(--ink-2); font-size: 13.5px;
    transition: border-color .15s ease;
}
.activity-item:hover { border-color: var(--bronze); }
.activity-item .a-ico { font-size: 18px; }
.activity-item .a-txt em { color: var(--muted); font-style: normal; margin-left: 4px; }
.activity-item .a-where { color: var(--muted); }
.activity-item .a-time { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
@media (max-width: 560px) {
    .activity-item .a-where { display: none; }
}

/* ---------- 相册灯箱 ---------- */
.photo-item {
    padding: 0; border: 0; background: none; cursor: zoom-in;
    display: block; border-radius: 8px; overflow: hidden;
}
.photo-item img { display: block; transition: transform .2s ease; }
.photo-item:hover img { transform: scale(1.04); }
.lightbox {
    position: fixed; inset: 0; z-index: 80;
    background: rgba(15, 12, 9, .86);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.lightbox img {
    max-width: min(92vw, 960px); max-height: 88vh;
    border-radius: 8px; box-shadow: var(--shadow-lg);
}
.lb-close {
    position: absolute; top: 16px; right: 20px;
    background: none; border: 0; color: #f0e6d2;
    font-size: 34px; cursor: pointer; line-height: 1;
}

/* ---------- 分享海报 ---------- */
.poster-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; }
#poster-canvas {
    max-width: min(88vw, 380px); height: auto;
    border-radius: 12px; box-shadow: var(--shadow-lg);
}
.poster-actions { display: flex; gap: 10px; }

/* ---------- 背景音乐 ---------- */
.bgm-box {
    margin-top: 14px; border: 1px dashed var(--line-strong);
    border-radius: 10px; padding: 10px 12px; text-align: left;
}
.bgm-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.bgm-box audio { width: 100%; height: 34px; }

/* ---------- 家族关联 ---------- */
.family-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 0; border-bottom: 1px dashed var(--line);
    font-size: 14px;
}
.family-item:last-of-type { border-bottom: 0; }
.family-item .f-rel {
    flex: none; font-size: 12px; color: var(--bronze);
    border: 1px solid var(--bronze-3); border-radius: 999px;
    padding: 1px 9px; background: transparent;
}
.family-item a { color: var(--ink-2); text-decoration: none; }
.family-item a:hover { color: var(--bronze); }
.family-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.family-form .input { flex: 1 1 160px; min-width: 0; }

/* ---------- 馆主工具 ---------- */
.owner-tools { border: 1px dashed var(--bronze-3); }
.owner-panel summary {
    cursor: pointer; font-size: 13.5px; color: var(--bronze);
    margin-bottom: 6px; user-select: none;
}

/* ---------- 祭扫成功动画 ---------- */
.sacrifice-bloom {
    position: fixed; inset: 0; z-index: 90; pointer-events: none;
    display: flex; align-items: flex-end; justify-content: center;
}
.sacrifice-bloom .sb-glow {
    position: absolute; bottom: 18vh; font-size: 40px;
    animation: sb-glow 3.6s ease-out forwards;
    filter: drop-shadow(0 0 26px rgba(255, 196, 92, .9));
}
@keyframes sb-glow {
    0% { transform: scale(.4); opacity: 0; }
    18% { transform: scale(1.25); opacity: 1; }
    70% { transform: scale(1); opacity: .95; }
    100% { transform: scale(.9); opacity: 0; }
}
.sacrifice-bloom .sb-petal,
.sacrifice-bloom .sb-ember {
    position: absolute; top: 20vh; opacity: 0;
    animation: sb-fall 3.6s ease-in forwards;
}
@keyframes sb-fall {
    0% { transform: translate(0, -30px) rotate(0deg); opacity: 0; }
    12% { opacity: 1; }
    100% { transform: translate(var(--drift, 40px), 70vh) rotate(320deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .fest-weather, .sacrifice-bloom { display: none; }
}
