/* ============================================================
 * 建设世界 · 设计系统
 * ------------------------------------------------------------
 * 1) tokens     — 颜色/字体/间距/圆角/阴影/动效 全部走变量
 * 2) base       — 重置与排版
 * 3) layout     — 应用外壳、页头、页脚
 * 4) nav        — 顶栏 + 侧边栏
 * 5) components — 卡片/按钮/徽章/表单/空态/骨架/提示
 * 6) blocks     — 服务器状态、动态、投票、神人榜、封禁、捐赠、下载、搜索
 * 7) admin      — 管理后台（admin.html 也链接本文件）
 * 8) responsive — 统一 3 档：900 / 640 / 420
 * 9) print
 * ============================================================ */

/* ============================================================
 * 1. TOKENS
 * ============================================================ */
:root {
  /* ============================================================
   * 配色：冷调中性阶（参考 simpfun.net 的 Nuxt UI neutral 阶梯思路）
   * ------------------------------------------------------------
   * 三层结构，每层只差一点点，靠 1px 淡边框分层，不靠阴影和模糊：
   *   bg（页面底） → surface（卡片） → surface-3（卡内分区/悬停）
   * 底色是「冷调深蓝灰」而不是纯黑：纯黑 + 白色描边会显得脏，
   * 带一点蓝色倾向的深灰叠冷白蓝强调色才协调。
   * ============================================================ */

  /* --- 面（由深到浅，共 4 级） --- */
  --bg:            #191d28;
  --surface-1:     #212733;      /* 卡片：纯色，不用半透明 */
  --surface-2:     #262d3b;      /* 悬停 / 次级面 */
  --surface-3:     #2a3140;      /* 卡内分区 / 输入框 */
  --surface-solid: #212733;
  --surface-glass: rgba(25,29,40,.72);

  /* --- 描边（共 4 级，全部克制；simpfun 的分层全靠这个） --- */
  --border-subtle: #262d3b;
  --border:        #2f3746;
  --border-strong: #3d4658;
  --border-accent: rgba(122,193,232,.38);

  /* --- 文字（4 级；最低级 ≈3:1，仅用于非必要装饰小字） --- */
  --text-1: #eef1f7;
  --text-2: #b9c1d1;
  --text-3: #9098ab;
  --text-4: #6a7386;

  /* --- 强调色：单一冷白蓝 --- */
  --accent:        #7ac1e8;
  --accent-strong: #9bd3f2;
  --accent-dim:    rgba(122,193,232,.12);
  --accent-dim-2:  rgba(122,193,232,.22);
  --accent-on:     #0c1a24;      /* 强调色实底上的文字色 */

  /* --- 语义色 --- */
  --ok:      #4ecf9a;
  --ok-dim:  rgba(78,207,154,.12);
  --ok-line: rgba(78,207,154,.30);
  --danger:      #ef6a63;
  --danger-dim:  rgba(239,106,99,.12);
  --danger-line: rgba(239,106,99,.30);
  --warn:      #e0b263;
  --warn-dim:  rgba(224,178,99,.12);
  --warn-line: rgba(224,178,99,.30);
  --bili:      #fb7299;

  /* --- 网格背景：默认不用（已在 HTML 中移除元素），仅玻璃主题需要 --- */
  --grid-line:  rgba(255,255,255,.04);
  --grid-size:  44px;
  --grid-fade:  radial-gradient(ellipse 78% 62% at 50% 0%, #000 0%, transparent 78%);

  /* --- 圆角（对齐 simpfun 的克制尺度：4px 基准） --- */
  --r-xs:   4px;
  --r-sm:   6px;
  --r-md:   8px;
  --r-lg:   12px;
  --r-xl:   16px;
  --r-full: 999px;

  /* --- 间距（8 档，基准 .25rem ↔ --spacing） --- */
  --s-1: .25rem;
  --s-2: .5rem;
  --s-3: .75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 2.5rem;
  --s-8: 4rem;

  /* --- 字体（simpfun 用 Public Sans；无网络时回落到系统字体） --- */
  --font: "Public Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
          "Liberation Mono", monospace;

  --fs-2xs: .6875rem;
  --fs-xs:  .75rem;
  --fs-sm:  .8125rem;
  --fs-base:.9375rem;
  --fs-md:  1.0625rem;
  --fs-lg:  1.3125rem;
  --fs-xl:  1.75rem;
  --fs-2xl: 2.25rem;
  --fs-3xl: 3rem;

  /* --- 阴影：默认全关（扁平风格靠边框分层，不靠阴影） --- */
  --sh-1: none;
  --sh-2: 0 2px 8px -2px rgba(0,0,0,.28);
  --sh-3: 0 12px 32px -12px rgba(0,0,0,.5);
  --ring: 0 0 0 3px var(--accent-dim);

  /* --- 动效（simpfun 用 500ms 主题过渡 / 150ms 交互） --- */
  --ease: cubic-bezier(.4,0,.2,1);
  --t-fast: .15s;
  --t: .2s;

  --page-max: 940px;
  --app-max: 1280px;   /* ↔ --ui-container: 80rem */
}

/* ---------- 浅色主题 ---------- */
html.light-mode {
  --bg:            #f8fafc;
  --surface-1:     #ffffff;
  --surface-2:     #f8fafc;
  --surface-3:     #f1f5f9;
  --surface-solid: #ffffff;
  --surface-glass: rgba(248,250,252,.78);

  --border-subtle: #e8edf4;
  --border:        #dbe2ec;
  --border-strong: #c4cdda;
  --border-accent: rgba(18,113,159,.42);

  --text-1: #0f172a;
  --text-2: #475569;
  --text-3: #64748b;
  --text-4: #78879c;

  --accent:        #0d6a94;
  --accent-strong: #0a5478;
  --accent-dim:    rgba(13,106,148,.09);
  --accent-dim-2:  rgba(13,106,148,.18);
  --accent-on:     #ffffff;

  --ok:      #0b7a51;
  --ok-dim:  rgba(11,122,81,.09);
  --ok-line: rgba(11,122,81,.26);
  --danger:      #c8392f;
  --danger-dim:  rgba(200,57,47,.08);
  --danger-line: rgba(200,57,47,.24);
  --warn:      #8f5e0f;
  --warn-dim:  rgba(143,94,15,.09);
  --warn-line: rgba(143,94,15,.26);
  --bili:      #e0507f;

  --grid-line: rgba(15,23,42,.04);

  --sh-1: none;
  --sh-2: 0 2px 8px -3px rgba(15,23,42,.10);
  --sh-3: 0 16px 40px -16px rgba(15,23,42,.18);
  --ring: 0 0 0 3px var(--accent-dim-2);
}

/* ---------- 液态玻璃主题（可选） ----------
 * 思路：冷调深色打底 + 克制的柔光色团 + 玻璃面。
 * 这版把「亮」整体压下来了：底色更暗、光晕更弱、卡面更暗，
 * 因为玻璃主题最容易翻车的地方就是「整页发灰发亮、显得很廉价」。
 * 所有规则都约束在 html.glass 下，不影响另外两套主题。
 */
html.glass {
  --bg:            #0a0d14;
  --surface-1:     rgba(255,255,255,.045);
  --surface-2:     rgba(255,255,255,.07);
  --surface-3:     rgba(255,255,255,.10);
  --surface-solid: #0f131b;
  --surface-glass: rgba(12,15,22,.7);
  --border-subtle: rgba(255,255,255,.07);
  --border:        rgba(255,255,255,.10);
  --border-strong: rgba(255,255,255,.16);
  --text-1: #f0f3f8;
  --text-2: #b6bfd0;
  --text-3: #8790a3;
  --text-4: #6b7488;
  /* 玻璃面用的圆角比扁平主题略大一点，镜面感靠圆角 + 高光撑住 */
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
}

/* 光晕背景：固定在底层，制造被玻璃折射的彩色光源
 * ⚠️ 必须用独立的 position:fixed 元素，不能用 body::before ——
 * body 是 column flex 容器，::before 会被当成一个 flex 项参与布局，
 * 把 .app 整个顶到首屏下面（曾导致玻璃主题首页一片空白）。
 */
.glass-glow { display: none; }

html.glass .glass-glow {
  display: block;
  position: fixed; inset: -20%; z-index: 0; pointer-events: none;
  /* 光晕再压一档：只在角落留一点冷暖倾向，中间保持干净，
   * 颜色分量集中在下半屏，避免顶部标题区发白。 */
  background:
    radial-gradient(34% 28% at 14% 78%, rgba(72,132,240,.13), transparent 72%),
    radial-gradient(30% 26% at 88% 84%, rgba(170,96,225,.10), transparent 72%),
    radial-gradient(26% 22% at 74% 8%,  rgba(48,190,178,.06), transparent 72%);
  filter: blur(10px);
  animation: glassDrift 26s ease-in-out infinite alternate;
}
@keyframes glassDrift {
  0%   { transform: translate3d(0,0,0) scale(1); }
  50%  { transform: translate3d(2%,-2%,0) scale(1.06); }
  100% { transform: translate3d(-2%,1.5%,0) scale(1.02); }
}

/* 网格在玻璃主题下只当极淡纹理 */
html.glass { --grid-line: rgba(255,255,255,.028); }

/* 玻璃面：导航 / 侧栏 / 卡片 / 表单 / 按钮
 * ⚠️ 这里绝对不能加 position:relative —— 它会把 .sidebar 的 fixed
 * 和 .navbar 的 sticky 一起改掉：侧栏会退化成 100vh 的普通流内元素，
 * 把整页内容顶到首屏以下（首页看起来一片空白）。
 * relative 只加在真正需要 ::before 高光的卡片上，见下面单独一组。
 */
html.glass .navbar,
html.glass .navbar.is-stuck,
html.glass .sidebar,
html.glass .card,
html.glass .mc-card,
html.glass .forum-post,
html.glass .vote-card,
html.glass .story-card,
html.glass .tuto-card,
html.glass .donate-card,
html.glass .download-item,
html.glass .sr-item,
html.glass .server-status-card,
html.glass .info-item,
html.glass .mc-motd,
html.glass .mc-psec,
html.glass .auth-box,
html.glass .search-bar,
html.glass .post-item,
html.glass .rule-item,
html.glass .tuto-step,
html.glass .popover,
html.glass .btn,
html.glass .home-btn,
html.glass .theme-toggle,
html.glass .sidebar-toggle,
html.glass .download-btn,
html.glass .vote-btn,
html.glass .form-group input,
html.glass .form-group textarea,
html.glass .form-group select {
  /* 玻璃填充压暗到 3.5%~6%：原来是 5.5%~14% 的白色，
   * 叠在深底上会把整页提亮，这是「液态玻璃发白」的主因。 */
  background-color: rgba(255,255,255,.035);
  background-image: linear-gradient(160deg, rgba(255,255,255,.075) 0%, rgba(255,255,255,.012) 45%, rgba(255,255,255,.04) 100%);
  background-blend-mode: overlay;
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.14),
    0 8px 26px -14px rgba(0,0,0,.6);
}

