/* 液态玻璃风格：半透明磨砂面板 + 边缘高光，底下垫一层彩色光斑让玻璃有东西可透 */
:root {
  --brand: #0CD664;
  --brand-deep: #08B553;
  --fg: #111827;
  --dim: #4B5563;
  --radius: 26px;

  --glass: rgba(255, 255, 255, .38);
  --glass-strong: rgba(255, 255, 255, .62);
  --glass-edge: rgba(255, 255, 255, .75);
  --glass-hi: rgba(255, 255, 255, .9);
  --glass-shadow: 0 10px 30px rgba(15, 40, 30, .10), 0 1px 2px rgba(15, 40, 30, .06);
  --chip: rgba(255, 255, 255, .55);

  --bg: #E9F1EE;
  --blob1: rgba(12, 214, 100, .62);
  --blob2: rgba(56, 189, 248, .55);
  --blob3: rgba(167, 139, 250, .50);
  --blob4: rgba(251, 191, 36, .42);
}
:root[data-theme="dark"] {
  --fg: #F3F4F6;
  --dim: #A1A8B4;

  --glass: rgba(40, 44, 52, .42);
  --glass-strong: rgba(48, 52, 62, .62);
  --glass-edge: rgba(255, 255, 255, .14);
  --glass-hi: rgba(255, 255, 255, .22);
  --glass-shadow: 0 10px 30px rgba(0, 0, 0, .35), 0 1px 2px rgba(0, 0, 0, .3);
  --chip: rgba(255, 255, 255, .10);

  --bg: #07090C;
  --blob1: rgba(12, 214, 100, .34);
  --blob2: rgba(37, 99, 235, .34);
  --blob3: rgba(147, 51, 234, .30);
  --blob4: rgba(234, 88, 12, .20);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { background: var(--bg); touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  min-height: 100vh; color: var(--dim);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
/* 固定的彩色光斑背景（用伪元素而不是 background-attachment:fixed，iOS Safari 才不会抖） */
body::before {
  content: ""; position: fixed; inset: -10%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(55% 45% at 10% 12%, var(--blob1), transparent 72%),
    radial-gradient(50% 42% at 95% 22%, var(--blob2), transparent 72%),
    radial-gradient(58% 48% at 80% 82%, var(--blob3), transparent 72%),
    radial-gradient(50% 42% at 6% 72%, var(--blob4), transparent 72%),
    var(--bg);
  filter: saturate(120%);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wrap, .topbar, .footer { width: 100%; max-width: 1024px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }

/* ===== 玻璃面板通用样式 ===== */
.glass, .topbar::before, .notice, .quick, .tabs, .card,
.sim-cats, .sim-search, .sim-more, .g, .player-bar {
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-hi), inset 0 -1px 0 rgba(255, 255, 255, .08);
}
/* 不支持磨砂的浏览器：提高不透明度，保证文字看得清 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass: rgba(255, 255, 255, .88); }
  :root[data-theme="dark"] { --glass: rgba(30, 33, 40, .92); }
}

/* 顶栏：悬浮胶囊 */
.topbar {
  position: sticky; top: 10px; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  height: 58px; margin-top: 10px;
}
.topbar::before {
  content: ""; position: absolute; inset: 0 16px; z-index: -1;
  border-radius: 999px; background: var(--glass-strong);
}
.logo { display: flex; align-items: center; gap: 9px; padding-left: 10px; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 50%; color: #fff;
  background: linear-gradient(160deg, #3BE88A, var(--brand) 45%, var(--brand-deep));
  box-shadow: inset 0 1px 1px rgba(255,255,255,.7), 0 4px 12px rgba(12,214,100,.35);
  display: grid; place-items: center; font-weight: 800; font-size: 17px;
}
.logo-text { font-weight: 700; font-size: 17px; color: var(--fg); letter-spacing: -.2px; }
.actions { display: flex; gap: 4px; padding-right: 9px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--fg); transition: background .2s, transform .15s; }
.icon-btn:hover { background: var(--chip); }
.icon-btn:active { transform: scale(.92); }

/* 横幅 */
.banner {
  position: relative; margin-top: 14px; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 7;
  box-shadow: var(--glass-shadow);
}
/* 横幅上的玻璃高光边 */
.banner::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 0 0 1px rgba(255,255,255,.25);
  background: linear-gradient(180deg, rgba(255,255,255,.18), transparent 40%);
}
.banner-track { display: flex; height: 100%; transition: transform .5s cubic-bezier(.2,.8,.2,1); touch-action: pan-y; }
.slide { flex: 0 0 100%; height: 100%; position: relative; display: block; }
.slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide-ph {
  width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px;
  color: #fff; text-align: center; padding: 16px;
}
.slide-ph h2 { font-size: clamp(26px, 6vw, 56px); font-weight: 800; letter-spacing: -.5px; text-shadow: 0 2px 16px rgba(0,0,0,.18); }
.slide-ph p { font-size: clamp(13px, 2.2vw, 20px); opacity: .95; }
/* 圆点放在一个小玻璃胶囊里 */
.banner-dots {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 1;
  display: flex; gap: 6px; padding: 6px 10px; border-radius: 999px;
  background: rgba(255,255,255,.22); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.35);
}
.banner-dots:empty { display: none; }
.banner-dots button { width: 7px; height: 7px; border-radius: 4px; background: rgba(255,255,255,.6); transition: width .3s; }
.banner-dots button.on { width: 20px; background: #fff; }

/* 公告 */
.notice {
  display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 0 8px 0 8px; height: 46px;
  border-radius: 999px;
}
.notice-icon {
  flex: none; width: 30px; height: 30px; border-radius: 50%; color: #fff; display: grid; place-items: center;
  background: linear-gradient(160deg, #3BE88A, var(--brand-deep));
  box-shadow: inset 0 1px 1px rgba(255,255,255,.6);
}
.notice-icon svg { width: 15px; height: 15px; }
.notice-box { flex: 1; overflow: hidden; white-space: nowrap; font-size: 13px; color: var(--fg); padding-right: 10px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.notice-text { display: inline-block; padding-left: 100%; animation: marquee 18s linear infinite; }
@keyframes marquee { to { transform: translateX(-100%); } }

/* 快捷图标（目前 site.json 里没配，不显示） */
.quick {
  display: flex; gap: 12px; margin-top: 14px; padding: 12px; overflow-x: auto;
  border-radius: var(--radius); scrollbar-width: none;
}
.quick::-webkit-scrollbar { display: none; }
.quick a { flex: none; width: 60px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--fg); }
.quick .q-icon { width: 54px; height: 54px; border-radius: 15px; overflow: hidden; transition: transform .15s; }
.quick a:hover .q-icon { transform: translateY(-2px); }
.quick span.label { width: 100%; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 字母头像（没有图片时），带一点玻璃高光 */
.ph {
  width: 100%; height: 100%; display: grid; place-items: center; color: #fff; font-weight: 800; position: relative;
  text-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.ph::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,0) 50%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 0 0 1px rgba(255,255,255,.18);
}
.q-icon img, .card-art img, .g-art img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 分类标签：玻璃胶囊 + 可拖动的玻璃滑块（iOS 分段控件） */
.tabs {
  position: relative; display: flex; gap: 4px; margin-top: 14px; padding: 5px; overflow-x: auto;
  border-radius: 999px; scrollbar-width: none;
  touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  position: relative; z-index: 1;
  flex: 1 0 auto; min-width: 72px; height: 42px; padding: 0 16px; border-radius: 999px;
  font-size: 14px; color: var(--dim); transition: color .25s;
}
.tabs button:hover { color: var(--fg); }
.tabs button.on { color: #fff; font-weight: 600; }

/* 滑块：平时是带光泽的绿色胶囊，回弹着滑到选中项 */
.tab-thumb {
  position: absolute; top: 5px; left: 0; z-index: 0; height: 42px; width: 0; border-radius: 999px; pointer-events: none;
  background: linear-gradient(160deg, #3BE88A, var(--brand) 50%, var(--brand-deep));
  box-shadow: inset 0 1px 1px rgba(255,255,255,.65), inset 0 -1px 1px rgba(0,0,0,.08), 0 4px 14px rgba(12,214,100,.35);
  transition:
    translate .55s cubic-bezier(.34, 1.45, .64, 1),
    width .55s cubic-bezier(.34, 1.45, .64, 1),
    scale .3s cubic-bezier(.34, 1.45, .64, 1),
    background .25s, box-shadow .25s, opacity .2s;
}
.tab-thumb.no-anim { transition: scale .3s cubic-bezier(.34, 1.45, .64, 1), background .25s, box-shadow .25s; }

/* 按住拖动时：滑块放大，变成透明的玻璃透镜 */
.tabs.dragging { cursor: grabbing; }
.tabs.dragging .tab-thumb {
  scale: 1.12;
  background: rgba(255, 255, 255, .28);
  -webkit-backdrop-filter: blur(3px) saturate(200%); backdrop-filter: blur(3px) saturate(200%);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.9), inset 0 0 0 1px rgba(255,255,255,.55),
              inset 0 -6px 12px rgba(12,214,100,.18), 0 8px 24px rgba(15,40,30,.18);
}
:root[data-theme="dark"] .tabs.dragging .tab-thumb { background: rgba(255, 255, 255, .10); }
.tabs.dragging button.on { color: var(--dim); font-weight: 400; }
.tabs.dragging button.lit { color: var(--brand-deep); font-weight: 600; }
:root[data-theme="dark"] .tabs.dragging button.lit { color: var(--brand); }

/* 卡片 */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; } }
.card {
  position: relative; display: flex; gap: 12px; padding: 12px; min-height: 100px;
  border-radius: 22px; -webkit-tap-highlight-color: transparent;
}
.card-art {
  flex: none; align-self: center; width: clamp(44px, 14vw, 60px); aspect-ratio: 1; border-radius: 15px; overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.card-art .ph { font-size: 22px; }
.q-icon .ph { font-size: 22px; }
.card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 4px 4px 2px 0; }
.card-title { font-size: 15px; font-weight: 700; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.2px; }
.card-desc { margin-top: 3px; font-size: 12px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-cta {
  white-space: nowrap; align-self: flex-start; margin-top: 8px; padding: 3px 12px; border-radius: 999px;
  background: var(--chip); color: var(--brand-deep); font-size: 12px; font-weight: 600;
  border: 1px solid var(--glass-edge);
}
:root[data-theme="dark"] .card-cta { color: var(--brand); }

.empty { padding: 40px 0; text-align: center; }
.footer { padding-top: 28px; padding-bottom: 36px; text-align: center; font-size: 12px; }

.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 20;
  padding: 10px 20px; border-radius: 999px; color: var(--fg); font-size: 14px;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--glass-edge); box-shadow: var(--glass-shadow);
}

