/* Warmane-like layout: navigation-wrapper, page-frame video, page-content-wrapper, wm-ui frames */

:root {
  --bg-deep: #0a0b0d;
  --bg-panel: rgba(12, 14, 18, 0.92);
  --border: #3d3830;
  --border-dim: #2a2620;
  --text: #e8e4dc;
  --muted: #9a9488;
  --gold: #c4a035;
  --gold-dim: #8a7020;
  --gold-glow: rgba(196, 160, 53, 0.25);
  /* 弹窗内按钮：蒙灰、纯色扁平（无渐变，不显立体） */
  --modal-btn-fg: #b8b5ad;
  --modal-btn-fg-hover: #d8d4cc;
  --modal-btn-bg: #2c2c30;
  --modal-btn-bg-hover: #38383c;
  --modal-btn-edge: #454545;
  --modal-btn-edge-hover: #5c5c5c;
  --font-ui: "Noto Sans SC", "Segoe UI", system-ui, sans-serif;
  --font-display: "Cinzel", "Times New Roman", serif;
  --radius: 2px;

  /*
   * 导航栏 —— 只改下面变量即可（无需改其它选择器）
   *
   * 【整体布局】与 Warmane global.css 对齐：
   *   - .navigation-wrapper 与 #page-frame 同宽 1008px、同一条竖直中心线（margin-left/right:auto）
   *   - .navigation-wrapper 无左右 padding（否则横条会比视频框窄，对称被破坏）
   *   - #page-frame { margin:90px auto 0 }；窄屏下 .center 宽 998px，相对外框左右各 5px（非侧条 7px）
   *   - #page-content-wrapper 宽 1000px、top:-136px
   *   --wm-nav-top（顶栏整体下移，留出顶部深色留白）/ --wm-nav-extra-top / --warmane-page-frame-margin-top / --warmane-page-content-pull
   *   --wm-nav-nudge-y：与 Warmane .navigation 一致，整条横条相对上移（通常 -30px），勿用负 background-y 硬抠
   *
   * 【仅横条内图案】wm_navbar.png：--wm-nav-bar-bg-x / -y / size（微调切片，主要靠 nudge-y 整体上移）
   *
   * 徽章 wm_navlogo.png（.navigation-logo 背景雪碧）
   *   --wm-nav-logo-left / -top：整块徽章相对顶栏的左右、上下
   *   --wm-nav-logo-bg-x / -y：雪碧在框内的偏移（通常 0 0）
   *   --wm-nav-logo-hover-y：悬停时纵向偏移（第二帧，默认 -125px）
   *
   * 链接区（避免与图重叠）
   *   --wm-nav-bits-left / -right
   */
  /* 顶栏 position:absolute 的 top：下移后视口上方留出深色区（Warmane 截图）；徽章 top:-60 时宜 ≥56px */
  --wm-nav-top: 64px;
  /* Warmane .navigation：top:-30px; margin-bottom:-30px；整条横条上移，不靠 bg-position 裁切 */
  --wm-nav-nudge-y: -30px;
  /* Cursor 简易浏览器等顶栏会遮住页面最上沿时，可改为 40px～56px，整条导航下移露出横条与徽章 */
  --wm-nav-extra-top: 0;
  /* 与 Warmane #page-frame 一致：margin-top: 90px auto 0 */
  --warmane-page-frame-margin-top: 90px;
  /* 与 Warmane #page-content-wrapper 一致：position:relative; top:-136px */
  --warmane-page-content-pull: -136px;
  /* #page-frame 与 #page-content-wrapper 之间的占位：人数条 + 其下页脚块，避免内容上拉重叠 */
  --page-online-stats-clearance: 40px;
  /* 人数条与页脚之间的 QQ 图标行占位 */
  --page-qq-row-clearance: 48px;
  --page-footer-stack-clearance: 56px;

  /*
   * 主图视频装饰框图：放在 assets/images/，文件名见下方 CSS url()
   * --video-frame-*：四角边条尺寸；视频在 .center 内距外框留出贴图位置
   */
  --video-frame-corner: 12px;
  /* 左右装饰条宽（与 Warmane #page-frame > .leftmost-frame / .rightmost-frame 一致） */
  --video-frame-side: 7px;
  /* 视频 .center 相对 #page-frame 内侧左右留白：Warmane 为 margin-left:5px + width:998px（1090px 档） */
  --video-frame-center-inset: 5px;
  --video-frame-top: 8px;
  --video-frame-bottom: 8px;
  --page-frame-video-object-pos: center center;
  --wm-nav-bar-bg-x: center;
  --wm-nav-bar-bg-y: -0px;
  --wm-nav-bar-bg-size: cover;

  --wm-nav-logo-left: 15px;
  --wm-nav-logo-top: -59px;
  --wm-nav-logo-bg-x: 0;
  --wm-nav-logo-bg-y: 0;
  --wm-nav-logo-hover-y: -125px;

  --wm-nav-bits-left: 140px;
  --wm-nav-bits-right: 80px;

  /* 首页大背景视频：原先 0.75 会让整段像蒙一层灰；1 为完全不透明，需要略压暗可改 0.92 */
  --page-frame-video-opacity: 1;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: #0f0f0f;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg-deep);
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--bg-deep);
  pointer-events: none;
}

/* 背景音乐开关（固定在右下角，低于弹窗 z-index） */
.bgm-toggle {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 9990;
  width: 36px;
  height: 36px;
  padding: 0;
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1;
  color: var(--muted);
  background: rgba(10, 11, 13, 0.88);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.35);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.bgm-toggle:hover {
  color: var(--gold);
  border-color: var(--gold-dim);
}

.bgm-toggle--paused {
  color: var(--border);
  opacity: 0.75;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: #edd56a;
}

/* Noscript */
#noscript-override {
  margin: 0;
  padding: 16px 20px;
  text-align: center;
  background: #3a1212;
  color: #fff;
  border-bottom: 2px solid #8b2c2c;
}

#noscript-override p {
  margin: 0;
}

