/* ============================================================
   深靛蓝主题（深靛蓝底 + 通栏分区 + 细线分隔 + 琥珀橙强调）
   页面底是游戏横幅图模糊成的氛围底 + 自上而下加深的深色遮罩；
   宽屏卡片半透明深色带阴影，仍不用 backdrop-filter 毛玻璃；手机端各区块贴边平铺，靠 1px 分隔线划分。
   布局：.hero / .hero__content / main 用 display: contents 拆掉外壳，
   横幅、游戏信息、各分区直接成为 .page-shell 的子项，由 order / grid 排位：
   手机端 横幅 → 居中信息卡 → 截图 → 简介；
   宽屏   左侧吸顶信息栏 + 右侧内容列。HTML 结构和 id 不变。
   说明：JS 会在验证码/画廊/滑块上写内联 left/width/transform，
   这些元素的 position 上下文（relative/absolute）必须保留，不要动。
   ============================================================ */

:root {
  --bg: #18213a;
  --bg-outer: #10152a;
  --surface: #212c4a;
  --surface-2: #2a3759;
  --line: #34426a;
  --line-strong: #47578a;

  --ink: #f2f3f5;
  --text: #c9cdd4;
  --muted: #9aa3b8;

  /* 唯一强调色：琥珀橙；其上的文字用深色 */
  --brand: #ffb020;
  --brand-press: #e89a0c;
  --on-brand: #1a1300;
  --brand-soft: rgba(255, 176, 32, 0.12);

  /* 宽屏半透明卡片（信息栏 / 分区共用） */
  --card-bg: rgba(20, 27, 50, 0.72);
  --card-line: rgba(255, 255, 255, 0.12);
  --card-shadow: 0 20px 44px -24px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.07);

  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --gap: 0px;
  --footer-height: 76px;
  color-scheme: dark;
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  overscroll-behavior: none;
  min-height: 100%;
  background-color: var(--bg-outer);
  background-image: linear-gradient(180deg, #1a2444 0%, #10152a 100%);
  background-attachment: fixed;
}

body {
  margin: 0;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
  min-height: 100vh;
}

/* 氛围底：::before 是横幅图放大模糊的底图层，::after 是自上而下加深的深色遮罩。
   --hero-image 由 app.js 的 renderBaseInfo 设置；没有横幅时退回 html 的纯渐变底 */
body::before {
  content: "";
  position: fixed;
  inset: -90px;
  z-index: -2;
  background: var(--hero-image, none) center / cover no-repeat;
  filter: blur(60px) saturate(1.6);
  transform: translateZ(0);
  pointer-events: none;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(13, 17, 34, 0.28) 0%, rgba(13, 17, 34, 0.6) 45%, rgba(13, 17, 34, 0.9) 100%);
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

.container {
  width: min(100%, 600px);
  margin: 0 auto;
}

.page-shell {
  min-height: 100vh;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 0 calc(var(--footer-height) + 8px);
  background: linear-gradient(180deg, rgba(24, 33, 58, 0.3) 0, rgba(24, 33, 58, 0.78) 460px, var(--bg) 860px);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  opacity: 0;
  transition: opacity 0.18s ease;
}
.page-shell.is-ready { opacity: 1; }

/* 拆壳：让横幅、信息、分区都成为 .page-shell 的直接布局子项 */
.hero,
.hero__content,
.main-content { display: contents; }

.hero__banner-frame { order: 1; }
.game-info { order: 2; }
.panel--gallery { order: 3; }
.server-status-bar { order: 4; }
.panel--intro { order: 5; }
.official_activity { order: 6; }

/* ============================================================
   HERO（通栏横幅 + 游戏信息）
   ============================================================ */
.hero__backdrop { display: none; }

.hero__banner-frame {
  position: relative;
  min-height: 180px;
  overflow: hidden;
  margin: 0;
  border: 0;
  border-radius: 0;
}
.hero__banner-image {
  width: 100%;
  min-height: 180px;
  object-fit: cover;
}
/* 横幅底部压暗（半透明深色，不盖死下方氛围底） */
.hero__banner-frame::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 40px;
  background: linear-gradient(to top, rgba(17, 24, 48, 0.55), transparent);
  pointer-events: none;
}

