/* 纪念馆全局样式 —— 庄重肃穆，深色系 + 金色点缀 */
:root {
  --page-bg-1: #5c6c85;
  --page-bg-2: #44516a;
  --card: #101114;
  --card-2: #17181c;
  --gold: #d3ab63;
  --gold-dim: #a8874f;
  --ink: #efe9dc;
  --muted: #a9a59a;
  --line: rgba(211, 171, 99, 0.22);
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink);
  background: linear-gradient(180deg, var(--page-bg-1), var(--page-bg-2));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: #e8c684; }
img { max-width: 100%; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 28px 20px 60px; }

/* ---------- 顶部导航 ---------- */
.nav {
  display: flex; justify-content: center; align-items: center;
  gap: 8px; padding: 10px 0 22px; flex-wrap: wrap;
}
.nav a {
  font-family: var(--serif);
  font-size: 15px; letter-spacing: 0.35em; text-indent: 0.35em;
  color: rgba(239, 233, 220, 0.85);
  padding: 8px 14px; border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}
.nav a:hover { color: var(--gold); background: rgba(16, 17, 20, 0.35); }
.nav a.active { color: var(--gold); background: rgba(16, 17, 20, 0.45); }
.nav .sep { color: rgba(239, 233, 220, 0.35); font-size: 12px; }

/* ---------- 纪念卡片 ---------- */
.memorial {
  position: relative;
  background: var(--card);
  border-radius: 30px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255,255,255,0.04);
  overflow: hidden;
}
.hero { padding: 72px 64px 84px; position: relative; }
.hero-inner {
  display: flex; align-items: center; gap: 72px;
  position: relative; z-index: 2;
}

/* 上下居中排版（可在后台“首页”里切换） */
body.hero-stack .hero-inner { flex-direction: column; gap: 40px; text-align: center; }
body.hero-stack .portrait { margin: 0 auto; }
body.hero-stack .hero-text { max-width: 640px; }

/* 遗像 */
.portrait { position: relative; flex: 0 0 auto; }
.portrait .ring {
  width: 300px; height: 300px; border-radius: 50%;
  padding: 7px;
  background: linear-gradient(145deg, #e6c886, #b98f4e 60%, #8a683a);
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.portrait img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  border-radius: 50%;
  background: #222;
}
.portrait .cap {
  position: absolute; left: 0; right: 0; bottom: 46px;
  text-align: center;
  font-family: var(--serif); font-size: 26px; letter-spacing: 0.2em; text-indent: 0.2em;
  color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,0.85);
  pointer-events: none;
}

/* 标题与题字 */
.hero-text { flex: 1 1 auto; min-width: 0; }
.hero-text h1 {
  font-family: var(--serif); font-weight: 700;
  font-size: 46px; line-height: 1.5; letter-spacing: 0.06em;
  margin: 0 0 34px; color: #f5f1e6;
}
.hero-text .motto {
  font-family: var(--serif); font-size: 20px; letter-spacing: 0.12em;
  color: #d8d2c2; margin: 0; line-height: 1.9; white-space: nowrap;
}

/* 淡雅点缀（内联 SVG） */
.deco { position: absolute; z-index: 1; opacity: 0.9; pointer-events: none; }
.deco.crane1 { top: 8px; left: 2%; width: 124px; mix-blend-mode: screen; opacity: 0.92; }
.deco.crane2 { top: 108px; right: 7%; width: 66px; mix-blend-mode: screen; opacity: 0.5; transform: scaleX(-1); }
.deco.cloud1 { top: 62px; left: 32%; width: 52px; opacity: 0.38; }
.deco.cloud2 { top: 42px; right: 28%; width: 44px; opacity: 0.32; }
.deco.cloud3 { bottom: 78px; left: 11%; width: 40px; opacity: 0.28; }
.deco.pine { bottom: 24px; right: 4%; width: 112px; }
.deco.pine2 { bottom: 30px; left: 4%; width: 60px; opacity: 0.7; }