/* 描边只给「面板类」元素统一成 1px 玻璃边；
 * 按钮/输入框保留各自原有的边框定义，避免四边都多出一圈亮边。
 * ⚠️ 侧边栏与页头不在此列：侧栏只有右侧贴边描边，页头自带圆角+全边。
 */
html.glass .card,
html.glass .mc-card,
html.glass .forum-post,
html.glass .vote-card,
html.glass .story-card,
html.glass .tuto-card,
html.glass .donate-card,
html.glass .download-item,
html.glass .sr-item,
html.glass .server-status-card,
html.glass .info-item,
html.glass .mc-motd,
html.glass .mc-psec,
html.glass .auth-box,
html.glass .search-bar,
html.glass .post-item,
html.glass .rule-item,
html.glass .tuto-step,
html.glass .popover {
  border: 1px solid rgba(255,255,255,.15);
}

/* 只有这些卡片带 ::before 顶边高光，所以只有它们需要 relative */
html.glass .card,
html.glass .mc-card,
html.glass .forum-post,
html.glass .vote-card,
html.glass .story-card,
html.glass .tuto-card,
html.glass .donate-card,
html.glass .download-item,
html.glass .server-status-card,
html.glass .info-item,
html.glass .auth-box { position: relative; }

/* 顶边高光：模拟玻璃镜面反射 */
html.glass .card::before,
html.glass .forum-post::before,
html.glass .vote-card::before,
html.glass .story-card::before,
html.glass .tuto-card::before,
html.glass .donate-card::before,
html.glass .download-item::before,
html.glass .mc-card::before,
html.glass .server-status-card::before,
html.glass .info-item::before,
html.glass .auth-box::before {
  content: "";
  position: absolute; left: 12%; right: 12%; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  pointer-events: none;
}

/* 悬停：玻璃更亮一点，并轻微抬升 */
html.glass .forum-post:hover,
html.glass .vote-card:hover,
html.glass .story-card:hover,
html.glass .tuto-card:hover,
html.glass .donate-card:hover,
html.glass .download-item:hover,
html.glass .sr-item:hover,
html.glass .post-item:hover {
  background-color: rgba(255,255,255,.085);
  border-color: rgba(255,255,255,.24);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.34),
    0 20px 50px -16px rgba(0,0,0,.7);
}

/* 实底按钮在玻璃主题下改为「高光玻璃」而不是纯色 */
html.glass .btn-primary,
html.glass .home-btn.primary {
  background-color: rgba(158,214,255,.22);
  background-image: linear-gradient(160deg, rgba(255,255,255,.42), rgba(255,255,255,.06));
  border-color: rgba(255,255,255,.4);
  color: #eaf6ff;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}

/* 侧栏：更厚一点的玻璃 + 顶部高光（保持只有右侧贴边描边） */
html.glass .sidebar {
  background-color: rgba(16,20,28,.5);
  background-image: linear-gradient(180deg, rgba(255,255,255,.13), rgba(255,255,255,.02) 30%, rgba(255,255,255,.06));
  border: none;
  border-right: 1px solid rgba(255,255,255,.15);
  box-shadow: inset -1px 0 0 rgba(255,255,255,.12), 0 30px 80px -20px rgba(0,0,0,.8);
}
html.glass .sidebar-menu a.active {
  background-color: rgba(255,255,255,.12);
  background-image: linear-gradient(160deg, rgba(255,255,255,.2), rgba(255,255,255,.04));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3);
}

/* 玻璃主题下的主标题：轻微透光感 */
html.glass #homePage .server-status .title,
html.glass .server-header h2,
html.glass .forum-header h2 {
  text-shadow: 0 2px 30px rgba(150,200,255,.35);
}


/* 液态玻璃固定为黑底（不再是「玻璃+浅色」两套）：
 * 亮玻璃在白底上很容易糊成一片、层次全靠描边硬撑，观感不如直接用「浅色」主题。
 * 因此选择玻璃主题时一律使用深色底，与 html.light-mode 互斥处理见 js/ui.js。
 */

/* 降级：不支持 backdrop-filter 时给足不透明度，避免文字看不清 */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  html.glass .card, html.glass .forum-post, html.glass .vote-card,
  html.glass .story-card, html.glass .tuto-card, html.glass .donate-card,
  html.glass .download-item, html.glass .mc-card, html.glass .sidebar,
  html.glass .navbar.is-stuck, html.glass .popover {
    background-color: rgba(20,24,32,.92);
  }
}

/* 尊重「减少动态效果」 */
@media (prefers-reduced-motion: reduce) {
  html.glass .glass-glow { animation: none; }
}

/* ---------- 主题切换弹窗 ----------
 * 点顶栏主题按钮弹出；Apple 风格：毛玻璃浮层 + 弹性缩放进场。
 */
.theme-picker { position: relative; }

.popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 1200;
  min-width: 250px;
  padding: var(--s-2);
  border-radius: var(--r-lg);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  box-shadow: var(--sh-3);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  transform-origin: top right;
  opacity: 0;
  visibility: hidden;
  transform: scale(.94) translateY(-6px);
  transition: opacity .18s var(--ease), transform .18s var(--ease), visibility .18s;
}
.popover.open { opacity: 1; visibility: visible; transform: scale(1) translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .popover { transition: opacity .01ms, visibility .01ms; transform: none; }
  .popover.open { transform: none; }
}

.popover-title {
  padding: var(--s-2) var(--s-3) var(--s-2);
  font-size: var(--fs-2xs); font-weight: 600;
  color: var(--text-4);
  letter-spacing: .1em;
}