/* 信息卡：图标、标题、标签全部居中（不压横幅，横幅下沿常有宣传语） */
.game-info {
  position: relative;
  padding: 16px 16px 22px;
  width: 100%;
}

.game-info .game-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  text-align: center;
}
.game-info .app-icon {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  object-fit: cover;
  flex: none;
  border: 1px solid var(--line-strong);
}
.game-info .game-details {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
}
.game-info .game-info__title {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  line-height: 26px;
  word-break: break-word;
}
.game-info .hero__subtitle { display: none; }

.game-info .player-count {
  display: flex;
  align-items: center;
  gap: 4px;
}
.game-info .player-count .icon {
  width: 13px; height: 13px; margin-right: 4px;
  filter: brightness(0) invert(1);
  opacity: 0.55;
}
.game-info .player-count .stat { font-size: 11.5px; color: var(--muted); line-height: 1; }
.game-info .player-count .count {
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

.game-info .game-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  min-height: 16px;
}
.game-info .tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  color: var(--text);
  font-size: 10px;
  font-weight: 500;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

/* 下载按钮：上下叠放、各占整行；第一个可见按钮实心琥珀，其后的可见按钮描边 */
.game-info .download-section {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.game-info .download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 15px;
  border-radius: var(--radius-md);
  min-width: 0;
  border: 1px solid var(--brand);
  text-decoration: none;
  color: var(--on-brand);
  background: var(--brand);
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.game-info .download-btn:not([hidden]) ~ .download-btn {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}
.game-info .download-btn:active { transform: scale(0.98); background: var(--brand-press); }
.game-info .download-btn:not([hidden]) ~ .download-btn:active { background: var(--surface-2); }
.game-info .download-btn .lf-icon {
  width: 18px; height: 18px; margin-right: 7px; flex: none;
  filter: brightness(0);
}
.game-info .download-btn:not([hidden]) ~ .download-btn .lf-icon { filter: brightness(0) invert(1); }
.game-info .download-btn .label {
  color: inherit;
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
  white-space: nowrap;
}

.account-password-entry {
  display: block;
  margin: 6px auto 0;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

/* ── 文字标题通用 ── */
.section-heading h2,
.modal__dialog h3 {
  margin: 0;
  font-weight: 700;
}

/* ============================================================
   通用按钮
   ============================================================ */
.ghost-btn {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 14px;
  transition: background-color 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}
.cta-btn:active { transform: scale(0.98); }
.cta-btn:disabled,
.is-disabled { opacity: 0.45; pointer-events: none; }

.cta-btn--primary {
  background: var(--brand);
  color: var(--on-brand);
}
.cta-btn--primary:active { background: var(--brand-press); }
.cta-btn--secondary {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--line-strong);
}
.cta-btn--dark {
  background: #000;
  color: var(--ink);
  border-color: var(--line-strong);
}
.cta-btn--ghost-light {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

/* ============================================================
   主内容 —— 通栏分区，上边一条细线
   ============================================================ */
.panel,
.official_activity {
  padding: 20px 16px 22px;
  background: var(--bg);
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 0;
}
.section-heading h2 {
  position: relative;
  padding-bottom: 8px;
  font-size: 16px;
  color: var(--ink);
  line-height: 22px;
}
/* 标题下方的琥珀短横线 */
.section-heading h2::before {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 22px;
  height: 3px;
  background: var(--brand);
}
.section-heading p { display: none; }

.game_jianjie .section-heading p,
.official_activity .section-heading p,
.banner .section-heading p { display: none; }

/* ── 简介 ── */
.intro-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 0;
}
.intro-copy { position: relative; display: grid; gap: 4px; }
.intro-copy__body {
  max-height: none;
  overflow: visible;
  transition: max-height 0.3s ease;
}
.intro-copy__body.is-collapsed {
  max-height: 130px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 58%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 58%, transparent 100%);
}
.intro-copy__body.is-expanded { max-height: none; }
.intro-expand-btn {
  display: inline-flex;
  align-self: flex-end;
  align-items: center;
  gap: 2px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 0 0;
  cursor: pointer;
}
#introText {
  margin: 0;
  line-height: 23px;
  font-size: 13px;
  color: var(--text);
  white-space: pre-line;
}
.intro-art img {
  width: 100%;
  border-radius: var(--radius-md);
  min-height: 220px;
  object-fit: cover;
  display: none;
}