/*
 * Warmane 顶栏（global.css 逻辑摘要，非截图推断）：
 * - 条背景图在 .navigation 上：../images/wm_navbar.png，no-repeat + background-size: cover，高约 64px，top: -30px
 * - Logo 雪碧在 a.navigation-logo：../images/wm_navlogo.png 125×125，hover 时 background-position: 0 -125px，left:15px top:-59px float:left
 * - .navbits：position:absolute; right:80px，链接行高等于条高
 * 本项目资源路径：../img/wm_navbar.png、wm_navlogo.png（与 index 同级的 img 文件夹）
 */
/* 非 Warmane 仍用 sticky */
.navigation-wrapper:not(.navigation-wrapper--warmane) {
  position: sticky;
  top: 0;
  z-index: 200;
}

/*
 * Warmane 原版：.navigation-wrapper 为 position:absolute; width:1008px; 水平居中；与 #page-frame、#page-content 宽度联动
 */
.navigation-wrapper.navigation-wrapper--warmane {
  position: absolute;
  left: 0;
  right: 0;
  margin-left: auto;
  margin-right: auto;
  width: 1008px;
  max-width: calc(100% - 24px);
  top: calc(var(--wm-nav-top) + var(--wm-nav-extra-top));
  z-index: 200;
  /* Warmane：无左右 padding，保证 wm_navbar 与 #page-frame 同宽对齐 */
  padding: 0;
  overflow: visible;
  background: transparent;
  border: none;
  box-shadow: none;
}

.navigation-wrapper--warmane::after {
  content: "";
  display: table;
  clear: both;
}

.navigation-wrapper--warmane .navigation-logo {
  position: absolute;
  left: var(--wm-nav-logo-left);
  top: var(--wm-nav-logo-top);
  width: 125px;
  height: 125px;
  margin: 0;
  padding: 0;
  background: url("../img/wm_navlogo.png") no-repeat var(--wm-nav-logo-bg-x) var(--wm-nav-logo-bg-y);
  background-size: 125px auto;
  display: block;
  z-index: 2;
  text-indent: -9999px;
  overflow: hidden;
}

.navigation-wrapper--warmane .navigation-logo:hover {
  background-position: var(--wm-nav-logo-bg-x) var(--wm-nav-logo-hover-y);
}

/* 使用官方雪碧时隐藏内联 logo 图 */
.navigation-wrapper--warmane .navigation-logo-img {
  display: none;
}

.navigation-wrapper--warmane .navigation-logo.navigation-logo--fallback {
  background-image: none;
  text-indent: 0;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 120px;
  height: auto;
  min-height: 2rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.navigation-wrapper--warmane .navigation-logo.navigation-logo--fallback .navigation-logo-img {
  display: none !important;
}

.navigation-logo-img[hidden] {
  display: none !important;
}

.navigation-wrapper:not(.navigation-wrapper--warmane) .navigation-logo.navigation-logo--fallback {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 0 16px var(--gold-glow);
}

.navigation-wrapper--warmane .navigation {
  width: 100%;
  max-width: 1008px;
  height: 64px;
  position: relative;
  /* Warmane global.css：条整体上移，顶区留白由 --wm-nav-top 承担 */
  top: var(--wm-nav-nudge-y);
  margin: 0 0 var(--wm-nav-nudge-y) 0;
  z-index: 1;
  background-image: url("../img/wm_navbar.png");
  background-repeat: no-repeat;
  background-position: var(--wm-nav-bar-bg-x) var(--wm-nav-bar-bg-y);
  background-size: var(--wm-nav-bar-bg-size);
  display: block;
}

.navigation-wrapper--warmane .navigation .navbits {
  position: absolute;
  left: var(--wm-nav-bits-left);
  right: var(--wm-nav-bits-right);
  top: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  height: 64px;
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-end;
  box-sizing: border-box;
}

.navigation-wrapper--warmane .navigation .navbits li {
  float: none;
  margin: 0 0 0 clamp(24px, 4vw, 57px);
}

.navigation-wrapper--warmane .navigation .navbits li:first-child {
  margin-left: 0;
}

.navigation-wrapper--warmane .navigation .navbits a {
  display: block;
  height: 64px;
  line-height: 64px;
  padding: 0 2px;
  color: #996019;
  text-shadow: 2px 2px 0 #000;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: none;
}

.navigation-wrapper--warmane .navigation .navbits a:hover {
  color: #b87726;
  background: transparent;
}

.navigation-wrapper--warmane .navigation .navbits a.is-active {
  color: #c9a030;
}

/* 导航占位：外观同链接，不可跳转、无悬停变色 */
.navigation-wrapper--warmane .navigation .navbits .navbits__static {
  display: block;
  height: 64px;
  line-height: 64px;
  padding: 0 2px;
  color: #996019;
  text-shadow: 2px 2px 0 #000;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: none;
  cursor: default;
}

.navigation-wrapper--warmane .nav-toggle {
  position: relative;
  z-index: 5;
  float: right;
  margin-top: -40px;
}

@media (max-width: 900px) {
  .navigation-wrapper--warmane .navigation .navbits {
    left: 12px;
    right: 12px;
    flex-wrap: wrap;
    height: auto;
    min-height: 64px;
    justify-content: center;
  }

  .navigation-wrapper--warmane .navigation .navbits a {
    height: auto;
    line-height: 1.3;
    padding: 8px 6px;
    font-size: 12px;
  }

  .navigation-wrapper--warmane .navigation .navbits .navbits__static {
    height: auto;
    line-height: 1.3;
    padding: 8px 6px;
    font-size: 12px;
  }
}

/* 非 Warmane 时的通用顶栏（保留类名备用） */
.navigation-wrapper:not(.navigation-wrapper--warmane) {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 10px 20px 8px;
  background: linear-gradient(180deg, #141210 0%, #0c0b09 100%);
  border-bottom: 1px solid var(--border-dim);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.navigation-wrapper:not(.navigation-wrapper--warmane) .navigation-logo {
  display: flex;
  align-items: center;
  min-height: 48px;
  min-width: 120px;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-shadow: 0 0 16px var(--gold-glow);
  background: none;
  float: none;
  width: auto;
  height: auto;
  position: static;
  text-indent: 0;
  overflow: visible;
}

.navigation-wrapper:not(.navigation-wrapper--warmane) .navigation-logo-img {
  display: block;
  max-height: 48px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px var(--gold-glow));
}

.navigation-wrapper:not(.navigation-wrapper--warmane) .navigation {
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
  background: transparent;
  float: none;
  height: auto;
  top: 0;
  margin-bottom: 0;
}

.navigation-wrapper:not(.navigation-wrapper--warmane) .navigation .navbits {
  position: static;
  left: auto;
  right: auto;
  height: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin: 0;
  padding: 0;
  list-style: none;
}

.navigation-wrapper:not(.navigation-wrapper--warmane) .navigation .navbits li {
  margin: 0;
}

.navigation-wrapper:not(.navigation-wrapper--warmane) .navigation .navbits a {
  display: block;
  padding: 10px 14px;
  height: auto;
  line-height: inherit;
  color: var(--muted);
  text-shadow: none;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  border-bottom: 2px solid transparent;
}

.navigation-wrapper:not(.navigation-wrapper--warmane) .navigation .navbits a:hover {
  color: var(--text);
  background: rgba(196, 160, 53, 0.06);
}

.navigation-wrapper:not(.navigation-wrapper--warmane) .navigation .navbits a.is-active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.navigation-wrapper:not(.navigation-wrapper--warmane) .navigation .navbits .navbits__static {
  display: block;
  padding: 10px 14px;
  height: auto;
  line-height: inherit;
  color: var(--muted);
  text-shadow: none;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  border-bottom: 2px solid transparent;
  cursor: default;
}

.navigation-wrapper:not(.navigation-wrapper--warmane) .nav-toggle {
  float: none;
  margin-top: 0;
}

.nav-toggle {
  display: none;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  cursor: pointer;
}

.nav-toggle:hover {
  border-color: var(--gold-dim);
}

/* 与 Warmane #page-frame：margin 90px 顶距、z-index:1；宽度 1008 档高度约 382px */
#page-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1008px;
  margin: var(--warmane-page-frame-margin-top) auto 0;
  height: 382px;
  background: #0d0c0a;
  overflow: hidden;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.45);
}