.theme-option {
  display: flex; align-items: center; gap: var(--s-3);
  width: 100%;
  padding: var(--s-2) var(--s-3);
  border: none; border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
  font-size: var(--fs-sm); font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.theme-option:hover { background: var(--surface-2); color: var(--text-1); }
.theme-option i:first-child { width: 1.15em; text-align: center; color: var(--accent); font-size: var(--fs-sm); }
.theme-option .theme-name { flex: 1; }
.theme-option .theme-check { color: var(--accent); font-size: var(--fs-xs); opacity: 0; }
.theme-option[aria-selected="true"] { color: var(--text-1); background: var(--accent-dim); font-weight: 600; }
.theme-option[aria-selected="true"] .theme-check { opacity: 1; }

.popover-divider { height: 1px; margin: var(--s-2) var(--s-3); background: var(--border-subtle); }

/* 玻璃主题下弹窗跟随玻璃质感 */
html.glass .popover {
  background-color: rgba(20,24,32,.72);
  background-image: linear-gradient(160deg, rgba(255,255,255,.09), rgba(255,255,255,.015));
  border-color: rgba(255,255,255,.14);
}

/* ============================================================
 * 2. BASE
 * ============================================================ */
*,*::before,*::after { margin:0; padding:0; box-sizing:border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* 锚点/深链接定位时给吸顶导航留出空间（原本高亮常被导航遮住） */
  scroll-padding-top: 92px;
}
/* 深链接目标本身也留出上边距 */
[id] { scroll-margin-top: 92px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-1);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease);
}

h1,h2,h3,h4 { font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; }
button,input,select,textarea { font-family: inherit; font-size: inherit; color: inherit; }
code,kbd { font-family: var(--mono); }

::selection { background: var(--accent-dim-2); color: var(--text-1); }

/* 统一可见焦点环（键盘可达性） */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* 滚动条 */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--r-full); border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-4); background-clip: content-box; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,*::before,*::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; }
}

/* 屏幕阅读器专用 */
.sr-only {
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

/* 跳到主内容 */
.skip-link {
  position: absolute; left: var(--s-4); top: -100px; z-index: 2000;
  padding: var(--s-2) var(--s-4);
  background: var(--accent); color: var(--accent-on);
  border-radius: var(--r-sm); font-size: var(--fs-sm); font-weight: 600;
  transition: top var(--t) var(--ease);
}
.skip-link:focus { top: var(--s-4); }

/* ---------- 网格背景：默认关闭 ----------
 * 全屏等距网格是很强的视觉噪音，容易显廉价；simpfun 那类风格靠
 * 「纯色面 + 1px 淡边框」分层。这里保留类名但默认不显示，
 * 只把网格留给「液态玻璃」主题当纹理用（且压到极淡）。
 */
.grid-background {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  display: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  background-position: center top;
  -webkit-mask-image: var(--grid-fade);
  mask-image: var(--grid-fade);
}
html.glass .grid-background { display: block; }

/* ============================================================
 * 3. LAYOUT
 * ============================================================ */
.app {
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  min-height: 100vh; width: 100%;
  max-width: var(--app-max);
  margin: 0 auto;
  padding: var(--s-5) var(--s-6) var(--s-4);
}

.main-content { flex: 1; display: flex; flex-direction: column; padding: var(--s-6) 0; }
.page-container { display: flex; flex-direction: column; flex: 1; width: 100%; max-width: var(--page-max); margin: 0 auto; }

/* 统一页头 */
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--s-4); flex-wrap: wrap;
  padding-bottom: var(--s-4);
  margin-bottom: var(--s-5);
  border-bottom: 1px solid var(--border-subtle);
}
.page-header .page-sub,
.page-sub { font-size: var(--fs-sm); color: var(--text-3); margin-top: var(--s-1); }

/* 兼容旧类名：各页原本各写一套 header，统一收口到这里 */
.server-header, .forum-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--s-4); flex-wrap: wrap;
  padding-bottom: var(--s-4);
  margin-bottom: var(--s-5);
  border-bottom: 1px solid var(--border-subtle);
}
.server-header h2, .forum-header h2, .page-header h2, .page-title {
  font-size: var(--fs-xl); font-weight: 600; letter-spacing: -.015em;
  color: var(--text-1);
  display: flex; align-items: center; gap: var(--s-3);
}
.server-header h2 i, .forum-header h2 i, .page-header h2 i, .page-title i { color: var(--accent); font-size: .85em; }

/* 页头右侧的次级操作（如「全站搜索」） */
.forum-header > a, .server-header > a, .page-header > a {
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 36px; padding: 0 var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-1);
  color: var(--text-2);
  font-size: var(--fs-sm); font-weight: 500;
  white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.forum-header > a:hover, .server-header > a:hover, .page-header > a:hover {
  background: var(--surface-3); border-color: var(--border-strong); color: var(--text-1);
}

.footer-copy {
  margin-top: var(--s-6); padding-top: var(--s-5);
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  font-size: var(--fs-xs); color: var(--text-4); letter-spacing: .04em;
}

/* ============================================================
 * 4. NAV — 顶栏 + 侧边栏
 * ============================================================ */
.navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-3) var(--s-4);
  min-height: 56px;
  border: 1px solid transparent;
  border-radius: var(--r-lg);
  transition: border-color var(--t) var(--ease), background-color var(--t) var(--ease);
}
/* 滚动后：贴成一块扁平浮条（1px 淡边 + 纯色面），不加阴影不做毛玻璃，
 * 与非玻璃主题的「扁平、靠边框分层」保持一致。
 */
.navbar.is-stuck {
  background: var(--surface-1);
  border-color: var(--border-subtle);
}
.navbar-left { display: flex; align-items: center; gap: var(--s-3); }
.navbar-right { display: flex; align-items: center; gap: var(--s-2); }

.server-name {
  display: inline-flex; align-items: center;
  min-height: 36px;                 /* 触摸目标不低于 36px */
  font-size: var(--fs-md); font-weight: 600;
  letter-spacing: .04em;
  color: var(--text-1);
  margin-left: var(--s-1);
  border-radius: var(--r-sm);
}
.server-name:hover { color: var(--accent); }

/* 图标按钮 */
.sidebar-toggle, .theme-toggle {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: var(--fs-md);
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
              background-color var(--t-fast) var(--ease);
}
.sidebar-toggle { border-radius: var(--r-sm); }
.theme-toggle { border-radius: var(--r-full); font-size: var(--fs-base); }
.sidebar-toggle:hover, .theme-toggle:hover { border-color: var(--border-strong); color: var(--text-1); background: var(--surface-2); }
.sidebar-toggle:active, .theme-toggle:active { transform: scale(.97); }
.theme-toggle i { transition: transform var(--t) var(--ease); }
html.light-mode .theme-toggle i { transform: rotate(180deg); }

/* ---------- 侧边栏 ---------- */
.sidebar-backdrop {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,.5);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden;
  transition: opacity var(--t) var(--ease), visibility var(--t);
}
.sidebar-backdrop.open { opacity: 1; visibility: visible; }
html.light-mode .sidebar-backdrop { background: rgba(16,24,40,.32); }

.sidebar {
  position: fixed; top: 0; left: 0; z-index: 1000;
  height: 100dvh; width: 292px;
  display: flex; flex-direction: column; gap: var(--s-4);
  padding: var(--s-5) var(--s-4);
  background: var(--surface-solid);
  border-right: 1px solid var(--border-subtle);
  box-shadow: var(--sh-3);
  transform: translateX(-102%);
  visibility: hidden;
  transition: transform .34s var(--ease), visibility .34s;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sidebar.open { transform: translateX(0); visibility: visible; }

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-3);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--border-subtle);
}
.sidebar-header span { font-size: var(--fs-base); font-weight: 600; letter-spacing: .08em; color: var(--text-2); }
.sidebar-close {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; border-radius: var(--r-sm);
  color: var(--text-3); font-size: var(--fs-base); cursor: pointer;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.sidebar-close:hover { color: var(--text-1); background: var(--surface-2); border-color: var(--border); }
.sidebar-close i { transition: transform var(--t) var(--ease); }
.sidebar-close:hover i { transform: rotate(90deg); }

.sidebar-menu { display: flex; flex-direction: column; gap: 2px; }
.sidebar-menu a {
  position: relative;
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  color: var(--text-2); font-size: var(--fs-base); font-weight: 400;
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.sidebar-menu a i { width: 1.25em; text-align: center; font-size: var(--fs-sm); color: var(--text-3); transition: color var(--t-fast) var(--ease); }
.sidebar-menu a:hover { color: var(--text-1); background: var(--surface-2); }
.sidebar-menu a:hover i { color: var(--accent); }
/* 当前页 */
.sidebar-menu a.active { color: var(--text-1); background: var(--accent-dim); font-weight: 500; }
.sidebar-menu a.active i { color: var(--accent); }
.sidebar-menu a.active::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 2px; height: 1.05em; border-radius: var(--r-full); background: var(--accent);
}
.sidebar-foot {
  margin-top: auto; padding-top: var(--s-5);
  display: flex; align-items: center; gap: var(--s-2);
  font-size: var(--fs-2xs); color: var(--text-4); letter-spacing: .05em;
}

/* ============================================================
 * 5. COMPONENTS
 * ============================================================ */

/* ---------- 卡片 ---------- */
.card,
.mc-card,
.forum-post,
.vote-card,
.story-card,
.tuto-card,
.donate-card,
.download-item,
.sr-item,
.auth-box,
.panel {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--s-5);
}