/* ---------- 首页入口 ---------- */
.entries {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 18px; margin-top: 26px;
}
.entry {
  background: rgba(16, 17, 20, 0.72);
  border: 1px solid var(--line);
  border-radius: 18px; padding: 30px 24px;
  text-align: center; transition: transform 0.2s, border-color 0.2s;
  display: block;
}
.entry:hover { transform: translateY(-3px); border-color: var(--gold-dim); }
.entry .t { font-family: var(--serif); font-size: 21px; letter-spacing: 0.3em; text-indent: 0.3em; color: var(--ink); margin-bottom: 10px; }
.entry .d { font-size: 13px; color: var(--muted); line-height: 1.8; }

/* ---------- 内容页通用 ---------- */
.page-card {
  background: var(--card); border-radius: 24px;
  padding: 54px 56px; box-shadow: 0 24px 60px rgba(0,0,0,0.4);
}
.page-title {
  font-family: var(--serif); font-size: 30px; letter-spacing: 0.25em; text-indent: 0.25em;
  text-align: center; margin: 0 0 8px; color: #f5f1e6;
}
.page-sub { text-align: center; color: var(--muted); font-size: 13px; letter-spacing: 0.2em; margin-bottom: 40px; }
.divider { height: 1px; background: var(--line); margin: 30px auto; max-width: 220px; }

/* 文章列表 */
.article-list { list-style: none; margin: 0; padding: 0; }
.article-list li { border-bottom: 1px solid rgba(211,171,99,0.12); }
.article-list li:last-child { border-bottom: none; }
.article-list a { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 20px 6px; color: var(--ink); }
.article-list a:hover .at { color: var(--gold); }
.article-list .at { font-family: var(--serif); font-size: 19px; letter-spacing: 0.05em; }
.article-list .ad { flex: 0 0 auto; font-size: 13px; color: var(--muted); }

