/* ============================================================
   GameHub 游戏平台导航 - 样式
   设计基调：暗色优先 + 单一 teal 强调色，中性灰底，
   真实品牌 favicon，克制动效（仅 transform/opacity）。
   ============================================================ */

:root {
  --bg: #0a0d13;
  --bg-2: #0e1219;
  --surface: #131a25;
  --surface-2: #1a222f;
  --border: #232c3b;
  --text: #e8edf5;
  --muted: #93a0b4;
  --accent: #34d399;
  --accent-2: #10b981;
  --ring: rgba(52, 211, 153, 0.35);
  --radius: 14px;
  --r-tile: 12px;
  --r-pill: 999px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --maxw: 1180px;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.6);
}

html[data-theme="light"] {
  --bg: #f4f7fb;
  --bg-2: #eef2f8;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --border: #e3e8f0;
  --text: #0e141f;
  --muted: #5b6675;
  --accent: #059669;
  --accent-2: #047857;
  --ring: rgba(5, 150, 105, 0.28);
  --shadow: 0 16px 36px -20px rgba(15, 30, 50, 0.25);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  background:
    radial-gradient(900px 480px at 88% -8%, rgba(52, 211, 153, 0.10), transparent 60%),
    radial-gradient(720px 420px at -5% 0%, rgba(16, 185, 129, 0.08), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 68px;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  color: #04130d;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px var(--ring);
  font-size: 20px;
}
.brand-text {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.2px;
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.brand-text small {
  font-weight: 600;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.5px;
}
.nav-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.nav-links a {
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition: color 0.18s, background 0.18s;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.icon-btn {
  width: 40px; height: 40px;
  flex: none;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 18px;
  display: grid; place-items: center;
  transition: border-color 0.18s, transform 0.18s;
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn:active { transform: scale(0.95); }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
  padding: 72px 22px 40px;
}
.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(36px, 6vw, 62px);
  font-weight: 850;
  letter-spacing: -1.5px;
  line-height: 1.04;
}
.hero .sub {
  margin: 0 0 26px;
  max-width: 46ch;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 14px;
  height: 56px;
  transition: border-color 0.18s, box-shadow 0.18s;
  box-shadow: var(--shadow);
}
.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--ring);
}
.search > i { font-size: 19px; color: var(--muted); }
.search input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  outline: none;
  min-width: 0;
}
.search input::placeholder { color: var(--muted); }
.search .clear {
  border: none;
  background: var(--surface-2);
  color: var(--muted);
  width: 30px; height: 30px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 15px;
  display: grid; place-items: center;
}
.search .clear:hover { color: var(--text); }

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.hero-tags li {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
}
.hero-tags .dot { display: none; }

/* Hero side panel */
.hero-side {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.side-head {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.quick li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  border-radius: 12px;
  transition: background 0.16s, transform 0.16s;
}
.quick li + li a { border-top: 1px solid var(--border); border-radius: 0; }
.quick li a:hover { background: var(--surface-2); transform: translateX(3px); }
.quick .q-logo {
  width: 36px; height: 36px;
  flex: none;
  border-radius: var(--r-tile);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  overflow: hidden;
}
.quick .q-logo img { width: 24px; height: 24px; object-fit: contain; }
.quick .q-name { font-weight: 700; font-size: 15px; }
.quick .q-go { margin-left: auto; color: var(--muted); font-size: 16px; }
.quick li a:hover .q-go { color: var(--accent); }
.side-foot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}
.side-foot:hover { gap: 10px; }

/* ---------- Chips ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: center;
  padding-top: 8px;
  padding-bottom: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.16s, border-color 0.16s, background 0.16s;
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active {
  color: #04130d;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
}
.chip .count {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.14);
  padding: 1px 7px;
  border-radius: var(--r-pill);
}
.chip:not(.active) .count { background: var(--surface-2); color: var(--muted); }

/* ---------- Directory ---------- */
.directory { padding: 28px 22px 24px; }
.dir-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.dir-head h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.3px; }
.dir-count { color: var(--muted); font-size: 14px; }
.dir-count b { color: var(--accent); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 14px;
}
.card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.18s var(--ease), border-color 0.18s, box-shadow 0.18s;
  /* 入场动效初始态 */
  opacity: 0;
  transform: translateY(14px);
}
.card.in {
  opacity: 1;
  transform: none;
  transition: transform 0.18s var(--ease), border-color 0.18s, box-shadow 0.18s,
    opacity 0.5s var(--ease);
}
.card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--brand, var(--accent));
  opacity: 0.9;
}
.card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--brand, var(--accent)) 55%, var(--border));
  box-shadow: 0 14px 30px -16px color-mix(in srgb, var(--brand, var(--accent)) 60%, transparent);
}
.logo {
  flex: none;
  width: 44px; height: 44px;
  border-radius: var(--r-tile);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  overflow: hidden;
}
.logo img { width: 30px; height: 30px; object-fit: contain; }
.logo-fallback {
  width: 100%; height: 100%;
  display: none;
  align-items: center; justify-content: center;
  font-size: 20px;
}
.logo-fallback img.mono {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: block;
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.meta .name {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.meta .desc {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.go {
  color: var(--muted);
  font-size: 17px;
  opacity: 0;
  transform: translateX(-4px);
  transition: 0.18s var(--ease);
}
.card:hover .go { opacity: 1; color: var(--accent); transform: none; }
.fav {
  position: absolute;
  top: 8px; right: 8px;
  width: 26px; height: 26px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  opacity: 0;
  z-index: 2;
  display: grid; place-items: center;
  transition: 0.16s;
}
.card:hover .fav { opacity: 1; }
.fav.on { opacity: 1; color: #fbbf24; }
.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 64px 0;
  font-size: 16px;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 26px 0 44px;
  color: var(--muted);
  font-size: 13px;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.site-footer a { color: var(--accent); font-weight: 600; }
.site-footer .sep {
  width: 1px; height: 13px;
  background: var(--border);
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 48px;
  }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
  }
  .chip { scroll-snap-align: start; }
  .meta .desc { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .card { opacity: 1 !important; transform: none !important; transition: none !important; }
  * { scroll-behavior: auto !important; }
}
