/* =============================================================
   小游戏平台 · 设计系统 + 前台样式
   零外部依赖：无 CDN 字体、无图标库（图标全部内联 SVG）
   支持浅色/深色双主题，断点 1024 / 768 / 480
   ============================================================= */

/* ---------- 设计变量 ---------- */
:root {
  --brand:            #6C5CE7;
  --brand-600:        #5B4BD6;
  --brand-400:        #8B7CF0;
  --accent:           #00D2FF;
  --accent-600:       #00A8CC;
  --success:          #12B886;
  --warning:          #F59F0B;
  --danger:           #F0455A;
  --pink:             #F0508B;

  --bg:               #F6F7FB;
  --bg-elev:          #FFFFFF;
  --bg-sunken:        #EEEFF6;
  --surface:          #FFFFFF;
  --surface-2:        #F9FAFD;
  --text:             #16182E;
  --text-2:           #5A5F7A;
  --text-3:           #949AB2;
  --border:           #E6E8F2;
  --border-2:         #D5D8E8;

  --shadow-xs:        0 1px 2px rgba(22,24,46,.05);
  --shadow-sm:        0 2px 8px rgba(22,24,46,.06);
  --shadow-md:        0 8px 24px rgba(22,24,46,.09);
  --shadow-lg:        0 18px 48px rgba(22,24,46,.14);
  --shadow-brand:     0 8px 24px rgba(108,92,231,.28);

  --r-xs: 6px;  --r-sm: 10px;  --r-md: 14px;  --r-lg: 20px;  --r-xl: 28px;  --r-full: 999px;
  --sp: 8px;

  --header-h: 68px;
  --maxw: 1360px;

  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Source Han Sans SC", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;

  --ease: cubic-bezier(.4, 0, .2, 1);
  --fast: .16s var(--ease);
  --norm: .26s var(--ease);
}