/* ============================================================
   截图画廊
   ============================================================ */
.gallery-shell {
  display: block;
  padding: 0;
  position: relative;
}
/* 截图条向右出血到屏幕边，露出下一张的一截 */
.gallery-track-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 0;
  margin-right: -16px;
  padding: 0 16px 0 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: transparent;
}
.gallery-track-wrap::-webkit-scrollbar { display: none; }
.gallery-track { display: flex; gap: 10px; transition: none; }
.gallery-slide {
  width: 62%;
  min-width: 62%;
  flex: 0 0 62%;
  box-sizing: border-box;
}
.gallery-slide img {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}

.gallery-preview {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
}
.gallery-preview img {
  max-width: 92%;
  max-height: 88vh;
  border-radius: var(--radius-sm);
  object-fit: contain;
}
.gallery-preview__bar { display: none; }
.gallery-preview__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 31;
  transition: background 0.15s;
}
.gallery-preview__nav:hover { background: var(--surface-2); }
.gallery-preview__prev { left: 10px; }
.gallery-preview__next { right: 10px; }

.gallery-nav {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  font-size: 20px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.gallery-dots { display: none; justify-content: flex-start; margin-top: 12px; gap: 6px; }
.gallery-dots--inline { display: flex; }
.gallery-dots button {
  width: 14px;
  height: 3px;
  border-radius: 0;
  padding: 0;
  border: none;
  background: var(--line-strong);
  transition: width 0.2s ease, background-color 0.2s ease;
}
.gallery-dots button.is-active {
  width: 26px;
  background: var(--brand);
}

.gallery-thumbs {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.gallery-thumb {
  padding: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 2px solid transparent;
  opacity: 0.55;
  overflow: hidden;
}
.gallery-thumb.is-active { border-color: var(--brand); opacity: 1; }
.gallery-thumb img {
  width: 100%;
  aspect-ratio: 10 / 17;
  object-fit: cover;
}

/* ============================================================
   下载卡 / 主下载按钮
   ============================================================ */
.download-grid {
  display: flex;
  gap: 10px;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.download-grid::-webkit-scrollbar { display: none; }
.download-grid-wrap { padding: 0; }
.download-row-label { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.download-actions-bar { display: none; }

.download-main-btn {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 16px 16px 16px 58px;
  border-radius: var(--radius-md);
  min-height: 76px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.download-main-btn::before {
  content: attr(data-icon);
  position: absolute;
  left: 16px;
  top: 16px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 18px;
  color: var(--on-brand);
  background: var(--brand);
}
.download-main-btn strong { font-size: 16px; color: var(--ink); }
.download-main-btn span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.download-main-btn.is-primary {
  background: var(--brand);
  border-color: var(--brand);
}
.download-main-btn.is-primary strong,
.download-main-btn.is-primary span { color: var(--on-brand); }
.download-main-btn.is-primary::before { background: rgba(0, 0, 0, 0.18); color: var(--on-brand); }

.download-card {
  min-width: 142px;
  border-radius: var(--radius-md);
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.download-card::after { display: none; }
.download-card strong { color: var(--ink); font-size: 12px; display: block; margin-bottom: 6px; }
.download-card p { color: var(--muted); font-size: 11px; margin: 0 0 10px; line-height: 1.6; }
.download-card .cta-btn {
  min-height: 32px;
  padding: 2px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
}
.cta-btn--h5-chip { background: var(--surface-2); color: var(--ink); border-color: var(--line-strong); }
.cta-btn--download-chip { background: var(--brand); color: var(--on-brand); }

.download-note {
  margin: 0;
  padding: 6px 0 0;
  background: transparent;
  color: var(--muted);
  border: 0;
  font-size: 11px;
}

/* ── 通知 / 官方活动 ── */
.notice-list { display: grid; gap: 8px; }
.text-link-btn {
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: 13px;
  line-height: 22px;
  padding: 0;
}
.notice-item { padding: 10px 0; border: 0; background: transparent; }
.official_activity .section-heading { padding: 0; margin-bottom: 14px; }
.notice-list--activities { padding: 0; gap: 0; }
.notice-item--official {
  display: block;
  padding: 14px 0;
  background: transparent;
  border-top: 1px solid var(--line);
}
.notice-item--official:first-child { border-top: 0; padding-top: 0; }
.notice-item--official::before { display: none; }
.notice-item--official strong { position: relative; padding-left: 14px; margin-bottom: 7px; }
.notice-item--official strong::before {
  content: "";
  position: absolute;
  left: 0; top: 6px;
  width: 6px; height: 6px;
  background: var(--brand);
}
.notice-item strong { color: var(--ink); font-size: 13px; line-height: 18px; display: block; margin-bottom: 6px; }
.notice-item p { color: var(--muted); font-size: 12px; line-height: 18px; margin: 0; }

/* ── 引导卡 ── */
.guide-notice-box {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px;
  margin-bottom: 10px;
  border-radius: var(--radius-md);
  background: var(--brand-soft);
  border: 1px solid rgba(255, 176, 32, 0.28);
}
.guide-notice-box__icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: var(--brand);
}
.guide-notice-box__icon img { width: 22px; height: 22px; filter: brightness(0); }
.guide-notice-box strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 20px;
  color: var(--brand);
}
.guide-notice-box p { margin: 0; color: var(--text); line-height: 16px; font-size: 12px; }

.guide-grid { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 0; }
.guide-card {
  display: grid;
  grid-template-columns: 166px 1fr;
  gap: 10px;
  padding: 0;
  background: transparent;
  border: 0;
}
.guide-card:nth-child(even) { grid-template-columns: 1fr 166px; }
.guide-card:nth-child(even) img { order: 2; }
.guide-card:nth-child(even) .guide-card__body { order: 1; }
.guide-card img {
  width: 156px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}
.guide-card h3 { color: var(--ink); font-size: 15px; line-height: 20px; margin: 0 0 4px; }
.guide-card p { color: var(--muted); font-size: 13px; line-height: 17px; margin: 0; }

/* ============================================================
   底部固定栏（贴底通栏）
   ============================================================ */
.sticky-footer,
.footer_fix {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 600px);
  min-height: 64px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  z-index: 12;
}
.sticky-footer__meta {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: center;
  min-width: 0;
  flex: 1;
}
.game_name { min-width: 0; }
.sticky-footer__actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.sticky-footer__actions .cta-btn {
  min-height: auto;
  height: 44px;
  min-width: 110px;
  padding: 0 28px;
  border-radius: var(--radius-md);
  background: var(--brand);
  color: var(--on-brand);
  font-size: 16px;
  font-weight: 700;
  border: 0;
  white-space: nowrap;
}
.sticky-footer__actions .cta-btn:active { background: var(--brand-press); }
.sticky-footer__actions #footerIosButton { display: none; }
.sticky-footer__icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line-strong);
}
.sticky-footer__title {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 700;
  line-height: 18px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sticky-footer__desc {
  margin: 0;
  line-height: 15px;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ============================================================
   弹窗
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.72);
  padding: 16px;
}
.modal__dialog {
  position: relative;
  width: min(100%, 520px);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line-strong);
}
.register-view,
.login-view,
.cf-gate-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cf-gate-view { width: min(100%, 420px); align-items: center; text-align: center; }
.cf-gate__body { min-height: 76px; display: flex; justify-content: center; align-items: center; }
.modal__close {
  position: absolute;
  right: 14px; top: 14px;
  width: 30px; height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}
