/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', sans-serif;
  background: #080c16;
  color: #c8d4e8;
  min-height: 100vh;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1e2d4a; border-radius: 3px; }

/* ===== HEADER ===== */
.banner {
  position: sticky; top: 0; z-index: 100;
  background: rgba(8,12,22,0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,180,255,0.1);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Brand */
.brand {
  display: flex; align-items: center; gap: 6px;
  font-size: 20px; font-weight: 800; white-space: nowrap;
  letter-spacing: -0.3px;
  flex-shrink: 0;
}
.brand-main {
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.brand-zoo {
  background: linear-gradient(135deg, #a78bfa, #f472b6);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 900;
}

/* Search */
.search-bar {
  flex: 1;
  max-width: 500px;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(56,189,248,0.18);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
  height: 38px;
}
.search-bar:focus-within {
  border-color: rgba(56,189,248,0.45);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.07);
}
.stab {
  background: none; border: none; cursor: pointer;
  padding: 0 13px; height: 38px;
  font-size: 12px; font-weight: 500; color: #4a5a7a;
  border-right: 1px solid rgba(56,189,248,0.1);
  transition: all .18s; white-space: nowrap; flex-shrink: 0;
}
.stab.active { color: #38bdf8; background: rgba(56,189,248,0.08); }
.stab:hover:not(.active) { color: #94a3b8; }
#searchInput {
  flex: 1; background: none; border: none; outline: none;
  padding: 0 12px; height: 38px;
  font-size: 13px; color: #c8d4e8;
  font-family: inherit;
}
#searchInput::placeholder { color: #3a4a6a; }
#searchBtn {
  background: none; border: none; cursor: pointer;
  padding: 0 14px; height: 38px;
  font-size: 15px; color: #38bdf8;
  border-left: 1px solid rgba(56,189,248,0.1);
  transition: background .18s; flex-shrink: 0;
}
#searchBtn:hover { background: rgba(56,189,248,0.1); }

/* Header right */
.header-right {
  display: flex; flex-direction: column;
  align-items: flex-end; gap: 2px;
  flex-shrink: 0; margin-left: auto;
}
.lang-toggle { display: flex; gap: 4px; }
.lang-btn {
  padding: 3px 11px;
  border-radius: 20px;
  border: 1px solid rgba(99,179,237,0.25);
  background: transparent;
  color: #64748b;
  font-size: 11px; font-weight: 500;
  cursor: pointer;
  transition: all .18s;
  font-family: inherit;
}
.lang-btn:hover { border-color: #38bdf8; color: #38bdf8; }
.lang-btn.active {
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}
.tagline {
  font-size: 11px; color: #2a3a5a;
  white-space: nowrap;
}

/* ===== LAYOUT ===== */
.layout {
  display: flex;
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 16px;
  gap: 0;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 180px;
  flex-shrink: 0;
  padding: 24px 0;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,0.04);
}
.sidebar::-webkit-scrollbar { width: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  font-size: 13px; color: #4a5a7a;
  cursor: pointer;
  border-radius: 8px;
  margin: 1px 8px;
  transition: all .18s;
  user-select: none;
}
.nav-item:hover { color: #94a3b8; background: rgba(255,255,255,0.04); }
.nav-item.active {
  color: #38bdf8;
  background: rgba(56,189,248,0.08);
  font-weight: 600;
}
.nav-emoji { font-size: 15px; }

/* ===== MAIN CONTENT ===== */
main#sections {
  flex: 1;
  padding: 28px 28px 60px;
  min-width: 0;
}

/* ===== SECTION ===== */
.section { margin-bottom: 52px; }

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(56,189,248,0.1);
}
.section-emoji { font-size: 22px; line-height: 1; }
.section-title {
  font-size: 18px; font-weight: 700;
  color: #e2e8f0;
  letter-spacing: -0.2px;
}
.section-desc {
  font-size: 12px; color: #374151;
  flex: 1;
  margin-left: 4px;
}
.section-count {
  font-size: 11px; color: #2a3a5a;
  background: rgba(56,189,248,0.06);
  border: 1px solid rgba(56,189,248,0.1);
  border-radius: 20px;
  padding: 2px 10px;
  white-space: nowrap;
}

/* ===== CARDS GRID ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

/* ===== CARD ===== */
.card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 14px 12px;
  background: rgba(15,20,35,0.8);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  cursor: pointer;
  transition: all .2s;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  opacity: 0;
  transition: opacity .2s;
}
.card:hover {
  border-color: rgba(56,189,248,0.3);
  background: rgba(20,28,50,0.9);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3), 0 0 0 1px rgba(56,189,248,0.15);
}
.card:hover::before { opacity: 1; }

.card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
}
.card-icon {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 16px;
}
.card-icon img {
  width: 20px; height: 20px;
  border-radius: 4px;
  object-fit: contain;
}
.card-name {
  font-size: 13px; font-weight: 600;
  color: #dde6f5;
  flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-tag {
  font-size: 10px; font-weight: 500;
  padding: 1px 7px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.tag-cloud { background: rgba(56,189,248,0.12); color: #38bdf8; border: 1px solid rgba(56,189,248,0.2); }
.tag-local { background: rgba(52,211,153,0.12); color: #34d399; border: 1px solid rgba(52,211,153,0.2); }
.tag-free  { background: rgba(167,139,250,0.12); color: #a78bfa; border: 1px solid rgba(167,139,250,0.2); }
.tag-hot   { background: rgba(251,113,133,0.12); color: #fb7185; border: 1px solid rgba(251,113,133,0.2); }

.card-desc {
  font-size: 11.5px;
  color: #4a5a7a;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card:hover .card-desc { color: #64748b; }

/* ===== EXPAND BUTTON ===== */
.expand-wrap {
  display: flex; justify-content: center;
  margin-top: 14px;
}
.expand-btn {
  background: rgba(56,189,248,0.05);
  border: 1px solid rgba(56,189,248,0.18);
  border-radius: 20px;
  padding: 6px 22px;
  font-size: 12px; color: #38bdf8;
  cursor: pointer; transition: all .18s;
  display: flex; align-items: center; gap: 6px;
  font-family: inherit;
}
.expand-btn:hover {
  background: rgba(56,189,248,0.1);
  box-shadow: 0 0 16px rgba(56,189,248,0.12);
}
.hidden-cards { display: none; }
.hidden-cards.expanded { display: grid; margin-top: 10px; }

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 28px;
  border-top: 1px solid rgba(255,255,255,0.04);
  font-size: 12px; color: #1e2d4a;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .layout { padding: 0 12px; }
  main#sections { padding: 20px 0 40px; }
  .banner { padding: 0 16px; gap: 12px; }
  .tagline { display: none; }
  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
}
@media (max-width: 600px) {
  .header-right .tagline { display: none; }
  .search-bar { max-width: none; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
}