/* 视频在装饰框内侧（与 Warmane 边条 + 角图占位一致） */
#page-frame .center {
  position: absolute;
  z-index: 1;
  top: var(--video-frame-top);
  bottom: var(--video-frame-bottom);
  left: var(--video-frame-center-inset);
  right: var(--video-frame-center-inset);
  overflow: hidden;
  background: #070605;
  box-shadow: inset 0 0 0 1px rgba(90, 80, 65, 0.25);
}

/* ---------- 主图视频区装饰框（四角 + 上下条 + 左右条）---------- */
#page-frame > .frame-corners {
  display: block;
  position: absolute;
  z-index: 2;
  width: var(--video-frame-corner);
  height: var(--video-frame-corner);
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* 与 Warmane 主题同名：assets/images/page_content_*.png（四角若缺文件可先拷自主题或用下方 CDN） */
#page-frame > .frame-corners.tl {
  top: 0;
  left: 0;
  background-image: url("../assets/images/page_content_tl.png");
}

#page-frame > .frame-corners.tr {
  top: 0;
  right: 0;
  background-image: url("../assets/images/page_content_tr.png");
}

#page-frame > .frame-corners.bl {
  bottom: 0;
  left: 0;
  background-image: url("../assets/images/page_content_bl.png");
}

#page-frame > .frame-corners.br {
  bottom: 0;
  right: 0;
  background-image: url("../assets/images/page_content_br.png");
}

#page-frame > .header {
  display: block;
  position: absolute;
  z-index: 2;
  top: 0;
  left: var(--video-frame-corner);
  right: var(--video-frame-corner);
  height: var(--video-frame-top);
  pointer-events: none;
  background: url("../assets/images/page_content_header.png") repeat-x 0 50%;
  background-size: auto 100%;
}

#page-frame > .footer {
  display: block;
  position: absolute;
  z-index: 2;
  bottom: 0;
  left: var(--video-frame-corner);
  right: var(--video-frame-corner);
  height: var(--video-frame-bottom);
  pointer-events: none;
  background: url("../assets/images/page_content_footer.png") repeat-x 0 50%;
  background-size: auto 100%;
}

#page-frame > .leftmost-frame {
  display: block;
  position: absolute;
  z-index: 2;
  left: 0;
  top: var(--video-frame-corner);
  bottom: var(--video-frame-corner);
  width: var(--video-frame-side);
  pointer-events: none;
  background: url("../assets/images/page_content-lc.png") repeat-y 0 0;
  background-size: 100% auto;
}

#page-frame > .rightmost-frame {
  display: block;
  position: absolute;
  z-index: 2;
  right: 0;
  top: var(--video-frame-corner);
  bottom: var(--video-frame-corner);
  width: var(--video-frame-side);
  pointer-events: none;
  background: url("../assets/images/page_content-rc.png") repeat-y 100% 0;
  background-size: 100% auto;
}

#wm-theme-navigation {
  display: none;
}

.page-frame-video {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--page-frame-video-object-pos);
  opacity: var(--page-frame-video-opacity);
  pointer-events: none;
}

/* 与 Warmane #page-content-wrapper：宽 1000px；top 含人数条 clearance，使上拉后仍与视频下沿对齐且不盖住人数条 */
#page-content-wrapper {
  position: relative;
  z-index: 2;
  width: 1000px;
  max-width: calc(100% - 24px);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 0;
  top: calc(
    var(--warmane-page-content-pull) - var(--page-online-stats-clearance) - var(--page-qq-row-clearance) -
      var(--page-footer-stack-clearance)
  );
  padding: 0 12px 48px;
}

#page-content-wrapper > .frame-corners,
#page-content-wrapper > .header,
#page-content-wrapper > .footer {
  display: none;
}

#page-content-wrapper > .center {
  position: relative;
}

#page-content {
  min-height: 200px;
}

/* 视频框正下方：极窄一条，与视频无叠层；风格接近弹窗（深色底 + 细边），不占满宽 */
.page-online-stats {
  position: relative;
  z-index: 3;
  max-width: 1008px;
  margin: 10px auto 0;
  padding: 0 12px;
  box-sizing: border-box;
  pointer-events: auto;
}

.page-online-stats__bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0 6px;
  width: fit-content;
  max-width: 100%;
  min-height: 24px;
  margin: 0 auto;
  padding: 3px 10px;
  font-family: var(--font-ui);
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: rgba(10, 11, 13, 0.94);
  border: 1px solid var(--border-dim);
  border-radius: 2px;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.page-online-stats__total-block {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.page-online-stats__total-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
}