.modal__close:hover { background: var(--surface-2); color: var(--ink); }

.register-success-view {
  width: min(100%, 440px);
  padding: 28px 20px 20px;
  text-align: center;
}
.register-success-view__close {
  top: 10px;
  right: 10px;
  font-size: 24px;
}
.register-success-view__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: var(--radius-md);
  background: var(--brand);
  color: var(--on-brand);
}
.register-success-view__icon svg { width: 28px; height: 28px; }
.register-success-view h3 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  line-height: 28px;
}
.register-success-view__hint {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}
.register-success-view__credentials {
  display: grid;
  gap: 12px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg);
  text-align: left;
}
.register-success-view__row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}
.register-success-view__row strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 14px;
  font-family: Consolas, "SF Mono", Menlo, monospace;
}
.register-success-view__confirm {
  width: 100%;
  min-height: 44px;
  margin-top: 16px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--brand);
  color: var(--on-brand);
  font-size: 15px;
  font-weight: 700;
}
.register-success-view__confirm:hover { background: var(--brand-press); }
.register-success-view__confirm:active { transform: scale(0.99); }

.game-header { padding: 1px; }
.game-title {
  padding: 2px 34px 0 0;
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 28px;
  text-align: left;
  color: var(--ink);
}
.cf-gate-view .game-title { padding: 2px 0 0; text-align: center; }

