:root {
    --brand: #ff5a1f;
    --brand-2: #ff8a00;
    --ink: #1f2330;
    --muted: #7a8194;
    --line: #eceef3;
    --bg: #f4f5f9;
    --panel: #fff;
    --dark: #141826;
    --radius: 12px;
    --shadow: 0 4px 18px rgba(20, 24, 38, .06);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0; background: var(--bg); color: var(--ink);
    font: 14px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; }
p { margin: 0; }
.wrap { width: min(1200px, 100% - 32px); margin: 0 auto; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.center { text-align: center; }
.right { text-align: right; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 18px; border-radius: 999px; border: 1px solid transparent;
    font: inherit; font-weight: 600; cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 4px 12px rgba(255, 90, 31, .3); }
.btn-primary:hover { color: #fff; filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost { background: #fff; border-color: #dfe2ea; color: var(--ink); }
.btn-ghost:hover { border-color: var(--brand); }
.btn-glass { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.4); color: #fff; backdrop-filter: blur(4px); }
.btn-glass:hover { background: rgba(255,255,255,.28); color: #fff; }
.btn-sm { padding: 4px 14px; font-size: 13px; }
.btn-lg { padding: 11px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; color: #aab0c0; cursor: pointer; font: inherit; }
.link-btn:hover { color: #fff; }

/* ---------- 顶栏 ---------- */
.topbar { background: var(--dark); color: #fff; position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 10px rgba(0,0,0,.2); }
.topbar-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { display: flex; align-items: baseline; gap: 8px; font-size: 22px; font-weight: 800; letter-spacing: 1px; }
.logo:hover { color: #fff; }
.logo-mark { font-size: 24px; }
.logo small { font-size: 10px; color: var(--brand-2); letter-spacing: 2px; font-weight: 600; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 8px 14px; border-radius: 8px; color: #c9cede; font-size: 15px; white-space: nowrap; }
.nav a:hover, .nav a.active { color: #fff; background: rgba(255,255,255,.08); }
.nav a.active { box-shadow: inset 0 -3px 0 var(--brand); }
.search { margin-left: auto; display: flex; background: rgba(255,255,255,.1); border-radius: 999px; overflow: hidden; }
.search input { background: none; border: 0; color: #fff; padding: 8px 14px; width: 200px; font: inherit; outline: none; }
.search input::placeholder { color: #8d93a6; }
.search button { background: none; border: 0; padding: 0 14px; cursor: pointer; }
.userbar { display: flex; align-items: center; gap: 10px; }
.userbar form { margin: 0; }
.uname { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
    width: 32px; height: 32px; border-radius: 50%; flex: none;
    display: grid; place-items: center; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, var(--brand), #c026d3);
}
.avatar-lg { width: 48px; height: 48px; font-size: 20px; }
.avatar-xl { width: 76px; height: 76px; font-size: 32px; }

.toast {
    position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 60;
    background: var(--dark); color: #fff; padding: 10px 22px; border-radius: 999px;
    box-shadow: 0 8px 30px rgba(0,0,0,.25); animation: toast 4s forwards;
}
@keyframes toast { 0%{opacity:0;transform:translate(-50%,-10px)} 8%,85%{opacity:1;transform:translate(-50%,0)} 100%{opacity:0;visibility:hidden} }

/* ---------- 通用面板 ---------- */
.panel { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-head h2 { font-size: 18px; display: flex; align-items: center; gap: 10px; }
.bar { width: 4px; height: 18px; border-radius: 2px; background: linear-gradient(var(--brand), var(--brand-2)); }
.more { color: var(--muted); font-size: 13px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
.page-head { padding: 28px 0 18px; }
.page-head h1 { font-size: 26px; margin-bottom: 4px; }
.empty-state, .empty { text-align: center; padding: 30px; color: var(--muted); }
.empty { padding: 12px 0; }

/* ---------- 封面 ---------- */
.cover {
    position: relative; overflow: hidden; border-radius: 10px; color: #fff;
    background: radial-gradient(circle at 80% 15%, rgba(255,255,255,.35), transparent 40%), linear-gradient(135deg, var(--c1), var(--c2));
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.cover::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, rgba(255,255,255,.04) 0 10px, transparent 10px 20px); }
.cover-icon { font-size: 54px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.3)); z-index: 1; }
.cover-title { font-weight: 800; font-size: 18px; letter-spacing: 2px; text-shadow: 0 2px 6px rgba(0,0,0,.35); z-index: 1; }
.cover-md { aspect-ratio: 16/10; }
.cover-sq { aspect-ratio: 1; }
.cover-sq .cover-title { font-size: 14px; }
.cover-lg { width: 220px; aspect-ratio: 1; border-radius: 20px; box-shadow: 0 10px 40px rgba(0,0,0,.3); flex: none; }
.cover-lg .cover-icon { font-size: 96px; }
.cover-sm { width: 56px; height: 56px; flex: none; border-radius: 12px; }
.cover-sm .cover-icon { font-size: 28px; }
.cover-xs { width: 28px; height: 28px; flex: none; border-radius: 7px; display: inline-flex; }
.cover-xs .cover-icon { font-size: 15px; }
.cover-sm .badge, .cover-xs .badge { display: none; }
.badge { position: absolute; top: 8px; left: 8px; z-index: 2; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 6px; }
.badge-hot { background: #ff3b30; }
.badge-new { background: #00b96b; }

/* ---------- 游戏卡片 ---------- */
.game-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; position: relative; transition: .2s; }
.game-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(20,24,38,.12); }
.game-card .cover { border-radius: 0; }
.game-card-body { padding: 12px 14px 14px; }
.game-card-body h3 { font-size: 16px; }
.game-card-play { position: absolute; right: 12px; bottom: 16px; }
.mini-tile { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; display: flex; flex-direction: column; gap: 6px; transition: .2s; }
.mini-tile:hover { transform: translateY(-4px); }
.mini-tile small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12px; line-height: 1.5; }

/* ---------- 首屏 ---------- */
.hero { display: grid; grid-template-columns: 1fr 300px; gap: 18px; margin-top: 20px; }
.carousel { position: relative; height: 380px; border-radius: var(--radius); overflow: hidden; background: var(--dark); box-shadow: var(--shadow); }
.slide {
    position: absolute; inset: 0; opacity: 0; transition: opacity .6s; pointer-events: none;
    background: radial-gradient(circle at 75% 40%, rgba(255,255,255,.25), transparent 45%), linear-gradient(120deg, var(--c1), var(--c2));
    display: flex; align-items: center; padding: 0 56px; color: #fff;
}
.slide.is-active { opacity: 1; pointer-events: auto; }
.slide-art { position: absolute; right: 6%; top: 50%; transform: translateY(-55%); font-size: 210px; filter: drop-shadow(0 20px 30px rgba(0,0,0,.35)); animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-62%) rotate(-4deg); } }
.slide-text { position: relative; max-width: 55%; }
.slide h2 { font-size: 46px; font-weight: 900; letter-spacing: 4px; margin: 12px 0 8px; text-shadow: 0 4px 16px rgba(0,0,0,.3); }
.slide p { font-size: 17px; opacity: .92; }
.slide-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.slide-actions form { margin: 0; }
.slide-server { margin-top: 16px; font-size: 13px !important; opacity: .8; }
.pill { display: inline-block; background: rgba(0,0,0,.25); padding: 3px 12px; border-radius: 999px; font-size: 12px; }
.carousel-dots { position: absolute; left: 0; right: 0; bottom: 0; display: flex; background: rgba(0,0,0,.35); backdrop-filter: blur(6px); }
.carousel-dots button { flex: 1; background: none; border: 0; color: #cfd3df; padding: 11px 0; cursor: pointer; font: inherit; border-top: 3px solid transparent; }
.carousel-dots button.is-active { color: #fff; border-top-color: var(--brand); background: rgba(255,255,255,.08); }

.side-panel { display: flex; flex-direction: column; gap: 12px; }
.side-heading { font-size: 17px; text-align: center; }
.side-title { font-size: 14px; color: var(--muted); font-weight: 500; }
.welcome { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.recent-item { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; }
.recent-item:hover { background: var(--bg); }
.recent-item > span:nth-child(2) { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.recent-item .cover-sm { width: 44px; height: 44px; }
.recent-item .cover-sm .cover-icon { font-size: 22px; }
.recent-item .go { color: var(--brand); font-size: 13px; }
.quick-links { margin-top: auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; border-top: 1px solid var(--line); padding-top: 12px; }
.quick-links a { display: flex; flex-direction: column; align-items: center; font-size: 22px; padding: 4px; border-radius: 8px; }
.quick-links a:hover { background: var(--bg); }
.quick-links span { font-size: 12px; color: var(--muted); }

/* ---------- 表单 ---------- */
.form { display: flex; flex-direction: column; gap: 12px; margin: 18px 0; }
.form.compact { margin: 0; gap: 10px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; }
.form input[type=email], .form input[type=password], .form input[type=text] {
    padding: 10px 14px; border: 1px solid #dfe2ea; border-radius: 10px; font: inherit; outline: none; transition: .15s; background: #fafbfd;
}
.form input:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(255,90,31,.12); }
.form .checkbox { flex-direction: row; align-items: center; font-weight: 400; }
.error { color: #e5484d; font-size: 13px; margin-top: -6px; }
.auth-wrap { min-height: calc(100vh - 260px); display: grid; place-items: center; padding: 40px 16px;
    background: radial-gradient(circle at 20% 20%, rgba(255,90,31,.12), transparent 40%), radial-gradient(circle at 80% 70%, rgba(147,51,234,.1), transparent 40%); }
.auth-card { width: min(420px, 100%); padding: 34px; }
.auth-card h1 { font-size: 24px; margin-bottom: 4px; }
.auth-card a { color: var(--brand); }

/* ---------- 列表 / 表格 ---------- */
.three-col { display: grid; grid-template-columns: 1.15fr 1fr .8fr; gap: 18px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.table td { padding: 8px 4px; border-bottom: 1px dashed var(--line); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table-lg td { padding: 12px 8px; }
.table-lg th { padding: 8px; }
.game-inline { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 6px; font-weight: 600; }
.tag-new { background: #e6f9f0; color: #00a35c; }
.tag-hot { background: #fff0eb; color: var(--brand); }
.tag-smooth { background: #eef4ff; color: #3b6fe0; }
.tag-soon { background: #f2f3f7; color: var(--muted); }
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.news-list li:last-child { border-bottom: 0; }
.news-list a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-list time { font-size: 12px; flex: none; }
.cat { flex: none; font-size: 12px; padding: 0 6px; border-radius: 4px; background: #eef4ff; color: #3b6fe0; margin-right: 6px; }
.cat-公告 { background: #fff0eb; color: var(--brand); }
.cat-活动 { background: #fdf0ff; color: #b026c9; }
.cat-攻略 { background: #e6f9f0; color: #00a35c; }
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.rank-list li.me { background: #fff6f1; border-radius: 8px; padding-left: 6px; }
.rank-list a, .rank-list li > span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: #eef0f5; color: var(--muted); flex: none; }
.rank-1 { background: #ff4d4f; color: #fff; }
.rank-2 { background: #ff7a45; color: #fff; }
.rank-3 { background: #ffa940; color: #fff; }
.hotness { color: var(--brand); font-weight: 600; font-size: 13px; }

.feature-row { display: flex; align-items: center; gap: 16px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.feature-row > div { flex: 1; }
.feature-row .score { font-size: 28px; font-weight: 800; color: var(--brand); }
.feature-row .score small { font-size: 12px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.tags span { font-size: 12px; background: var(--bg); padding: 1px 8px; border-radius: 6px; color: var(--muted); }
.tags.light span { background: rgba(255,255,255,.18); color: #fff; }

/* ---------- 筛选 ---------- */
.filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.filter-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.filter-label { color: var(--muted); width: 44px; }
.chip { padding: 3px 14px; border-radius: 999px; background: var(--bg); font-size: 13px; }
.chip.is-active { background: var(--brand); color: #fff; }
.pager { margin-top: 24px; }
.pagination { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.page { padding: 6px 12px; border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.page.current { background: var(--brand); color: #fff; }
.page.disabled { opacity: .5; }

/* ---------- 游戏详情 ---------- */
.game-banner { color: #fff; padding: 40px 0; background: radial-gradient(circle at 85% 30%, rgba(255,255,255,.2), transparent 40%), linear-gradient(120deg, var(--c1), var(--c2)); }
.game-banner-inner { display: flex; gap: 36px; align-items: center; }
.game-meta h1 { font-size: 40px; font-weight: 900; letter-spacing: 3px; }
.tagline { font-size: 17px; opacity: .9; margin: 6px 0 12px; }
.crumbs { font-size: 13px; opacity: .8; margin-bottom: 8px; }
.crumbs a:hover { color: #fff; text-decoration: underline; }
.crumbs.dark a:hover { color: var(--brand); }
.stats { display: flex; gap: 32px; margin-top: 18px; }
.stats div { display: flex; flex-direction: column; }
.stats strong { font-size: 24px; }
.stats small { font-size: 12px; opacity: .8; }
.stats.dark small { color: var(--muted); }
.two-col { display: grid; grid-template-columns: 1fr 320px; gap: 20px; margin-top: 24px; align-items: start; }
.main-col, .side-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.prose { font-size: 15px; line-height: 1.9; color: #3a4052; }
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.server { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; transition: .15s; }
a.server:hover { border-color: var(--brand); background: #fff8f4; }
.server em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--muted); }
.server .dot { width: 8px; height: 8px; border-radius: 50%; background: #3b6fe0; flex: none; }
.server-new .dot { background: #00b96b; } .server-new em { color: #00a35c; }
.server-hot .dot { background: #ff3b30; } .server-hot em { color: #ff3b30; }
.server-soon { opacity: .6; cursor: not-allowed; }
.server-soon .dot { background: #bbb; }
.last-server { margin-bottom: 12px; padding: 8px 12px; background: #fff8f4; border-radius: 8px; }
.last-server a { color: var(--brand); font-weight: 600; }

/* ---------- 游戏中 ---------- */
.play-wrap { padding-top: 16px; }
.play-bar { display: flex; align-items: center; gap: 14px; background: #fff; padding: 10px 16px; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; flex-wrap: wrap; }
.play-bar .spacer { flex: 1; }
.play-bar .back { color: var(--muted); }
.play-layout { display: grid; grid-template-columns: 1fr; gap: 18px; }
.play-layout.with-side { grid-template-columns: 1fr 300px; }
.play-layout aside { display: flex; flex-direction: column; gap: 18px; }
.stage { background: #0b0d14; border-radius: var(--radius); overflow: hidden; height: min(78vh, 720px); box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.stage iframe { width: 100%; height: 100%; border: 0; display: block; }
.stage:fullscreen { height: 100vh; border-radius: 0; }
.stage:-webkit-full-screen { width: 100%; height: 100%; border-radius: 0; }
/* 不支持原生全屏（iPhone Safari）：游戏铺满页面 */
.stage-exit { display: none; }
body.pseudo-fullscreen { overflow: hidden; }
html body.pseudo-fullscreen .stage[data-stage] { position: fixed; inset: 0; z-index: 1000; width: 100vw; height: 100dvh; max-height: none; aspect-ratio: auto; border-radius: 0; margin: 0; box-shadow: none; }
body.pseudo-fullscreen .stage-exit { display: flex; align-items: center; justify-content: center; position: absolute; top: max(8px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); z-index: 1; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff; font-size: 18px; cursor: pointer; }
.notice { margin-top: 10px; background: #fff8f4; padding: 8px 10px; border-radius: 8px; }
.notice a { color: var(--brand); font-weight: 600; }

/* ---------- 资讯 ---------- */
.article-list { display: flex; flex-direction: column; gap: 12px; }
.article-item { display: flex; gap: 16px; align-items: center; transition: .15s; }
.article-item:hover { transform: translateX(4px); color: inherit; }
.article-item h3 { font-size: 16px; margin-bottom: 4px; }
.article h1 { font-size: 26px; margin: 10px 0 6px; }
.article .prose { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.article-cta { display: flex; align-items: center; gap: 14px; margin-top: 28px; padding: 16px; background: var(--bg); border-radius: var(--radius); }
.article-cta > div { flex: 1; }
.legal { max-width: 860px; margin: 0 auto; }
.legal .prose h2 { font-size: 17px; margin: 26px 0 8px; color: var(--text, #1f2433); }
.legal .prose p { margin: 0 0 10px; }

/* ---------- 个人中心 ---------- */
.profile { display: flex; align-items: center; gap: 20px; margin-top: 24px; padding: 28px; }
.profile h1 { font-size: 24px; }
.profile .stats { margin: 0 0 0 auto; }
.rename { margin-top: 8px; font-size: 13px; }
.rename summary { display: inline-block; cursor: pointer; color: var(--brand); list-style: none; }
.rename summary::-webkit-details-marker { display: none; }
.rename-form { display: flex; gap: 8px; margin-top: 8px; }
.rename-form input { padding: 6px 12px; border: 1px solid #dfe2ea; border-radius: 8px; font: inherit; outline: none; background: #fafbfd; width: 200px; max-width: 100%; }
.rename-form input:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(255,90,31,.12); }
.rename .error { margin-top: 6px; }

/* ---------- 页脚 ---------- */
.footer { margin-top: 48px; background: var(--dark); color: #8d93a6; padding: 28px 0; font-size: 13px; }
.health { border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: 12px 16px; text-align: center; }
.health strong { color: #c9cede; margin-right: 8px; }
.footer-links { display: flex; justify-content: center; gap: 22px; margin: 16px 0 8px; }
.footer-links a:hover { color: #fff; }
.copy { text-align: center; }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
    .grid-6 { grid-template-columns: repeat(3, 1fr); }
    .grid-4 { grid-template-columns: repeat(3, 1fr); }
    .three-col { grid-template-columns: 1fr 1fr; }
    .three-col > :last-child { grid-column: span 2; }
    .search { display: none; }
}
@media (max-width: 820px) {
    .topbar-inner { height: auto; flex-wrap: wrap; gap: 8px; padding: 10px 0; }
    .nav { order: 3; width: 100%; overflow-x: auto; }
    .userbar { margin-left: auto; }
    .hero, .two-col, .play-layout.with-side, .three-col, .grid-2 { grid-template-columns: 1fr; }
    .three-col > :last-child { grid-column: auto; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-6 { grid-template-columns: repeat(2, 1fr); }
    .carousel { height: 320px; }
    .slide { padding: 0 24px; }
    .slide h2 { font-size: 32px; }
    .slide-text { max-width: 100%; }
    .slide-art { font-size: 120px; opacity: .35; }
    .game-banner-inner { flex-direction: column; text-align: center; }
    .game-banner .tags, .game-banner .stats, .game-banner .slide-actions { justify-content: center; }
    .cover-lg { width: 150px; }
    .profile { flex-wrap: wrap; }
    .table-lg { display: block; overflow-x: auto; }
}

/* ---------- 图片封面 / 横屏游戏 ---------- */
.cover.has-image { background: var(--img) center / cover no-repeat, linear-gradient(135deg, var(--c1), var(--c2)); justify-content: flex-end; padding-bottom: 10px; }
.cover.has-image::after { background: linear-gradient(transparent 45%, rgba(0,0,0,.55)); }
.cover-sm.has-image, .cover-xs.has-image { justify-content: center; padding: 0; }
.cover-sm.has-image::after, .cover-xs.has-image::after { background: rgba(0,0,0,.25); }
.stage.stage-landscape { height: auto; aspect-ratio: 16 / 9; max-height: 80vh; }
.stage.stage-portrait { height: min(82vh, 820px); width: min(100%, calc(min(82vh, 820px) * 9 / 16)); margin: 0 auto; }
.device-switch { display: inline-flex; background: var(--bg); border-radius: 999px; padding: 2px; }
.device-switch a { padding: 3px 12px; border-radius: 999px; font-size: 13px; color: var(--muted); }
.device-switch a.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

/* ---------- 语言切换 ---------- */
.lang-menu { position: relative; }
.lang-menu summary { list-style: none; cursor: pointer; padding: 6px 10px; border-radius: 8px; color: #c9cede; font-size: 14px; white-space: nowrap; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover, .lang-menu[open] summary { color: #fff; background: rgba(255,255,255,.08); }
.lang-list { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); padding: 6px; min-width: 170px; z-index: 60; }
.lang-list a { display: block; padding: 8px 12px; border-radius: 6px; color: var(--text, #1f2330); font-size: 14px; white-space: nowrap; }
.lang-list a:hover { background: #f1f3f8; }
.lang-list a.on { color: var(--brand); font-weight: 600; }
.lang-notice { margin: 0 0 10px; padding: 8px 12px; border-radius: 8px; background: #fff7e6; color: #8a5a00; font-size: 14px; }
@media (max-width: 900px) { .lang-menu summary span { display: none; } }

/* 其他语言的导航文字更长：窄屏时收紧顶栏，避免横向滚动 */
.logo span { white-space: nowrap; }
@media (max-width: 1180px) {
    .topbar-inner { gap: 14px; }
    .nav a { padding: 8px 9px; font-size: 14px; }
    .search input { width: 150px; }
}
.section-head { flex-wrap: wrap; gap: 4px 12px; }
.section-head .more { white-space: nowrap; }
@media (max-width: 960px) {
    .logo > span:not(.logo-mark), .logo small { display: none; }
}
.three-col > * { min-width: 0; }  /* 长标题（译文）不撑宽网格列 */
.server.has-char { border-color: var(--brand); background: #fff7f0; }
.server .char { font-size: 11px; color: var(--brand); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 90px; }

/* ---------- 顶栏精简：账号操作收进头像菜单，语言只显示图标 ---------- */
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; padding: 0 !important; border-radius: 50%; font-size: 18px; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; cursor: pointer; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu[open] summary, .user-menu summary:hover { box-shadow: 0 0 0 3px rgba(255,255,255,.25); }
.menu-list { position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px; background: #fff; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); padding: 6px; z-index: 60; }
.menu-head { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-weight: 600; color: var(--text, #1f2330); }
.menu-head small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.menu-list a, .menu-list button { display: block; width: 100%; text-align: left; padding: 8px 12px; border: 0; background: none; border-radius: 6px; color: var(--text, #1f2330); font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap; }
.menu-list a:hover, .menu-list button:hover { background: #f1f3f8; }
.menu-list form { margin: 0; }
.search input { width: 150px; }

/* ==================== 手机适配 ==================== */
.search-link { display: none; }
.rotate-hint { display: none; }
.search-row { display: flex; gap: 8px; margin-bottom: 14px; }
.search-row input { flex: 1; min-width: 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; font: inherit; background: #fff; }
@media (max-width: 1080px) {
    .search-link { display: grid; }
}
@media (max-width: 640px) {
    .wrap { width: calc(100% - 24px); }
    .section { margin-top: 22px; }
    .panel { padding: 14px; }

    /* 顶栏：第一行 logo + 图标，第二行导航可横向滑动 */
    .topbar-inner { gap: 6px; padding: 8px 0 4px; }
    .nav { scrollbar-width: none; margin: 0 -4px; }
    .nav::-webkit-scrollbar { display: none; }
    .nav a { padding: 7px 10px; font-size: 14px; }
    .lang-list, .menu-list { position: fixed; top: 54px; right: 12px; left: auto; }

    /* 首页轮播：文字压到底部，标签换成小圆点 */
    .hero { margin-top: 12px; gap: 12px; }
    .carousel { height: 300px; }
    .slide { padding: 0 18px 40px; align-items: flex-end; }
    .slide h2 { font-size: 26px; letter-spacing: 1px; margin: 8px 0 4px; }
    .slide p { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .slide-actions { margin-top: 12px; gap: 8px; }
    .slide .slide-server { display: none; }
    .logo > span:not(.logo-mark) { display: inline; font-size: 19px; }
    .slide-art { font-size: 88px; top: 28%; right: 4%; opacity: .5; }
    .carousel-dots { justify-content: center; gap: 8px; padding: 12px; background: none; backdrop-filter: none; }
    .carousel-dots button { flex: none; width: 8px; height: 8px; padding: 0; border: 0; border-radius: 4px; font-size: 0; background: rgba(255,255,255,.45); }
    .carousel-dots button.is-active { width: 22px; background: #fff; }
    .btn-lg { padding: 10px 18px; font-size: 15px; }

    /* 表格：普通表格允许换行；大表格变成一行一张卡片 */
    .table td { white-space: normal; }
    .table-lg, .table-lg tbody { display: block; overflow: visible; }
    .table-lg thead { display: none; }
    .table-lg tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
    .table-lg tr:last-child { border-bottom: 0; }
    .table-lg td { padding: 0; border: 0; }
    .table-lg td:first-child { flex-basis: 100%; font-weight: 600; }
    .table-lg td:last-child { margin-left: auto; }

    /* 游戏详情：封面缩小放在左边，服务器列表更快出现 */
    .game-banner { padding: 18px 0; }
    .game-banner-inner { flex-direction: row; align-items: flex-start; text-align: left; gap: 14px; }
    .cover-lg { width: 92px; border-radius: 16px; }
    .cover-lg .cover-icon { font-size: 44px; }
    .cover-lg .cover-title { display: none; }
    .crumbs { display: none; }
    .game-meta { min-width: 0; }
    .game-meta h1 { font-size: 24px; letter-spacing: 1px; }
    .tagline { font-size: 14px; margin: 4px 0 8px; }
    .stats { gap: 18px; margin-top: 10px; }
    .stats strong { font-size: 18px; }
    .game-banner .tags, .game-banner .stats, .game-banner .slide-actions { justify-content: flex-start; }
    .server-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

    /* 游戏页 */
    .play-wrap { padding-top: 8px; }
    .play-bar { gap: 6px 12px; padding: 8px 12px; margin-bottom: 10px; font-size: 14px; }
    .play-bar .hide-sm { display: none; }
    .stage { height: min(74svh, 720px); }
}
/* 竖着拿手机玩横屏游戏：提示横过来 */
@media (max-width: 640px) and (orientation: portrait) {
    .rotate-hint { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; padding: 10px 12px; border-radius: 10px; background: #1b1f2e; color: #e6e8f0; font-size: 14px; }
}
/* 手机横屏玩游戏：隐藏网站界面，游戏铺满屏幕 */
@media (orientation: landscape) and (max-height: 540px) {
    body.playing .topbar, body.playing .footer, body.playing .play-bar, body.playing .lang-notice, body.playing .toast { display: none; }
    body.playing main > .play-wrap { width: 100%; padding: 0; }
    body.playing .play-layout { display: block; }
    body.playing .play-layout aside { display: none; }
    body.playing .stage, body.playing .stage.stage-landscape, body.playing .stage.stage-portrait { height: 100svh; max-height: none; width: 100%; aspect-ratio: auto; border-radius: 0; margin: 0; box-shadow: none; }
}
@media (max-width: 640px) {
    .footer-links { flex-wrap: wrap; gap: 6px 16px; justify-content: center; }
    .three-col .table { table-layout: fixed; }
    .three-col .table td { overflow-wrap: anywhere; }
    .three-col .table th:first-child { width: 42%; }
    .slide-actions .btn, .slide-actions form { max-width: 100%; }
    .slide-actions .btn { white-space: normal; text-align: center; }
}
@media (max-width: 380px) {
    .logo > span:not(.logo-mark) { font-size: 16px; letter-spacing: 0; max-width: 128px; overflow: hidden; text-overflow: ellipsis; }
    .logo { gap: 4px; }
}
/* 自带手机布局的横屏游戏（如金街大亨）：手机竖着拿时游戏铺满屏幕，只留一行返回栏 */
@media (max-width: 640px) and (orientation: portrait) {
    body.adaptive-play .topbar, body.adaptive-play .footer, body.adaptive-play .lang-notice { display: none; }
    body.adaptive-play main > .play-wrap { width: 100%; padding: 0; }
    body.adaptive-play .play-bar { border-radius: 0; margin: 0; padding: 6px 12px; box-shadow: none; }
    body.adaptive-play .play-bar .btn, body.adaptive-play .play-bar .tag { display: none; }
    body.adaptive-play .stage.stage-adaptive { aspect-ratio: auto; height: calc(100svh - 34px); max-height: none; border-radius: 0; box-shadow: none; }
}