@media (prefers-reduced-motion: reduce) {
  .notice-text { animation: none; padding-left: 0; }
  .banner-track, .tab-thumb { transition: none; }
}


/* ===== 模拟器：分类 + 游戏直接排在本页 ===== */
.sim { margin-top: 14px; }

/* 平台分类：横向滚动的玻璃胶囊，沿用标签栏的视觉 */
.sim-cats {
  display: flex; gap: 4px; padding: 5px; border-radius: 999px; overflow-x: auto;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; -webkit-tap-highlight-color: transparent;
}
.sim-cats::-webkit-scrollbar { display: none; }
.sim-cats button {
  flex: 0 0 auto; height: 36px; padding: 0 14px; border-radius: 999px;
  font-size: 13px; color: var(--dim); white-space: nowrap; transition: color .25s, background .25s;
}
.sim-cats button:hover { color: var(--fg); }
.sim-cats button.on {
  color: #fff; font-weight: 600;
  background: linear-gradient(160deg, #3BE88A, var(--brand) 50%, var(--brand-deep));
  box-shadow: inset 0 1px 1px rgba(255,255,255,.65), 0 4px 14px rgba(12,214,100,.35);
}

/* 搜索框 */
.sim-search {
  display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 0 14px;
  height: 44px; border-radius: 999px;
}
.sim-search svg { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--dim); stroke-width: 2; stroke-linecap: round; }
.sim-search input {
  flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none;
  font-size: 14px; color: var(--fg); font-family: inherit;
}
.sim-search input::placeholder { color: var(--dim); }
.sim-search input::-webkit-search-cancel-button { display: none; }
.sim-search button { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--chip); color: var(--dim); font-size: 11px; line-height: 1; }