.page-online-stats__total-label {
  opacity: 0.9;
}

.page-online-stats__total-num {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.page-online-stats__lights {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.page-online-stats__realm {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* 信号灯：三色 + 错相呼吸（currentColor 用于光晕） */
.page-online-stats__signal {
  display: block;
  width: 9px;
  height: 9px;
  flex-shrink: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.45) 0%, transparent 42%),
    radial-gradient(circle at 50% 50%, currentColor 0%, currentColor 100%);
  box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.55);
  animation: page-online-signal-breath 2.6s ease-in-out infinite;
  will-change: transform, opacity, filter;
}

.page-online-stats__signal--vanilla {
  color: #e8c838;
  animation-delay: 0s;
}

.page-online-stats__signal--tbc {
  color: #3cb878;
  animation-delay: 0.55s;
}

.page-online-stats__signal--wlk {
  color: #4db8e8;
  animation-delay: 1.1s;
}

/* 总人数：红色信号灯，与后三盏错相 */
.page-online-stats__signal--total {
  color: #e04040;
  animation-delay: 1.65s;
}

@keyframes page-online-signal-breath {
  0%,
  100% {
    opacity: 0.55;
    filter: brightness(0.82) saturate(0.9);
    transform: scale(1);
    box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.55), 0 0 2px rgba(0, 0, 0, 0.4);
  }

  50% {
    opacity: 1;
    filter: brightness(1.12) saturate(1.15);
    transform: scale(1.12);
    box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.35), 0 0 10px 3px currentColor;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-online-stats__signal {
    animation: none;
    opacity: 0.95;
    transform: none;
  }
}

.page-online-stats__realm-meta {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
}

.page-online-stats__abbr {
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.page-online-stats__realm-meta strong {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.page-online-stats__sep {
  opacity: 0.35;
  user-select: none;
  padding: 0 1px;
}

/* 人数条与页脚之间的 QQ 加群入口（外观与 .bgm-toggle 一致：36×36 深色方钮 + 内阴影 + 悬停金边） */
.page-qq-row {
  position: relative;
  z-index: 3;
  max-width: 1008px;
  margin: 6px auto 0;
  padding: 0 12px;
  text-align: center;
  box-sizing: border-box;
}

.page-qq-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  line-height: 1;
  vertical-align: middle;
  color: var(--muted);
  background: rgba(10, 11, 13, 0.88);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.35);
  transition: color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
  text-decoration: none;
}

.page-qq-link:hover {
  color: var(--gold);
  border-color: var(--gold-dim);
}

.page-qq-link:focus-visible {
  outline: none;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.35), 0 0 0 2px var(--bg-deep), 0 0 0 4px var(--gold-dim);
}

.page-qq-link__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.page-qq-link__icon svg {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0.92;
}

.page-qq-link:hover .page-qq-link__icon svg {
  opacity: 1;
}

#wm-ui-flash-message:empty {
  display: none;
}

/* Secondary nav: NEWS / STREAM / … + clock */
#page-navigation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px 12px;
  margin-bottom: 0;
}

#page-navigation ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

#page-navigation a {
  display: inline-block;
  padding: 6px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 2px;
}

#page-navigation a:hover {
  color: var(--text);
  border-color: rgba(196, 160, 53, 0.35);
}

#page-navigation a.active {
  color: var(--gold);
  border-color: rgba(196, 160, 53, 0.5);
  background: rgba(196, 160, 53, 0.08);
}

#page-navigation ul:last-child li {
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 0.9rem;
  color: var(--muted);
  padding: 4px 8px;
}

/* Two columns */
.content-wrapper {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 0;
  align-items: stretch;
}

.wm-ui-generic-frame {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.wm-ui-bottom-border {
  border-bottom: 1px solid var(--border);
}

.wm-ui-top-border {
  border-top: 1px solid var(--border);
}

.wm-ui-right-border {
  border-right: 1px solid var(--border);
}

.wm-ui-left-border {
  border-left: 1px solid var(--border);
}

.page-articles-left {
  padding: 16px 20px 24px;
}

.page-articles-right {
  padding: 16px 14px 20px;
}

.wm-ui-article-title p {
  margin: 0;
}

.wm-ui-article-title p:first-child {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.wm-ui-article-title p:last-child {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
  margin-bottom: 10px;
}

.wm-ui-article-content {
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(61, 56, 48, 0.5);
}

.wm-ui-article-content:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
}

.wm-ui-article-content p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Statistics table */
#wm-ui-plugin-statistics {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

#wm-ui-plugin-statistics td {
  padding: 6px 4px;
  vertical-align: middle;
  color: var(--text);
}

#wm-ui-plugin-statistics td img {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

#wm-ui-plugin-statistics .statistics {
  text-align: right;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.82rem;
}

#wm-ui-plugin-statistics .statistics span {
  color: var(--gold);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

#wm-ui-plugin-statistics .spacer {
  height: 6px;
}

#wm-ui-plugin-statistics .seperator {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196, 160, 53, 0.35), transparent);
  margin: 8px 0;
}

#wm-ui-plugin-statistics tr:last-child td {
  text-align: center;
  padding-top: 12px;
  font-size: 0.82rem;
  color: var(--muted);
}

#wm-ui-plugin-statistics tr:last-child span {
  color: var(--gold);
  font-weight: 700;
}

.clear {
  clear: both;
}

/* ---------- 创建账户弹层 ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  /* 外边距略大，弹窗在视口中占比更小、更不抢眼 */
  padding: clamp(20px, 5vmin, 40px);
  box-sizing: border-box;
}

.modal-overlay[hidden] {
  display: none !important;
}

body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(1px);
}

.modal-dialog--create-account {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  max-height: min(82vh, 680px);
  overflow: hidden;
  padding: 0;
  /* 与 body / .page-bg 同源：--bg-deep */
  background: var(--bg-deep);
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.32);
}

.modal-dialog--download {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  max-height: min(82vh, 680px);
  overflow: hidden;
  padding: 0;
  background: var(--bg-deep);
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.32);
}

.modal-dialog--login {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  max-height: min(82vh, 680px);
  overflow: hidden;
  padding: 0;
  background: var(--bg-deep);
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.32);
}

