/* ==========================================================================
   游戏首抽号合集 + 独立选号分页 — 移动优先响应式样式
   设计原则：简洁、耐看、护眼、真实角色立绘比例贴合、手机端零排版错乱
   ========================================================================== */

:root {
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-subtle: #f8faf8;
  --border: #e4e8e3;
  --border-strong: #cfd6ce;

  --primary: #1f6b4e;
  --primary-hover: #18573f;
  --primary-soft: #eaf4ef;
  --primary-ring: rgba(31, 107, 78, 0.14);

  --accent: #b57b28;
  --accent-soft: #fdf5e7;
  --danger: #c6473a;

  --text-main: #18201c;
  --text-secondary: #56635c;
  --text-muted: #86928b;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-xs: 0 1px 2px rgba(16, 28, 22, 0.04);
  --shadow-sm: 0 2px 8px rgba(16, 28, 22, 0.05);
  --shadow-bar: 0 -4px 18px rgba(16, 28, 22, 0.07);

  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body.game-body {
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}

body.home-body {
  padding-bottom: 24px;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

img {
  display: block;
  max-width: 100%;
}

.hidden {
  display: none !important;
}

.container {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 14px;
}

/* ---------- 顶部栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand,
.topbar-nav-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-link {
  text-decoration: none;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.back-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 9px 5px 6px;
  border-radius: 8px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.14s ease;
}

.back-home-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.topbar-sep {
  width: 1px;
  height: 15px;
  background: var(--border-strong);
  flex-shrink: 0;
}

.topbar-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.stock-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #27a26f;
  flex-shrink: 0;
}

/* ---------- 闲鱼官方店铺防走丢横条（首页与每个游戏分页顶部） ---------- */
.shop-contact-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, #fff9ec 0%, #fffdf7 100%);
  border: 1px solid #f2d59c;
  box-shadow: var(--shadow-xs);
}

.shop-contact-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  min-width: 0;
}

.shop-contact-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ffda44;
  color: #2b2100;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}

.shop-contact-text {
  font-size: 14px;
  color: #3d2c08;
  font-weight: 600;
  white-space: nowrap;
}

.shop-contact-text strong {
  color: #18201c;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.shop-contact-sub {
  font-size: 12px;
  color: #8c6a24;
}

.shop-copy-btn {
  padding: 5px 12px;
  border-radius: 999px;
  background: #1f6b4e;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.14s ease, transform 0.12s ease;
}

.shop-copy-btn:hover {
  background: #18573f;
}

.shop-copy-btn.copied {
  background: #27a26f;
}

.footer-shop-line {
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--text-main);
  font-weight: 600;
}

.footer-shop-line strong {
  color: var(--primary);
  font-weight: 800;
}

@media (max-width: 520px) {
  .shop-contact-bar {
    padding: 9px 12px;
    gap: 8px;
  }
  .shop-contact-sub {
    display: none;
  }
}

/* ==========================================================================
   一、合集首页样式（index.html）
   ========================================================================== */
.home-main {
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hub-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hub-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.hub-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.hub-search-wrap {
  position: relative;
  width: 100%;
}

.hub-search-input {
  height: 38px !important;
  background: var(--surface-subtle) !important;
}

.hub-search-input:focus {
  background: #ffffff !important;
}

.hub-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 0 2px;
}

.game-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.hub-game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.hub-game-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 6px 20px rgba(16, 28, 22, 0.08);
}

.hub-game-cover {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 21 / 10;
  overflow: hidden;
  background: #dfe4de;
}

.hub-game-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.hub-game-card:hover .hub-game-cover img {
  transform: scale(1.02);
}

.cover-stock-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(20, 28, 24, 0.74);
  backdrop-filter: blur(6px);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 600;
}

.hub-game-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.hub-game-title-link {
  text-decoration: none;
}

.hub-game-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
}

.hub-game-title-link:hover .hub-game-title {
  color: var(--primary);
}

.hub-game-en {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.hub-game-summary {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.hub-server-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hub-server-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.hub-server-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.server-pill-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 9px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-strong);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
  transition: all 0.14s ease;
}

.server-pill-link:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.server-pill-count {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--primary);
}

.hub-card-foot {
  padding-top: 10px;
  margin-top: auto;
  border-top: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hub-char-count {
  font-size: 12px;
  color: var(--text-muted);
}

.hub-enter-btn {
  text-decoration: none;
}

/* 3 步说明卡 */
.guide-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 14px;
}

.guide-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 9px;
}

.guide-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.guide-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ==========================================================================
   二、单款游戏独立选号页样式（game.html）
   ========================================================================== */