.step-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.step-tag {
  border: 1px solid var(--brand);
  color: var(--brand);
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
}
.step-title { color: var(--ink); font-size: 16px; font-weight: 700; line-height: 24px; margin: 0; }

.card {
  padding: 0;
  border: 0;
  background: transparent;
}
.form-grid { display: grid; gap: 14px; margin-top: 0; }
.account-password-hint { margin: 0; color: var(--muted); font-size: 13px; }
.login-view .cta-btn:disabled { opacity: 0.6; cursor: wait; }
.form-grid label { display: grid; gap: 6px; font-size: 12px; color: var(--text); }
.form-grid input {
  min-height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-strong);
  background: var(--bg);
  padding: 8px 14px;
  color: var(--ink);
  font-size: 14px;
  line-height: 20px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-grid input:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-soft);
}

/* ── auth 引导 ── */
.auth-download-panel,
.auth-guide-panel { padding: 0; border: 0; background: transparent; }
.auth-mini-downloads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.mini-download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  min-height: 42px;
  border-radius: var(--radius-md);
  border: 0;
  background: var(--brand);
  color: var(--on-brand);
}
.mini-download-btn__icon { width: 15px; height: 15px; flex: none; filter: brightness(0); }
.mini-download-btn strong { font-size: 12px; line-height: 20px; }
.mini-download-btn span { display: none; }

.mini-guide-list { display: grid; gap: 16px; }
.mini-guide-item {
  display: grid;
  grid-template-columns: 166px 1fr;
  gap: 12px;
  align-items: center;
  padding: 0;
  background: transparent;
  border: 0;
}
.mini-guide-item img { width: 166px; height: auto; object-fit: cover; border-radius: var(--radius-md); border: 1px solid var(--line); }
.mini-guide-item strong { display: block; margin-bottom: 8px; font-size: 16px; color: var(--ink); }
.mini-guide-item p { margin: 0; color: var(--muted); line-height: 17px; font-size: 14px; }

.mini-guide-notice {
  background: var(--brand-soft);
  border: 1px solid rgba(255, 176, 32, 0.28);
  border-radius: var(--radius-md);
  padding: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.mini-guide-notice__icon {
  background: var(--brand);
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}
.mini-guide-notice__icon img { width: 20px; height: 20px; filter: brightness(0); }
.mini-guide-notice__title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
  color: var(--brand);
}
.mini-guide-notice__desc { margin: 0; font-size: 12px; line-height: 16px; color: var(--text); }