.modal-dialog--bug-report {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  max-height: min(82vh, 680px);
  overflow: hidden;
  padding: 0;
  background: var(--bg-deep);
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.32);
}

.modal-dialog--announce {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 580px;
  max-height: min(82vh, 680px);
  overflow: hidden;
  padding: 0;
  background: var(--bg-deep);
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.32);
}

.modal-announce__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0 2px;
  margin: 0 0 2px;
  border-bottom: 1px solid var(--border-dim);
}

.modal-announce__tab {
  padding: 8px 11px;
  margin: 0 0 -1px;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease;
}

.modal-announce__tab:hover {
  color: var(--text);
}

.modal-announce__tab[aria-selected="true"] {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--gold-dim);
}

.modal-announce__panel {
  padding-top: 8px;
}

.modal-announce__panel[hidden] {
  display: none !important;
}

.modal-announce__tabs + .modal-announce__panel .modal-announce__lead {
  margin-top: 4px;
}

.modal-changelog__feed {
  max-height: min(38vh, 280px);
  overflow-y: auto;
  margin: 0;
  padding: 4px 2px 10px 0;
  border-top: 1px solid var(--border-dim);
  border-bottom: 1px solid var(--border-dim);
}

.modal-changelog__feed:not(.cms-subpage__feed) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.modal-changelog__feed:focus {
  outline: none;
}

.modal-changelog__feed:focus-visible {
  box-shadow: inset 0 0 0 1px rgba(196, 160, 53, 0.2);
}

.modal-changelog__block {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-dim);
}

.modal-changelog__block:last-child {
  border-bottom: none;
}

/* 弹窗更新日志：每版本块固定槽高（归档页除外） */
.modal-changelog__feed:not(.cms-subpage__feed) .modal-changelog__block {
  box-sizing: border-box;
  flex: 0 0 118px;
  height: 118px;
  min-height: 118px;
  max-height: 118px;
  padding: 10px 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.modal-changelog__feed:not(.cms-subpage__feed) .modal-changelog__ver {
  margin: 0 0 4px;
  flex-shrink: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  word-break: break-word;
}

.modal-changelog__feed:not(.cms-subpage__feed) .modal-changelog__feed-preview {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
}

.modal-changelog__feed:not(.cms-subpage__feed) .modal-changelog__arch-hint {
  flex-shrink: 0;
  margin: 4px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-changelog__ver {
  margin: 0 0 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.modal-changelog__list {
  margin: 0;
  padding-left: 1.15em;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.55;
}

.modal-changelog__list li {
  margin-bottom: 4px;
}

.modal-changelog__list li:last-child {
  margin-bottom: 0;
}

.modal-announce__bug-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin: 12px 0 10px;
}

.modal-announce__bug-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  text-decoration: none;
}

.modal-announce__bug-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

.modal-announce__tag--pin {
  color: var(--gold);
  border-color: var(--gold-dim);
}

.modal-announce__lead {
  margin: 0 0 12px;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.55;
}

.modal-announce__lead strong {
  color: var(--text);
  font-weight: 600;
}

.modal-announce__lead--feed-note {
  margin-bottom: 8px;
  font-size: 0.82rem;
}

.modal-announce__feed-preview,
.modal-changelog__feed-preview {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
  white-space: pre-line;
}

.modal-changelog__arch-hint {
  margin: 8px 0 0;
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.45;
}

.modal-announce__arch-link {
  color: var(--gold-dim);
  text-decoration: none;
}

.modal-announce__arch-link:hover {
  color: var(--gold);
  text-decoration: underline;
}

.modal-announce__feed {
  max-height: min(38vh, 300px);
  overflow-y: auto;
  margin: 0;
  padding: 4px 2px 10px 0;
  border-top: 1px solid var(--border-dim);
  border-bottom: 1px solid var(--border-dim);
}

/* 弹窗内：纵向 flex，配合子项 flex-basis 固定每条槽高 */
.modal-announce__feed:not(.cms-subpage__feed) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.modal-announce__feed:focus {
  outline: none;
}

.modal-announce__feed:focus-visible {
  box-shadow: inset 0 0 0 1px rgba(196, 160, 53, 0.25);
}

.modal-announce__item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-dim);
}

.modal-announce__item:last-child {
  border-bottom: none;
}

/* 弹窗公告列表：每条固定槽高，避免正文长短导致框架高低不一（归档页 .cms-subpage__feed 除外） */
.modal-announce__feed:not(.cms-subpage__feed) .modal-announce__item {
  box-sizing: border-box;
  flex: 0 0 142px;
  height: 142px;
  min-height: 142px;
  max-height: 142px;
  padding: 10px 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.modal-announce__feed:not(.cms-subpage__feed) .modal-announce__meta {
  flex-shrink: 0;
  margin-bottom: 4px;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
}

.modal-announce__feed:not(.cms-subpage__feed) .modal-announce__time {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-announce__feed:not(.cms-subpage__feed) .modal-announce__item-title {
  margin: 0 0 4px;
  flex-shrink: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.32;
  word-break: break-word;
}

.modal-announce__feed:not(.cms-subpage__feed) .modal-announce__feed-preview {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
}

.modal-announce__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.modal-announce__tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-dim);
}

.modal-announce__tag--maint {
  color: #b8b0a0;
}

.modal-announce__tag--event {
  color: #8fb878;
}

.modal-announce__tag--rule {
  color: #c49a6c;
}

.modal-announce__tag--tip {
  color: #8a9eb0;
}

.modal-announce__time {
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.modal-announce__item-title {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.modal-announce__excerpt {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.5;
}

/* 公告/日志：后台写入且经服务端 sanitize 的 HTML（含多图） */
.modal-announce__excerpt--html {
  word-break: break-word;
  /* textarea 回车为 \n，默认 HTML 会折叠；pre-line 保留换行 */
  white-space: pre-line;
}

.modal-announce__excerpt--html img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0.65em 0;
  border-radius: var(--radius);
  border: 1px solid var(--border-dim);
}

.modal-announce__excerpt--html a {
  color: var(--gold-dim);
  text-decoration: none;
}

.modal-announce__excerpt--html a:hover {
  color: var(--gold);
  text-decoration: underline;
}

.modal-announce__excerpt--html p {
  margin: 0 0 0.65em;
}

.modal-announce__excerpt--html p:last-child {
  margin-bottom: 0;
}

.modal-changelog__li--html {
  word-break: break-word;
  white-space: pre-line;
}

.modal-changelog__li--html img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0.5em 0;
  border-radius: var(--radius);
  border: 1px solid var(--border-dim);
}