.main-content {
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 游戏头卡 + 服务器切换下拉框 */
.game-header-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 13px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.game-header-top {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.game-id-bar {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.game-thumb {
  width: 72px;
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
  background: #dfe4de;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.game-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-heading {
  min-width: 0;
  flex: 1;
}

.game-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.game-main-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

.server-active-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
}

.game-sub-en {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 服务器下拉框组件 */
.server-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.server-picker-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.server-select {
  flex: 1;
  min-width: 0;
  height: 36px;
  line-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1.5px solid var(--primary);
  background-color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  outline: none;
  cursor: pointer;
}

@media (max-width: 420px) {
  .game-body .topbar-sep,
  .game-body #topbarGameName {
    display: none;
  }

  .server-select {
    font-size: 12.5px;
    padding: 0 8px;
  }
}

.server-select:focus {
  box-shadow: 0 0 0 3px var(--primary-ring);
}

/* 精简公告行 */
.game-notice-strip {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding-top: 9px;
  border-top: 1px dashed var(--border);
}

.notice-mini-icon {
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.notice-text {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ---------- 公告下方：如何登录图文教程 ---------- */
.login-guide-wrap {
  margin-top: 2px;
  border-radius: 10px;
  border: 1px solid #d5e6dc;
  background: #f5faf7;
  overflow: hidden;
}

.login-guide-toggle {
  width: 100%;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  transition: background-color 0.14s ease;
}

.login-guide-toggle:hover {
  background: #ebf5ef;
}

.login-guide-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.guide-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--primary);
  color: #ffffff;
  white-space: nowrap;
  flex-shrink: 0;
}

.guide-toggle-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guide-toggle-action {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.login-guide-body {
  padding: 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px dashed #d5e6dc;
  background: #ffffff;
}

.guide-format-box {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--accent-soft);
  border: 1px solid rgba(181, 123, 40, 0.28);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.guide-format-code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: #9b5c14;
  background: rgba(255, 255, 255, 0.85);
  padding: 5px 9px;
  border-radius: 6px;
  border: 1px solid rgba(181, 123, 40, 0.22);
  word-break: break-all;
}

.guide-format-tips {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.guide-steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.guide-step-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-subtle);
  display: flex;
  flex-direction: column;
}

.guide-step-caption {
  flex: 1;
  padding: 8px 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.45;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}

.guide-step-img-btn {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  cursor: zoom-in;
  background: #141a17;
}

.guide-step-img-btn img {
  width: 100%;
  height: auto;
  display: block;
}

.guide-zoom-hint {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(20, 28, 24, 0.72);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
}

/* 全屏大图弹窗 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(14, 20, 17, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.lightbox-close {
  position: fixed;
  top: 14px;
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 24px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.lightbox-content {
  max-width: min(960px, 96vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 82vh;
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

.lightbox-caption {
  margin: 0;
  color: #eef3f0;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

/* ---------- 选号主面板 ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 13px;
  box-shadow: var(--shadow-sm);
}

.quick-filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.filter-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.pill-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pill-btn {
  min-height: 30px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  transition: all 0.15s ease;
}

.pill-btn:active {
  transform: scale(0.96);
}

.pill-btn.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.roster-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 11px;
  flex-wrap: wrap;
}

.panel-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main);
}

.panel-hint {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* 角色立绘网格：移动端 3 列展示清晰真实人脸，桌面端 5 列与 129x92 原图几乎 1:1 锐利匹配 */
.character-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.char-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px 5px 7px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  border: 1.5px solid var(--border);
  user-select: none;
  -webkit-user-select: none;
  transition: border-color 0.15s ease, background-color 0.15s ease,
    box-shadow 0.15s ease, transform 0.1s ease;
  min-width: 0;
}

.char-card:hover {
  border-color: var(--border-strong);
  background: #ffffff;
}

.char-card:active {
  transform: scale(0.97);
}

.char-card.selected {
  background: var(--primary-soft);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-ring);
}

/* 贴合真实角色立绘 129x92 (约 7:5) 比例，完整显示面部不裁切 */
.char-avatar-box {
  position: relative;
  width: 100%;
  aspect-ratio: 129 / 92;
  border-radius: 8px;
  overflow: hidden;
  background: #252b27;
  margin-bottom: 5px;
}

