:root {
  color-scheme: light;
  --canvas: #f2f2ed;
  --paper: #fbfbf8;
  --ink: #171816;
  --muted: #777a73;
  --soft: #a8aaa3;
  --line: #dcdcd5;
  --line-strong: #c8c9c1;
  --accent: #e94f1d;
  --accent-soft: #fff0e9;
  --sidebar: #1b1c1a;
  --sidebar-muted: #989b93;
  --sidebar-line: #30312e;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { background: var(--canvas); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-user-select: none;
  user-select: none;
}
button, input { font: inherit; }
button { color: inherit; -webkit-tap-highlight-color: transparent; }
button, label { touch-action: manipulation; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 246px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 18px 22px;
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  color: #f2f2ee;
  border-right: 1px solid #11120f;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; }
.brand-mark {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: -.04em;
}
.brand strong { display: block; font-size: 14px; letter-spacing: .01em; }
.brand span:last-child { display: block; margin-top: 3px; color: var(--sidebar-muted); font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }
.category-nav { display: grid; gap: 4px; }
.nav-item {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--sidebar-muted);
  text-align: left;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.nav-item:hover { color: #fff; background: #242522; }
.nav-item.active { color: #fff; background: #272825; border-color: #383a35; }
.nav-icon { width: 26px; height: 26px; display: grid; place-items: center; }
.nav-icon svg { width: 18px; height: 18px; }
.nav-copy { min-width: 0; }
.nav-copy b { display: block; font-size: 13px; font-weight: 650; }
.nav-copy small { display: block; margin-top: 2px; color: #73766f; font-size: 10px; letter-spacing: .025em; }
.nav-count { color: #70736c; font-size: 11px; font-variant-numeric: tabular-nums; }
.nav-item.active .nav-count { color: #b9bbb4; }
.sidebar-foot { margin-top: auto; padding: 18px 8px 2px; border-top: 1px solid var(--sidebar-line); color: #767970; font-size: 10px; line-height: 1.6; }
.status-line { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; color: #a7aaa2; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #7dbb72; box-shadow: 0 0 0 3px rgba(125,187,114,.1); }

.workspace { min-width: 0; display: flex; min-height: 100vh; flex-direction: column; }
.topbar {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(242,242,237,.94);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar-note { color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.mobile-brand { display: none; }
.content { width: min(1120px, calc(100% - 68px)); margin: 0 auto; padding: 68px 0 80px; }
.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 42px; }
.kicker { margin: 0 0 13px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
h1 { margin: 0; font-size: clamp(42px, 5vw, 68px); line-height: .95; letter-spacing: -.065em; font-weight: 780; }
.intro-copy { margin: 17px 0 0; color: var(--muted); font-size: 14px; }
.intro-stat { text-align: right; line-height: 1; }
.intro-stat span { display: block; font-size: clamp(32px, 4vw, 52px); font-weight: 300; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.intro-stat small { display: block; margin-top: 8px; color: var(--soft); font-size: 9px; font-weight: 800; letter-spacing: .18em; }

.controls { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.search-field {
  min-width: 0;
  flex: 1;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-field:focus-within { border-color: #9b9d95; box-shadow: 0 0 0 3px rgba(23,24,22,.055); }
.search-field svg { width: 18px; height: 18px; color: #676a63; }
.search-field input { flex: 1; min-width: 0; height: 48px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; user-select: text; -webkit-user-select: text; }
.search-field input::placeholder { color: #999b95; }
kbd { min-width: 25px; padding: 3px 6px; border: 1px solid #d4d5ce; border-bottom-color: #b8bab2; border-radius: 5px; background: #f4f4f0; color: #84867f; font-family: inherit; font-size: 10px; line-height: 1.2; text-align: center; }
.clear-btn {
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: transparent;
  color: #5d605a;
  cursor: pointer;
}
.clear-btn:hover { border-color: #9b9d95; color: var(--ink); }
.mobile-categories { display: none; }
.results-head { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 11px; border-bottom: 1px solid var(--line-strong); }
.inline-action { border: 0; padding: 5px 0; background: transparent; color: #61645d; font-size: 11px; cursor: pointer; }
.inline-action:hover { color: var(--accent); }

.game-list { background: var(--paper); border-bottom: 1px solid var(--line-strong); }
.card { border-top: 1px solid var(--line); }
.card:first-child { border-top: 0; }
.card-head {
  width: 100%;
  min-height: 67px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 86px 118px 28px;
  align-items: center;
  gap: 14px;
  padding: 9px 14px 9px 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background .12s ease;
}
.card-head:hover { background: #f6f6f2; }
.row-index { align-self: stretch; display: grid; place-items: center; border-right: 1px solid #e7e7e1; color: #acaea7; font-size: 10px; font-variant-numeric: tabular-nums; }
.name { min-width: 0; overflow-wrap: anywhere; color: #1d1e1b; font-size: 14px; font-weight: 620; line-height: 1.45; letter-spacing: -.008em; }
.tag { justify-self: start; color: #7b7e77; font-size: 10px; }
.version-count { color: #8c8e88; font-size: 10px; white-space: nowrap; text-align: right; }
.chev { display: grid; place-items: center; color: #999b95; transition: transform .15s ease, color .15s ease; }
.chev svg { width: 15px; height: 15px; }
.card.open .chev { transform: rotate(180deg); color: var(--ink); }
.extra { display: none; margin-left: 54px; padding: 0 54px 22px 14px; }
.card.open .extra { display: block; }
.extra-label { margin: 0 0 9px; color: #a0a29b; font-size: 9px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.version-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); border-top: 1px solid #e3e3dd; }
.version { min-width: 0; padding: 10px 12px 10px 0; border-bottom: 1px solid #e3e3dd; color: #5d6059; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.version:nth-child(odd) { padding-right: 20px; }
mark { background: #ffe2d3; color: #8e2f0f; border-radius: 2px; padding: 0 1px; }

.empty, .notice { padding: 64px 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: #868981; background: var(--paper); text-align: center; font-size: 13px; }
.error { color: #a13a2a; background: #fff7f4; }
.load-more-wrap { display: flex; justify-content: center; padding-top: 28px; }
.load-more { min-width: 146px; height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 7px; background: transparent; color: #555851; font-size: 12px; cursor: pointer; }
.load-more:hover { background: var(--paper); border-color: #aeb0a8; color: var(--ink); }
.load-more svg { width: 14px; height: 14px; }
.footer { margin-top: auto; min-height: 68px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 34px; border-top: 1px solid var(--line); color: #999b95; font-size: 10px; }
.footer kbd { margin: 0 2px; }

@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .topbar { height: 62px; justify-content: space-between; padding: 0 20px; }
  .mobile-brand { display: flex; align-items: center; gap: 9px; font-size: 13px; }
  .mobile-brand .brand-mark { width: 28px; height: 28px; border-radius: 7px; font-size: 13px; }
  .topbar-note { font-size: 9px; }
  .content { width: min(100% - 40px, 760px); padding: 44px 0 64px; }
  .intro { margin-bottom: 30px; }
  .mobile-categories { display: flex; gap: 5px; overflow-x: auto; margin: 0 0 17px; padding: 0 0 2px; scrollbar-width: none; }
  .mobile-categories::-webkit-scrollbar { display: none; }
  .mobile-tab { flex: 0 0 auto; height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: #767972; font-size: 11px; cursor: pointer; }
  .mobile-tab.active { border-color: var(--ink); background: var(--ink); color: #fff; }
}

@media (max-width: 640px) {
  .topbar-note { display: none; }
  .content { width: calc(100% - 28px); padding-top: 34px; }
  .intro { align-items: flex-start; margin-bottom: 24px; }
  .kicker { margin-bottom: 10px; }
  h1 { font-size: 42px; }
  .intro-copy { max-width: 240px; margin-top: 12px; font-size: 12px; line-height: 1.5; }
  .intro-stat span { font-size: 30px; }
  .intro-stat small { font-size: 8px; }
  .controls { gap: 6px; }
  .search-field { height: 48px; }
  .search-field input { height: 44px; font-size: 13px; }
  .clear-btn { height: 48px; padding: 0 12px; font-size: 12px; }
  .search-field kbd { display: none; }
  .results-head { font-size: 10px; }
  .card-head { min-height: 64px; grid-template-columns: 38px minmax(0,1fr) 86px 22px; gap: 9px; padding-right: 8px; }
  .row-index { font-size: 9px; }
  .name { font-size: 13px; }
  .tag { display: none; }
  .version-count { font-size: 9px; }
  .extra { margin-left: 38px; padding: 0 12px 18px 10px; }
  .version-list { grid-template-columns: 1fr; }
  .version:nth-child(odd) { padding-right: 0; }
  .footer { padding: 17px 14px; flex-direction: column; align-items: flex-start; }
  .footer span:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