.modal-changelog__li--html a {
  color: var(--gold-dim);
  text-decoration: none;
}

.modal-changelog__li--html a:hover {
  color: var(--gold);
  text-decoration: underline;
}

.modal-announce__more {
  margin: 12px 0 0;
  text-align: center;
  font-size: 0.82rem;
}

.modal-announce__more-link {
  color: var(--muted);
  text-decoration: none;
}

.modal-announce__more-link:hover {
  color: var(--gold);
}

.modal-announce__more-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.88;
}

.modal-bug-form__intro {
  margin: 0 0 14px;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.55;
}

.modal-bug-form__intro strong {
  color: var(--text);
  font-weight: 600;
}

.modal-bug-form__row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

@media (max-width: 560px) {
  .modal-bug-form__row2 {
    grid-template-columns: 1fr;
  }
}

.modal-login-form__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.modal-login-form__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 4px;
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border-dim);
}

.modal-login-form__sep {
  color: var(--border);
  font-size: 0.75rem;
  user-select: none;
}

.modal-login-form__link {
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.modal-login-form__link:hover {
  color: var(--gold);
}

/* 与 #page-frame 同款 assets/images/page_content_*.png 装饰框 */
.modal-dialog__frame {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.modal-dialog__frame .modal-frame-corner {
  display: block;
  position: absolute;
  z-index: 2;
  width: var(--video-frame-corner);
  height: var(--video-frame-corner);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.modal-dialog__frame .modal-frame-corner.tl {
  top: 0;
  left: 0;
  background-image: url("../assets/images/page_content_tl.png");
}

.modal-dialog__frame .modal-frame-corner.tr {
  top: 0;
  right: 0;
  background-image: url("../assets/images/page_content_tr.png");
}

.modal-dialog__frame .modal-frame-corner.bl {
  bottom: 0;
  left: 0;
  background-image: url("../assets/images/page_content_bl.png");
}

.modal-dialog__frame .modal-frame-corner.br {
  bottom: 0;
  right: 0;
  background-image: url("../assets/images/page_content_br.png");
}

.modal-dialog__frame .modal-frame-strip--header {
  display: block;
  position: absolute;
  z-index: 2;
  top: 0;
  left: var(--video-frame-corner);
  right: var(--video-frame-corner);
  height: var(--video-frame-top);
  background: url("../assets/images/page_content_header.png") repeat-x 0 50%;
  background-size: auto 100%;
}

.modal-dialog__frame .modal-frame-strip--footer {
  display: block;
  position: absolute;
  z-index: 2;
  bottom: 0;
  left: var(--video-frame-corner);
  right: var(--video-frame-corner);
  height: var(--video-frame-bottom);
  background: url("../assets/images/page_content_footer.png") repeat-x 0 50%;
  background-size: auto 100%;
}

.modal-dialog__frame .modal-frame-strip--lc {
  display: block;
  position: absolute;
  z-index: 2;
  left: 0;
  top: var(--video-frame-corner);
  bottom: var(--video-frame-corner);
  width: var(--video-frame-side);
  background: url("../assets/images/page_content-lc.png") repeat-y 0 0;
  background-size: 100% auto;
}

.modal-dialog__frame .modal-frame-strip--rc {
  display: block;
  position: absolute;
  z-index: 2;
  right: 0;
  top: var(--video-frame-corner);
  bottom: var(--video-frame-corner);
  width: var(--video-frame-side);
  background: url("../assets/images/page_content-rc.png") repeat-y 100% 0;
  background-size: 100% auto;
}

.modal-dialog__inner {
  position: relative;
  z-index: 3;
  margin: var(--video-frame-top) var(--video-frame-center-inset) var(--video-frame-bottom) var(--video-frame-center-inset);
  padding: 10px 12px 14px;
  max-height: min(calc(82vh - 48px), 620px);
  overflow: auto;
  background: var(--bg-deep);
  /* 与 body 一致：全弹窗内统一 UI 字体 */
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}

.modal-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-dim);
}

.modal-dialog__title {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text);
}

.modal-dialog__head-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.modal-dialog__clock {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.modal-dialog__close {
  margin: 0;
  padding: 0 6px;
  border: none;
  background: transparent;
  font-family: var(--font-ui);
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--radius);
}

.modal-dialog__close:hover {
  color: var(--gold);
  background: rgba(196, 160, 53, 0.08);
}

.modal-account-form__intro {
  margin: 0 0 14px;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.55;
}

.modal-account-form__intro strong {
  color: var(--text);
  font-weight: 600;
}

.modal-account-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}

@media (max-width: 640px) {
  .modal-account-form__grid {
    grid-template-columns: 1fr;
  }
}

.modal-field {
  display: block;
  margin-bottom: 12px;
}

.modal-field__label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.modal-field__input {
  width: 100%;
  padding: 8px 10px;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
}

.modal-field__input:focus {
  outline: none;
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 1px rgba(196, 160, 53, 0.2);
}

select.modal-field__input {
  cursor: pointer;
}

textarea.modal-field__input {
  min-height: 112px;
  resize: vertical;
}