/* 文章正文 */
.article-body { font-family: var(--serif); font-size: 18px; line-height: 2.1; color: #e6e0d1; }
.article-body p { margin: 0 0 1.2em; text-indent: 2em; }
.article-meta { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 34px; letter-spacing: 0.15em; }
.back-link { display: inline-block; margin-top: 40px; font-size: 14px; letter-spacing: 0.2em; }

/* 照片墙 */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.photo-item { background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.photo-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: #000; cursor: zoom-in; }
.photo-item .pc { padding: 12px 14px; font-size: 14px; color: var(--muted); line-height: 1.7; }
.photo-item .pd { display: block; font-size: 12px; color: #6f6a5e; margin-top: 4px; }

/* 空状态 */
.empty {
  text-align: center; padding: 70px 20px; color: var(--muted);
}
.empty .e1 { font-family: var(--serif); font-size: 22px; letter-spacing: 0.3em; text-indent: 0.3em; color: #cfc8b6; margin-bottom: 16px; }
.empty .e2 { font-size: 14px; line-height: 2; }

/* 灯箱 */
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,0.92); z-index: 50;
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 88vh; border-radius: 8px; }
.lightbox .lb-cap { position: absolute; bottom: 26px; left: 0; right: 0; text-align: center; color: #cfc8b6; font-size: 15px; }

/* ---------- 底部落款 ---------- */
.footer { text-align: center; padding: 44px 0 10px; color: rgba(239,233,220,0.6); }
.footer .sign { font-family: var(--serif); font-size: 16px; letter-spacing: 0.4em; text-indent: 0.4em; }
.footer .tiny { font-size: 12px; margin-top: 10px; letter-spacing: 0.2em; color: rgba(239,233,220,0.35); }

/* ---------- 管理后台 ---------- */
.admin-card { background: var(--card); border-radius: 24px; padding: 48px; max-width: 860px; margin: 0 auto; box-shadow: 0 24px 60px rgba(0,0,0,0.4); }
.admin-card h2 { font-family: var(--serif); letter-spacing: 0.3em; text-indent: 0.3em; text-align: center; margin: 0 0 30px; font-size: 24px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 8px; letter-spacing: 0.15em; }
.input, .textarea, select.input {
  width: 100%; background: #0b0c0e; border: 1px solid rgba(211,171,99,0.25);
  border-radius: 10px; color: var(--ink); font-size: 16px; padding: 12px 14px;
  font-family: var(--sans); outline: none;
}
.textarea { min-height: 280px; line-height: 1.9; resize: vertical; font-family: var(--serif); }
.input:focus, .textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(211,171,99,0.15); }
.btn {
  display: inline-block; border: 1px solid var(--gold-dim); background: transparent;
  color: var(--gold); font-size: 15px; letter-spacing: 0.3em; text-indent: 0.3em;
  padding: 12px 30px; border-radius: 999px; cursor: pointer; transition: all 0.2s;
  font-family: var(--serif);
}
.btn:hover { background: var(--gold); color: #101114; }
.btn.solid { background: var(--gold); color: #101114; }
.btn.solid:hover { background: #e8c684; }
.btn.danger { border-color: #8a4a4a; color: #d08a8a; }
.btn.danger:hover { background: #8a4a4a; color: #fff; }
.btn.small { font-size: 13px; padding: 8px 18px; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

/* 首页设置：配色选择器 */
.color-row { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 8px; }
.color-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted); cursor: pointer;
}
.color-item input[type="color"] {
  width: 52px; height: 40px; padding: 2px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--card-2); cursor: pointer;
}
select.input {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card-2);
  color: var(--ink); font-size: 15px;
}
.form-err { color: #d08a8a; font-size: 14px; min-height: 22px; margin: 10px 0; text-align: center; }
.form-ok { color: #9fc48f; font-size: 14px; min-height: 22px; margin: 10px 0; text-align: center; }
.tabs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 34px; }
.tabs button {
  background: transparent; border: 1px solid transparent; color: var(--muted);
  font-family: var(--serif); font-size: 15px; letter-spacing: 0.25em; text-indent: 0.25em;
  padding: 10px 20px; border-radius: 999px; cursor: pointer;
}
.tabs button.active { color: var(--gold); border-color: var(--line); background: rgba(211,171,99,0.08); }
.mgr-item { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid rgba(211,171,99,0.12); }
.mgr-item .mt { font-family: var(--serif); font-size: 16px; }
.mgr-item .md { font-size: 12px; color: var(--muted); margin-top: 4px; }
.mgr-item .ops { flex: 0 0 auto; display: flex; gap: 8px; }
.mgr-thumb { width: 72px; height: 54px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; background: #000; }
.login-box { max-width: 420px; margin: 0 auto; }
.hint { font-size: 13px; color: var(--muted); line-height: 1.9; text-align: center; margin-top: 16px; }

/* ---------- 移动端 ---------- */
@media (max-width: 760px) {
  .wrap { padding: 18px 12px 48px; }
  .hero { padding: 48px 24px 60px; }
  .hero-inner { flex-direction: column; gap: 36px; text-align: center; }
  .portrait .ring { width: 220px; height: 220px; }
  .portrait .cap { font-size: 20px; bottom: 34px; }
  .hero-text h1 { font-size: 30px; margin-bottom: 24px; }
  .hero-text .motto { font-size: 17px; white-space: normal; }
  .deco.dove { left: 8%; top: 30px; width: 40px; }
  .deco.cloud1 { left: 60%; top: 26px; width: 36px; }
  .deco.cloud2 { display: none; }
  .deco.pine { width: 48px; bottom: 22px; right: 6%; }
  .deco.cloud3 { display: none; }
  .entries { grid-template-columns: 1fr; }
  .page-card { padding: 36px 22px; border-radius: 20px; }
  .page-title { font-size: 22px; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .admin-card { padding: 30px 20px; }
  .article-body { font-size: 16px; }
  .nav a { font-size: 13px; letter-spacing: 0.2em; text-indent: 0.2em; padding: 8px 10px; }
}