.char-avatar-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.char-name {
  width: 100%;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.char-sub {
  width: 100%;
  text-align: center;
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.char-card.selected .char-name {
  color: var(--primary);
}

/* 数量角标（右上角） */
.char-count-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  min-width: 22px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

/* 减 1 按钮（左上角） */
.char-dec-btn {
  position: absolute;
  top: 3px;
  left: 3px;
  z-index: 3;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(24, 32, 28, 0.18);
  color: var(--text-main);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.24);
  transition: background-color 0.12s ease, transform 0.1s ease;
}

.char-dec-btn:hover {
  background: #ffffff;
  color: var(--danger);
  border-color: rgba(198, 71, 58, 0.4);
}

.char-dec-btn:active {
  transform: scale(0.9);
}

/* 已选组合展示条 */
.selected-bar {
  margin-top: 12px;
  padding: 10px 11px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.selected-bar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}

.selected-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.text-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 2px 4px;
}

.text-btn:hover {
  color: var(--danger);
}

.selected-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px 4px 10px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(31, 107, 78, 0.28);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
}

.chip-remove {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 按钮通用样式 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(31, 107, 78, 0.24);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-ghost {
  background: #ffffff;
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}

.btn-ghost:hover {
  background: var(--surface-subtle);
  color: var(--text-main);
}

.btn-sm {
  min-height: 34px;
  padding: 0 14px;
  font-size: 12.5px;
}

.desktop-actions {
  display: none;
}

/* ---------- 查询结果区 ---------- */
.results-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-margin-top: 64px;
}

.results-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 2px 0;
}

.results-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.results-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.count-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 2px 8px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.results-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.code-search-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.code-search-input {
  width: 100%;
  height: 34px;
  padding: 0 10px 0 30px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease;
}

.code-search-input:focus {
  border-color: var(--primary);
}

.sort-select {
  height: 34px;
  line-height: 32px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background-color: var(--surface);
  font-size: 12.5px;
  color: var(--text-secondary);
  outline: none;
  flex-shrink: 0;
  cursor: pointer;
}

.sort-select:focus {
  border-color: var(--primary);
}

/* 账号结果卡片列表 */
.account-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.account-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 13px;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.account-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.account-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px dashed var(--border);
}

