/* ===== 人生纪念馆 · 全站样式 ===== */
:root {
  --bg-0: #05070f;
  --bg-1: #0a0d1f;
  --bg-2: #101534;
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .075);
  --line: rgba(168, 184, 255, .14);
  --line-2: rgba(168, 184, 255, .28);
  --text: #e9ecfb;
  --text-2: #b3bada;
  --muted: #7b83a8;
  --star: #a8b8ff;
  --star-deep: #6d7fd8;
  --candle: #ffc98b;
  --candle-2: #ff9d5c;
  --jade: #7fd6bd;
  --rose: #f2a2b8;
  --danger: #ff8080;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 48px rgba(0, 0, 0, .45);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg-0);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---- 星空背景 ---- */
.sky {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, #1d2450 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 85% 15%, #241c44 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 10% 80%, #0f2438 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 55%, #04060d 100%);
}

.sky::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,.9), transparent),
    radial-gradient(1px 1px at 70% 20%, rgba(255,255,255,.7), transparent),
    radial-gradient(1.5px 1.5px at 40% 70%, rgba(200,215,255,.85), transparent),
    radial-gradient(1px 1px at 85% 60%, rgba(255,255,255,.6), transparent),
    radial-gradient(1px 1px at 12% 85%, rgba(255,255,255,.5), transparent),
    radial-gradient(1.5px 1.5px at 60% 45%, rgba(220,225,255,.7), transparent),
    radial-gradient(1px 1px at 33% 12%, rgba(255,255,255,.6), transparent),
    radial-gradient(1px 1px at 92% 88%, rgba(255,255,255,.5), transparent);
  background-size: 100% 100%;
  animation: twinkle 7s ease-in-out infinite alternate;
}

@keyframes twinkle { from { opacity: .45 } to { opacity: 1 } }

/* ---- 清明主题（前后 10 天自动启用，见 _layout.html 的 .sky.qingming）----
   星空换成烟雨青山：清明在白天、在雨里、在山上，深夜星河那套不对味。
   只换背景，不动前景排版——节令是氛围，不该让人重新找按钮在哪。 */