.modal-field--inline {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.modal-field--terms .modal-field--terms__text {
  color: var(--gold);
  cursor: default;
}

.modal-field__check {
  margin-top: 3px;
  flex-shrink: 0;
}

.modal-captcha-placeholder {
  margin-bottom: 12px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px dashed var(--border-dim);
  border-radius: var(--radius);
}

.modal-captcha-placeholder__hint {
  margin: 0 0 8px;
  font-size: 0.75rem;
  color: var(--muted);
}

.modal-account-form__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.modal-btn-submit {
  padding: 8px 20px;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.4;
  color: var(--modal-btn-fg);
  background: var(--modal-btn-bg);
  border: 1px solid var(--modal-btn-edge);
  border-radius: var(--radius);
  cursor: pointer;
}

.modal-btn-submit:hover {
  color: var(--modal-btn-fg-hover);
  background: var(--modal-btn-bg-hover);
  border-color: var(--modal-btn-edge-hover);
}

.modal-btn-submit:focus-visible {
  outline: 2px solid var(--modal-btn-edge-hover);
  outline-offset: 2px;
}

.modal-download__lead {
  margin: 0 0 14px;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.modal-download__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.modal-download__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
}

.modal-download__row:last-child {
  margin-bottom: 0;
}

.modal-download__label {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.4;
}

.modal-download__btn {
  flex-shrink: 0;
  display: inline-block;
  padding: 8px 16px;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.35;
  text-decoration: none;
  text-align: center;
  color: var(--modal-btn-fg);
  background: var(--modal-btn-bg);
  border: 1px solid var(--modal-btn-edge);
  border-radius: var(--radius);
  cursor: pointer;
}

.modal-download__btn:hover {
  color: var(--modal-btn-fg-hover);
  background: var(--modal-btn-bg-hover);
  border-color: var(--modal-btn-edge-hover);
}

.modal-download__btn:focus-visible {
  outline: 2px solid var(--modal-btn-edge-hover);
  outline-offset: 2px;
}

/* Footer（紧挨人数条下方，与主内容区上拉配合） */
#page-footer {
  position: relative;
  z-index: 3;
  max-width: 1008px;
  margin: 6px auto 0;
  padding: 8px 14px 10px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.55;
}

#page-footer a {
  color: var(--muted);
}

#page-footer a:hover {
  color: var(--gold);
}

/* 仅占位展示，不可跳转、无悬停反馈 */
#page-footer .page-footer__text-link {
  color: var(--muted);
  cursor: default;
}

/* Responsive */
@media (max-width: 900px) {
  .content-wrapper {
    grid-template-columns: 1fr;
  }

  .page-articles-right {
    border-left: 1px solid var(--border);
  }

  #page-content-wrapper {
    top: calc(
      -48px - var(--page-online-stats-clearance) - var(--page-qq-row-clearance) -
        var(--page-footer-stack-clearance)
    );
  }
}

/* 大屏更接近 Warmane 主图高度（.center 内约 1600×610） */
@media (min-width: 1610px) {
  #page-frame {
    max-width: 1610px;
    height: 626px;
  }
}

@media (max-width: 1280px) {
  #page-frame {
    height: min(431px, 52vh);
  }
}

@media (max-width: 1090px) {
  #page-frame {
    max-width: 1008px;
    height: min(382px, 48vh);
  }
}

@media (max-width: 720px) {
  .navigation-wrapper:not(.navigation-wrapper--warmane) {
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: inline-block;
  }

  .navigation-wrapper:not(.navigation-wrapper--warmane) .navigation {
    display: none;
    flex: 1 1 100%;
    width: 100%;
    order: 3;
    border-top: 1px solid var(--border-dim);
    margin-top: 4px;
    padding-top: 8px;
  }

  .navigation-wrapper:not(.navigation-wrapper--warmane) .navigation.is-open {
    display: flex;
    justify-content: stretch;
  }

  .navigation-wrapper:not(.navigation-wrapper--warmane) .navigation .navbits {
    flex-direction: column;
    width: 100%;
    justify-content: stretch;
  }

  .navigation-wrapper:not(.navigation-wrapper--warmane) .navigation .navbits a {
    border-bottom: 1px solid rgba(61, 56, 48, 0.5);
    border-left: 3px solid transparent;
  }

  .navigation-wrapper:not(.navigation-wrapper--warmane) .navigation .navbits .navbits__static {
    border-bottom: 1px solid rgba(61, 56, 48, 0.5);
    border-left: 3px solid transparent;
  }

  .navigation-wrapper:not(.navigation-wrapper--warmane) .navigation .navbits a.is-active {
    border-left-color: var(--gold);
  }

  /* 小屏恢复文档流，避免 absolute 顶栏错位 */
  .navigation-wrapper.navigation-wrapper--warmane {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    width: 100%;
    max-width: 100%;
    margin: 8px 0 0;
    padding: 8px 12px 12px;
  }

  .navigation-wrapper--warmane .navigation-logo {
    position: relative;
    left: auto;
    top: auto;
    margin: 0 auto 12px;
    transform: none;
  }

  .navigation-wrapper--warmane .nav-toggle {
    float: none;
    margin: 0 0 8px auto;
    display: block;
  }

  .navigation-wrapper--warmane .navigation {
    display: none;
    float: none;
    top: 0;
    margin-bottom: 8px;
    height: auto;
    min-height: 48px;
    background-size: 100% 100%;
  }

  .navigation-wrapper--warmane .navigation.is-open {
    display: block;
  }

  .navigation-wrapper--warmane .navigation .navbits {
    position: static;
    left: auto;
    right: auto;
    height: auto;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
  }

  .navigation-wrapper--warmane .navigation .navbits li {
    margin: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.35);
  }

  .navigation-wrapper--warmane .navigation .navbits a {
    height: auto;
    line-height: 1.4;
    padding: 10px 12px;
    text-shadow: 1px 1px 0 #000;
  }

  .navigation-wrapper--warmane .navigation .navbits .navbits__static {
    height: auto;
    line-height: 1.4;
    padding: 10px 12px;
    text-shadow: 1px 1px 0 #000;
  }

  #page-frame {
    margin-top: 12px;
    min-height: 200px;
    height: 32vh;
    max-width: 100%;
  }

  #page-frame > .frame-corners,
  #page-frame > .header,
  #page-frame > .footer,
  #page-frame > .leftmost-frame,
  #page-frame > .rightmost-frame {
    display: none !important;
  }

  #page-frame .center {
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    box-shadow: none;
  }

  #page-content-wrapper {
    top: calc(
      -28px - var(--page-online-stats-clearance) - var(--page-qq-row-clearance) -
        var(--page-footer-stack-clearance)
    );
  }

  #page-navigation {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ——— CMS 子页：公告归档 news.html、完整更新日志 changelog.html ——— */
.cms-subpage-body {
  min-height: 100vh;
  margin: 0;
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--bg-deep);
  padding-bottom: 56px;
}

.cms-subpage-body .page-bg {
  background: radial-gradient(ellipse 100% 55% at 50% -12%, rgba(196, 160, 53, 0.08) 0%, transparent 52%),
    var(--bg-deep);
}

