/* ==========================================================================
   脑力盒子 · 应用外壳样式
   设计令牌 + 首页 + 公用组件（游戏页复用）
   ========================================================================== */

:root {
  --bg: #0a0d13;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.085);
  --surface-3: rgba(255, 255, 255, 0.12);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #eef2fa;
  --dim: #9aa4b8;
  --faint: #68728a;
  --accent: #6f8cff;
  --accent2: #3d5bd9;
  --ok: #3ecf8e;
  --warn: #ffb020;
  --err: #ff5c6c;
  --radius: 16px;
  --radius-sm: 11px;
  --pad: 14px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
    "Noto Sans CJK SC", "Source Han Sans SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  height: 100%;
}

body {
  margin: 0;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1100px 620px at 8% -12%, rgba(111, 140, 255, 0.17), transparent 62%),
    radial-gradient(820px 520px at 102% -4%, rgba(183, 140, 255, 0.13), transparent 58%),
    radial-gradient(760px 620px at 50% 112%, rgba(95, 224, 200, 0.07), transparent 62%);
}

#app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}

a { color: inherit; text-decoration: none; }
button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}
input, select, textarea { font-family: inherit; }
svg { display: block; }

.hidden { display: none !important; }

/* ============================== 顶栏 ============================== */

.appbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: calc(var(--safe-t) + 7px) 10px 7px;
  min-height: 54px;
  background: rgba(10, 13, 19, 0.72);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}

.appbar-mid {
  flex: 1;
  min-width: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.appbar-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.appbar-sub {
  font-size: 10.5px;
  color: var(--faint);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.appbar-sub:empty { display: none; }

.appbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 38px;
  justify-content: flex-end;
}

.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  color: var(--dim);
  flex: none;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.icon-btn:active { background: var(--surface-2); color: var(--text); transform: scale(0.94); }
.icon-btn.accent { color: var(--accent); }

/* ============================== 首页 ============================== */

.home {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: calc(var(--safe-t) + 30px) 18px calc(var(--safe-b) + 30px);
  animation: fadeIn 0.35s ease both;
}

.hero { position: relative; padding-bottom: 6px; }

.hero-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--dim);
  text-transform: uppercase;
}
.hero-kicker::before {
  content: "";
  width: 20px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.hero-title {
  margin: 12px 0 10px;
  font-size: clamp(30px, 9vw, 38px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.hero-title .grad {
  background: linear-gradient(100deg, #8aa6ff 0%, #b78cff 48%, #5fe0c8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-sub {
  margin: 0;
  font-size: 13px;
  line-height: 1.75;
  color: var(--dim);
  max-width: 34em;
}

.hero-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 15px; }
.chip {
  font-size: 11px;
  color: var(--dim);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 11px;
  line-height: 1.4;
}

.sec {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 26px 2px 12px;
}
.sec-h { font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; color: var(--text); }
.sec-s { font-size: 10.5px; color: var(--faint); letter-spacing: 0.04em; }

.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 13px;
  min-height: 134px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(158deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.022));
  overflow: hidden;
  transition: transform 0.16s ease, border-color 0.2s ease, background 0.2s ease;
  animation: cardIn 0.42s cubic-bezier(0.22, 0.9, 0.3, 1) both;
  animation-delay: var(--d, 0ms);
}
.game-card::after {
  content: "";
  position: absolute;
  right: -34px;
  bottom: -56px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.16;
  filter: blur(10px);
  pointer-events: none;
  transition: opacity 0.25s;
}
.game-card:active { transform: scale(0.972); background: linear-gradient(158deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03)); }
@media (hover: hover) and (pointer: fine) {
  .game-card:hover { transform: translateY(-2px); border-color: var(--line-2); }
  .game-card:hover::after { opacity: 0.26; }
}

.tile {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  background: linear-gradient(150deg, var(--accent), var(--accent2));
  box-shadow: 0 8px 18px -8px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  flex: none;
}
.tile.tile-xs { font-size: 13px; letter-spacing: -0.04em; }