/* 深色主题 */
[data-theme="dark"] {
  --bg:               #0B0C18;
  --bg-elev:          #14162A;
  --bg-sunken:        #0F1120;
  --surface:          #171A2E;
  --surface-2:        #1E2138;
  --text:             #EEF0FA;
  --text-2:           #A5ABCA;
  --text-3:           #6F769B;
  --border:           #262A45;
  --border-2:         #33385A;
  --shadow-xs:        0 1px 2px rgba(0,0,0,.4);
  --shadow-sm:        0 2px 8px rgba(0,0,0,.45);
  --shadow-md:        0 8px 24px rgba(0,0,0,.5);
  --shadow-lg:        0 18px 48px rgba(0,0,0,.6);
  --shadow-brand:     0 8px 28px rgba(108,92,231,.45);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; padding: 0;
  font-family: var(--font);
  font-size: 15px; line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1,h2,h3,h4,h5,h6 { margin: 0; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
h1 { font-size: 30px; } h2 { font-size: 22px; } h3 { font-size: 18px; } h4 { font-size: 16px; }
p { margin: 0 0 12px; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; border-style: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }
table { border-collapse: collapse; width: 100%; }
svg { display: block; }
::selection { background: var(--brand); color: #fff; }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 6px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.row { display: flex; align-items: center; }
.between { display: flex; align-items: center; justify-content: space-between; }
.col { display: flex; flex-direction: column; }
.gap4 { gap: 4px; } .gap8 { gap: 8px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; } .gap24 { gap: 24px; }
.grow { flex: 1; min-width: 0; }
.mt8{margin-top:8px}.mt16{margin-top:16px}.mt24{margin-top:24px}.mt32{margin-top:32px}
.mb8{margin-bottom:8px}.mb16{margin-bottom:16px}.mb24{margin-bottom:24px}
.text-2 { color: var(--text-2); } .text-3 { color: var(--text-3); }
.tc { text-align: center; } .tr { text-align: right; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px;
  border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500; white-space: nowrap;
  border: 1px solid transparent;
  transition: all var(--fast);
  user-select: none;
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: .5; pointer-events: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, #8B5CF6 100%);
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 12px 30px rgba(108,92,231,.4); transform: translateY(-1px); }

.btn-accent { background: linear-gradient(135deg, var(--accent) 0%, #5FD6FF 100%); color: #003344; box-shadow: 0 8px 22px rgba(0,210,255,.3); }
.btn-accent:hover { filter: brightness(1.06); transform: translateY(-1px); }

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

.btn-soft { background: var(--bg-sunken); color: var(--text-2); }
.btn-soft:hover { background: var(--border); color: var(--text); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }

.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; border-radius: var(--r-xs); }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { height: 50px; padding: 0 30px; font-size: 15px; border-radius: var(--r-md); }
.btn-block { width: 100%; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: var(--r-sm); }

/* ---------- 表单 ---------- */
.field { margin-bottom: 18px; }
.label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.label .req { color: var(--danger); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; padding: 0 14px; height: 44px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  font-size: 14px; outline: none;
  transition: border-color var(--fast), box-shadow var(--fast);
}
.textarea { height: auto; min-height: 96px; padding: 12px 14px; line-height: 1.6; resize: vertical; }
.select { appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23949AB2' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(108,92,231,.14);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input-group { position: relative; }
.input-group .input { padding-left: 42px; }
.input-group > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--text-3); pointer-events: none; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track { width: 44px; height: 24px; border-radius: 999px; background: var(--border-2); position: relative; transition: background var(--fast); flex: none; }
.switch .track::after { content:''; position:absolute; top:2px; left:2px; width:20px; height:20px; border-radius:50%; background:#fff; box-shadow: var(--shadow-xs); transition: transform var(--fast); }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(20px); }

/* ---------- 顶部导航 ---------- */
.header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--norm), background var(--norm), box-shadow var(--norm);
}
[data-theme="dark"] .header { background: rgba(11,12,24,.82); }
.header.scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow-xs); }
.header-inner { display: flex; align-items: center; gap: 20px; height: var(--header-h); }

.logo { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; letter-spacing: -.02em; flex: none; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--brand) 0%, #A855F7 50%, var(--accent) 100%);
  display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(108,92,231,.4);
  color: #fff;
}
.logo-mark svg { width: 19px; height: 19px; }
.logo > span:not(.logo-mark) { background: linear-gradient(135deg, var(--brand), var(--accent)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.nav { display: flex; align-items: center; gap: 2px; }
.nav a {
  padding: 8px 14px; border-radius: var(--r-sm); font-size: 14px; font-weight: 500;
  color: var(--text-2); transition: all var(--fast);
}
.nav a:hover { color: var(--brand); background: var(--bg-sunken); }
.nav a.active { color: var(--brand); background: rgba(108,92,231,.1); }

.header-search { position: relative; flex: 1 1 0; min-width: 0; max-width: 340px; }
.header-search .input { height: 40px; border-radius: var(--r-full); padding-left: 40px; background: var(--bg-sunken); border-color: transparent; min-width: 0; width: 100%; }
.header-search .input:focus { background: var(--surface); border-color: var(--brand); }
.header-search > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); }
.search-pop {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  overflow: hidden; display: none; max-height: 380px; overflow-y: auto;
}
.search-pop.show { display: block; }
.search-pop a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; transition: background var(--fast); }
.search-pop a:hover { background: var(--bg-sunken); }
.search-pop img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; background: var(--bg-sunken); }
.search-pop .sp-title { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-pop .sp-meta { font-size: 12px; color: var(--text-3); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 76px 0 92px;
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(108,92,231,.22), transparent 60%),
    radial-gradient(760px 380px at 88% 0%, rgba(0,210,255,.18), transparent 62%),
    linear-gradient(180deg, #FFFDF7 0%, var(--bg) 100%);
}
[data-theme="dark"] .hero {
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(108,92,231,.3), transparent 60%),
    radial-gradient(760px 380px at 88% 0%, rgba(0,210,255,.22), transparent 62%),
    linear-gradient(180deg, #14162A 0%, var(--bg) 100%);
}
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: .35;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 72%);
}
.hero-inner { position: relative; z-index: 1; text-align: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 8px; border-radius: var(--r-full);
  background: var(--bg-elev); border: 1px solid var(--border);
  font-size: 13px; color: var(--text-2); box-shadow: var(--shadow-sm); margin-bottom: 22px;
}
.hero-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(18,184,134,.2); flex: none; }
.hero h1 { font-size: 52px; font-weight: 700; letter-spacing: -.03em; margin-bottom: 18px; }
.hero h1 em {
  font-style: normal;
  background: linear-gradient(120deg, var(--brand) 0%, #A855F7 45%, var(--accent) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub { font-size: 17px; color: var(--text-2); max-width: 620px; margin: 0 auto 32px; }
.hero-search { max-width: 560px; margin: 0 auto 20px; }
.hero-search .input { height: 54px; border-radius: var(--r-full); padding-left: 52px; padding-right: 120px; font-size: 15px; box-shadow: var(--shadow-md); }
.hero-search > svg { left: 20px; width: 20px; height: 20px; }
.hero-search .btn { position: absolute; right: 6px; top: 6px; height: 42px; border-radius: var(--r-full); }
.hero-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.hero-stats { display: flex; justify-content: center; gap: 44px; margin-top: 44px; flex-wrap: wrap; }
.hero-stat .num { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.hero-stat .lbl { font-size: 13px; color: var(--text-3); }

/* ---------- 区块 ---------- */
.section { padding: 52px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; gap: 16px; }
.section-title { display: flex; align-items: center; gap: 12px; font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
.section-title .bar { width: 4px; height: 20px; border-radius: 2px; background: linear-gradient(180deg, var(--brand), var(--accent)); flex: none; }
.section-more { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--text-3); transition: color var(--fast); }
.section-more:hover { color: var(--brand); }
.section-more svg { width: 15px; height: 15px; }

/* ---------- 游戏卡片网格 ---------- */
.grid-games {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(216px, 1fr));
}
.grid-games.compact { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }

.game-card { display: block; }
.game-thumb {
  position: relative; width: 100%; padding-top: 62%;
  border-radius: var(--r-md); overflow: hidden;
  background: var(--bg-sunken);
  box-shadow: var(--shadow-sm);
  transition: transform var(--norm), box-shadow var(--norm);
}
.game-thumb img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform .45s var(--ease);
}
.game-card:hover .game-thumb { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.game-card:hover .game-thumb img { transform: scale(1.07); }
.game-thumb::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 42%, rgba(8,10,24,.72) 100%);
  opacity: 0; transition: opacity var(--norm);
}
.game-card:hover .game-thumb::after { opacity: 1; }
.thumb-play {
  position: absolute; inset: 0; z-index: 2; display: grid; place-items: center;
  opacity: 0; transform: scale(.86); transition: all var(--norm);
}
.game-card:hover .thumb-play { opacity: 1; transform: scale(1); }
.thumb-play span {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,.96); color: var(--brand);
  display: grid; place-items: center; box-shadow: var(--shadow-lg);
}
.thumb-play svg { width: 22px; height: 22px; margin-left: 2px; }
.thumb-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  padding: 4px 9px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 600; color: #fff;
  background: rgba(12,14,30,.66); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  letter-spacing: .02em;
}
.thumb-badge.hot { background: linear-gradient(135deg, #FF6B3D, var(--pink)); }
.thumb-badge.new { background: linear-gradient(135deg, var(--success), #38D9A9); }
.thumb-badge.vip { background: linear-gradient(135deg, #D4AF37, #F7D070); color: #3A2C00; }
.thumb-dual { position: absolute; bottom: 10px; right: 10px; z-index: 2; }
.thumb-dual svg { width: 20px; height: 20px; color: #fff; filter: drop-shadow(0 1px 3px rgba(0,0,0,.5)); }

.game-info { padding: 12px 2px 0; }
.game-title {
  font-size: 14.5px; font-weight: 600; line-height: 1.4; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
  transition: color var(--fast);
}
.game-card:hover .game-title { color: var(--brand); }
.game-meta { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-3); }
.game-meta .rate { color: var(--warning); font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
.game-meta .rate svg { width: 13px; height: 13px; }

/* ---------- 卡片通用 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-xs);
  transition: box-shadow var(--norm), border-color var(--norm), transform var(--norm);
}
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-2); }
.card-pad { padding: 24px; }
.card-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h3 { font-size: 16px; font-weight: 600; }
.card-body { padding: 22px; }

/* ---------- 分类 / 标签 Pill ---------- */
.pills { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.pills::-webkit-scrollbar { display: none; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  padding: 9px 16px; border-radius: var(--r-full);
  background: var(--surface); border: 1px solid var(--border);
  font-size: 13.5px; font-weight: 500; color: var(--text-2);
  transition: all var(--fast); white-space: nowrap;
}
.pill svg { width: 16px; height: 16px; }
.pill:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }
.pill.active {
  background: linear-gradient(135deg, var(--brand), #8B5CF6); border-color: transparent; color: #fff;
  box-shadow: 0 6px 18px rgba(108,92,231,.3);
}
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--r-full);
  font-size: 12px; font-weight: 500;
  background: var(--bg-sunken); color: var(--text-2);
}
.tag.brand { background: rgba(108,92,231,.12); color: var(--brand); }
.tag.success { background: rgba(18,184,134,.12); color: var(--success); }
.tag.warning { background: rgba(245,159,11,.14); color: var(--warning); }
.tag.danger { background: rgba(240,69,90,.12); color: var(--danger); }

/* ---------- 星级 ---------- */
.stars { display: inline-flex; gap: 2px; }
.stars svg { width: 15px; height: 15px; color: var(--border-2); }
.stars svg.on { color: var(--warning); }
.stars.lg svg { width: 22px; height: 22px; }

/* ---------- 页脚 ---------- */
.footer { background: var(--bg-elev); border-top: 1px solid var(--border); padding: 48px 0 28px; margin-top: 40px; }
.footer-cols { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 36px; }
.footer h4 { font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.footer a { display: block; font-size: 13.5px; color: var(--text-2); padding: 5px 0; transition: color var(--fast); }
.footer a:hover { color: var(--brand); }
.footer-bottom {
  margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  font-size: 13px; color: var(--text-3); flex-wrap: wrap;
}

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 34px 0 0; flex-wrap: wrap; }
.pager a, .pager span.pager-num, .pager span.pager-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 12px;
  border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2);
  font-size: 14px; transition: all var(--fast);
}
.pager a:hover { border-color: var(--brand); color: var(--brand); }
.pager .active { background: linear-gradient(135deg, var(--brand), #8B5CF6); color: #fff; border-color: transparent; font-weight: 600; }
.pager .disabled { opacity: .45; cursor: default; }
.pager .pager-gap { padding: 0 4px; color: var(--text-3); }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; top: 84px; left: 50%; transform: translateX(-50%); z-index: 3000; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast {
  padding: 12px 20px; border-radius: var(--r-full);
  background: rgba(22,24,46,.94); color: #fff; font-size: 14px;
  box-shadow: var(--shadow-lg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  animation: toastIn .3s var(--ease); display: flex; align-items: center; gap: 8px;
}
.toast svg { width: 17px; height: 17px; }
.toast.ok svg { color: #38D9A9; } .toast.err svg { color: #FF8787; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(12,14,30,.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.modal-mask.show { display: flex; animation: fadeIn .2s var(--ease); }
.modal {
  background: var(--bg-elev); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 460px; max-height: 88vh; overflow: auto;
  animation: modalIn .26s var(--ease);
}
.modal-lg { max-width: 720px; }
.modal-head { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 17px; font-weight: 600; }
.modal-body { padding: 24px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.modal-close { width: 32px; height: 32px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--text-3); transition: all var(--fast); }
.modal-close:hover { background: var(--bg-sunken); color: var(--text); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }

/* ---------- 提示条 ---------- */
.alert { padding: 14px 18px; border-radius: var(--r-md); margin-bottom: 18px; font-size: 14px; }
.alert.err { background: rgba(240,69,90,.1); color: var(--danger); border: 1px solid rgba(240,69,90,.2); }
.alert.ok { background: rgba(18,184,134,.1); color: var(--success); border: 1px solid rgba(18,184,134,.2); }
.alert.warn { background: rgba(245,159,11,.1); color: var(--warning); border: 1px solid rgba(245,159,11,.22); }
.alert.info { background: rgba(108,92,231,.09); color: var(--brand); border: 1px solid rgba(108,92,231,.2); }
.alert ul { margin: 0; padding-left: 18px; list-style: disc; }

/* ---------- 空状态 / 骨架 ---------- */
.empty { padding: 64px 24px; text-align: center; color: var(--text-3); }
.empty svg { width: 68px; height: 68px; margin: 0 auto 16px; opacity: .35; }
.empty h4 { font-size: 16px; color: var(--text-2); margin-bottom: 6px; }
.empty p { font-size: 14px; margin-bottom: 18px; }

.skel { background: var(--bg-sunken); border-radius: var(--r-sm); position: relative; overflow: hidden; }
.skel::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
  animation: shimmer 1.4s infinite;
}
[data-theme="dark"] .skel::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent); }
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* ---------- 认证页（登录/注册） ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side {
  position: relative; overflow: hidden; padding: 60px 56px; color: #fff;
  background: linear-gradient(150deg, #2D1B69 0%, #5B21B6 40%, #6C5CE7 70%, #00A8CC 100%);
  display: flex; flex-direction: column; justify-content: center;
}
.auth-side::before {
  content:''; position:absolute; inset:0;
  background-image: radial-gradient(circle at 20% 20%, rgba(255,255,255,.14) 0, transparent 42%),
                    radial-gradient(circle at 80% 70%, rgba(0,210,255,.2) 0, transparent 45%);
}
.auth-side > * { position: relative; z-index: 1; }
.auth-side h2 { font-size: 38px; font-weight: 700; letter-spacing: -.03em; margin-bottom: 16px; }
.auth-side p { font-size: 16px; opacity: .85; max-width: 420px; }
.auth-feats { margin-top: 40px; display: flex; flex-direction: column; gap: 16px; }
.auth-feat { display: flex; align-items: center; gap: 12px; font-size: 15px; opacity: .92; }
.auth-feat .ico { width: 38px; height: 38px; border-radius: 11px; background: rgba(255,255,255,.16); display: grid; place-items: center; flex: none; }
.auth-feat svg { width: 19px; height: 19px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; background: var(--bg); }
.auth-box { width: 100%; max-width: 400px; }
.auth-box h1 { font-size: 27px; margin-bottom: 8px; }
.auth-box .sub { color: var(--text-3); font-size: 14.5px; margin-bottom: 30px; }
.auth-alt { text-align: center; margin-top: 22px; font-size: 14px; color: var(--text-2); }
.auth-alt a { color: var(--brand); font-weight: 500; }
.auth-divider { display: flex; align-items: center; gap: 14px; margin: 24px 0; color: var(--text-3); font-size: 12.5px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ---------- 游戏播放页 ---------- */
.player-shell { background: #08091A; min-height: 100vh; display: flex; flex-direction: column; }
.player-top {
  height: 58px; display: flex; align-items: center; gap: 14px; padding: 0 16px;
  background: rgba(255,255,255,.045); border-bottom: 1px solid rgba(255,255,255,.07);
  color: #fff; flex: none;
}
.player-top .back { width: 38px; height: 38px; border-radius: var(--r-sm); display: grid; place-items: center; color: rgba(255,255,255,.72); transition: all var(--fast); }
.player-top .back:hover { background: rgba(255,255,255,.1); color: #fff; }
.player-top .back svg { width: 19px; height: 19px; }
.player-top .title { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-top .acts { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.player-top .acts button {
  height: 36px; padding: 0 12px; border-radius: var(--r-sm); color: rgba(255,255,255,.72);
  font-size: 13px; display: inline-flex; align-items: center; gap: 6px; transition: all var(--fast);
}
.player-top .acts button:hover { background: rgba(255,255,255,.1); color: #fff; }
.player-top .acts button svg { width: 16px; height: 16px; }
.player-top .acts button.on { color: var(--pink); }
.player-stage { flex: 1; position: relative; background: #08091A; display: grid; place-items: center; padding: 12px; }
.player-stage iframe { width: 100%; height: 100%; border: 0; display: block; border-radius: var(--r-sm); background: #000; }
.player-loading { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; gap: 14px; }
.spinner { width: 34px; height: 34px; border: 3px solid rgba(255,255,255,.15); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 排行榜 ---------- */
.rank-list { display: flex; flex-direction: column; }
.rank-item {
  display: flex; align-items: center; gap: 16px; padding: 14px 16px;
  border-radius: var(--r-md); transition: background var(--fast);
}
.rank-item:hover { background: var(--surface-2); }
.rank-no {
  width: 30px; flex: none; text-align: center; font-size: 16px; font-weight: 700;
  font-family: var(--font-mono); color: var(--text-3);
}
.rank-item:nth-child(1) .rank-no { color: #D4AF37; }
.rank-item:nth-child(2) .rank-no { color: #9CA3AF; }
.rank-item:nth-child(3) .rank-no { color: #B45309; }
.rank-thumb { width: 74px; height: 46px; border-radius: var(--r-xs); object-fit: cover; flex: none; background: var(--bg-sunken); }
.rank-score { font-weight: 600; font-family: var(--font-mono); font-size: 14px; }

/* ---------- 评论 ---------- */
.cmt { display: flex; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.cmt:last-child { border-bottom: none; }
.cmt-avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; object-fit: cover; background: var(--bg-sunken); display: grid; place-items: center; color: var(--text-3); font-weight: 600; }
.cmt-body { flex: 1; min-width: 0; }
.cmt-top { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.cmt-name { font-weight: 600; font-size: 14px; }
.cmt-time { font-size: 12.5px; color: var(--text-3); }
.cmt-text { font-size: 14.5px; color: var(--text-2); line-height: 1.7; word-break: break-word; }
.cmt-acts { display: flex; gap: 16px; margin-top: 8px; }
.cmt-acts button { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-3); transition: color var(--fast); }
.cmt-acts button:hover { color: var(--brand); }
.cmt-acts button.on { color: var(--brand); }
.cmt-acts svg { width: 14px; height: 14px; }

/* ---------- 适配 ---------- */
@media (max-width: 1100px) {
  .hero h1 { font-size: 42px; }
  .grid-games { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}
@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .footer-cols { grid-template-columns: 1fr 1fr; gap: 28px; }
}
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .nav { display: none; }
  .header-inner { gap: 12px; }
  .header-search { max-width: none; }
  .logo { font-size: 16px; gap: 8px; }
  .logo-mark { width: 30px; height: 30px; border-radius: 9px; }
  .logo-mark svg { width: 17px; height: 17px; }
  .header-inner .row.gap8 { gap: 6px; flex: none; }
  /* 手机上让筛选条可横向滑动而不撑破版面（桌面保持每行一组） */
  .pills { min-width: 0; flex: 1 1 auto; max-width: 100%; }
  .hero { padding: 52px 0 64px; }
  .hero h1 { font-size: 32px; }
  .hero-sub { font-size: 15px; }
  .hero-stats { gap: 28px; }
  .hero-stat .num { font-size: 22px; }
  .section { padding: 36px 0; }
  .grid-games { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .grid-games.compact { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
  .card-pad { padding: 18px; }
  .footer-cols { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .hero h1 { font-size: 27px; }
  .hero-stat { display: none; }
  .hero-stat:first-child { display: block; }
  .grid-games { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .section-head { flex-direction: column; align-items: flex-start; }
}
/* 小屏（390 及以下）：品牌只留图标，把空间让给搜索与登录按钮，避免右侧被裁 */
@media (max-width: 420px) {
  .header-inner { gap: 10px; }
  .logo > span:not(.logo-mark) { display: none; }
  .header-search .input { padding-left: 34px; font-size: 13.5px; }
  .header-search > svg { left: 11px; width: 15px; height: 15px; }
  .header-inner .btn-sm { padding-left: 10px; padding-right: 10px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
