:root {
  --bg: #1a1f1c;
  --bg2: #232a26;
  --panel: #2d352f;
  --panel2: #38423b;
  --line: #141914;
  --grass: #6cbf4a;
  --green: #4caf50;
  --blue: #2e7dd1;
  --yellow: #e8c53a;
  --red: #d64545;
  --text: #e8eee6;
  --muted: #9aa79c;
  --link: #7cc8ff;
  --shadow: 0 4px 0 rgba(0, 0, 0, 0.55);
}

/* ---------- 主题：简约风 ---------- */
body[data-theme="minimal"] {
  --bg: #f5f6f8;
  --bg2: #eceef2;
  --panel: #ffffff;
  --panel2: #e9ecf1;
  --line: #d9dde3;
  --grass: #3f9d4f;
  --green: #2f9e44;
  --blue: #2b7fd4;
  --yellow: #d9a400;
  --red: #d64545;
  --text: #1f2933;
  --muted: #6b7a87;
  --shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
body[data-theme="minimal"] {
  background-image: none;
}
body[data-theme="minimal"] .pixel-nav,
body[data-theme="minimal"] .box,
body[data-theme="minimal"] .card,
body[data-theme="minimal"] .hero,
body[data-theme="minimal"] .friend-link,
body[data-theme="minimal"] .pixel-btn,
body[data-theme="minimal"] .nav-links a,
body[data-theme="minimal"] .logo-block,
body[data-theme="minimal"] .pixel-table th,
body[data-theme="minimal"] .pixel-table td {
  border-radius: 8px;
}
body[data-theme="minimal"] .hero {
  background: linear-gradient(180deg, #e7f0e4 0%, #dfe8dc 100%);
  border: 1px solid var(--line);
}
body[data-theme="minimal"] .pixel-nav::before { display: none; }
body[data-theme="minimal"] .box { border: 1px solid var(--line); }
body[data-theme="minimal"] .nav-links a {
  box-shadow: none;
  border: 1px solid var(--line);
}
body[data-theme="minimal"] .pixel-btn { box-shadow: 0 2px 6px rgba(0,0,0,0.15); border-radius: 6px; }
body[data-theme="minimal"] .pixel-btn:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,0.2); }
body[data-theme="minimal"] .pixel-title {
  text-shadow: 1px 1px 0 var(--green);
}
body[data-theme="minimal"] form input[type="text"],
body[data-theme="minimal"] form input[type="password"],
body[data-theme="minimal"] form input[type="email"],
body[data-theme="minimal"] form input[type="number"],
body[data-theme="minimal"] form select,
body[data-theme="minimal"] form textarea,
body[data-theme="minimal"] .search-input,
body[data-theme="minimal"] .file-input {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}
body[data-theme="minimal"] .pixel-nav,
body[data-theme="minimal"] .pixel-nav::before {
  border: 1px solid var(--line);
}