.card-name { font-size: 14.5px; font-weight: 700; letter-spacing: 0.01em; line-height: 1.3; }
.card-desc {
  font-size: 11px;
  color: var(--dim);
  line-height: 1.5;
  margin-top: -3px;
}
.card-status {
  position: absolute;
  top: 11px;
  right: 11px;
  max-width: calc(100% - 60px);
  font-size: 10px;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  color: var(--dim);
  background: rgba(8, 11, 18, 0.5);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  backdrop-filter: blur(6px);
}
.card-status.hot { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }

.foot {
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.8;
  color: var(--faint);
}
.foot strong { color: var(--dim); font-weight: 600; }
.foot-actions { display: flex; gap: 9px; margin-top: 13px; }
.foot-actions .btn { flex: 1; }

/* ============================== 游戏页容器 ============================== */

.g-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 12px 14px calc(14px + var(--safe-b));
  min-height: 0;
  animation: fadeIn 0.28s ease both;
}

.g-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
}
.g-title { font-size: 13px; font-weight: 700; letter-spacing: 0.02em; }
.g-sub { font-size: 11px; color: var(--faint); line-height: 1.5; }
.g-head-right { display: flex; align-items: center; gap: 6px; flex: none; }

.board-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================== 面板 / 数据 ============================== */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--pad);
}
.panel-h {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--dim);
  margin-bottom: 8px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 9px 8px;
  text-align: center;
  min-width: 0;
}
.stat-v {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.stat-k { font-size: 10px; color: var(--faint); margin-top: 2px; letter-spacing: 0.03em; }

.big { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }

/* ============================== 按钮 ============================== */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 9px 15px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform 0.1s ease, background 0.16s ease, border-color 0.16s ease, opacity 0.16s;
  text-align: center;
}
.btn:active { transform: scale(0.965); background: var(--surface); }
.btn.primary {
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px -8px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
.btn.primary:active { background: linear-gradient(180deg, var(--accent2), var(--accent2)); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--dim); }
.btn.danger { background: rgba(255, 92, 108, 0.12); border-color: rgba(255, 92, 108, 0.32); color: #ff8b96; }
.btn.ghost:active, .btn.danger:active { background: var(--surface-2); }
.btn.sm { min-height: 38px; padding: 7px 12px; font-size: 12.5px; border-radius: 10px; }
.btn.xs { min-height: 32px; padding: 5px 9px; font-size: 11.5px; border-radius: 8px; }
/* 小尺寸按钮通过伪元素扩大触控热区到 ≥44px，视觉尺寸保持不变 */
.btn.sm::after, .btn.xs::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 44px;
  transform: translateY(-50%);
}
.seg-item { position: relative; }
.seg-item::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 44px;
  transform: translateY(-50%);
}
.btn.lg { min-height: 50px; font-size: 15px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn.icon { width: 42px; min-width: 42px; padding: 0; }
.btn.icon.sm { width: 34px; min-width: 34px; }
.btn[disabled], .btn.is-disabled {
  opacity: 0.42;
  pointer-events: none;
}
.btn.on { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.btn-row { display: flex; align-items: center; gap: 8px; }
.btn-row .btn { flex: 1; }
.btn-row.compact .btn { flex: none; }

/* ============================== 分段控件 ============================== */

.seg {
  display: flex;
  align-items: stretch;
  gap: 2px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg-item {
  flex: 1;
  min-width: 0;
  min-height: 34px;
  padding: 6px 9px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--dim);
  white-space: nowrap;
  transition: color 0.16s, background 0.16s, box-shadow 0.16s;
}
.seg-item.active {
  color: #fff;
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  box-shadow: 0 5px 14px -6px var(--accent);
}
.seg.sm .seg-item { min-height: 32px; font-size: 11.5px; padding: 4px 8px; }

/* ============================== 键盘 / 网格 ============================== */

.pad { display: grid; gap: 7px; }
.pad-key {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 19px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: transform 0.08s, background 0.12s;
  touch-action: manipulation;
}
.pad-key:active, .pad-key.on { transform: scale(0.96); background: var(--surface-3); border-color: var(--line-2); }
.pad-key.dim { color: var(--faint); font-size: 13px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

/* ============================== 标签 ============================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--dim);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  line-height: 1.3;
  white-space: nowrap;
}
.badge.ok { color: var(--ok); border-color: rgba(62, 207, 142, 0.3); background: rgba(62, 207, 142, 0.1); }
.badge.warn { color: var(--warn); border-color: rgba(255, 176, 32, 0.3); background: rgba(255, 176, 32, 0.1); }
.badge.err { color: var(--err); border-color: rgba(255, 92, 108, 0.3); background: rgba(255, 92, 108, 0.1); }
.badge.accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }

.tag {
  font-size: 10px;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
  line-height: 1.4;
}

/* ============================== 布局工具 ============================== */

.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.between { justify-content: space-between; }
.center { align-items: center; justify-content: center; }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-10 { gap: 10px; } .gap-14 { gap: 14px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-14 { margin-top: 14px; }
.muted { color: var(--dim); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
.hint { font-size: 11.5px; line-height: 1.65; color: var(--faint); }
.divider { height: 1px; background: var(--line); margin: 2px 0; flex: none; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.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;
}

/* ============================== 遮罩 / 弹窗 / Toast ============================== */

.layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.layer > * { pointer-events: auto; }

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(4, 6, 11, 0.68);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: fadeIn 0.18s ease both;
}

.dialog {
  width: min(100%, 372px);
  max-height: min(84vh, 640px);
  overflow-y: auto;
  background: linear-gradient(180deg, #161c2b, #111623);
  border: 1px solid var(--line-2);
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 34px 80px -18px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: popIn 0.24s cubic-bezier(0.22, 1.1, 0.36, 1) both;
}
.dialog-title { font-size: 16.5px; font-weight: 800; letter-spacing: 0.01em; margin-bottom: 9px; }
.dialog-body { font-size: 13px; line-height: 1.8; color: var(--dim); }
.dialog-body p { margin: 0 0 8px; }
.dialog-body p:last-child { margin-bottom: 0; }
.dialog-body ul { margin: 6px 0 8px; padding-left: 18px; }
.dialog-body li { margin-bottom: 4px; }
.dialog-body b, .dialog-body strong { color: var(--text); font-weight: 600; }
.dialog-actions { display: flex; gap: 9px; margin-top: 18px; }
.dialog-actions .btn { flex: 1; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(30px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 130;
  max-width: 78vw;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(26, 32, 46, 0.96);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.22s ease both;
  pointer-events: none;
  white-space: pre-wrap;
}
.toast.out { animation: toastOut 0.2s ease both; }

/* ============================== 进度 ============================== */

.progress {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 0.3s ease;
}

/* ============================== 动画 ============================== */

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@keyframes popIn {
  0% { opacity: 0; transform: translateY(12px) scale(0.96); }
  100% { opacity: 1; transform: none; }
}
@keyframes toastIn {
  0% { opacity: 0; transform: translate(-50%, 10px); }
  100% { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes toastOut {
  0% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, 8px); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; } 50% { opacity: 0.45; }
}
@keyframes shimmer {
  0% { background-position: -140% 0; } 100% { background-position: 240% 0; }
}

/* ============================== 大屏适配 ============================== */

@media (min-width: 700px) {
  .home { max-width: 820px; padding-left: 26px; padding-right: 26px; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .hero-title { font-size: 40px; }
}

@media (max-width: 359px) {
  :root { --pad: 12px; }
  .home { padding-left: 14px; padding-right: 14px; }
  .g-wrap { padding-left: 11px; padding-right: 11px; }
  .card-name { font-size: 13.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   分类首页（v2）：品牌区 / 大区 Tab / 分类 chips / 3×3 九宫格
   ========================================================================== */

.home-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-top: calc(var(--safe-t) + 14px);
}
.brand-wrap { min-width: 0; }
.brand {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.brand .grad {
  background: linear-gradient(100deg, #8aa6ff 0%, #b78cff 55%, #5fe0c8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.brand-sub {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--faint);
  letter-spacing: 0.01em;
}
.home-tools { display: flex; align-items: center; gap: 2px; flex: none; }

.search-wrap { margin-top: 10px; }
.search-input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.search-input::placeholder { color: var(--faint); }
.search-input:focus { border-color: var(--accent); }

.home-tabs {
  display: flex;
  gap: 3px;
  margin: 14px 0 10px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.home-tab {
  flex: 1;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--dim);
  transition: color 0.16s, background 0.16s, box-shadow 0.16s;
  touch-action: manipulation;
}
.home-tab .cnt {
  font-size: 10px;
  font-weight: 600;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.home-tab.active {
  color: #fff;
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  box-shadow: 0 6px 16px -8px var(--accent);
}
.home-tab.active .cnt { color: rgba(255, 255, 255, 0.72); }

.home-chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 1px 0 6px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.home-chips::-webkit-scrollbar { display: none; }
.home-chip {
  flex: none;
  min-height: 32px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--dim);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  transition: color 0.16s, border-color 0.16s, background 0.16s;
  touch-action: manipulation;
}
.home-chip.active {
  color: var(--text);
  border-color: var(--line-2);
  background: var(--surface-3);
}

.resume {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 8px 0 2px;
  padding: 10px 13px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.02));
  transition: transform 0.12s, border-color 0.16s;
}
.resume:active { transform: scale(0.985); }
.resume .g-tile { width: 36px; height: 36px; border-radius: 10px; font-size: 15px; }
.resume-mid { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.resume-k { font-size: 9.5px; color: var(--faint); letter-spacing: 0.06em; }
.resume-n { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resume-s { font-size: 11px; color: var(--dim); flex: none; max-width: 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resume-arrow { color: var(--faint); font-size: 18px; line-height: 1; flex: none; }

.cat-sec { margin-top: 20px; animation: fadeIn 0.3s ease both; }
.cat-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 2px 9px;
  min-height: 18px;
}
.cat-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.cat-name { font-size: 13px; font-weight: 700; letter-spacing: 0.02em; }
.cat-desc {
  font-size: 10.5px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40%;
}
.cat-count {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  flex: none;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.g-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-height: 104px;
  padding: 13px 6px 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(158deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.02));
  overflow: hidden;
  transition: transform 0.14s ease, border-color 0.18s ease;
  animation: cardIn 0.36s cubic-bezier(0.22, 0.9, 0.3, 1) both;
  animation-delay: var(--d, 0ms);
}
.g-card::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -46px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.14;
  filter: blur(8px);
  pointer-events: none;
}
.g-card:active { transform: scale(0.965); }
@media (hover: hover) and (pointer: fine) {
  .g-card:hover { transform: translateY(-2px); border-color: var(--line-2); }
}
.g-tile {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  background: linear-gradient(150deg, var(--accent), var(--accent2));
  box-shadow: 0 8px 18px -8px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.26);
  flex: none;
}
.g-tile.xs { font-size: 13.5px; letter-spacing: -0.04em; }
.g-name {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.g-state {
  margin-top: -2px;
  max-width: 100%;
  font-size: 9.5px;
  line-height: 1.2;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.home-result-hint {
  margin: 12px 2px 10px;
  font-size: 11.5px;
  color: var(--faint);
}
.home-empty {
  margin: 26px 0 10px;
  text-align: center;
  font-size: 12px;
  color: var(--faint);
  line-height: 1.7;
}

@media (min-width: 700px) {
  .home { max-width: 760px; }
  .game-grid { grid-template-columns: repeat(4, 1fr); }
  .brand { font-size: 30px; }
}

@media (max-width: 359px) {
  .game-grid { gap: 8px; }
  .g-card { min-height: 98px; padding: 11px 4px 9px; }
  .g-tile { width: 40px; height: 40px; font-size: 16.5px; }
  .g-name { font-size: 11.5px; }
}

/* 分享链接输入框 */
.share-url {
  width: 100%;
  height: 44px;
  margin-top: 10px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
}
.share-url:focus { border-color: var(--accent); }