.account-id-block {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.account-code-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.account-code {
  font-family: var(--font-mono);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.02em;
  word-break: break-all;
}

.stock-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.stock-pill.stock-ok {
  background: var(--primary-soft);
  color: var(--primary);
}

.stock-pill.stock-low {
  background: var(--accent-soft);
  color: var(--accent);
}

.stock-pill.stock-out {
  background: #edf0ee;
  color: var(--text-muted);
}

.price-inquire {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

.account-card-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.price-tag {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
  color: #c24b2c;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.price-tag .price-yen {
  font-size: 12px;
  font-weight: 700;
  margin-right: 1px;
}

.account-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.meta-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  white-space: nowrap;
}

.meta-tag.ssr-tag {
  background: var(--accent-soft);
  border-color: rgba(181, 123, 40, 0.25);
  color: var(--accent);
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  background: var(--primary-soft);
  border: 1px solid rgba(31, 107, 78, 0.22);
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.copy-btn:hover,
.copy-btn.copied {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.copy-btn:active {
  transform: scale(0.96);
}

/* 账号内角色真实头像条（同样按 129:92 比例展示） */
.account-chars {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-char {
  width: 66px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 9px;
  border: 1px solid transparent;
}

.mini-char.matched {
  background: var(--primary-soft);
  border-color: rgba(31, 107, 78, 0.35);
}

.mini-avatar-wrap {
  position: relative;
  width: 58px;
  height: 42px;
  border-radius: 7px;
  overflow: hidden;
  background: #252b27;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.mini-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.mini-qty {
  position: absolute;
  right: 2px;
  bottom: 2px;
  padding: 0 4px;
  height: 15px;
  border-radius: 4px;
  background: rgba(24, 32, 28, 0.86);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 15px;
  font-variant-numeric: tabular-nums;
}

.mini-name {
  width: 100%;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-char.matched .mini-name {
  color: var(--primary);
}

/* 空状态 */
.empty-state {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.empty-icon {
  color: var(--text-muted);
  margin-bottom: 2px;
}

.empty-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
}

.empty-desc {
  margin: 0 0 6px;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* 分页器 */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 0 4px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.14s ease;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.page-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.page-indicator {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0 8px;
  font-variant-numeric: tabular-nums;
}

/* 页脚 */
.site-footer {
  margin-top: 24px;
  padding: 16px 0 12px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.site-footer p {
  margin: 0;
}

/* ---------- 移动端吸底操作栏 ---------- */
.mobile-sticky-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  box-shadow: var(--shadow-bar);
}

.mobile-bar-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.mobile-bar-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-bar-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.mobile-bar-count strong {
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.mobile-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-mobile {
  min-height: 38px;
  padding: 0 16px;
  font-size: 13.5px;
}

/* ---------- 轻提示 Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(78px + env(safe-area-inset-bottom));
  transform: translate(-50%, 16px);
  z-index: 60;
  width: max-content;
  max-width: calc(100vw - 28px);
  padding: 10px 18px;
  border-radius: 10px;
  background: rgba(24, 32, 28, 0.92);
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.home-body .toast {
  bottom: 28px;
}

/* ==========================================================================
   三、资源号 / 白号直购区样式（index.html & game.html）
   ========================================================================== */
.hub-section-head-between {
  justify-content: space-between;
  flex-wrap: wrap;
}

.hub-section-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-cat-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.cat-pill-btn {
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  transition: all 0.14s ease;
}

.cat-pill-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.cat-pill-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.product-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.product-card.is-restocking {
  border-style: dashed;
}

.product-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.product-card-id {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.product-cat-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  white-space: nowrap;
}

.product-code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  word-break: break-all;
}

.product-card-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.product-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
}

.product-subtitle {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.product-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.product-tag {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--accent-soft);
  border: 1px solid rgba(181, 123, 40, 0.24);
  color: #946017;
  white-space: nowrap;
}

.product-card-foot {
  padding-top: 10px;
  margin-top: auto;
  border-top: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.product-price-wrap {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.product-empty-inline {
  grid-column: 1 / -1;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 22px 14px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* 单款游戏页内的资源号快捷卡 */
.game-products-panel {
  background: var(--surface);
  border: 1px solid #d5e6dc;
  border-radius: var(--radius-lg);
  padding: 12px 13px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.game-products-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.game-products-badge {
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--primary);
  color: #ffffff;
}

.game-products-hint {
  font-size: 12px;
  color: var(--text-secondary);
}

.game-product-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.game-product-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.game-product-item.is-restocking {
  border-style: dashed;
}

.game-product-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.game-product-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.game-product-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.game-product-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.game-product-right {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

/* ==========================================================================
   平板与桌面端响应式增强（>= 640px / >= 768px）
   ========================================================================== */

@media (min-width: 640px) {
  .container {
    padding: 0 20px;
  }

  .home-main {
    padding-top: 22px;
    gap: 18px;
  }

  .hub-hero {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 20px 22px;
  }

  .hub-search-wrap {
    width: 240px;
    flex-shrink: 0;
  }

  .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-grid.single-product {
    grid-template-columns: 1fr;
  }

  .game-products-panel {
    padding: 13px 16px;
  }

  .game-product-item {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
  }

  .game-product-right {
    padding-top: 0;
    border-top: none;
    flex-shrink: 0;
    justify-content: flex-end;
  }

  /* 只有 1 款游戏时在桌面端做成横版大卡片，视觉更饱满 */
  .game-grid.single-game {
    grid-template-columns: 1fr;
  }

  .game-grid.single-game .hub-game-card {
    flex-direction: row;
  }

  .game-grid.single-game .hub-game-cover {
    width: 44%;
    aspect-ratio: auto;
    min-height: 215px;
    flex-shrink: 0;
  }

  .game-grid.single-game .hub-game-body {
    padding: 18px 20px;
  }

  .guide-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .guide-steps-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .main-content {
    padding-top: 16px;
    gap: 14px;
  }

  .game-header-card {
    padding: 15px 18px;
  }

  .game-header-top {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }

  .game-thumb {
    width: 86px;
    height: 48px;
  }

  .server-picker {
    flex-shrink: 0;
    padding: 6px 10px;
  }

  .server-select {
    flex: none;
    min-width: 170px;
  }

  .panel {
    padding: 16px 18px;
  }

  .quick-filters {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .character-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
  }

  .char-card {
    padding: 7px 7px 8px;
  }

  .char-name {
    font-size: 13.5px;
  }

  .char-sub {
    font-size: 11px;
  }

  .results-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .code-search-wrap {
    width: 170px;
    flex: none;
  }

  .mini-char {
    width: 72px;
  }

  .mini-avatar-wrap {
    width: 64px;
    height: 46px;
  }
}

@media (min-width: 768px) {
  body.game-body {
    padding-bottom: 32px;
  }

  .mobile-sticky-bar {
    display: none;
  }

  .desktop-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding-top: 13px;
    border-top: 1px solid var(--border);
  }

  .match-summary {
    font-size: 13.5px;
    color: var(--text-secondary);
  }

  .match-summary strong {
    color: var(--primary);
    font-size: 16px;
    font-variant-numeric: tabular-nums;
  }

  .action-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .account-card {
    padding: 14px 18px;
  }

  .toast {
    bottom: 28px;
  }
}