.register-download-card,
.register-guide-showcase,
.register-guide-steps-card {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--bg);
}
.register-guide-showcase {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 12px;
  align-items: center;
  min-height: 330px;
}
.register-guide-showcase__copy { align-self: center; padding-left: 14px; }
.register-guide-showcase__copy h5 { margin: 0 0 10px; color: var(--ink); font-size: 15px; line-height: 20px; font-weight: 700; }
.register-guide-showcase__copy p { margin: 0; color: var(--muted); font-size: 12px; line-height: 18px; }
.register-guide-showcase__visual { display: flex; justify-content: center; align-items: center; }
.register-guide-showcase__visual img { width: 160px; max-width: 100%; height: auto; object-fit: contain; }
.register-guide-steps-card { margin-top: 12px; }
.mini-guide-list--register { gap: 22px; }
.mini-guide-list--register .mini-guide-item {
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 18px;
  align-items: center;
  min-height: 220px;
}
.mini-guide-list--register .mini-guide-item:nth-child(even) { grid-template-columns: 180px minmax(0, 1fr); }
.mini-guide-list--register .mini-guide-item:nth-child(even) img { order: 1; }
.mini-guide-list--register .mini-guide-item:nth-child(even) div { order: 2; }
.mini-guide-list--register .mini-guide-item img { width: 180px; margin: 0 auto; }
.mini-guide-list--register .mini-guide-item strong { margin-bottom: 10px; font-size: 15px; line-height: 22px; color: var(--ink); }
.mini-guide-list--register .mini-guide-item p { color: var(--muted); font-size: 11px; line-height: 18px; }
.register-guide-footer-note { margin: 18px 0 0; text-align: center; color: var(--muted); font-size: 12px; line-height: 18px; }

/* ============================================================
   toast / 提示遮罩
   ============================================================ */
.toast {
  position: fixed;
  left: 50%; top: 18px;
  transform: translateX(-50%);
  z-index: 25;
  min-width: 220px;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--ink);
  color: var(--bg);
  text-align: center;
  font-size: 13px;
  font-weight: 600;
}

.browser-tip {
  position: fixed;
  inset: 0;
  z-index: 15;
  background: rgba(0, 0, 0, 0.78);
  display: grid;
  place-items: start center;
  padding: 32px 16px;
}
.browser-tip__card {
  width: min(100%, 420px);
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink);
}
.browser-tip__card p { margin: 0 0 14px; line-height: 1.8; }

.share-overlay {
  position: fixed;
  inset: 0;
  z-index: 16;
  background: rgba(0, 0, 0, 0.84);
  display: grid;
  place-items: start end;
  padding: 18px;
}
.share-overlay__content { max-width: 320px; color: var(--ink); text-align: right; }
.share-overlay__arrow { font-size: 56px; line-height: 1; margin-bottom: 8px; color: var(--brand); }
.share-overlay__text strong { display: block; font-size: 22px; margin-bottom: 8px; }
.share-overlay__text p { margin: 0 0 14px; color: var(--text); line-height: 1.7; }

/* ============================================================
   语言切换
   ============================================================ */
.lang-switch { position: fixed; top: 12px; right: 12px; z-index: 200; }
.lang-switch__btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: rgba(24, 33, 58, 0.82);
  color: var(--ink);
  font-size: 12px;
  border: 1px solid var(--line-strong);
  cursor: pointer;
  line-height: 1;
}
.lang-switch__icon { width: 14px; height: 14px; flex-shrink: 0; }
.lang-switch__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  list-style: none;
  margin: 0;
  padding: 4px;
  background: var(--surface);
  border-radius: var(--radius-md);
  min-width: 100%;
  border: 1px solid var(--line-strong);
}
.lang-switch__menu li { padding: 8px 12px; border-radius: 4px; color: var(--text); font-size: 12px; cursor: pointer; white-space: nowrap; }
.lang-switch__menu li:hover { background: var(--surface-2); }
.lang-switch__menu li.is-active { color: var(--brand); font-weight: 700; }

.server-status-bar {
  width: 100%;
  height: 2px;
  background: var(--brand);
  margin-top: 8px;
}

/* ============================================================
   验证码（功能尺寸保留，仅换色）
   ============================================================ */