.card { margin-bottom: var(--s-5); }
.card > h2 {
  font-size: var(--fs-md); font-weight: 600;
  color: var(--text-1); margin-bottom: var(--s-4);
  display: flex; align-items: center; gap: var(--s-2);
}

/* 可悬停卡片：统一交互 = 边框提亮 + 背景微提 */
.mc-card, .forum-post, .vote-card, .story-card, .tuto-card,
.donate-card, .download-item, .sr-item, .post-item {
  transition: border-color var(--t) var(--ease), background-color var(--t) var(--ease),
              transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.forum-post:hover, .vote-card:hover, .story-card:hover, .tuto-card:hover,
.donate-card:hover, .download-item:hover, .post-item:hover {
  border-color: var(--border);
  background: var(--surface-2);
}
.download-item:hover, .sr-item:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--sh-2); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 40px; padding: 0 var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text-1);
  font-size: var(--fs-sm); font-weight: 500;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-on); font-weight: 600; }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }

.btn-danger { background: var(--danger-dim); border-color: var(--danger-line); color: var(--danger); }
.btn-danger:hover { background: rgba(240,101,95,.2); border-color: var(--danger); }

.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text-1); }

.btn-sm { min-height: 32px; padding: 0 var(--s-3); font-size: var(--fs-xs); }

/* 首页行动按钮 */
.home-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 44px; padding: 0 var(--s-5);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-1);
  color: var(--text-2);
  font-size: var(--fs-sm); font-weight: 500;
  transition: background-color var(--t) var(--ease), border-color var(--t) var(--ease),
              color var(--t) var(--ease), transform var(--t) var(--ease);
}
.home-btn:hover { background: var(--surface-3); border-color: var(--border-strong); color: var(--text-1); transform: translateY(-1px); }
.home-btn i { font-size: .95em; opacity: .8; }
.home-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-on); font-weight: 600; }
.home-btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-on); }
.home-btn.bili { color: var(--bili); }
.home-btn.bili:hover { border-color: var(--bili); color: var(--bili); background: rgba(251,114,153,.08); }

.back-home-btn {
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 40px; padding: 0 var(--s-4); margin-top: var(--s-3);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface-1); color: var(--text-2);
  font-size: var(--fs-sm); font-weight: 500;
  transition: background-color var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease);
}
.back-home-btn:hover { background: var(--surface-3); border-color: var(--border-strong); color: var(--text-1); }

/* 次级小按钮 */
.refresh-btn, .mc-refresh {
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 32px; padding: 0 var(--s-3);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: transparent; color: var(--text-2);
  font-size: var(--fs-xs); cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.refresh-btn:hover, .mc-refresh:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text-1); }

/* ---------- 徽章 / 标签 ---------- */
.badge, .pin-badge, .mc-proto, .mc-plabel-badge, .download-badge,
.status-badge, .vote-result-badge, .donor, .badge-online {
  display: inline-flex; align-items: center; gap: var(--s-1);
  padding: .12rem var(--s-3);
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-3);
  font-size: var(--fs-2xs); font-weight: 500;
  letter-spacing: .05em;
  white-space: nowrap;
}

.pin-badge { color: var(--accent); background: var(--accent-dim); border-color: var(--border-accent); margin-left: var(--s-2); }
.download-badge { color: var(--accent); background: var(--accent-dim); border-color: var(--border-accent); }
.badge-online { color: var(--ok); background: var(--ok-dim); border-color: var(--ok-line); }

.badge.java, .pl-java, .mc-proto.proto-ping { color: var(--accent); background: var(--accent-dim); border-color: var(--border-accent); }
.badge.bedrock, .pl-bedrock, .mc-proto.proto-bedrock { color: var(--warn); background: var(--warn-dim); border-color: var(--warn-line); }
.badge.bot, .pl-bot { color: var(--text-3); background: var(--surface-2); border-color: var(--border-subtle); }
.badge.query, .mc-proto.proto-query { color: var(--ok); background: var(--ok-dim); border-color: var(--ok-line); }
.badge.third, .mc-proto.proto-third { color: var(--text-3); background: var(--surface-2); border-color: var(--border-subtle); }

.status-badge { padding: .3rem var(--s-4); font-size: var(--fs-xs); }
.status-badge.online { color: var(--ok); background: var(--ok-dim); border-color: var(--ok-line); }
.status-badge.offline { color: var(--danger); background: var(--danger-dim); border-color: var(--danger-line); }
.status-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge.online .dot { animation: pulseDot 2.4s var(--ease) infinite; }

@keyframes pulseDot {
  0%   { box-shadow: 0 0 0 0 rgba(94,211,164,.5); }
  70%  { box-shadow: 0 0 0 7px rgba(94,211,164,0); }
  100% { box-shadow: 0 0 0 0 rgba(94,211,164,0); }
}

/* ---------- 表单 ---------- */
.form-group { margin-bottom: var(--s-4); }
.form-group label {
  display: block;
  font-size: var(--fs-xs); font-weight: 500;
  color: var(--text-2);
  margin-bottom: var(--s-2);
}
.form-group input,
.form-group textarea,
.form-group select,
.auth-box input,
.input {
  width: 100%;
  padding: .6rem var(--s-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-1);
  font-size: var(--fs-base);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.form-group input::placeholder,
.form-group textarea::placeholder,
.auth-box input::placeholder,
.input::placeholder { color: var(--text-4); }
.form-group input:hover, .form-group textarea:hover, .form-group select:hover { border-color: var(--border-strong); }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus,
.auth-box input:focus, .input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-3);
  box-shadow: var(--ring);
}
.form-group textarea { min-height: 96px; resize: vertical; line-height: 1.7; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.form-hint { font-size: var(--fs-xs); color: var(--text-3); line-height: 1.7; }

/* 下拉箭头 */
select {
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: var(--s-6);
}

/* ---------- 空态 / 骨架 / 提示 ---------- */
.empty-state, .sr-empty, .mc-players-empty {
  text-align: center;
  padding: var(--s-6) var(--s-4);
  color: var(--text-4);
  font-size: var(--fs-sm);
}
.empty-state i, .sr-empty i { display: block; font-size: var(--fs-xl); margin-bottom: var(--s-3); opacity: .5; }
/* 加载态的空容器：把转圈居中 */
.empty-state.state-loading { display: flex; align-items: center; justify-content: center; padding: var(--s-5) 0; }
.empty-state.state-loading .spinner { margin: 0 auto; }

/* 骨架屏 */
.skeleton {
  position: relative; overflow: hidden;
  background: var(--surface-2);
  border-radius: var(--r-sm);
}
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--surface-3), transparent);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }
.skeleton-line { height: 12px; margin-bottom: var(--s-2); }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-70 { width: 70%; }
.skeleton-card { height: 96px; margin-bottom: var(--s-3); }

/* 行内提示条 */
.note {
  display: flex; align-items: flex-start; gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
  background: var(--surface-1);
  font-size: var(--fs-sm); line-height: 1.7;
  color: var(--text-2);
}
.note i { margin-top: .25em; flex-shrink: 0; }
.note.warn { background: var(--warn-dim); border-color: var(--warn-line); color: var(--warn); }
.note.ok   { background: var(--ok-dim); border-color: var(--ok-line); color: var(--ok); }
.note.danger { background: var(--danger-dim); border-color: var(--danger-line); color: var(--danger); }