.sim-count { margin: 12px 2px 0; font-size: 12px; color: var(--dim); }

/* 游戏格子 */
.sim-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
@media (min-width: 560px) { .sim-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 720px) { .sim-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; } }

.g {
  display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: 18px;
  text-align: center; -webkit-tap-highlight-color: transparent; transition: transform .18s;
}
.g:active { transform: scale(.96); }
.g-art {
  position: relative; display: block; width: 100%; aspect-ratio: 1; border-radius: 13px; overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.g-art .ph { font-size: 20px; }
.g-name {
  font-size: 12px; font-weight: 600; color: var(--fg); line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px 2px;
}
/* 点下去之后盖在封面上的「启动中」 */
.g-mask {
  position: absolute; inset: 0; display: none; place-items: center;
  background: rgba(0,0,0,.55); color: #fff; font-size: 12px; font-weight: 600;
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.g.busy .g-mask { display: grid; }

.sim-more {
  display: block; width: 100%; margin-top: 14px; height: 46px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--brand-deep); font-family: inherit;
}
:root[data-theme="dark"] .sim-more { color: var(--brand); }
.sim-empty { padding: 40px 0; text-align: center; color: var(--dim); }

/* ===== 游戏全屏播放器 ===== */
body.player-open { overflow: hidden; }
.player {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: var(--bg);
}
.player[hidden] { display: none; }
.player-bar {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top, 10px));
  border-radius: 0; border-left: 0; border-right: 0; border-top: 0;
}
.player-back {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 14px 6px 10px; border-radius: 999px;
  background: var(--chip); border: 1px solid var(--glass-edge);
  color: var(--brand-deep); font-size: 14px; font-weight: 600; font-family: inherit;
}
:root[data-theme="dark"] .player-back { color: var(--brand); }
.player-back svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.player-title {
  flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: var(--fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player iframe { flex: 1; width: 100%; border: 0; background: #000; }

.sim-tip {
  margin: 10px 0 0; padding: 10px 14px; border-radius: 16px;
  background: var(--chip); border: 1px solid var(--glass-edge);
  font-size: 12px; line-height: 1.5; color: var(--dim);
}
