/* ============ New Century 怀念馆 · MC 夜空怀旧风 v2 ============ */
:root {
  --dirt-dark: #2a2015;
  --dirt: #59422b;
  --grass: #7cbd4e;
  --grass-dark: #5a9134;
  --panel: #c6c6c6;
  --panel-dark: #555555;
  --panel-light: #ffffff;
  --gold: #fcdb05;
  --gold-dark: #b8a000;
  --diamond: #4aedd9;
  --redstone: #ff5555;
  --ink: #2b2b2b;
  --paper: #f5efdf;
  --night1: #0c1226;
  --night2: #1a2440;
  --dusk1: #3d2f52;
  --dusk2: #7a3b52;
  --amber: #ffb75e;
  --font-cn: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-px: "SF Mono", "Menlo", Consolas, "Courier New", monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-cn);
  color: var(--ink);
  background-color: var(--night1);
  background-image:
    radial-gradient(ellipse 1200px 500px at 50% -80px, rgba(90,110,190,.30), transparent 70%),
    radial-gradient(ellipse 900px 380px at 85% 30%, rgba(122,59,82,.16), transparent 70%),
    linear-gradient(180deg, var(--night1) 0%, var(--night2) 45%, #22304f 78%, #2c3a2e 100%);
  background-attachment: fixed;
  min-height: 100vh;
}
/* 像素星空 */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(2px 2px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 8%, #ffe9a8 50%, transparent 51%),
    radial-gradient(2px 2px at 45% 22%, #cfe6ff 50%, transparent 51%),
    radial-gradient(1px 1px at 63% 12%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 78% 26%, #ffd7d7 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 9%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 8% 34%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 35% 40%, #e8f0ff 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 33%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 70% 45%, #ffe9a8 50%, transparent 51%),
    radial-gradient(1px 1px at 16% 52%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 82% 58%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 42% 62%, #ffd7d7 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 70%, #cfe6ff 50%, transparent 51%),
    radial-gradient(1px 1px at 95% 40%, #fff 50%, transparent 51%);
  animation: twinkle 7s ease-in-out infinite alternate;
  opacity: .8;
}
@keyframes twinkle { from { opacity: .55; } to { opacity: .95; } }

img { image-rendering: pixelated; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(12, 18, 38, .82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 3px solid #000;
  box-shadow: 0 4px 24px rgba(0,0,0,.5);
}
.topbar-inner {
  max-width: 1140px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; flex-wrap: wrap;
}
.logo {
  display: flex; align-items: center; gap: 10px; margin-right: auto;
  font-weight: 800; color: #fff; letter-spacing: 1px; text-decoration: none;
  text-shadow: 0 2px 0 rgba(0,0,0,.6);
}
.logo .cube {
  width: 30px; height: 30px;
  background: linear-gradient(180deg, var(--grass) 0 34%, var(--dirt) 34% 100%);
  border: 2px solid #000; box-shadow: inset -4px -4px 0 rgba(0,0,0,.28);
  animation: bob 3.4s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0);} 50% { transform: translateY(-3px);} }
.nav a {
  display: inline-block; padding: 7px 12px; margin: 2px;
  color: #d9e2f5; text-decoration: none; font-size: 14px;
  background: rgba(255,255,255,.07);
  border: 2px solid rgba(0,0,0,.65);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.14), inset -1px -1px 0 rgba(0,0,0,.35);
  border-radius: 4px;
  transition: background .15s, transform .15s, color .15s;
}
.nav a:hover { background: rgba(124,189,78,.28); color: #fff; transform: translateY(-1px); }
.nav a.active {
  background: linear-gradient(180deg, #6fae43, #4c8728); color: #fff;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.25), inset -1px -2px 0 rgba(0,0,0,.35), 0 3px 0 rgba(0,0,0,.4);
}

/* ---------- 通用布局 ---------- */
.wrap { max-width: 1140px; margin: 0 auto; padding: 30px 16px 90px; }
.page { display: none; }
.page.active { display: block; animation: fadein .3s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: none;} }

h1.page-title, h2.section-title {
  color: #fff;
  text-shadow: 0 3px 0 #000, 0 0 24px rgba(124,189,78,.25);
  letter-spacing: 2px;
}
h1.page-title { font-size: 32px; margin: 12px 0 6px; }
h2.section-title {
  font-size: 22px; margin: 38px 0 16px;
  border-left: 8px solid var(--grass); padding-left: 14px;
  position: relative;
}
h2.section-title::after {
  content: ""; position: absolute; left: 0; bottom: -6px; width: 46px; height: 3px;
  background: var(--gold);
}
.page-sub { color: #b9c3da; margin: 0 0 20px; font-size: 14px; }

/* MC 面板 */
.panel {
  background: var(--panel);
  border: 3px solid;
  border-color: var(--panel-light) var(--panel-dark) var(--panel-dark) var(--panel-light);
  box-shadow: 0 0 0 3px #000, 8px 8px 0 rgba(0,0,0,.45);
  padding: 18px 20px;
}
.panel.dark {
  background: #232c46; color: #e9e2d2;
  border-color: #4a5678 #10121f #10121f #4a5678;
}

/* MC 按钮 */
.mcbtn {
  display: inline-block; cursor: pointer; user-select: none;
  padding: 8px 18px; font-size: 14px; color: #fff; font-family: var(--font-cn);
  background: linear-gradient(180deg, #6e7383, #4c5162);
  border: 2px solid #000; border-radius: 3px;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.22), inset -2px -2px 0 rgba(0,0,0,.35), 0 3px 0 rgba(0,0,0,.4);
  text-shadow: 1px 2px 0 rgba(0,0,0,.5); text-decoration: none;
  transition: transform .1s, filter .15s;
}
.mcbtn:hover { filter: brightness(1.14); }
.mcbtn:active { transform: translateY(2px); box-shadow: inset 2px 2px 0 rgba(255,255,255,.15), inset -2px -2px 0 rgba(0,0,0,.35); }
.mcbtn.small { padding: 4px 11px; font-size: 12px; }
.mcbtn.green { background: linear-gradient(180deg, #7cbf4e, #55872e); }
.mcbtn.chip.active { background: linear-gradient(180deg, #7cbf4e, #55872e); }

/* ---------- 首页 hero：MC 日落 ---------- */
.hero {
  position: relative; overflow: hidden;
  margin-top: 8px; padding: 64px 34px 56px;
  background: linear-gradient(180deg, #1b2547 0%, #4a3568 34%, #94435c 58%, #d97b4a 82%, #f2a65a 100%);
  border: 4px solid #000; border-radius: 4px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.08), 10px 10px 0 rgba(0,0,0,.45);
}
/* 太阳 */
.hero .sun {
  position: absolute; right: 11%; top: 46%; width: 84px; height: 84px;
  background: repeating-linear-gradient(0deg, #ffd98a 0 8px, #ffb75e 8px 16px);
  border-radius: 50%;
  box-shadow: 0 0 60px 22px rgba(255, 183, 94, .45);
  animation: sunbob 6s ease-in-out infinite;
}
@keyframes sunbob { 0%,100% { transform: translateY(0);} 50% { transform: translateY(-6px);} }
/* 像素山剪影 */
.hero .hills {
  position: absolute; left: 0; right: 0; bottom: -2px; height: 120px; pointer-events: none;
  background:
    linear-gradient(180deg, transparent 39%, #10241d 40%),
    conic-gradient(from 240deg at 18% 100%, transparent 0 40deg, #16352b 40deg 320deg, transparent 320deg) 0 0/340px 100% no-repeat,
    conic-gradient(from 240deg at 68% 100%, transparent 0 40deg, #122a23 40deg 320deg, transparent 320deg) 120px 0/420px 100% no-repeat,
    conic-gradient(from 240deg at 40% 100%, transparent 0 40deg, #0e211b 40deg 320deg, transparent 320deg) -60px 0/380px 100% no-repeat,
    linear-gradient(180deg, transparent 60%, #0d1c17 61%);
}
/* 像素云 */
.hero .cloud {
  position: absolute; height: 22px; background: rgba(255,255,255,.75);
  box-shadow: 0 0 0 3px rgba(255,255,255,.25);
  animation: drift linear infinite;
}
.hero .cloud.c1 { width: 130px; top: 16%; left: -140px; animation-duration: 52s; }
.hero .cloud.c2 { width: 84px; top: 30%; left: -90px; animation-duration: 38s; animation-delay: -19s; opacity: .55; }
.hero .cloud.c3 { width: 170px; top: 9%; left: -180px; animation-duration: 70s; animation-delay: -44s; opacity: .4; }
@keyframes drift { from { transform: translateX(0);} to { transform: translateX(1400px);} }

.hero h1 {
  position: relative; margin: 0 0 10px;
  font-size: 48px; letter-spacing: 8px; color: #fff;
  text-shadow: 4px 4px 0 #3a1e33, 8px 8px 0 rgba(0,0,0,.35);
}
.hero .en { position: relative; color: var(--gold); font-size: 14px; letter-spacing: 5px; font-family: var(--font-px); }
.hero p.lead { position: relative; color: #ffeedd; max-width: 720px; line-height: 2; text-shadow: 0 2px 0 rgba(0,0,0,.35); }
.hero .qq {
  position: relative; display: inline-block; margin-top: 14px; color: #2b2b2b;
  background: var(--gold); padding: 5px 14px; border: 2px solid #000;
  font-weight: 700; box-shadow: 3px 3px 0 rgba(0,0,0,.4);
}

/* 数据统计 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 28px 0; }
.stat { text-align: center; padding: 18px 8px; position: relative; overflow: hidden; }
.stat::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: linear-gradient(90deg, var(--grass), var(--gold));
}
.stat .num { font-size: 36px; font-weight: 900; color: #3d6b1e; text-shadow: 2px 2px 0 rgba(255,255,255,.55); font-family: var(--font-px); }
.stat .lbl { font-size: 13px; color: #6b5a45; margin-top: 2px; }

/* 卡片网格 */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel);
  border: 3px solid;
  border-color: var(--panel-light) var(--panel-dark) var(--panel-dark) var(--panel-light);
  box-shadow: 0 0 0 3px #000, 6px 6px 0 rgba(0,0,0,.42);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translate(-2px, -4px); box-shadow: 0 0 0 3px #000, 10px 12px 0 rgba(0,0,0,.5); }
.card .cover { height: 172px; background: #3a3a3a; position: relative; overflow: hidden; }
.card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.card:hover .cover img { transform: scale(1.06); }
.card .cover .noimg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #9f9f9f; font-size: 14px;
  background-image: linear-gradient(45deg, #464646 25%, transparent 25%, transparent 75%, #464646 75%), linear-gradient(45deg, #464646 25%, transparent 25%, transparent 75%, #464646 75%); background-size: 24px 24px; background-position: 0 0, 12px 12px; }
.card .body { padding: 14px 16px 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.card h3 { margin: 0; font-size: 17px; }
.card .meta { font-size: 12px; color: #77664e; }
.card p.excerpt { margin: 0; font-size: 13px; color: #4a4235; line-height: 1.7; }
.card .foot { margin-top: auto; display: flex; gap: 8px; align-items: center; }
.badge { display: inline-block; font-size: 11px; padding: 2px 8px; border: 2px solid #000; background: var(--gold); color: #3a3000; font-weight: 700; }
.badge.green { background: #9ad06d; color: #1d3306; }
.badge.blue { background: #7fd6e8; color: #08323c; }
.badge.red { background: #e88b8b; color: #47100d; }
.badge.gray { background: #bdbdbd; color: #333; }

/* ---------- 时间线 ---------- */
.timeline { position: relative; margin: 10px 0 0; padding-left: 44px; }
.timeline::before {
  content: ""; position: absolute; left: 13px; top: 6px; bottom: 6px; width: 6px;
  background: repeating-linear-gradient(180deg, var(--grass) 0 14px, var(--grass-dark) 14px 28px);
  border: 2px solid #000; box-shadow: 0 0 14px rgba(124,189,78,.35);
}
.tl-item { position: relative; margin: 0 0 24px; animation: fadein .3s ease; }
.tl-item::before {
  content: ""; position: absolute; left: -38px; top: 18px; width: 14px; height: 14px;
  background: var(--gold); border: 3px solid #000;
  box-shadow: 0 0 0 3px rgba(252,219,5,.25), 0 0 12px rgba(252,219,5,.5);
}
.tl-card { padding: 16px 18px; }
.tl-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.tl-date { font-family: var(--font-px); font-weight: 800; color: var(--grass-dark); }
.tl-tag { font-size: 11px; border: 2px solid #000; padding: 1px 8px; background: #e7d9b8; }
.tl-title { font-size: 18px; font-weight: 800; margin: 6px 0; }
.tl-text { font-size: 14px; line-height: 1.9; color: #463c2c; }
.tl-src { margin-top: 8px; font-size: 12px; color: #8a7a5e; }
.tl-img { margin-top: 10px; max-width: 420px; width: 100%; border: 3px solid #000; box-shadow: 4px 4px 0 rgba(0,0,0,.3); cursor: zoom-in; transition: transform .15s; }
.tl-img:hover { transform: scale(1.015); }

/* ---------- 文章正文 ---------- */
.article-body { font-size: 15px; line-height: 2; }
.article-body img { max-width: 100%; height: auto; border: 3px solid #000; margin: 6px 0; box-shadow: 4px 4px 0 rgba(0,0,0,.3); cursor: zoom-in; }
.article-body blockquote, .article-body .quote {
  margin: 10px 0; padding: 8px 14px; background: #ece5d2; border-left: 6px solid #a89a76; font-size: 13px;
}
.article-body p { margin: 10px 0; white-space: pre-wrap; }
.article-body a { color: #3c6e1f; }

/* 评论（村民留言） */
.comments { margin-top: 16px; border-top: 3px dashed #a89a76; padding-top: 12px; }
.comment { display: flex; gap: 10px; margin: 10px 0; align-items: flex-start; }
.comment .head {
  flex: none; width: 34px; height: 34px; background: var(--grass-dark);
  border: 2px solid #000; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800;
  box-shadow: 2px 2px 0 rgba(0,0,0,.3);
}
.comment .bubble { background: #efe9d6; border: 2px solid #b9ac8a; padding: 8px 12px; font-size: 13px; flex: 1; }
.comment .bubble .who { font-weight: 700; color: #5d4d30; font-size: 12px; }
.comment .bubble .what { white-space: pre-wrap; }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(5,8,18,.8); z-index: 90; display: none; overflow-y: auto; padding: 40px 14px; }
.modal-mask.open { display: block; animation: fadein .2s ease; }
.modal {
  max-width: 880px; margin: 0 auto; background: var(--paper);
  border: 4px solid #000; border-radius: 3px;
  box-shadow: 10px 12px 0 rgba(0,0,0,.55), inset 0 0 0 2px #fff;
  padding: 22px 26px 30px;
  animation: popin .22s ease;
}
@keyframes popin { from { transform: translateY(14px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h2 { margin: 0 0 4px; font-size: 20px; }
.modal .meta { color: #857658; font-size: 12px; margin-bottom: 14px; }
.modal .close-row { text-align: right; margin-bottom: 6px; }
.reply { border-top: 2px solid #d8cfb6; padding: 12px 2px; }
.reply .who { font-weight: 800; font-size: 13px; color: #4c6e2f; }
.reply .when { color: #9b8d6d; font-size: 11px; margin-left: 8px; }
.reply .txt { font-size: 14px; line-height: 1.9; margin-top: 4px; }
.reply .txt img { max-width: 100%; border: 2px solid #000; cursor: zoom-in; }
.reply .txt blockquote, .reply .txt .quote { background: #eee5cd; border-left: 5px solid #b3a47c; margin: 6px 0; padding: 6px 10px; font-size: 13px; }
.reply .txt p { margin: 6px 0; white-space: pre-wrap; }

/* Discuz 折叠内容（隐藏文字） */
.spoiler { margin: 8px 0; border: 2px solid #b3a47c; background: #f2ecdb; }
.spoiler .spoilerheader { padding: 4px 8px; background: #e5dcc2; }
.spoiler .spoilerbutton { font-size: 12px; cursor: pointer; background: #6e7383; color: #fff; border: 2px solid #000; padding: 2px 10px; }
.spoiler .spoilerbody { padding: 8px 12px; }
.spoiler .spoilerbody img { max-width: 100%; border: 2px solid #000; margin: 4px 0; }

/* 相册 */
.gallery-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.gallery { columns: 3 260px; column-gap: 16px; }
.gallery figure { margin: 0 0 16px; break-inside: avoid; background: var(--panel); border: 3px solid #000; box-shadow: 4px 4px 0 rgba(0,0,0,.35); padding: 8px; transition: transform .15s; }
.gallery figure:hover { transform: translate(-1px,-2px); }
.gallery img { width: 100%; display: block; cursor: zoom-in; }
.gallery figcaption { font-size: 12px; color: #6b5a45; padding-top: 6px; }

/* 灯箱 */
.lightbox {
  position: fixed; inset: 0; z-index: 120; display: none;
  align-items: center; justify-content: center;
  background: rgba(4,6,14,.92); cursor: zoom-out;
}
.lightbox.open { display: flex; animation: fadein .18s ease; }
.lightbox img { max-width: 92vw; max-height: 88vh; border: 3px solid #000; box-shadow: 0 0 60px rgba(0,0,0,.8); }
.lightbox .lb-cap { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; color: #cfd6ea; font-size: 13px; text-shadow: 0 2px 0 #000; }
.lightbox .lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; line-height: 40px; text-align: center;
  color: #fff; font-size: 22px; user-select: none; cursor: pointer;
  background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.25);
}
.lightbox .lb-nav:hover { background: rgba(255,255,255,.2); }
.lightbox .lb-prev { left: 18px; } .lightbox .lb-next { right: 18px; }

/* 帮助页 tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.help-body { font-size: 14px; line-height: 2.05; white-space: pre-wrap; word-break: break-word; }
.help-body a { color: #3c6e1f; }

/* 搜索框 */
.searchbar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.searchbar input {
  flex: 1; min-width: 200px; padding: 9px 14px; font-size: 14px; font-family: var(--font-cn);
  color: #fff; background: rgba(255,255,255,.08);
  border: 2px solid #000; border-radius: 3px;
  box-shadow: inset 2px 2px 0 rgba(0,0,0,.3);
  outline: none;
}
.searchbar input::placeholder { color: #8f9ab5; }
.searchbar input:focus { background: rgba(255,255,255,.14); box-shadow: inset 2px 2px 0 rgba(0,0,0,.3), 0 0 0 2px rgba(124,189,78,.5); }

/* 聊天趣事页 */
.chat-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.chatline { padding: 13px 15px; position: relative; }
.chatline .who { font-weight: 800; color: #2f5c14; font-size: 13px; }
.chatline .who::before { content: "💬 "; }
.chatline .when { color: #9b8d6d; font-size: 11px; margin-left: 8px; font-family: var(--font-px); }
.chatline .say { margin-top: 5px; font-size: 14px; line-height: 1.8; color: #443a28; word-break: break-word; }
.chatline .say i { color: #8a6d3b; font-style: normal; }
.chatline:hover { background: #ece5d2; }

/* 关于页 */
.about-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(280px,1fr)); gap: 20px; }
.userlist { display: flex; flex-wrap: wrap; gap: 8px; }
.userlist span { background: #efe9d6; border: 2px solid #b9ac8a; padding: 3px 10px; font-size: 12px; }
.missing-note { font-size: 12px; color: #8a6d3b; }

/* 返回顶部 */
.backtop {
  position: fixed; right: 22px; bottom: 26px; z-index: 60;
  width: 46px; height: 46px; display: none;
  align-items: center; justify-content: center; cursor: pointer;
  color: #fff; font-size: 18px; text-shadow: 0 2px 0 #000;
  background: linear-gradient(180deg, #6fae43, #4c8728);
  border: 3px solid #000; border-radius: 4px;
  box-shadow: 0 4px 0 rgba(0,0,0,.5);
  transition: transform .15s;
}
.backtop.show { display: flex; animation: fadein .2s ease; }
.backtop:hover { transform: translateY(-3px); }

footer {
  margin-top: 70px; padding: 28px 16px 44px; text-align: center; color: #9aa5c0; font-size: 12px;
  border-top: 4px solid #000; background: rgba(8,11,22,.88);
}
footer .grass-strip { height: 12px; max-width: 1140px; margin: 0 auto 20px;
  background: linear-gradient(180deg, var(--grass) 0 45%, var(--dirt) 45% 100%);
  border: 2px solid #000; }

@media (max-width: 640px) {
  .hero { padding: 44px 20px 40px; }
  .hero h1 { font-size: 30px; letter-spacing: 3px; }
  .hero .sun { width: 60px; height: 60px; right: 6%; }
  .timeline { padding-left: 30px; }
  .tl-item::before { left: -30px; }
}