/* ---------- 旧结构兼容层 ----------
 * 这些类来自早期各页的独立写法，页面仍在用，这里统一给出正式样式，
 * 避免继续依赖行内 style。
 */
.page-stack { display: flex; flex-direction: column; flex: 1; gap: var(--s-5); }

.server-status-card {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--s-5);
}
.server-status-card > div { display: flex; flex-direction: column; gap: var(--s-5); }

.player-name {
  display: inline-flex; align-items: center; gap: var(--s-1);
  margin: 0 var(--s-1) var(--s-1) 0;
  padding: .15rem var(--s-3);
  border-radius: var(--r-full);
  background: var(--surface-3);
  border: 1px solid var(--border-subtle);
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.info-item .value { display: flex; flex-direction: column; gap: var(--s-2); }
.info-item .value a {
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 36px;                 /* 触摸目标下限 */
  color: var(--accent);
  font-size: var(--fs-sm);
  transition: color var(--t-fast) var(--ease);
}
.info-item .value a:hover { color: var(--accent-strong); }
.info-item .value a i.fa-external-link-alt { font-size: .75em; opacity: .5; }

/* 内容区里裸露的普通链接（早期页面残留的裸 <a>，没有按钮类）：
 * 给到至少 36px 的点击高度，手机上好点。 */
.page-stack a:not([class]),
.server-status-card a:not([class]) {
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 36px;
}

/* 页头图标语义色 */
.server-header h2 i.fa-heart,  .page-header h2 i.fa-heart  { color: var(--danger); }
.server-header h2 i.fa-trophy, .page-header h2 i.fa-trophy { color: var(--warn); }
.server-header h2 i.fa-download, .page-header h2 i.fa-download { color: var(--accent); }

/* 页脚小字 */
.footer-note, .donate-note, .download-note {
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--text-4);
  margin-top: var(--s-5);
  line-height: 1.9;
}

/* 代码行内 */
.code-inline {
  font-family: var(--mono);
  font-size: .88em;
  color: var(--accent);
  background: var(--surface-3);
  border: 1px solid var(--border-subtle);
  padding: .08em .4em;
  border-radius: var(--r-xs);
  word-break: break-all; overflow-wrap: anywhere;
}

/* 资讯条目 */
.info-item {
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  background: var(--surface-1);
  margin-bottom: var(--s-3);
}
.info-item .label { font-size: var(--fs-xs); color: var(--text-3); letter-spacing: .05em; margin-bottom: var(--s-1); }
.info-item .value { font-size: var(--fs-base); color: var(--text-1); line-height: 1.7; }

/* 规则/步骤列表 */
.rule-list { display: flex; flex-direction: column; gap: var(--s-2); }
.rule-item, .tuto-step {
  display: flex; align-items: flex-start; gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  color: var(--text-2);
  font-size: var(--fs-base);
  line-height: 1.7;
}
.rule-item i { margin-top: .3em; flex-shrink: 0; color: var(--accent); }
.tuto-step .num, .num {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.5rem; height: 1.5rem; margin-top: .15em;
  border-radius: var(--r-full);
  background: var(--accent-dim); border: 1px solid var(--border-accent);
  color: var(--accent);
  font-size: var(--fs-2xs); font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.tuto-step { margin-bottom: var(--s-2); }
.tuto-note2 {
  display: flex; align-items: flex-start; gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: var(--warn-dim); border: 1px solid var(--warn-line);
  color: var(--warn);
  font-size: var(--fs-sm); line-height: 1.7;
  margin-top: var(--s-4);
}
.tuto-note2 i { margin-top: .25em; }

/* ============================================================
 * 6. BLOCKS
 * ============================================================ */

/* ---------- 首页 ---------- */
#homePage {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  flex: 1; text-align: center;
  padding: var(--s-6) 0;
}
#homePage .server-status {
  display: flex; flex-direction: column; align-items: center;
  width: 100%;
  padding-bottom: var(--s-6);
}
#homePage .server-status .title {
  font-size: var(--fs-3xl);
  font-weight: 600;
  letter-spacing: -.03em;
  color: var(--text-1);
  margin-bottom: var(--s-3);
  line-height: 1.1;
}
#homePage .server-status .uptime,
#homePage .uptime {
  font-size: var(--fs-md);
  color: var(--text-2);
  margin-bottom: 0;
  font-variant-numeric: tabular-nums;
}
#homePage .server-status .uptime span { color: var(--accent); font-weight: 600; }

.site-stats { margin-top: var(--s-2); font-size: var(--fs-sm); color: var(--text-3); }
.site-stats span { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }

.version-info { margin-top: var(--s-3); font-size: var(--fs-xs); color: var(--text-4); letter-spacing: .04em; }

.home-actions {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: var(--s-3); margin-top: var(--s-5);
}

/* ---------- 服务器状态 ---------- */
.mc-card { padding: var(--s-5); margin-bottom: var(--s-4); border-radius: var(--r-lg); }
.mc-card-off { border-color: var(--danger-line); background: var(--danger-dim); }

.mc-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s-3); margin-bottom: var(--s-4); }
.mc-live { display: inline-flex; align-items: center; }
.mc-live-text {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: .22rem var(--s-3);
  border-radius: var(--r-full);
  border: 1px solid var(--ok-line);
  background: var(--ok-dim);
  color: var(--ok);
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: .06em;
}
.mc-live-text::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex-shrink: 0;
}
.mc-live-off { color: var(--danger); border-color: var(--danger-line); background: var(--danger-dim); }

.mc-online { font-size: var(--fs-base); color: var(--text-2); }
.mc-online i { opacity: .55; margin-right: var(--s-1); }

.mc-meta { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; margin-bottom: var(--s-4); }

.mc-pgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s-3); margin-bottom: var(--s-4); }
.mc-psec { padding: var(--s-3) var(--s-4); background: var(--surface-1); border: 1px solid var(--border-subtle); border-radius: var(--r-md); }
.mc-plabel {
  display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap;
  font-size: var(--fs-xs); color: var(--text-3);
  letter-spacing: .05em; margin-bottom: var(--s-3);
  font-variant-numeric: tabular-nums;
}
.mc-plist { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.mc-player {
  padding: .1rem var(--s-2);
  border-radius: var(--r-xs);
  background: var(--surface-3);
  border: 1px solid var(--border-subtle);
  color: var(--text-2);
  font-size: var(--fs-xs);
}
.mc-motd {
  padding: var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  font-size: var(--fs-sm); line-height: 1.9;
  color: var(--text-2);
}
.mc-motd-empty { color: var(--text-4); }

.mc-foot {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: var(--s-3); margin-top: var(--s-3);
  font-size: var(--fs-xs); color: var(--text-4);
}

/* 离线/错误/加载 居中状态 */
.mc-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; width: 100%; padding: var(--s-6) var(--s-4); }
.mc-state-icon { font-size: var(--fs-xl); margin-bottom: var(--s-3); color: var(--text-4); }
.mc-state.state-off .mc-state-icon { color: var(--danger); opacity: .85; }
.mc-state.state-error .mc-state-icon { color: var(--warn); }
/* 加载态：中性色 + 细转圈，不要用「离线/错误」的红色图标 ——
 * 加载中不是错误，用红色会显得像出问题了。 */
.mc-state.state-loading .mc-state-icon { color: var(--text-3); opacity: 1; }
.mc-state.state-loading .mc-state-title { color: var(--text-2); font-weight: 500; }
.mc-state.state-loading .spinner { margin: 0 auto; }
.mc-state-title { font-size: var(--fs-md); font-weight: 600; color: var(--text-1); margin-bottom: var(--s-1); }
.mc-state-sub, .mc-state-text { font-size: var(--fs-sm); color: var(--text-3); margin-bottom: var(--s-4); }
.mc-state-proto { margin-top: var(--s-2); }

/* 加载中 */
.spinner {
  width: 22px; height: 22px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 动态 ---------- */
.forum-post { padding: var(--s-5); margin-bottom: var(--s-4); }
.forum-post .post-title {
  font-size: var(--fs-md); font-weight: 600; color: var(--text-1);
  margin-bottom: var(--s-2);
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-1);
}
.forum-post .post-meta { font-size: var(--fs-xs); color: var(--text-3); margin-bottom: var(--s-3); }
.forum-post .post-excerpt { font-size: var(--fs-base); color: var(--text-2); line-height: 1.8; white-space: pre-wrap; }
.post-images { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s-3); margin-top: var(--s-4); }
.post-images img {
  width: 100%; height: 100%; max-height: 420px; object-fit: cover;
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
  background: var(--surface-2);
  display: block;
}
.post-images img:only-child { grid-column: 1 / -1; object-fit: contain; }
.forum-post:target,
.forum-post.is-target { border-color: var(--border-accent); box-shadow: 0 0 0 1px var(--accent-dim), var(--sh-2); }

