:root {
  color-scheme: dark;
  --bg: #080e1c;
  --bg-soft: #0d1628;
  --panel: #111c32;
  --panel-2: #17253f;
  --line: rgba(148, 163, 184, .16);
  --line-strong: rgba(148, 163, 184, .28);
  --text: #edf3ff;
  --muted: #91a4c7;
  --accent: #5eead4;
  --accent-2: #38bdf8;
  --warm: #fbbf24;
  --danger: #fb7185;
  --shadow: 0 18px 50px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; background:
    radial-gradient(1200px 500px at 15% -10%, rgba(56, 189, 248, .14), transparent 55%),
    radial-gradient(900px 400px at 95% 0%, rgba(94, 234, 212, .08), transparent 55%),
    var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
img { background: var(--panel-2); }
[hidden] { display: none !important; }
.hero {
  max-width: 1180px; margin: 0 auto; padding: 22px 18px 0;
}
.hero-top { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 7px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.brand em { color: var(--muted); font-style: normal; font-weight: 500; letter-spacing: 0; border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; }
.brand-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.icon-button {
  border: 1px solid var(--line); background: rgba(17, 28, 50, .7); color: var(--text);
  width: 38px; height: 38px; border-radius: 12px; cursor: pointer; display: inline-grid; place-items: center;
}
.icon-button:active { transform: scale(.96); }
.refresh-icon { font-size: 18px; line-height: 1; }
.hero-copy { padding: 22px 0 16px; }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .22em; }
.hero h1 { margin: 0; font-size: 34px; line-height: 1.1; letter-spacing: -.02em; }
.subtitle { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.hero-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden;
  border: 1px solid var(--line); background: var(--line); border-radius: 16px;
}
.hero-stats > div { background: rgba(13, 22, 40, .92); padding: 11px 12px; min-width: 0; }
.hero-stats strong { display: block; font-size: 20px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-stats span { color: var(--muted); font-size: 10px; }
.hero-updated { display: none; }
.toolbar {
  position: sticky; top: 0; z-index: 10; margin-top: 14px; padding: 10px 18px 9px;
  background: rgba(8, 14, 28, .88); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line);
}
.search-row, .filter-scroll, .board-tabs { max-width: 1180px; margin-left: auto; margin-right: auto; }
.search-row { display: flex; gap: 8px; }
.search {
  flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: 0 12px;
  color: var(--muted);
}
.search:focus-within { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(56, 189, 248, .1); }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text); padding: 11px 0; }
.favorites-toggle {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  border-radius: 12px; padding: 0 11px; cursor: pointer; font-size: 12px;
}
.favorites-toggle[aria-pressed="true"] { color: var(--warm); border-color: rgba(251, 191, 36, .5); background: rgba(251, 191, 36, .08); }
.filter-scroll { display: flex; align-items: center; gap: 9px; margin-top: 9px; overflow-x: auto; scrollbar-width: none; }
.filter-scroll::-webkit-scrollbar { display: none; }
.chip-group { display: flex; gap: 6px; flex: 0 0 auto; }
.divider { width: 1px; height: 18px; background: var(--line); flex: 0 0 auto; }
.chip {
  border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px;
  padding: 5px 11px; white-space: nowrap; cursor: pointer; font-size: 12px;
}
.chip.is-active { background: var(--accent); border-color: var(--accent); color: #042f2e; font-weight: 800; }
.board-tabs {
  display: flex; gap: 3px; margin-top: 9px; padding: 3px; border: 1px solid var(--line);
  background: rgba(17, 28, 50, .65); border-radius: 12px;
}
.board-tab {
  flex: 1; border: 0; background: transparent; color: var(--muted); padding: 7px 6px; border-radius: 9px;
  cursor: pointer; font-size: 12px; font-weight: 600;
}
.board-tab.is-active { background: var(--panel-2); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.04) inset; }
main { max-width: 1180px; margin: 0 auto; padding: 14px 18px 40px; }
.list-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 2px 0 12px; }
.list-head h2 { margin: 0; font-size: 18px; }
.list-head p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.result-count { color: var(--muted); font-size: 11px; white-space: nowrap; }
.grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.card {
  position: relative; display: flex; flex-direction: column; text-align: left; padding: 0; overflow: hidden;
  border: 1px solid var(--line); background: var(--panel); color: inherit; border-radius: 16px; cursor: pointer;
  box-shadow: 0 1px 0 rgba(255,255,255,.025) inset;
}
.card:active { transform: scale(.995); }
.cover-wrap { position: relative; height: 0; padding-top: 56.25%; overflow: hidden; background: var(--panel-2); }
.cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.card:hover .cover { transform: scale(1.03); }
.rank {
  position: absolute; left: 9px; top: 9px; min-width: 27px; height: 27px; padding: 0 7px;
  display: inline-grid; place-items: center; border-radius: 8px; background: rgba(2, 6, 23, .78);
  border: 1px solid rgba(255,255,255,.14); color: #fff; font-size: 12px; font-weight: 800; backdrop-filter: blur(8px);
}
.rank.top { background: var(--accent); color: #032f2b; border-color: transparent; }
.cover-badge {
  position: absolute; right: 9px; bottom: 9px; border-radius: 7px; padding: 2px 7px;
  background: rgba(2,6,23,.78); color: #dbeafe; font-size: 10px; backdrop-filter: blur(8px);
}
.favorite {
  position: absolute; right: 9px; top: 9px; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.16); background: rgba(2,6,23,.68); color: #dbeafe;
  font-size: 16px; cursor: pointer; backdrop-filter: blur(8px);
}
.favorite.is-active { color: var(--warm); border-color: rgba(251,191,36,.55); }
.card-body { padding: 10px 12px 12px; min-width: 0; }
.card-kicker { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; margin-bottom: 4px; }
.platform-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); flex: 0 0 auto; }
.platform-dot.douyin { background: var(--danger); }
.card-title { margin: 0 0 6px; font-size: 14px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 40px; }
.card-creator { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-stats { display: flex; gap: 12px; margin-top: 8px; color: var(--muted); font-size: 11px; }
.card-stats strong { color: #dbeafe; font-weight: 600; }
.card-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.tag { border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 1px 7px; font-size: 10px; }
.tag.quality { color: var(--accent); border-color: rgba(94,234,212,.3); }
.tag.growth { color: var(--warm); border-color: rgba(251,191,36,.35); }
.skeleton-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.skeleton-card { height: 260px; border-radius: 16px; background: linear-gradient(100deg, var(--panel) 20%, var(--panel-2) 38%, var(--panel) 56%); background-size: 220% 100%; animation: shimmer 1.5s infinite linear; }
@keyframes shimmer { to { background-position: -220% 0; } }
.empty, .error { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty-icon { font-size: 34px; color: var(--accent-2); margin-bottom: 8px; }
.empty h3 { color: var(--text); margin: 0 0 4px; font-size: 17px; }
.empty p, .error p { margin: 0 0 16px; font-size: 12px; }
.primary-button { border: 0; background: var(--accent); color: #042f2e; border-radius: 10px; padding: 9px 16px; font-weight: 800; cursor: pointer; }
.detail { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.detail-backdrop { position: absolute; inset: 0; background: rgba(2, 6, 23, .72); backdrop-filter: blur(4px); }
.detail-panel {
  position: relative; width: min(760px, 100%); max-height: 92vh; overflow-y: auto; z-index: 1;
  background: var(--bg-soft); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 22px 22px 0 0; padding: 8px 18px calc(30px + env(safe-area-inset-bottom)); box-shadow: var(--shadow);
}
.detail-handle { width: 42px; height: 4px; border-radius: 99px; background: var(--line-strong); margin: 2px auto 8px; }
.detail-close { position: absolute; right: 14px; top: 14px; z-index: 2; }
.detail-cover { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 15px; display: block; margin: 10px 0 14px; }
.detail h2 { margin: 6px 44px 6px 0; font-size: 20px; line-height: 1.42; }
.byline { color: var(--muted); font-size: 11px; margin-bottom: 12px; }
.detail-section { border-top: 1px solid var(--line); padding-top: 13px; margin-top: 13px; }
.detail-section h3 { margin: 0 0 9px; font-size: 13px; }
.detail-description { color: #c7d5ee; font-size: 12px; white-space: pre-wrap; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.metric { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 8px 9px; }
.metric strong { display: block; font-size: 16px; }
.metric span { color: var(--muted); font-size: 10px; }
.metric small { color: var(--accent); font-size: 9px; display: block; margin-top: 1px; }
.metric small.negative { color: var(--danger); }
.links { display: grid; gap: 7px; }
.link {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; text-decoration: none;
  border: 1px solid var(--line); background: var(--panel); color: var(--accent-2); border-radius: 11px; padding: 9px 11px; font-size: 12px;
}
.link small { color: var(--muted); font-size: 10px; }
.detail-actions { display: flex; gap: 8px; margin-top: 14px; }
.detail-actions .primary-button { flex: 1; text-align: center; text-decoration: none; display: inline-block; }
.secondary-button { flex: 1; border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 10px; padding: 9px 14px; cursor: pointer; text-align: center; text-decoration: none; }
.favorite-detail.is-active { color: var(--warm); border-color: rgba(251,191,36,.5); }
.note { color: var(--muted); font-size: 10px; margin-top: 9px; }
.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: rgba(2, 6, 23, .92); border: 1px solid var(--line); color: var(--text);
  border-radius: 999px; padding: 8px 15px; font-size: 12px; z-index: 40; box-shadow: var(--shadow);
}
@media (min-width: 640px) {
  .grid, .skeleton-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { padding-left: 24px; padding-right: 24px; }
  .toolbar { padding-left: 24px; padding-right: 24px; }
  main { padding-left: 24px; padding-right: 24px; }
  .hero-stats { grid-template-columns: repeat(4, 1fr); }
  .hero-updated { display: block; }
  .hero h1 { font-size: 40px; }
}
@media (min-width: 1020px) {
  .grid, .skeleton-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { padding-top: 30px; }
  .hero-copy { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
  .hero-copy .subtitle { max-width: 460px; }
  .detail { align-items: center; padding: 18px; }
  .detail-panel { border-radius: 20px; border-bottom: 1px solid var(--line); max-height: 88vh; }
  .detail-handle { display: none; }
}