.sky.qingming {
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, #1b3a3a 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 85% 15%, #1a3348 0%, transparent 55%),
    radial-gradient(ellipse 60% 45% at 10% 80%, #14302b 0%, transparent 60%),
    linear-gradient(180deg, #0d1c22 0%, #091419 55%, #050b0e 100%);
}

/* 清明夜里少有星、多有雨：星点压淡，改成斜织的细雨。 */
.sky.qingming::after { opacity: .18; }

.sky.qingming::before {
  content: "";
  position: absolute;
  inset: -20% 0;
  background-image: repeating-linear-gradient(
    100deg,
    transparent 0 22px,
    rgba(178, 214, 214, .05) 22px 23px);
  animation: drizzle 4.5s linear infinite;
}

@keyframes drizzle {
  from { transform: translateY(-8%); }
  to   { transform: translateY(8%); }
}

/* 动效敏感的人不该被一整屏移动的雨丝晃到 */
@media (prefers-reduced-motion: reduce) {
  .sky.qingming::before { animation: none; }
}

#starfield { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

/* 清明期间星点动画压到很淡，让位给雨 */
.sky.qingming ~ #starfield { opacity: .25; }

/* ---- 人生档案馆（本人在世，见 Memorial.Living）----
   底色走暖：这不是墓，是一个人趁着还在、亲手整理自己的一生。
   性质近于老人给自己备下寿材——郑重，不忌讳，所以配色要有喜气，
   而不是把纪念馆的星空调亮一点了事。 */
.sky.living {
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, #4a2418 0%, transparent 62%),
    radial-gradient(ellipse 70% 50% at 85% 15%, #53301a 0%, transparent 55%),
    radial-gradient(ellipse 60% 45% at 10% 80%, #3d1f18 0%, transparent 60%),
    linear-gradient(180deg, #1c110c 0%, #140b08 55%, #0b0604 100%);
}

/* 暖色场景下星点换成微光的暖尘 */
.sky.living::after {
  opacity: .5;
  filter: sepia(.7) saturate(1.5) hue-rotate(-12deg);
}

.sky.living ~ #starfield { opacity: .3; filter: sepia(.6) hue-rotate(-15deg); }

/* 「本人健在」标识：这一条必须一眼看见。
   一座活人的馆被误当成讣告转进家族群，伤害是真实的，
   所以它不做成低调的小灰字，而是明确的暖色徽标。 */
.living-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: #4a2410;
  background: linear-gradient(135deg, #ffd98b, #ffb86c);
  box-shadow: 0 4px 16px rgba(255, 168, 92, .28);
}

/* 整页顶部的横幅版本：档案馆页面一进来就说清楚这是什么 */
.living-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  margin-bottom: 18px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 201, 139, .35);
  background: rgba(255, 190, 120, .1);
  color: var(--candle);
  font-size: .92rem;
  line-height: 1.7;
}

/* ---- 通用 ---- */
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; margin: 0 0 .6em; letter-spacing: .02em; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

.wrap { width: min(1220px, 92vw); margin: 0 auto; }
.narrow { width: min(880px, 92vw); margin: 0 auto; }
.muted { color: var(--muted); }
.dim { color: var(--text-2); }
.center { text-align: center; }
.serif { font-family: var(--serif); }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrapx { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.gap-s { gap: 6px; }
.mt { margin-top: 18px; }
.mt-l { margin-top: 40px; }
.mb { margin-bottom: 18px; }
.hidden { display: none !important; }
.small { font-size: .85rem; }
.tiny { font-size: .78rem; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- 顶栏 ---- */
header.nav {
  position: sticky; top: 0; z-index: 60;
  backdrop-filter: blur(18px);
  background: rgba(6, 9, 22, .72);
  border-bottom: 1px solid var(--line);
}
.nav-in { display: flex; align-items: center; gap: 26px; height: 62px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.16rem; letter-spacing: .12em; }
.logo .orb {
  width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #fff 0%, var(--star) 38%, var(--star-deep) 70%, #2b3a80 100%);
  box-shadow: 0 0 16px rgba(168, 184, 255, .65);
}
.nav-links { display: flex; gap: 22px; font-size: .93rem; }
.nav-links a { color: var(--text-2); transition: color .2s; }
.nav-links a:hover, .nav-links a.on { color: var(--text); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); font-size: 1.4rem; cursor: pointer; }

/* ---- 按钮 ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--text); font-size: .9rem; font-family: inherit;
  cursor: pointer; transition: all .22s; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--star); transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary {
  background: linear-gradient(135deg, #7d8ff0, #a8b8ff);
  border-color: transparent; color: #0a0d20; font-weight: 600;
}
.btn.primary:hover { box-shadow: 0 10px 28px rgba(140, 160, 255, .35); }
.btn.warm { background: linear-gradient(135deg, var(--candle-2), var(--candle)); border-color: transparent; color: #2a1607; font-weight: 600; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 13px; font-size: .82rem; }
.btn.lg { padding: 13px 30px; font-size: 1rem; }
.btn.danger { border-color: rgba(255,128,128,.4); color: var(--danger); }
.btn.block { width: 100%; }

/* ---- 卡片 ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(10px);
}
.card.tight { padding: 16px; }
.card.hover:hover { border-color: var(--line-2); background: var(--surface-2); }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g-auto { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

/* ---- 表单 ---- */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: .84rem; color: var(--text-2); margin-bottom: 6px; }
input, select, textarea {
  width: 100%; padding: 10px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: rgba(8, 11, 26, .6);
  color: var(--text); font-family: inherit; font-size: .92rem; transition: border-color .2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--star); }
textarea { resize: vertical; min-height: 92px; line-height: 1.7; }
select option { background: #10142c; }
input[type="checkbox"], input[type="radio"] { width: auto; }
.inline-check { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--text-2); }

/* ---- 标签 / 徽章 ---- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px; font-size: .76rem;
  background: rgba(168, 184, 255, .12); color: var(--star); border: 1px solid rgba(168,184,255,.2);
}
.tag.warm { background: rgba(255, 201, 139, .13); color: var(--candle); border-color: rgba(255,201,139,.24); }
.tag.jade { background: rgba(127, 214, 189, .13); color: var(--jade); border-color: rgba(127,214,189,.24); }
.tag.rose { background: rgba(242, 162, 184, .13); color: var(--rose); border-color: rgba(242,162,184,.24); }
.tag.plain { background: rgba(255,255,255,.06); color: var(--text-2); border-color: var(--line); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--jade); box-shadow: 0 0 8px var(--jade); }
.dot.live { background: #ff6b6b; box-shadow: 0 0 8px #ff6b6b; animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

/* ---- 头像 ---- */
.avatar {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
  background: linear-gradient(135deg, #2a3260, #1a1f42);
  border: 1px solid var(--line-2); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); color: var(--star);
}
.avatar.lg { width: 88px; height: 88px; font-size: 1.8rem; }
.avatar.xl { width: 128px; height: 128px; font-size: 2.6rem; }
.avatar.sm { width: 30px; height: 30px; font-size: .8rem; }

/* ---- 首页 hero ---- */
.hero { padding: 86px 0 60px; text-align: center; position: relative; }
.hero h1 { font-size: clamp(2.1rem, 5.4vw, 3.5rem); line-height: 1.35; margin-bottom: .35em; }
.hero .sub { font-size: 1.05rem; color: var(--text-2); max-width: 620px; margin: 0 auto 30px; }
.hero .glow-line {
  width: 140px; height: 1px; margin: 26px auto;
  background: linear-gradient(90deg, transparent, var(--star), transparent);
}
.moon {
  position: absolute; top: 26px; right: 8%;
  width: 84px; height: 84px; border-radius: 50%;
  background: radial-gradient(circle at 36% 32%, #fdfbf3, #e6e3d2 55%, #b9b6a4 100%);
  box-shadow: 0 0 60px rgba(255, 250, 230, .34), inset -12px -8px 22px rgba(0,0,0,.18);
  opacity: .85;
}

/* ---- 统计条 ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.stat { text-align: center; padding: 18px 10px; }
.stat b { display: block; font-family: var(--serif); font-size: 1.7rem; color: var(--star); }
.stat span { font-size: .82rem; color: var(--muted); }

/* ---- 纪念馆卡片 ---- */
.mem-card { display: block; position: relative; overflow: hidden; }
.mem-card .top { display: flex; gap: 14px; align-items: center; }
.mem-card .name { font-family: var(--serif); font-size: 1.12rem; }
.mem-card .dates { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.mem-card .epitaph {
  margin-top: 12px; font-size: .86rem; color: var(--text-2);
  font-family: var(--serif); line-height: 1.75;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mem-card .meta { margin-top: 14px; display: flex; gap: 14px; font-size: .76rem; color: var(--muted); }

/* ---- 星区地图 ---- */
.star-map {
  position: relative; border-radius: var(--radius);
  border: 1px solid var(--line); padding: 28px 20px;
  background: radial-gradient(ellipse at 50% 30%, rgba(40,52,110,.4), rgba(6,9,22,.7));
  overflow-x: auto;
}
.star-grid { display: grid; gap: 14px; justify-content: center; min-width: max-content; }
.grave {
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: .62rem; color: var(--muted);
  border: 1px dashed rgba(168,184,255,.16); transition: all .25s; position: relative;
}
.grave.filled {
  border: 0;
  background: radial-gradient(circle at 35% 32%, #fff, var(--star) 42%, var(--star-deep) 100%);
  box-shadow: 0 0 14px rgba(168,184,255,.55);
  color: transparent;
}
.grave.filled:hover { transform: scale(1.35); box-shadow: 0 0 24px rgba(200,215,255,.9); }
/* 姓名搜索命中的墓位 */
.grave.hit {
  animation: hitPulse 1.1s ease-in-out infinite;
  outline: 2px solid var(--candle);
  outline-offset: 3px;
}
@keyframes hitPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(255,201,139,.5) }
  50% { box-shadow: 0 0 26px rgba(255,201,139,1) }
}

.grave .lbl {
  position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%);
  font-size: .68rem; color: var(--text-2); white-space: nowrap; opacity: 0; transition: opacity .2s;
  pointer-events: none;
}
.grave.filled:hover .lbl { opacity: 1; }

/* ---- 纪念馆主页 ---- */
.mem-hero {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); padding: 42px 32px;
  background: linear-gradient(160deg, rgba(30,38,84,.65), rgba(10,13,32,.85));
}
.mem-hero .portrait-wrap { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.portrait {
  width: 132px; height: 168px; object-fit: cover; border-radius: 8px;
  border: 2px solid rgba(255,255,255,.14);
  box-shadow: 0 0 34px rgba(168,184,255,.28), 0 14px 34px rgba(0,0,0,.5);
  background: linear-gradient(160deg, #262e5a, #161a38);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 2.6rem; color: var(--star);
}
/* 墓碑落灰：久无人来会积灰，可以擦 */
.tomb { position: relative; width: 132px; height: 168px; flex-shrink: 0; }
.tomb .portrait { width: 100%; height: 100%; }
.tomb canvas.dust {
  position: absolute; inset: 0; border-radius: 8px;
  touch-action: none; cursor: grab; z-index: 2;
  transition: opacity .8s ease;
}
.tomb canvas.dust:active { cursor: grabbing; }
.tomb .dust-tip {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
  z-index: 3; padding: 3px 10px; border-radius: 999px; white-space: nowrap;
  background: rgba(8, 10, 22, .74); color: #d8d3c4; font-size: .68rem;
  pointer-events: none; transition: opacity .5s;
}
.dust-note { font-size: .78rem; color: #b0a894; margin-top: 10px; }
.dust-note b { color: var(--candle); font-weight: 500; }

.mem-hero h1 { font-size: 2rem; margin-bottom: 6px; }
.mem-hero .life { font-variant-numeric: tabular-nums; color: var(--text-2); letter-spacing: .05em; }
.mem-hero .epi {
  margin-top: 14px; font-family: var(--serif); font-size: 1rem;
  color: var(--candle); border-left: 2px solid rgba(255,201,139,.4); padding-left: 14px;
}

/* 供桌 */
.altar {
  margin-top: 22px; border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(20,25,54,.6), rgba(9,12,28,.9));
  padding: 20px; position: relative; overflow: hidden; min-height: 130px;
}
.altar-items { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; min-height: 62px; }
.altar-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 1.7rem; line-height: 1; padding: 6px 9px; border-radius: 10px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  animation: rise .6s ease-out;
}
.altar-item small { font-size: .62rem; color: var(--muted); }
@keyframes rise { from { opacity: 0; transform: translateY(16px) } to { opacity: 1; transform: none } }

.offer-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.offer-btn {
  display: flex; align-items: center; gap: 6px; padding: 7px 13px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; font-size: .85rem; color: var(--text); transition: all .2s; font-family: inherit;
}
.offer-btn:hover { border-color: var(--candle); background: rgba(255,201,139,.09); transform: translateY(-2px); }
.offer-btn .price { font-size: .72rem; color: var(--candle); }

/* 飘浮的祭品动效 */
.float-layer { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.float-item { position: absolute; font-size: 2rem; animation: floatUp 3.4s ease-out forwards; }
@keyframes floatUp {
  0% { opacity: 0; transform: translateY(0) scale(.6) }
  15% { opacity: 1; transform: translateY(-30px) scale(1.1) }
  100% { opacity: 0; transform: translateY(-320px) scale(.9) rotate(12deg) }
}

/* ---- 标签页 ---- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tab {
  padding: 11px 18px; cursor: pointer; color: var(--muted); font-size: .92rem;
  border-bottom: 2px solid transparent; white-space: nowrap; background: none; border-top: 0; border-left: 0; border-right: 0;
  font-family: inherit; transition: all .2s;
}
.tab:hover { color: var(--text-2); }
.tab.on { color: var(--star); border-bottom-color: var(--star); }

/* ---- 时间轴 ---- */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 1px;
  background: linear-gradient(180deg, transparent, var(--line-2) 12%, var(--line-2) 88%, transparent);
}
.tl-item { position: relative; padding-bottom: 26px; }
.tl-item::before {
  content: ""; position: absolute; left: -25px; top: 8px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--star); box-shadow: 0 0 12px var(--star);
}
.tl-date { font-size: .78rem; color: var(--candle); font-variant-numeric: tabular-nums; letter-spacing: .05em; }
.tl-title { font-family: var(--serif); font-size: 1.02rem; margin: 3px 0 5px; }
.tl-body { font-size: .88rem; color: var(--text-2); }

/* ---- 媒体库 ---- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.media-item {
  position: relative; border-radius: var(--radius-sm); overflow: hidden; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255,255,255,.03); aspect-ratio: 4/3;
  display: flex; align-items: center; justify-content: center;
}
.media-item img, .media-item video { width: 100%; height: 100%; object-fit: cover; }
.media-item .kind {
  position: absolute; top: 7px; left: 7px; font-size: .68rem; padding: 2px 7px;
  border-radius: 6px; background: rgba(0,0,0,.6); color: #fff;
}
.media-item .cap {
  position: absolute; inset: auto 0 0 0; padding: 22px 9px 7px; font-size: .74rem;
  background: linear-gradient(transparent, rgba(0,0,0,.85)); color: #fff;
}
.media-item .ai-badge {
  position: absolute; top: 7px; right: 7px; font-size: .66rem; padding: 2px 7px;
  border-radius: 6px; background: rgba(255,201,139,.9); color: #2a1607; font-weight: 600;
}
.audio-tile {
  flex-direction: column; gap: 8px; padding: 14px; aspect-ratio: auto;
  align-items: stretch;
}
.audio-tile .t { font-size: .84rem; }

/* ---- 追思墙 ---- */
.tribute { display: flex; gap: 13px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.tribute:last-child { border-bottom: 0; }
.tribute .body { flex: 1; min-width: 0; }
.tribute .who { font-size: .88rem; }
.tribute .when { font-size: .74rem; color: var(--muted); }
.tribute .txt { margin-top: 6px; font-size: .92rem; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
.tribute .imgs { display: flex; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.tribute .imgs img { width: 92px; height: 92px; object-fit: cover; border-radius: 8px; }
.reply { margin-top: 12px; padding-left: 14px; border-left: 2px solid var(--line); }

/* ---- AI 对话 ---- */
.chat-shell { display: grid; grid-template-columns: 230px 1fr; gap: 18px; min-height: 560px; }
.chat-list { border-right: 1px solid var(--line); padding-right: 14px; max-height: 620px; overflow-y: auto; }
.chat-list .item { padding: 9px 11px; border-radius: 9px; cursor: pointer; font-size: .85rem; color: var(--text-2); }
.chat-list .item:hover { background: var(--surface); }
.chat-list .item.on { background: rgba(168,184,255,.12); color: var(--text); }
.chat-body { display: flex; flex-direction: column; min-height: 560px; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 6px 4px 16px; max-height: 520px; }
.msg { display: flex; gap: 11px; margin-bottom: 20px; }
.msg .bubble {
  max-width: 76%; padding: 12px 16px; border-radius: 14px; font-size: .93rem;
  background: var(--surface); border: 1px solid var(--line); white-space: pre-wrap; line-height: 1.8;
}
.msg.me { flex-direction: row-reverse; }
.msg.me .bubble { background: rgba(168,184,255,.14); border-color: rgba(168,184,255,.26); }
.msg.ai .bubble { font-family: var(--serif); background: rgba(255,201,139,.07); border-color: rgba(255,201,139,.18); }
.msg .refs { margin-top: 8px; font-size: .72rem; color: var(--muted); }
.chat-input { display: flex; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.chat-input textarea { min-height: 46px; max-height: 130px; }
.disclaimer {
  font-size: .76rem; color: var(--muted); background: rgba(255,201,139,.07);
  border: 1px solid rgba(255,201,139,.18); border-radius: 9px; padding: 9px 13px; margin-bottom: 14px;
}
.typing span {
  display: inline-block; width: 6px; height: 6px; margin: 0 2px; border-radius: 50%;
  background: var(--star); animation: blink 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: .2s }
.typing span:nth-child(3) { animation-delay: .4s }
@keyframes blink { 0%,60%,100% { opacity: .25 } 30% { opacity: 1 } }

/* ---- 视频连线 ---- */
.live-shell { display: grid; grid-template-columns: 1fr 320px; gap: 16px; height: calc(100vh - 62px); padding: 16px 0; }
.video-grid {
  display: grid; gap: 10px; align-content: start;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  overflow-y: auto; padding-right: 4px;
}
.video-tile {
  position: relative; border-radius: 12px; overflow: hidden; background: #080b18;
  border: 1px solid var(--line); aspect-ratio: 4/3;
}
.video-tile video { width: 100%; height: 100%; object-fit: cover; background: #05070f; }
.video-tile .nameplate {
  position: absolute; left: 8px; bottom: 8px; display: flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; background: rgba(0,0,0,.62); font-size: .76rem;
}
.video-tile .city { color: var(--candle); font-size: .7rem; }
.video-tile.host { border-color: rgba(255,201,139,.5); }
.video-tile .off {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; background: #0a0e20;
}
.live-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.live-panel { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.live-feed { flex: 1; overflow-y: auto; font-size: .85rem; padding-right: 4px; }
.live-feed .ev { padding: 5px 0; border-bottom: 1px solid rgba(168,184,255,.07); }
.live-feed .ev .n { color: var(--star); }
.live-feed .ev.sys { color: var(--muted); font-size: .8rem; }
.live-bar {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
  padding: 12px; border-radius: var(--radius); border: 1px solid var(--line); background: rgba(8,11,26,.75);
}
.ctrl {
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.ctrl:hover { background: var(--surface-2); }
.ctrl.off { background: rgba(255,110,110,.18); border-color: rgba(255,110,110,.4); color: #ffb0b0; }
.ctrl.end { background: #e2564f; border-color: transparent; color: #fff; }
.liturgy-board {
  border-radius: var(--radius); border: 1px solid rgba(255,201,139,.28);
  background: rgba(255,201,139,.07); padding: 16px; font-family: var(--serif);
  white-space: pre-wrap; max-height: 190px; overflow-y: auto; line-height: 2;
}

/* ---- 进度条 ---- */
.bar { height: 6px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--star-deep), var(--star)); transition: width .4s; }
.bar.warm > i { background: linear-gradient(90deg, var(--candle-2), var(--candle)); }

/* ---- 表格 ---- */
table.tbl { width: 100%; border-collapse: collapse; font-size: .87rem; }
table.tbl th, table.tbl td { padding: 11px 10px; text-align: left; border-bottom: 1px solid var(--line); }
table.tbl th { color: var(--muted); font-weight: 500; font-size: .8rem; }
table.tbl tr:hover td { background: rgba(255,255,255,.02); }

/* ---- 弹层 ---- */
.mask {
  position: fixed; inset: 0; z-index: 200; background: rgba(3, 5, 14, .78);
  backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn .2s;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.modal {
  width: min(560px, 96vw); max-height: 88vh; overflow-y: auto;
  background: linear-gradient(160deg, #141a38, #0b0e22);
  border: 1px solid var(--line-2); border-radius: var(--radius); padding: 26px;
  box-shadow: var(--shadow); animation: pop .25s;
}
.modal.wide { width: min(880px, 96vw); }
@keyframes pop { from { transform: translateY(18px) scale(.98); opacity: 0 } to { transform: none; opacity: 1 } }
.modal h3 { margin-bottom: 18px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

/* ---- 提示 ---- */
#toast-box { position: fixed; top: 22px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 9px; align-items: center; }
.toast {
  padding: 10px 22px; border-radius: 999px; font-size: .88rem;
  background: rgba(18, 24, 52, .95); border: 1px solid var(--line-2);
  box-shadow: var(--shadow); animation: dropIn .25s;
}
.toast.err { border-color: rgba(255,128,128,.45); color: #ffc0c0; }
.toast.ok { border-color: rgba(127,214,189,.45); color: #b7f0e0; }
@keyframes dropIn { from { transform: translateY(-14px); opacity: 0 } to { transform: none; opacity: 1 } }

/* ---- 空状态 / 加载 ---- */
.empty { text-align: center; padding: 52px 20px; color: var(--muted); }
.empty .ico { font-size: 2.4rem; opacity: .5; margin-bottom: 10px; }
.loading { text-align: center; padding: 40px; color: var(--muted); font-size: .88rem; }
.skeleton { background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.09), rgba(255,255,255,.04)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { from { background-position: 200% 0 } to { background-position: -200% 0 } }

/* ---- 页脚 ---- */
footer.foot {
  margin-top: 70px; padding: 34px 0; border-top: 1px solid var(--line);
  color: var(--muted); font-size: .84rem; text-align: center;
}
footer.foot a { color: var(--text-2); }
footer.foot .links { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }

/* ---- 侧边导航（工作台） ---- */
.console-shell { display: grid; grid-template-columns: 210px 1fr; gap: 26px; align-items: start; }
.side-nav { position: sticky; top: 82px; display: flex; flex-direction: column; gap: 3px; }
.side-nav a {
  padding: 9px 14px; border-radius: 9px; font-size: .89rem; color: var(--text-2); transition: all .2s;
}
.side-nav a:hover { background: var(--surface); color: var(--text); }
.side-nav a.on { background: rgba(168,184,255,.13); color: var(--star); }
.side-nav .grp { font-size: .74rem; color: var(--muted); padding: 14px 14px 5px; letter-spacing: .1em; }

/* ---- 套餐 ---- */
.plan-card { position: relative; display: flex; flex-direction: column; }
.plan-card.featured { border-color: var(--star); box-shadow: 0 0 34px rgba(168,184,255,.18); }
.plan-card .badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  padding: 3px 14px; border-radius: 999px; font-size: .72rem;
  background: linear-gradient(135deg, #7d8ff0, #a8b8ff); color: #0a0d20; font-weight: 600;
}
.plan-card .price { font-family: var(--serif); font-size: 2.1rem; color: var(--star); margin: 10px 0; }
.plan-card .price small { font-size: .8rem; color: var(--muted); }
.plan-card ul { list-style: none; padding: 0; margin: 16px 0; flex: 1; font-size: .87rem; color: var(--text-2); }
.plan-card li { padding: 6px 0 6px 22px; position: relative; }
.plan-card li::before { content: "✦"; position: absolute; left: 0; color: var(--star); font-size: .8rem; }

/* ---- 捐款 ---- */
.amount-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.amount-btn {
  padding: 13px 6px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; text-align: center; font-family: var(--serif);
  font-size: 1.05rem; color: var(--text); transition: all .2s;
}
.amount-btn:hover, .amount-btn.on { border-color: var(--candle); background: rgba(255,201,139,.12); color: var(--candle); }
.cert {
  border: 2px solid rgba(255,201,139,.35); border-radius: var(--radius); padding: 34px;
  background: linear-gradient(160deg, rgba(38,30,18,.7), rgba(12,10,20,.9));
  text-align: center; font-family: var(--serif);
}
.cert h2 { color: var(--candle); letter-spacing: .3em; }

/* ---- 响应式 ---- */
@media (max-width: 980px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g3 { grid-template-columns: repeat(2, 1fr); }
  .console-shell { grid-template-columns: 1fr; }
  .side-nav { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 8px; }
  .side-nav .grp { display: none; }
  .live-shell { grid-template-columns: 1fr; height: auto; }
  .chat-shell { grid-template-columns: 1fr; }
  .chat-list { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 12px; max-height: 130px; display: flex; gap: 8px; overflow-x: auto; }
}
@media (max-width: 700px) {
  .nav-links { display: none; position: absolute; top: 62px; left: 0; right: 0; flex-direction: column; gap: 0; background: rgba(8,11,26,.98); border-bottom: 1px solid var(--line); padding: 8px 0; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 11px 22px; }
  .nav-toggle { display: block; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .hero { padding: 54px 0 40px; }
  .moon { width: 54px; height: 54px; top: 14px; }
  .mem-hero { padding: 26px 20px; }
  .modal { padding: 20px; }
}