/* ---------- 主题：科技风 ---------- */
body[data-theme="tech"] {
  --bg: #0d1117;
  --bg2: #131c26;
  --panel: #161e29;
  --panel2: #1f2b3a;
  --line: #0a2a3f;
  --grass: #33e0a8;
  --green: #10c98a;
  --blue: #1fa2ff;
  --yellow: #ffc93c;
  --red: #ff4d5e;
  --text: #d9e9f5;
  --muted: #7a93a8;
  --shadow: 0 0 14px rgba(0, 180, 255, 0.18);
}
body[data-theme="tech"] {
  background-image:
    radial-gradient(circle at 20% 0%, rgba(0, 200, 255, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 85% 100%, rgba(0, 255, 170, 0.06) 0%, transparent 50%);
  background-color: var(--bg);
  background-size: auto;
}
body[data-theme="tech"] a { color: var(--link, #5ec9ff); }
body[data-theme="tech"] .pixel-nav,
body[data-theme="tech"] .box,
body[data-theme="tech"] .card,
body[data-theme="tech"] .hero {
  border-color: var(--line);
  box-shadow: var(--shadow);
}
body[data-theme="tech"] .pixel-nav::before {
  background: linear-gradient(90deg, var(--blue), var(--grass));
}
body[data-theme="tech"] .hero {
  background: linear-gradient(135deg, #0f2438 0%, #0d1117 100%);
}
body[data-theme="tech"] .pixel-title {
  text-shadow: 0 0 12px var(--blue), 2px 2px 0 rgba(0,0,0,0.5);
}
body[data-theme="tech"] .nav-links a {
  background: var(--panel2);
  border-color: var(--line);
  box-shadow: none;
}
body[data-theme="tech"] .nav-links a:hover { background: var(--blue); }
body[data-theme="tech"] .logo-block {
  background: linear-gradient(135deg, var(--blue), var(--grass));
  border-radius: 4px;
}
body[data-theme="tech"] form input[type="text"],
body[data-theme="tech"] form input[type="password"],
body[data-theme="tech"] form input[type="email"],
body[data-theme="tech"] form input[type="number"],
body[data-theme="tech"] form select,
body[data-theme="tech"] form textarea,
body[data-theme="tech"] .search-input,
body[data-theme="tech"] .file-input {
  background: #0f1a26;
  border: 1px solid var(--line);
}

/* ---------- 明暗模式 ---------- */
body[data-mode="light"] {
  --bg: #f4f6f8;
  --bg2: #e9edf1;
  --panel: #ffffff;
  --panel2: #eef2f6;
  --line: #d7dde4;
  --grass: #3f9d4f;
  --green: #2f9e44;
  --blue: #2b7fd4;
  --yellow: #d9a400;
  --red: #d64545;
  --text: #202a33;
  --muted: #647480;
  --link: #1a73e8;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
body[data-mode="light"] {
  background-image: none;
  background-color: var(--bg);
}
body[data-mode="light"] a { color: var(--link, #1a73e8); }
body[data-mode="light"] .pixel-nav,
body[data-mode="light"] .box,
body[data-mode="light"] .card,
body[data-mode="light"] .hero {
  border-color: var(--line);
  box-shadow: var(--shadow);
}
body[data-mode="light"] .hero {
  background: linear-gradient(180deg, #e6efe4 0%, #dbe6d8 100%);
}
body[data-mode="light"] .pixel-title { text-shadow: 2px 2px 0 var(--green); }
body[data-mode="light"] .pixel-nav::before { background: var(--grass); }
body[data-mode="light"] .nav-links a {
  background: var(--panel2);
  border-color: var(--line);
  box-shadow: none;
}
body[data-mode="light"] .nav-links a:hover { background: var(--green); color: #fff; }
body[data-mode="light"] .logo-block { box-shadow: 2px 2px 0 #2c6e2f; }
body[data-mode="light"] form input[type="text"],
body[data-mode="light"] form input[type="password"],
body[data-mode="light"] form input[type="email"],
body[data-mode="light"] form input[type="number"],
body[data-mode="light"] form select,
body[data-mode="light"] form textarea,
body[data-mode="light"] .search-input,
body[data-mode="light"] .file-input {
  background: #fff;
  border: 1px solid var(--line);
}
body[data-mode="light"] .ip {
  background: #fff;
  color: #2f9e44;
  border: 1px solid var(--line);
}
body[data-mode="light"] .pixel-btn,
body[data-mode="light"] .friend-link,
body[data-mode="light"] .nav-links a {
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
body[data-mode="light"] .dot { background: #2f9e44; border-color: #1e6b2e; }
body[data-mode="light"] .dot.off { background: #e05a5a; }
body[data-mode="light"] .ok { color: #2f9e44; }
body[data-mode="light"] .card-desc { color: #4b5a66; }
body[data-mode="light"] .article blockquote { background: #eef4ea; color: #4a5a44; }
body[data-mode="light"] .article pre.md-code { background: #2b2b2b; }
body[data-mode="light"] .err-box { background: #fdeeee; color: #a33; }

/* ---------- 自定义主题占位 ---------- */
body[data-theme="custom"] {
  /* 通过后台「主题设置」注入 CSS 变量覆盖 */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.18) 1px, transparent 1px);
  background-size: 32px 32px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 16px; }

a { color: var(--link, #7cc8ff); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 导航 ---------- */
.pixel-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--panel);
  border: 2px solid var(--line);
  border-image: none;
  box-shadow: var(--shadow);
  padding: 10px 16px;
  margin: 14px auto;
  max-width: 1080px;
  position: relative;
}
.pixel-nav::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -2px;
  height: 6px;
  background: var(--grass);
  border: 2px solid var(--line);
  border-bottom: none;
}
.logo { font-size: 18px; font-weight: 900; letter-spacing: 1px; display: flex; align-items: center; gap: 8px; }
.logo-block {
  display: inline-block; width: 30px; height: 30px; line-height: 30px;
  text-align: center; background: var(--green); color: #fff;
  font-weight: 900; border: 2px solid var(--line); box-shadow: 2px 2px 0 #2c6e2f;
}
.nav-links { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-links a {
  color: var(--text); padding: 6px 12px; font-weight: 600;
  background: var(--panel2); border: 2px solid var(--line);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.5);
}
.nav-links a:hover { background: var(--green); color: #fff; text-decoration: none; }
.nav-user { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.user-chip { display: flex; align-items: center; gap: 6px; color: var(--text); font-weight: 700; }
.theme-toggle {
  background: var(--panel2); color: var(--text); border: 2px solid var(--line);
  padding: 5px 10px; font-size: 13px; font-weight: 700; cursor: pointer;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.5);
}
.theme-toggle:hover { background: var(--green); color: #fff; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  text-align: center;
  padding: 64px 20px 56px;
  margin: 6px 0 26px;
  background: linear-gradient(180deg, #2b3a2e 0%, #1c241f 100%);
  border: 3px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; opacity: 0.16;
  background-image:
    linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%),
    linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
  pointer-events: none;
}
.hero-content { position: relative; }
.pixel-title {
  font-size: 46px; font-weight: 900; letter-spacing: 3px;
  color: var(--text);
  text-shadow: 3px 3px 0 var(--green), 6px 6px 0 rgba(0,0,0,0.5);
  margin-bottom: 12px;
}
.hero-sub { font-size: 16px; color: #c8d8c8; margin-bottom: 16px; }
.hero-status { font-size: 15px; margin-bottom: 22px; color: var(--muted); }
.dot {
  display: inline-block; width: 12px; height: 12px; border-radius: 0;
  background: #7CFC00; border: 2px solid #2e6b00;
  animation: blink 1.4s infinite;
}
@keyframes blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0.3; } }
.dot.off { background: #e05a5a; border-color: #7a2e2e; animation: none; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- 按钮 ---------- */
.pixel-btn {
  display: inline-block; padding: 12px 24px; font-size: 16px; font-weight: 900;
  color: #fff; border: 2px solid var(--line); cursor: pointer;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.5); transition: transform 0.06s, box-shadow 0.06s;
  text-decoration: none;
}
.pixel-btn:hover { text-decoration: none; transform: translate(1px, 1px); box-shadow: 2px 2px 0 rgba(0,0,0,0.5); }
.pixel-btn:active { transform: translate(3px, 3px); box-shadow: none; }
.pixel-btn-green { background: var(--green); }
.pixel-btn-green:hover { background: #5dc263; }
.pixel-btn-blue { background: var(--blue); }
.pixel-btn-blue:hover { background: #4a94e0; }
.pixel-btn-yellow { background: var(--yellow); color: #222; }
.pixel-btn-yellow:hover { background: #ffc93c; }
.btn-small { padding: 5px 10px; font-size: 13px; background: var(--blue); color: #fff; border: 2px solid var(--line); box-shadow: 2px 2px 0 rgba(0,0,0,0.5); }

/* ---------- 轮播图 ---------- */
.carousel {
  position: relative; max-width: 900px; margin: 20px auto;
  background: #000; border: 3px solid var(--line); box-shadow: var(--shadow);
  overflow: hidden; image-rendering: pixelated;
}
.carousel-track { display: flex; transition: transform 0.4s ease; }
.carousel .slide { flex: 0 0 100%; min-width: 100%; position: relative; }
.carousel .slide img { display: block; width: 100%; height: 320px; object-fit: cover; }
.carousel .slide a { display: block; }
.slide-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 18px; font-size: 18px; font-weight: 900; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,0.85)); text-shadow: 2px 2px 0 #000;
}
.carousel-nav { position: absolute; bottom: 10px; right: 12px; display: flex; gap: 6px; z-index: 2; }
.dot-nav { width: 10px; height: 10px; border: 2px solid #fff; background: rgba(0,0,0,0.4); cursor: pointer; }
.dot-nav.on { background: var(--yellow); }
.carousel-prev, .carousel-next {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 38px; height: 48px; background: rgba(0,0,0,0.55); color: #fff;
  border: 2px solid var(--line); font-size: 22px; cursor: pointer; line-height: 1;
}
.carousel-prev { left: 8px; }
.carousel-next { right: 8px; }
.carousel-prev:hover, .carousel-next:hover { background: rgba(0,0,0,0.8); }

/* ---------- 友情链接 ---------- */
.friend-link {
  display: inline-block; margin: 0 8px 10px 0; padding: 8px 16px;
  background: var(--panel); border: 2px solid var(--line); box-shadow: 3px 3px 0 rgba(0,0,0,0.5);
  font-weight: 700; color: var(--blue); text-decoration: none;
}
.friend-link:hover { background: var(--grass); color: #fff; text-decoration: none; transform: translate(1px,1px); }

.carousel-thumb { width: 90px; height: 50px; object-fit: cover; border: 2px solid var(--line); image-rendering: pixelated; }
.thumb { width: 140px; height: 100px; object-fit: cover; border: 2px solid var(--line); }
.img-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* ---------- Markdown 渲染 ---------- */
.article { line-height: 1.8; word-break: break-word; }
.article p { margin: 8px 0; }
.article h1, .article h2, .article h3, .article h4, .article h5 { margin: 18px 0 8px; font-weight: 900; color: var(--yellow); }
.article h1 { font-size: 24px; } .article h2 { font-size: 21px; } .article h3 { font-size: 18px; } .article h4, .article h5 { font-size: 16px; }
.article blockquote { margin: 10px 0; padding: 8px 14px; border-left: 5px solid var(--grass); background: #f0ead8; color: #555; }
.article ul, .article ol { margin: 8px 0; padding-left: 26px; }
.article li { margin: 4px 0; }
.article pre.md-code { background: #2b2b2b; color: #eee; padding: 12px 14px; border: 2px solid var(--line); overflow-x: auto; font-size: 13px; line-height: 1.5; }
.article pre.md-code code { background: none; color: inherit; padding: 0; border: none; }
.article code.md-inline { background: #efe8d2; color: #a04040; padding: 2px 6px; border: 1px solid var(--line); font-size: 13px; }
.article del { color: var(--muted); }
.article img.md-img, .md-img img { max-width: 100%; border: 2px solid var(--line); }

/* ---------- 排行榜 / 日志 / 导出 ---------- */
.rank-td { font-size: 20px; text-align: center; }
.log-detail { max-width: 380px; word-break: break-word; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 12px; }
.export-card .card-title { font-size: 18px; }
.export-card .pixel-btn { margin: 6px 6px 0 0; }
.required-star { color: #ff9090; }
.pixel-btn[disabled] { opacity: 0.6; cursor: not-allowed; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form label { margin: 0; }
.inline-form input, .inline-form select { width: auto; }
.img-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.img-preview img { width: 90px; height: 60px; object-fit: cover; border: 2px solid var(--line); }

/* ---------- 区块 ---------- */
.section { margin-bottom: 30px; }
.section-title { font-size: 24px; font-weight: 900; margin-bottom: 12px; padding-left: 10px; border-left: 6px solid var(--grass); }
.page-title { font-size: 28px; font-weight: 900; margin-bottom: 16px; }
.narrow { max-width: 460px; margin: 30px auto; }

.box {
  background: var(--panel); border: 2px solid var(--line);
  box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px;
}
.box h3 { margin: 10px 0 8px; color: var(--yellow); }
.box hr { border: none; border-top: 2px solid var(--line); margin: 12px 0; }
.box p { margin: 8px 0; line-height: 1.7; }
.muted { color: var(--muted); font-size: 13px; }
.center { text-align: center; }
.err { color: #ff9090; font-weight: 700; }
.ok { color: #7CFC00; font-weight: 700; }
.code-row { display: flex; gap: 8px; align-items: center; }
.code-row input { flex: 1; }
.code-row .pixel-btn { padding: 10px 14px; font-size: 13px; margin-top: 0; white-space: nowrap; }
.file-input {
  width: 100%; background: #0f1310; color: var(--text);
  border: 2px solid var(--line); padding: 9px 12px; font-size: 14px;
}
.file-input::file-selector-button {
  background: var(--panel2); color: var(--text); border: 2px solid var(--line);
  padding: 5px 12px; margin-right: 10px; cursor: pointer; font-weight: 700;
}
.file-input::file-selector-button:hover { background: var(--blue); color: #fff; }
.article { line-height: 1.8; }
.ip {
  background: #0f1310; color: #7CFC00; padding: 2px 8px;
  border: 2px solid var(--line); font-family: "Courier New", monospace; font-weight: 700;
}

/* ---------- 卡片 ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 16px; }
.card {
  background: var(--panel2); border: 2px solid var(--line);
  box-shadow: var(--shadow); padding: 16px;
}
.game-card:hover { background: #43504300; background-color: #3d4940; }
.game-icon { font-size: 34px; margin-bottom: 8px; }
.card-title { font-weight: 900; font-size: 16px; margin-bottom: 6px; color: var(--yellow); }
.card-desc { color: #c2ccc4; font-size: 14px; line-height: 1.6; }
.stat-card { text-align: center; }
.stat-num { font-size: 30px; font-weight: 900; color: #7CFC00; margin-bottom: 6px; text-shadow: 2px 2px 0 rgba(0,0,0,0.6); }

/* ---------- 列表 ---------- */
.ann-list, .post-list, .comment-list, .rank-list, .steps { list-style: none; }
.ann-item, .post-row, .comment-row, .rank-row { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.ann-item:last-child, .post-row:last-child { border-bottom: none; }
.ann-date { color: var(--muted); font-size: 13px; margin-right: 8px; }
.ann-item.full { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.ann-title { color: var(--text); font-weight: 700; }
.post-row { display: flex; gap: 12px; align-items: center; }
.post-main { flex: 1; }
.post-title { color: var(--text); font-weight: 800; font-size: 16px; }
.avatar { display: inline-block; font-size: 20px; }
.avatar-img {
  display: inline-block; width: 22px; height: 22px;
  object-fit: cover; border: 2px solid var(--line); vertical-align: middle;
  image-rendering: pixelated;
}
.avatar-img.lg { width: 40px; height: 40px; }
.grass-block {
  display: inline-block; width: 22px; height: 22px; vertical-align: middle;
  background:
    linear-gradient(180deg, #7bbf45 0 52%, #8a6a3b 52% 100%);
  border: 2px solid var(--line);
  position: relative;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.5);
}
.grass-block::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 7px;
  background:
    linear-gradient(135deg, transparent 50%, #7bbf45 50%) 0 0 / 6px 6px,
    linear-gradient(45deg, transparent 50%, #68aa3a 50%) 0 0 / 6px 6px;
  background-color: #7bbf45;
}
.grass-block::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 9px;
  background:
    linear-gradient(135deg, transparent 50%, #8a6a3b 50%) 0 0 / 6px 6px,
    linear-gradient(45deg, transparent 50%, #75582c 50%) 0 0 / 6px 6px;
  background-color: #8a6a3b;
}
.grass-block.lg { width: 40px; height: 40px; }
.rank-count { float: right; color: var(--yellow); font-weight: 700; }

/* ---------- 称号 ---------- */
.title-chip {
  display: inline-block; background: var(--panel2); color: var(--yellow);
  border: 2px solid var(--line); padding: 1px 8px; font-size: 12px;
  font-weight: 700; margin-left: 4px; vertical-align: middle;
}

/* ---------- 图片上传预览 ---------- */
.img-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.preview-thumb { width: 90px; height: 90px; object-fit: cover; border: 2px solid var(--line); }
.img-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin: 14px 0; }
.post-img { width: 100%; border: 2px solid var(--line); background: #000; }

/* ---------- 管理后台 ---------- */
.admin-card { text-decoration: none; display: block; }
.admin-card:hover { transform: translateY(-3px); }
.pixel-table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 14px; }
.pixel-table th, .pixel-table td { border: 2px solid var(--line); padding: 8px 10px; text-align: left; }
.pixel-table th { background: var(--panel2); }
.pixel-btn-danger { background: #b04040; color: #fff; }
.pixel-btn-danger:hover { background: #d05050; }

/* ---------- VIP ---------- */
.vip-chip {
  display: inline-block; background: linear-gradient(135deg, #f7c948, #d99a00);
  color: #3a2a00; border: 2px solid #a97400; padding: 1px 8px; font-size: 12px;
  font-weight: 800; margin-left: 4px; vertical-align: middle; border-radius: 3px;
}
.vip { color: #f7c948; font-weight: 700; }
.vip-text { color: #f7c948; font-weight: 700; }

/* ---------- 搜索 ---------- */
.search-row { margin: 12px 0; }
.search-form { display: flex; gap: 8px; align-items: center; }
.search-input {
  flex: 1; background: #0f1310; color: var(--text);
  border: 2px solid var(--line); padding: 10px 12px; font-size: 15px;
}
.search-form .pixel-btn { margin-top: 0; }

/* ---------- 附件 ---------- */
.attach-box { background: var(--panel2); border: 2px dashed var(--line); padding: 12px; margin: 12px 0; }
.attach-list { list-style: none; padding: 0; margin: 8px 0 0; }
.attach-list li { margin: 8px 0; }
.attach-list .pixel-btn { padding: 6px 12px; font-size: 13px; margin-top: 0; }

/* ---------- 按钮行/行内表单 ---------- */
.btn-row { display: flex; gap: 8px; align-items: center; margin: 10px 0; }
.btn-row .pixel-btn { margin-top: 0; }
.inline-form { display: inline; }
.inline-form .pixel-btn { margin-top: 0; }

/* ---------- 封禁提示 ---------- */
.err-box { background: #3a1010; border: 2px solid #b04040; padding: 14px; margin: 12px 0; color: #ffb3b3; }

/* ---------- 表单 ---------- */
form label { display: block; margin: 12px 0 4px; font-weight: 700; }
form input[type="text"], form input[type="password"], form input[type="email"], form input[type="number"], form select, form textarea {
  width: 100%; background: #0f1310; color: var(--text);
  border: 2px solid var(--line); padding: 10px 12px; font-size: 15px;
  font-family: inherit;
}
form label.check-inline { display: flex; align-items: center; gap: 8px; font-weight: 400; }
form label.check-inline input { width: auto; }
form input:focus, form textarea:focus, form select:focus { outline: none; border-color: var(--grass); }
form button { margin-top: 16px; }
.comment-form { margin-top: 14px; }
input[type="color"] {
  width: 100%; height: 38px; background: #0f1310; border: 2px solid var(--line);
  cursor: pointer; padding: 2px;
}
body[data-mode="light"] input[type="color"] { background: #fff; }
.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 10px 0; }
.color-field label { margin: 0 0 4px; font-size: 13px; }
.color-field input[type="color"] { width: 100%; }
.color-preview {
  display: inline-block; width: 14px; height: 14px; border: 1px solid var(--line);
  vertical-align: middle; margin-right: 6px;
}

/* ---------- 密码显示切换 ---------- */
.pw-wrap { position: relative; display: block; }
.pw-wrap input[type="password"], .pw-wrap input[type="text"] { width: 100%; }
.pw-eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; padding: 4px; margin: 0; cursor: pointer;
  color: var(--muted); display: flex; align-items: center;
}
.pw-eye:hover { color: var(--grass); }
.pw-eye .eye-off { display: none; }
.pw-eye.showing .eye-on { display: none; }
.pw-eye.showing .eye-off { display: block; }

/* ---------- 页脚 ---------- */
.pixel-footer {
  text-align: center; padding: 20px; font-size: 13px; color: var(--muted);
  border-top: 2px solid var(--line); margin-top: 20px;
}

/* ---------- 商店 ---------- */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 16px; }
.shop-card { background: var(--panel2); border: 2px solid var(--line); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.shop-icon { font-size: 40px; text-align: center; }
.shop-name { font-weight: 900; font-size: 17px; text-align: center; color: var(--text); }
.shop-desc { color: var(--muted); font-size: 13px; line-height: 1.6; flex: 1; }
.shop-price { text-align: center; font-weight: 900; font-size: 18px; color: var(--yellow); }
.shop-stock { text-align: center; font-size: 12px; color: var(--muted); }
.shop-buy { text-align: center; }
.shop-buy .pixel-btn { width: 100%; text-align: center; }
.shop-off { opacity: 0.55; }

/* ---------- 主题设置 ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 10px 0; }
.theme-option { display: block; background: var(--panel2); border: 2px solid var(--line); padding: 12px; text-align: center; cursor: pointer; font-weight: 800; }
.theme-option:hover { border-color: var(--green); }
.theme-option.on { border-color: var(--green); box-shadow: 0 0 0 2px var(--green); }
.theme-swatch { height: 46px; border: 2px solid var(--line); margin-bottom: 8px; }
.mode-toggle { display: flex; gap: 10px; margin: 10px 0; }
.mode-toggle label { margin: 0; }

/* ---------- 积分/红包 ---------- */
.point-big { font-size: 26px; font-weight: 900; color: var(--yellow); }
.point-log-row { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.point-plus { color: #7CFC00; font-weight: 700; }
body[data-mode="light"] .point-plus { color: #2f9e44; }
.point-minus { color: var(--red); font-weight: 700; }
.rp-msg { background: #fff7e0; border: 2px solid #e0b34a; padding: 10px 14px; border-radius: 6px; font-weight: 700; color: #7a5b00; }
.rp-msg a { color: #b97f00; }
body[data-mode="light"] .rp-msg { background: #fff7e0; color: #7a5b00; }
.redpacket-card { border: 2px solid #e0b34a; background: linear-gradient(135deg, #fff4d6, #ffe9b0); padding: 14px; border-radius: 8px; margin: 10px 0; color: #7a5200; }
.rp-btn { display: inline-block; margin-top: 6px; padding: 5px 14px; border: 2px solid #c0392b; background: #e74c3c; color: #fff; font-weight: 800; cursor: pointer; border-radius: 4px; }
.rp-btn-open:hover { background: #c0392b; }
.rp-btn-done { background: #7f8c8d; border-color: #6b7575; }

/* ---------- “我的”板块 ---------- */
.me-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.me-card { background: var(--panel); border: 2px solid var(--line); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.me-card h3 { color: var(--yellow); margin: 0; }
.me-card .pixel-btn { margin-top: 6px; text-align: center; }
.me-stats { display: flex; gap: 14px; flex-wrap: wrap; margin: 8px 0; }
.me-stat { background: var(--panel2); border: 2px solid var(--line); padding: 10px 16px; text-align: center; min-width: 90px; }
.me-stat b { display: block; font-size: 20px; color: var(--yellow); }

/* ---------- 打赏 / 付费 / 抽奖 / 成就 / 私信 ---------- */
.pricing-box { border: 2px dashed var(--line); }
.pricing-box .me-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.pay-box { border: 2px dashed var(--yellow); }
.pay-box h3 { color: var(--yellow); }

/* 成就 */
.ach-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.achievement-row { display: flex; gap: 12px; align-items: center; padding: 12px; border: 2px solid var(--line); background: var(--panel2); }
.achievement-row.ach-done { border-color: var(--green); }
.achievement-row.ach-todo { opacity: 0.75; }
.ach-icon { font-size: 30px; min-width: 42px; text-align: center; }
.ach-main { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ach-status { white-space: nowrap; font-weight: 700; }
.ach-done .ach-status { color: #7CFC00; }
body[data-mode="light"] .ach-done .ach-status { color: #2f9e44; }
.ach-todo .ach-status { color: var(--muted); }

/* 抽奖 */
.lottery-pool { margin: 8px 0 12px; }
.lottery-pool li { padding: 4px 0; }

/* 私信 */
.post-row.msg-unread { background: rgba(255, 224, 130, 0.08); }
.msg-list { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.msg-bubble { max-width: 85%; padding: 10px 14px; border: 2px solid var(--line); box-shadow: var(--shadow); }
.msg-bubble.msg-me { align-self: flex-end; background: var(--blue); color: #fff; }
.msg-bubble.msg-them { align-self: flex-start; background: var(--panel2); }
.msg-name { font-size: 12px; opacity: 0.8; margin-bottom: 4px; }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .pixel-title { font-size: 32px; }
  .pixel-nav { flex-direction: column; align-items: stretch; }
  .nav-user { justify-content: space-between; }
}

/* 进度条 / 等级 */
.bar-wrap { background: var(--panel2); border: 2px solid var(--line); height: 14px; border-radius: 3px; overflow: hidden; margin: 6px 0; }
.bar-fill { background: var(--green); height: 100%; transition: width 0.3s; }
.level-badge { display: inline-block; background: var(--yellow); color: #222; font-weight: 800; padding: 2px 8px; border-radius: 3px; margin-left: 6px; font-size: 13px; }
.exp-bar { height: 10px; }
.exp-text { font-size: 13px; }