.cms-subpage-nav {
  position: relative;
  z-index: 5;
  max-width: 1008px;
  margin: 0 auto;
  padding: 12px 12px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px 20px;
}

/* 子页不用 Warmane 顶栏条，仅保留 Logo；覆盖首页用的 absolute 定位 */
.cms-subpage-nav.navigation-wrapper--warmane {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  width: 100%;
  max-width: 1008px;
  margin: 16px auto 0;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(61, 56, 48, 0.65);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

.cms-subpage-nav.navigation-wrapper--warmane .navigation-logo {
  position: relative;
  left: auto;
  top: auto;
  float: none;
  flex-shrink: 0;
}

.cms-subpage-nav .navigation-logo {
  flex-shrink: 0;
}

.cms-subpage-nav__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  padding-top: 8px;
  font-size: 13px;
}

.cms-subpage-nav__links a {
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.cms-subpage-nav__links a:hover {
  color: var(--gold);
}

.cms-subpage-nav__links a[aria-current="page"] {
  color: var(--gold);
  font-weight: 600;
}

.cms-subpage {
  max-width: min(880px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 16px 48px;
  box-sizing: border-box;
}

.cms-subpage__hero {
  margin: 0 0 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(196, 160, 53, 0.22);
}

.cms-subpage__hero .cms-subpage__title {
  margin: 0 0 12px;
  font-size: clamp(1.35rem, 2.6vw, 1.65rem);
  letter-spacing: 0.05em;
  text-shadow: 0 1px 14px rgba(196, 160, 53, 0.12);
}

.cms-subpage__hero .cms-subpage__lead {
  margin: 0;
  font-size: 0.9rem;
  max-width: 42em;
  line-height: 1.6;
}

.cms-subpage__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gold);
  margin: 0 0 8px;
  letter-spacing: 0.04em;
}

.cms-subpage__lead {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 20px;
  line-height: 1.5;
}

.cms-subpage__lead a {
  color: var(--gold-dim);
}

.cms-subpage__lead a:hover {
  color: var(--gold);
}

.cms-subpage__feed {
  margin-top: 0;
}

/* 归档 / 更新日志全页：解除弹窗 feed 的限高与上下边框，避免窄条滚动 */
.cms-subpage .modal-announce__feed.cms-subpage__feed,
.cms-subpage .modal-changelog__feed.cms-subpage__feed {
  max-height: none;
  overflow: visible;
  margin: 0;
  padding: 0;
  border: none;
  box-shadow: none;
}

.cms-subpage .modal-changelog__feed.cms-subpage__feed {
  padding: 8px 20px 22px;
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.42);
}

.cms-subpage__year-block {
  margin-bottom: 32px;
  padding: 0 20px 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.42);
}

.cms-subpage__year-block:last-child {
  margin-bottom: 0;
}

.cms-subpage__year-title {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.07em;
  margin: 0 -20px 16px;
  padding: 16px 20px 14px;
  border-bottom: 1px solid rgba(196, 160, 53, 0.25);
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(180deg, rgba(196, 160, 53, 0.09) 0%, rgba(0, 0, 0, 0.12) 100%);
}

.cms-subpage .modal-announce__item {
  padding: 16px 12px;
  margin: 0 -8px;
  border-radius: var(--radius);
  border-bottom-color: rgba(42, 38, 32, 0.95);
  transition: background 0.15s ease;
}

.cms-subpage .modal-announce__item:hover {
  background: rgba(196, 160, 53, 0.06);
}

.cms-subpage .modal-announce__item:last-child {
  border-bottom: none;
  padding-bottom: 14px;
}

.cms-subpage .modal-changelog__block {
  padding: 18px 0;
  border-bottom-color: rgba(42, 38, 32, 0.95);
}

.cms-subpage .modal-changelog__block:last-child {
  border-bottom: none;
  padding-bottom: 8px;
}

.cms-subpage .modal-changelog__ver {
  margin-bottom: 10px;
  padding-left: 14px;
  border-left: 3px solid var(--gold-dim);
  font-size: 0.95rem;
  color: var(--text);
}

.cms-subpage .modal-changelog__list {
  padding-left: 1.25em;
}

#newsMount > .cms-subpage__status,
#changelogMount > .cms-subpage__status {
  margin: 0;
  padding: 28px 24px;
  text-align: center;
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.cms-subpage__status {
  font-size: 14px;
  color: var(--muted);
  margin: 16px 0 0;
}

.cms-subpage__status--err {
  color: #c08070;
}

/* 工单查询 tickets.html */
.ticket-lookup-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  margin: 20px 0 8px;
  padding: 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
}

.ticket-lookup-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 200px;
  min-width: 160px;
}

.ticket-lookup-form__label {
  font-size: 12px;
  color: var(--muted);
}

.ticket-lookup-form__input {
  font: inherit;
  font-size: 15px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(8, 9, 11, 0.9);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
}

.ticket-lookup-form__input:focus {
  outline: 2px solid var(--gold-dim);
  outline-offset: 1px;
}

.ticket-lookup-form__submit {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  cursor: pointer;
  color: var(--modal-btn-fg);
  background: var(--modal-btn-bg);
  border: 1px solid var(--modal-btn-edge);
  border-radius: var(--radius);
}

.ticket-lookup-form__submit:hover {
  color: var(--modal-btn-fg-hover);
  background: var(--modal-btn-bg-hover);
  border-color: var(--modal-btn-edge-hover);
}

.ticket-result-mount {
  margin-top: 20px;
}

.ticket-result {
  padding: 18px;
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
}

.ticket-result__id {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--text);
}

.ticket-result__status {
  margin: 0 0 10px;
}

.ticket-result__status-label {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
}

.ticket-result__status-code {
  font-size: 13px;
  color: var(--muted);
}

.ticket-result__hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.ticket-result__sep {
  border: none;
  border-top: 1px solid var(--border-dim);
  margin: 16px 0;
}

.ticket-result__dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 20px;
  font-size: 13px;
}

.ticket-result__dl dt {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}

.ticket-result__dl dd {
  margin: 0;
  color: var(--text);
}

.ticket-result__preview-label {
  margin: 16px 0 8px;
  font-size: 12px;
  color: var(--muted);
}

.ticket-result__preview {
  margin: 0;
  padding: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  background: rgba(8, 9, 11, 0.75);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 220px;
  overflow: auto;
}