.slider-captcha { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 4px 0; user-select: none; }
.slider-captcha__image {
  position: relative;
  width: 280px;
  height: 155px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line);
}
.slider-captcha__bg { width: 100%; height: 100%; display: block; pointer-events: none; }
.slider-captcha__piece { position: absolute; left: -9px; top: 0; pointer-events: none; opacity: 0; transition: opacity 0.15s ease; }
.slider-captcha__refresh {
  position: absolute;
  top: 6px; right: 6px;
  width: 26px; height: 26px;
  border-radius: var(--radius-sm);
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 14px;
  line-height: 26px;
  text-align: center;
  cursor: pointer;
  padding: 0;
}
.slider-captcha__refresh:hover { background: rgba(0, 0, 0, 0.85); }
.slider-captcha__loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 12px;
  background: rgba(0, 0, 0, 0.55);
}
.slider-captcha__track {
  position: relative;
  width: 280px;
  height: 40px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.slider-captcha__fill { position: absolute; left: 0; top: 0; height: 100%; width: 0; background: var(--brand-soft); pointer-events: none; }
.slider-captcha__tip {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
}
.slider-captcha__tip.is-success { color: #4ade80; }
.slider-captcha__tip.is-error { color: #f87171; }
.slider-captcha__handle {
  position: absolute;
  left: 0; top: 0;
  width: 44px; height: 40px;
  background: var(--brand);
  border: 0;
  border-radius: var(--radius-md);
  text-align: center;
  line-height: 40px;
  color: var(--on-brand);
  font-weight: 700;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.slider-captcha__handle:active { cursor: grabbing; background: var(--brand-press); }

.captcha-block { margin-top: 8px; }

.cf-turnstile { min-height: 65px; display: flex; justify-content: center; align-items: center; }
.cf-turnstile[hidden] { display: none; }

.rotate-captcha__image { position: relative; display: inline-block; margin-bottom: 8px; }
.rotate-captcha__image img { display: block; transition: transform 0.05s linear; }

.text-click-captcha__prompt { font-size: 14px; margin-bottom: 6px; color: var(--ink); }
.text-click-captcha__image {
  position: relative;
  display: inline-block;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
}
.text-click-captcha__image img { display: block; pointer-events: none; }
.text-click-captcha__marks { position: absolute; inset: 0; pointer-events: none; }
.text-click-captcha__dot {
  position: absolute;
  width: 22px; height: 22px;
  margin-left: -11px; margin-top: -11px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-brand);
  font-size: 12px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}
.text-click-captcha__reset {
  margin-top: 6px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.image-code-captcha__image {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
}
.image-code-captcha__image img { display: block; max-width: 100%; height: auto; }
.image-code-captcha__input {
  margin-top: 10px;
  width: 100%;
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 0 14px;
  font-size: 16px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--bg);
  box-sizing: border-box;
}
.image-code-captcha__input:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.form-grid .image-code-captcha { margin-top: 4px; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 860px) {
  .section-heading { display: flex; }
  .sticky-footer__meta { grid-template-columns: 40px 1fr; gap: 8px; }
  .sticky-footer__icon { width: 40px; height: 40px; }
  .sticky-footer__title { font-size: 13px; }
  .sticky-footer__desc { font-size: 10px; }
  .sticky-footer__actions .cta-btn { height: 40px; min-width: 90px; padding: 0 18px; font-size: 14px; }
  .gallery-nav { display: none; }
  .auth-mini-downloads,
  .guide-notice-box { grid-template-columns: 1fr; }
}

/* 601–959px：仍是单列，内容列两侧加细线，和外层更深的底色分开 */
@media (min-width: 601px) and (max-width: 959px) {
  .page-shell { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}

/* ≥960px：两栏。左侧信息栏吸顶，右侧依次是横幅、截图、简介 */
@media (min-width: 960px) {
  :root { --footer-height: 72px; }
  .page-shell {
    background: transparent;
    max-width: 1200px;
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    grid-auto-rows: min-content;
    align-content: start;
    align-items: start;
    gap: 20px 28px;
    padding: 28px 28px calc(var(--footer-height) + 28px);
  }
  .game-info {
    grid-column: 1;
    grid-row: 1 / span 8;
    position: sticky;
    top: 28px;
    padding: 28px 22px 22px;
    background: var(--card-bg);
    border: 1px solid var(--card-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
  }
  .hero__banner-frame,
  .panel,
  .official_activity,
  .server-status-bar { grid-column: 2; }
  .hero__banner-frame {
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 30px 70px -28px rgba(0, 0, 0, 0.85);
  }
  .hero__banner-frame::after { display: none; }
  .panel,
  .official_activity {
    padding: 22px 24px 24px;
    background: var(--card-bg);
    border: 1px solid var(--card-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
  }
  .server-status-bar { margin-top: 0; }
  .gallery-track-wrap { margin-right: -24px; padding-right: 24px; }
  .gallery-slide { width: 31%; min-width: 31%; flex: 0 0 31%; }
  .sticky-footer,
  .footer_fix {
    width: 100%;
    padding-left: max(28px, calc((100% - 1200px) / 2 + 28px));
    padding-right: max(28px, calc((100% - 1200px) / 2 + 28px));
  }
}

/* ============================================================
   阿拉伯语 RTL 镜像（html[dir="rtl"] 时生效）
   交互组件（验证码 / 滑块 / 画廊）强制保持 LTR：
   JS 会在这些元素上写内联 left/width/transform 坐标，
   一旦翻转方向坐标会错乱，故只镜像文字与静态布局。
   ============================================================ */
[dir="rtl"] body { text-align: right; }

/* 语言切换器移到左上角 */
[dir="rtl"] .lang-switch { right: auto; left: 12px; }
[dir="rtl"] .lang-switch__menu { right: auto; left: 0; }

/* 图标与文字间距镜像 */
[dir="rtl"] .game-info .player-count .icon { margin-right: 0; margin-left: 4px; }
[dir="rtl"] .game-info .download-btn .lf-icon { margin-right: 0; margin-left: 7px; }

/* 标题下方短横线移到右侧 */
[dir="rtl"] .section-heading h2::before { left: auto; right: 0; }

/* 官方活动条目项目符号镜像 */
[dir="rtl"] .notice-item--official strong { padding-left: 0; padding-right: 14px; }
[dir="rtl"] .notice-item--official strong::before { left: auto; right: 0; }

/* 弹窗关闭按钮移到左上，标题避让方向随之镜像 */
[dir="rtl"] .modal__close { right: auto; left: 14px; }
[dir="rtl"] .game-title { padding: 2px 0 0 34px; text-align: right; }
[dir="rtl"] .cf-gate-view .game-title { padding: 2px 0 0; text-align: center; }

/* 注册引导文案内边距镜像 */
[dir="rtl"] .register-guide-showcase__copy { padding-left: 0; padding-right: 14px; }

/* 交互组件强制 LTR，保护 JS 内联坐标（验证码 / 滑块 / 画廊） */
[dir="rtl"] .gallery-track-wrap,
[dir="rtl"] .gallery-track,
[dir="rtl"] .gallery-preview,
[dir="rtl"] .slider-captcha,
[dir="rtl"] .rotate-captcha,
[dir="rtl"] .text-click-captcha,
[dir="rtl"] .image-code-captcha { direction: ltr; }

@media (max-width: 640px) {
  :root { --footer-height: 84px; }
  .hero__banner-frame,
  .hero__banner-image { min-height: 180px; }
  /* 弹窗在手机上从底部升起，占满宽度 */
  .modal { place-items: end center; padding: 0; }
  .modal__dialog {
    width: 100%;
    max-height: 92vh;
    padding: 22px 18px calc(18px + env(safe-area-inset-bottom, 0px));
    border-radius: 18px 18px 0 0;
    border-width: 1px 0 0;
  }
  .sticky-footer__actions { width: auto; }
  .sticky-footer__actions .cta-btn { min-width: 120px; height: 44px; font-size: 15px; }
  .mini-guide-item,
  .guide-card,
  .guide-card:nth-child(even) { grid-template-columns: 1fr; }
  .mini-guide-item img,
  .guide-card img { width: 100%; max-width: 166px; }
  .register-download-card,
  .register-guide-showcase,
  .register-guide-steps-card { padding: 16px; }
  .register-guide-showcase { grid-template-columns: 1fr; min-height: 0; }
  .register-guide-showcase__copy { padding-left: 0; }
  .register-guide-showcase__visual img { width: 156px; }
  .mini-guide-list--register .mini-guide-item,
  .mini-guide-list--register .mini-guide-item:nth-child(even) { grid-template-columns: 1fr; min-height: 0; }
  .mini-guide-list--register .mini-guide-item img,
  .mini-guide-list--register .mini-guide-item:nth-child(even) img { order: 0; width: 156px; }
  .mini-guide-list--register .mini-guide-item div,
  .mini-guide-list--register .mini-guide-item:nth-child(even) div { order: 0; }
}