/* 取不到数据时的占位（不再伪造数字） */
.is-unknown { color: var(--text-4) !important; cursor: help; border-bottom: 1px dashed var(--border-strong); }

/* ---------- 投票 ---------- */
.vote-card { padding: var(--s-5); margin-bottom: var(--s-4); }
.vote-title { font-size: var(--fs-md); font-weight: 600; color: var(--text-1); margin-bottom: var(--s-2); }
.vote-desc { font-size: var(--fs-base); color: var(--text-2); line-height: 1.8; margin-bottom: var(--s-4); white-space: pre-wrap; }
.vote-actions { display: flex; gap: var(--s-3); flex-wrap: wrap; }

.vote-btn {
  flex: 1; min-width: 128px;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 42px; padding: 0 var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-1);
  color: var(--text-2);
  font-size: var(--fs-sm); font-weight: 500;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.vote-btn:disabled { cursor: default; opacity: .55; }
.vote-btn.yes { color: var(--ok); border-color: var(--ok-line); background: var(--ok-dim); }
.vote-btn.yes:hover:not(:disabled) { border-color: var(--ok); background: rgba(94,211,164,.18); }
.vote-btn.yes.voted { border-color: var(--ok); background: rgba(94,211,164,.2); font-weight: 600; }
.vote-btn.no { color: var(--danger); border-color: var(--danger-line); background: var(--danger-dim); }
.vote-btn.no:hover:not(:disabled) { border-color: var(--danger); background: rgba(240,101,95,.18); }
.vote-btn.no.voted { border-color: var(--danger); background: rgba(240,101,95,.2); font-weight: 600; }

.vote-btn.choice {
  flex: 0 1 auto; min-width: 0;
  flex-direction: column; align-items: stretch; gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  color: var(--text-2); border-color: var(--border); background: var(--surface-1);
}
.vote-btn.choice span { text-align: center; }
.vote-btn.choice:hover:not(:disabled) { border-color: var(--border-strong); background: var(--surface-2); }
.vote-btn.choice.voted { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); font-weight: 600; }

.vote-meta {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s-2);
  margin-top: var(--s-3);
  font-size: var(--fs-xs); color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.vote-bar { display: flex; height: 4px; border-radius: var(--r-full); overflow: hidden; margin-top: var(--s-3); background: var(--surface-3); }
.vote-bar .fill-yes { background: var(--ok); height: 100%; transition: width .4s var(--ease); }
.vote-bar .fill-no  { background: var(--danger); height: 100%; transition: width .4s var(--ease); }

.vote-section-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: var(--s-3); padding: var(--s-2) 0 var(--s-4); margin-bottom: var(--s-3);
  border-bottom: 1px solid var(--border-subtle);
}
.vote-section-header span { font-size: var(--fs-sm); color: var(--text-3); }

.history-toggle {
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 34px; padding: 0 var(--s-3);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: transparent; color: var(--text-2);
  font-size: var(--fs-xs); cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.history-toggle:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text-1); }
.history-toggle span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.4rem; height: 1.2rem; padding: 0 .35rem;
  border-radius: var(--r-xs);
  background: var(--surface-3);
  font-size: var(--fs-2xs); font-variant-numeric: tabular-nums;
}
.history-divider {
  padding: var(--s-4) 0 var(--s-2);
  font-size: var(--fs-xs); color: var(--text-4); letter-spacing: .06em;
  border-top: 1px solid var(--border-subtle); margin-top: var(--s-3);
}

.vote-result {
  display: flex; gap: var(--s-4); align-items: center;
  margin-bottom: var(--s-2); padding: var(--s-3) var(--s-4);
  border-radius: var(--r-sm);
  background: var(--surface-1);
  font-size: var(--fs-sm); font-variant-numeric: tabular-nums;
}
.vote-result > span { display: flex; align-items: center; gap: var(--s-2); }
.vote-result > span:first-child { color: var(--ok); }
.vote-result > span:last-child { color: var(--danger); justify-content: flex-end; }
.vote-result.win-yes { background: var(--ok-dim); }
.vote-result.win-no { background: var(--danger-dim); }
.vote-result.win-choice { background: var(--accent-dim); }
.vote-pct { font-size: var(--fs-xs); opacity: .6; }
.win-yes span:first-child .vote-pct,
.win-no span:last-child .vote-pct,
.win-choice .vote-pct { opacity: 1; font-weight: 600; }

.vote-result-badge {
  display: flex; align-items: center; justify-content: center;
  padding: var(--s-3); margin-bottom: var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface-1); border: 1px solid var(--border-subtle);
  color: var(--text-3);
  font-size: var(--fs-sm); font-weight: 600; letter-spacing: .06em;
}
.vote-result-badge.result-yes    { background: var(--ok-dim);     color: var(--ok);     border-color: var(--ok-line); }
.vote-result-badge.result-no     { background: var(--danger-dim); color: var(--danger); border-color: var(--danger-line); }
.vote-result-badge.result-choice { background: var(--accent-dim); color: var(--accent); border-color: var(--border-accent); }
.vote-result-badge.result-draw   { background: var(--warn-dim);   color: var(--warn);   border-color: var(--warn-line); }

.opt-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-1); width: 100%; }
.opt-gallery img { width: 100%; height: auto; border-radius: var(--r-xs); display: block; }
.opt-thumbs { display: flex; gap: var(--s-1); flex-wrap: wrap; margin-bottom: var(--s-1); }
.opt-thumbs img { width: 44px; height: 44px; object-fit: cover; border-radius: var(--r-xs); }

/* ---------- 神人榜 ---------- */
.story-card { padding: var(--s-5); margin-bottom: var(--s-4); }
.story-title { font-size: var(--fs-md); font-weight: 600; color: var(--text-1); margin-bottom: var(--s-2); }
.story-meta { font-size: var(--fs-xs); color: var(--text-3); margin-bottom: var(--s-3); }
.story-content { font-size: var(--fs-base); color: var(--text-2); line-height: 1.85; }
.story-content p { margin: var(--s-2) 0; }
.story-content img { max-width: 100%; height: auto; border-radius: var(--r-md); margin: var(--s-3) 0; display: block; }
.story-content .story-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s-3); margin: var(--s-4) 0; }
.story-content .story-gallery img {
  width: 100%; height: 220px; object-fit: cover;
  border-radius: var(--r-md); margin: 0; display: block;
  border: 1px solid var(--border-subtle);
}
.story-content .story-gallery img:only-child { grid-column: 1 / -1; height: auto; max-height: 560px; object-fit: contain; }

/* ---------- 封挂榜 ---------- */
.bans-table { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-2); }
.ban-row {
  display: grid; grid-template-columns: 1fr 2fr auto;
  gap: var(--s-3); align-items: center;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-sm);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.ban-row.header {
  background: transparent; border-color: transparent;
  padding-top: 0; padding-bottom: var(--s-1);
  font-size: var(--fs-2xs); color: var(--text-4);
  letter-spacing: .1em;
}
.ban-row .player { color: var(--text-1); font-weight: 600; word-break: break-word; }
.ban-row .reason { color: var(--text-2); word-break: break-word; overflow-wrap: anywhere; }
.ban-row .date { color: var(--text-3); text-align: right; font-size: var(--fs-xs); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- 捐赠 ---------- */
.donate-section { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s-5); margin-top: var(--s-3); }
.donate-card { padding: var(--s-5) var(--s-4); text-align: center; }
.donate-card .icon { font-size: var(--fs-xl); margin-bottom: var(--s-3); color: var(--accent); }
.donate-card .name { font-size: var(--fs-md); font-weight: 600; color: var(--text-1); margin-bottom: var(--s-1); }
.donate-card .sub { font-size: var(--fs-xs); color: var(--text-3); margin-bottom: var(--s-4); }
.donate-card img {
  width: 100%; max-width: 220px; height: auto;
  margin: 0 auto; display: block;
  border-radius: var(--r-md);
  background: #fff; padding: var(--s-1);
  border: 1px solid var(--border-subtle);
}
.donate-list-title {
  display: flex; align-items: center; justify-content: center; gap: var(--s-2);
  font-size: var(--fs-base); font-weight: 600; color: var(--text-1);
  margin-bottom: var(--s-4);
}
.donate-list-title i { color: var(--warn); }
.donate-list { display: flex; flex-wrap: wrap; gap: var(--s-2); justify-content: center; }
.donor { color: var(--warn); background: var(--warn-dim); border-color: var(--warn-line); font-size: var(--fs-sm); padding: .2rem var(--s-3); }

/* ---------- 下载中心 ---------- */
.download-list { display: flex; flex-direction: column; gap: var(--s-3); }
.download-item {
  display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap;
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-lg);
}
.download-icon {
  flex-shrink: 0;
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-md);
  background: var(--accent-dim); border: 1px solid var(--border-accent);
  color: var(--accent); font-size: var(--fs-md);
}
.download-info { flex: 1; min-width: 200px; }
.download-name {
  display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap;
  font-size: var(--fs-md); font-weight: 600; color: var(--text-1);
}
.download-desc { font-size: var(--fs-sm); color: var(--text-2); line-height: 1.7; margin-top: var(--s-1); word-break: break-word; }
.download-meta { font-size: var(--fs-xs); color: var(--text-3); margin-top: var(--s-1); font-variant-numeric: tabular-nums; }
.download-btn {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 40px; padding: 0 var(--s-4);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--text-1);
  font-size: var(--fs-sm); font-weight: 500;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.download-btn:hover { background: var(--accent-dim); border-color: var(--accent); color: var(--accent-strong); transform: translateY(-1px); }

/* ---------- 搜索 ---------- */
.search-bar {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-2) var(--s-4);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: var(--s-5);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.search-bar:focus-within { border-color: var(--accent); box-shadow: var(--ring); background: var(--surface-2); }
.search-bar > i { color: var(--text-3); font-size: var(--fs-sm); }
.search-bar input { flex: 1; background: none; border: none; outline: none; font-size: var(--fs-base); color: var(--text-1); min-height: 36px; }
.search-bar input::placeholder { color: var(--text-4); }

.search-result-title {
  font-size: var(--fs-xs); color: var(--text-3);
  letter-spacing: .08em; margin: var(--s-5) 0 var(--s-3);
  padding-bottom: var(--s-2);
  border-bottom: 1px solid var(--border-subtle);
}
.search-result-title span { color: var(--accent); font-variant-numeric: tabular-nums; }

.sr-item { display: block; padding: var(--s-3) var(--s-4); margin-bottom: var(--s-2); border-radius: var(--r-md); color: var(--text-2); }
.sr-item .sr-title { font-weight: 600; font-size: var(--fs-base); color: var(--text-1); margin-bottom: var(--s-1); }
.sr-item .sr-meta { font-size: var(--fs-xs); color: var(--text-3); }
.sr-item .sr-excerpt {
  font-size: var(--fs-sm); color: var(--text-2); margin-top: var(--s-2); line-height: 1.7;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

/* 模糊搜索开关 */
.fuzzy-switch {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-size: var(--fs-xs); color: var(--text-3);
  cursor: pointer; user-select: none;
  transition: color var(--t-fast) var(--ease);
}
.fuzzy-switch:hover { color: var(--text-1); }
.fuzzy-track {
  position: relative; width: 38px; height: 21px;
  border-radius: var(--r-full);
  background: var(--surface-3); border: 1px solid var(--border);
  transition: background-color var(--t) var(--ease), border-color var(--t) var(--ease);
  flex-shrink: 0;
}
.fuzzy-knob {
  position: absolute; top: 2px; left: 2px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--text-3);
  transition: left var(--t) var(--ease), background-color var(--t) var(--ease);
}
#fuzzyToggle:checked + .fuzzy-track { background: var(--accent-dim-2); border-color: var(--accent); }
#fuzzyToggle:checked + .fuzzy-track .fuzzy-knob { left: 19px; background: var(--accent); }
#fuzzyToggle { position: absolute; opacity: 0; width: 0; height: 0; }
#fuzzyToggle:focus-visible + .fuzzy-track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 建设中 ---------- */
#underConstructionPage { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; text-align: center; gap: var(--s-4); }
#underConstructionPage .construction-icon { font-size: var(--fs-2xl); color: var(--text-4); margin-bottom: var(--s-2); }
#underConstructionPage .construction-title { font-size: var(--fs-lg); font-weight: 600; color: var(--text-1); }
#underConstructionPage .construction-desc { font-size: var(--fs-sm); color: var(--text-3); }

/* ---------- 页面容器显隐 ---------- */
#serverPage, #forumPage { display: none; }
#serverPage.active, #forumPage.active { display: flex; flex-direction: column; flex: 1; }

/* ============================================================
 * 7. ADMIN — 管理后台
 * ============================================================ */
.container { max-width: 1080px; margin: 0 auto; padding: var(--s-6) var(--s-5) var(--s-7); }

.admin-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-2); }
.admin-title {
  display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap;
  font-size: var(--fs-lg); font-weight: 600; letter-spacing: -.01em; color: var(--text-1);
}
.admin-sub {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap;
  margin-bottom: var(--s-5); padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--fs-sm); color: var(--text-3);
}
.admin-sub-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }

/* 标签页：横向可滚动，不再挤压换行 */
.tabs {
  display: flex; gap: var(--s-1);
  margin-bottom: var(--s-5);
  overflow-x: auto;
  padding-bottom: var(--s-2);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 36px; padding: 0 var(--s-3);
  border: 1px solid transparent; border-radius: var(--r-sm);
  background: transparent; color: var(--text-3);
  font-size: var(--fs-sm); font-weight: 500; white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.tab-btn:hover { color: var(--text-1); background: var(--surface-2); }
.tab-btn.active { color: var(--text-1); background: var(--accent-dim); border-color: var(--border-accent); font-weight: 600; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* 后台数据行 */
.post-list { display: flex; flex-direction: column; gap: var(--s-2); }
.post-item {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding: var(--s-3) var(--s-4);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
}
.post-item .info { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; min-width: 0; }
.post-item .info .title { font-weight: 600; color: var(--text-1); }
.post-item .info .meta { font-size: var(--fs-xs); color: var(--text-3); font-variant-numeric: tabular-nums; }
.post-item .info .pin-badge { font-size: var(--fs-2xs); padding: .05rem var(--s-2); border-radius: var(--r-full); background: var(--accent-dim); border: 1px solid var(--border-accent); color: var(--accent); margin-left: 0; }
.post-item .actions { display: flex; gap: var(--s-2); flex-shrink: 0; }

/* 表格（流量/日志/备份） */
.table-wrap { overflow-x: auto; border: 1px solid var(--border-subtle); border-radius: var(--r-md); }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
thead th {
  text-align: left; padding: var(--s-3) var(--s-4);
  font-size: var(--fs-xs); font-weight: 600; color: var(--text-3);
  letter-spacing: .06em;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}
tbody td { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border-subtle); color: var(--text-2); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-1); color: var(--text-1); }

/* 后台提示条 */
.toast {
  position: fixed; bottom: var(--s-5); right: var(--s-5); z-index: 9999;
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  box-shadow: var(--sh-3);
  color: var(--text-1); font-size: var(--fs-sm);
  opacity: 0; transform: translateY(12px); visibility: hidden;
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease), visibility var(--t);
}
.toast.show { opacity: 1; transform: translateY(0); visibility: visible; }
.toast.success { border-color: var(--ok-line); }
.toast.error { border-color: var(--danger-line); }

/* 登录遮罩 */
#authOverlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: var(--s-4);
  background: rgba(0,0,0,.72);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
html.light-mode #authOverlay { background: rgba(16,24,40,.45); }
#authOverlay.hidden { display: none; }

.auth-box { width: 100%; max-width: 380px; padding: var(--s-6) var(--s-5); text-align: center; border-radius: var(--r-xl); }
.auth-box .lock-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; margin-bottom: var(--s-4);
  border-radius: var(--r-full);
  background: var(--accent-dim); border: 1px solid var(--border-accent);
  color: var(--accent); font-size: var(--fs-lg);
}
.auth-box h2 { font-size: var(--fs-md); font-weight: 600; color: var(--text-1); margin-bottom: var(--s-1); }
.auth-box p { font-size: var(--fs-sm); color: var(--text-3); margin-bottom: var(--s-5); }
.auth-box input { text-align: center; letter-spacing: .3em; margin-bottom: var(--s-3); min-height: 44px; }
.auth-box .auth-error { min-height: 1.4rem; margin-bottom: var(--s-2); font-size: var(--fs-xs); color: var(--danger); }
.auth-box .btn { width: 100%; min-height: 44px; }

/* 后台返回前台入口 */
.admin-exit { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--fs-xs); color: var(--text-3); }
.admin-exit:hover { color: var(--accent); }

/* 后台工具条 */
.admin-bar { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-4); }
.admin-bar .spacer { flex: 1; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s-3); margin-bottom: var(--s-5); }
.stat-card { padding: var(--s-4); border: 1px solid var(--border-subtle); border-radius: var(--r-md); background: var(--surface-1); }
.stat-card .stat-label { font-size: var(--fs-xs); color: var(--text-3); margin-bottom: var(--s-1); }
.stat-card .stat-value { font-size: var(--fs-lg); font-weight: 600; color: var(--text-1); font-variant-numeric: tabular-nums; }

/* 弹窗（编辑投票等） */
.overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: var(--s-4);
  background: rgba(0,0,0,.72);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
html.light-mode .overlay { background: rgba(16,24,40,.45); }
.overlay[hidden] { display: none; }
.modal {
  width: 100%; max-width: 460px;
  max-height: calc(100dvh - var(--s-6));
  overflow-y: auto;
  padding: var(--s-5);
  border-radius: var(--r-xl);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  box-shadow: var(--sh-3);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-5); }
.modal-head h2 { font-size: var(--fs-md); font-weight: 600; color: var(--text-1); }
.modal-foot { display: flex; gap: var(--s-3); margin-top: var(--s-5); }
.modal-foot .btn { flex: 1; }
.modal textarea { min-height: 80px; }

/* ---------- 通用工具类（替代大量行内 style） ---------- */
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: var(--s-2); flex-wrap: wrap; }
.row-tight { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.row-ok { display: flex; align-items: center; gap: var(--s-2); min-width: 0; font-size: var(--fs-sm); color: var(--ok); }
.items-center { align-items: center; }
.no-shrink { flex-shrink: 0; }
.min-w-0 { min-width: 0; }
.truncate { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.truncate-sm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.truncate-xs { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; font-size: var(--fs-xs); color: var(--text-3); }
.truncate-60 { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.break-all { word-break: break-all; }
.op-60 { opacity: .6; }
.ink-soft { color: var(--text-2); }
.link-accent { font-size: var(--fs-sm); color: var(--accent); }
.err-line { display: flex; gap: var(--s-2); font-size: var(--fs-sm); color: var(--danger); }
.row-note { font-size: var(--fs-xs); color: var(--text-4); margin-top: var(--s-1); }
.stack-sm { display: flex; flex-direction: column; gap: var(--s-2); }
.stack-scroll { display: flex; flex-direction: column; gap: var(--s-1); max-height: 220px; overflow-y: auto; }
.row-wrap { display: flex; gap: var(--s-4); flex-wrap: wrap; }
.nowrap { white-space: nowrap; }

/* 后台数据行（迷你卡） */
.mini-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  margin-bottom: var(--s-1);
  font-size: var(--fs-sm);
}
.mini-row .mini-label { color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-row .mini-value { color: var(--text-1); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 上传进度条 */
.progress { flex: 1; height: 8px; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0%; border-radius: var(--r-full); background: var(--accent); transition: width .15s linear; }
.progress-fill { display: block; height: 100%; width: 0%; border-radius: var(--r-full); background: var(--accent); transition: width .15s linear; }

/* 后台小尺寸按钮/徽章 */
.btn-xs { min-height: 28px; padding: 0 var(--s-3); font-size: var(--fs-xs); border-radius: var(--r-xs); }
.chip-btn {
  display: inline-flex; align-items: center; gap: var(--s-1);
  padding: .15rem var(--s-2);
  border: 1px solid var(--border-accent); border-radius: var(--r-xs);
  background: var(--accent-dim); color: var(--accent);
  font-size: var(--fs-2xs); font-family: inherit; cursor: pointer;
  transition: background-color var(--t-fast) var(--ease);
}
.chip-btn:hover { background: var(--accent-dim-2); }
.chip-btn.warn { border-color: var(--warn-line); background: var(--warn-dim); color: var(--warn); }

/* 图床缩略图 */
.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: var(--r-sm); background: var(--surface-3); flex-shrink: 0; cursor: zoom-in; }

/* 大号统计数字 */
.stat-big { font-size: var(--fs-xl); font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat-big.ok { color: var(--ok); }
.section-title { font-size: var(--fs-lg); font-weight: 600; color: var(--text-1); margin-bottom: var(--s-5); }
.muted-sm { font-size: var(--fs-sm); color: var(--text-3); margin-bottom: var(--s-3); }
.form-label-hint { font-size: var(--fs-2xs); color: var(--text-4); letter-spacing: .04em; margin-right: var(--s-2); }

/* ============================================================
 * 8. RESPONSIVE — 统一 3 档：900 / 640 / 420
 * ============================================================ */
@media (max-width: 900px) {
  .app { padding: var(--s-4) var(--s-4) var(--s-3); }
  .main-content { padding: var(--s-5) 0; }
  .mc-pgrid { grid-template-columns: 1fr; }
  .container { padding: var(--s-5) var(--s-4) var(--s-6); }
}

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .post-item { flex-direction: column; align-items: stretch; gap: var(--s-3); }
  .post-item .actions { justify-content: flex-end; }
  .admin-sub { flex-direction: column; align-items: flex-start; }
  .download-item { padding: var(--s-4); gap: var(--s-3); }
  .download-btn { width: 100%; }
  .post-images { grid-template-columns: 1fr; }
  .story-content .story-gallery { grid-template-columns: 1fr; }
  .story-content .story-gallery img { height: auto; max-height: 340px; object-fit: contain; }
  .vote-result { flex-direction: column; align-items: stretch; gap: var(--s-2); }
  .vote-result > span:last-child { justify-content: flex-start; }
  .donate-card img { max-width: 200px; }
  /* 手机端把后台的次级按钮放大到可点（原 32px 偏小） */
  .btn-sm { min-height: 38px; padding: 0 var(--s-4); }
  .admin-sub-actions { width: 100%; }
  .admin-sub-actions .btn { flex: 1 1 auto; }
  /* 标签栏在手机上横向滚动，滚动条隐藏但保留触摸滑动 */
  .tabs { -webkit-overflow-scrolling: touch; }
  .tab-btn { min-height: 40px; }
  /* 触摸目标下限：所有可点元素不低于 36px */
  .mc-refresh, .refresh-btn, .history-toggle, .chip-btn { min-height: 36px; }
}

@media (max-width: 420px) {
  :root { --fs-2xl: 2rem; --fs-3xl: 2.4rem; --fs-xl: 1.4rem; }
  .app { padding: var(--s-3) var(--s-3); }
  .main-content { padding: var(--s-4) 0; }
  #homePage .server-status .title { letter-spacing: -.02em; }
  .home-actions { flex-direction: column; align-items: stretch; width: 100%; }
  .home-btn { width: 100%; }
  .container { padding: var(--s-4) var(--s-3) var(--s-5); }
  .card, .mc-card, .forum-post, .vote-card, .story-card, .tuto-card { padding: var(--s-4); }
  .ban-row { grid-template-columns: 1fr auto; gap: var(--s-2); }
  .ban-row.header { display: none; }
  .ban-row .reason { grid-column: 1 / -1; color: var(--text-3); font-size: var(--fs-xs); }
  .ban-row .date { text-align: right; }
  .theme-toggle, .sidebar-toggle { width: 36px; height: 36px; }
  .auth-box { padding: var(--s-5) var(--s-4); }
  .toast { left: var(--s-3); right: var(--s-3); bottom: var(--s-3); }
}

/* ============================================================
 * 9. PRINT
 * ============================================================ */
@media print {
  .navbar, .sidebar, .sidebar-backdrop, .footer-copy, .grid-background, .tabs, .toast { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .forum-post, .vote-card, .story-card { border-color: #ddd; background: #fff; }
}
