:root {
  --bg: #0b0b0f; --surface: #16161c; --surface-2: #1f1f27; --line: #2a2a33;
  --text: #ededf0; --muted: #9a9aa6; --primary: #8b7bff; --primary-2: #6d5cf0;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
.wrap { width: 100%; max-width: 1680px; margin: 0 auto; padding: 0 16px; }
.main { flex: 1; padding: 18px 0 40px; }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #3d3d48; background: #262630; }
.btn-primary { background: var(--primary-2); border-color: var(--primary-2); color: #fff; }
.btn-primary:hover { background: var(--primary); border-color: var(--primary); }
[hidden] { display: none !important; }

/* ---------- 顶栏 ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(11, 11, 15, .82); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid rgba(255,255,255,.06); padding-top: env(safe-area-inset-top); }
.topbar-inner { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; flex: none; }
.brand-logo { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, #ff5f6d, #845ef7 55%, #0a84ff); display: flex; align-items: center; justify-content: center; color: #fff; flex: none; }
.brand-logo svg { width: 20px; height: 20px; }
.type-nav { display: flex; gap: 4px; background: var(--surface); border-radius: 10px; padding: 3px; }
.type-nav a { padding: 5px 14px; border-radius: 8px; color: var(--muted); font-size: 14px; }
.type-nav a:hover { color: var(--text); }
.type-nav a.active { background: var(--surface-2); color: var(--text); font-weight: 500; }
.search { margin-left: auto; position: relative; width: 280px; }
.search svg { position: absolute; left: 11px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { width: 100%; height: 38px; padding: 0 12px 0 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; -webkit-appearance: none; appearance: none; }
.search input:focus { outline: none; border-color: var(--primary); }

/* ---------- 标签 / 提示 ---------- */
.notice { color: var(--muted); margin: 4px 0 16px; max-width: 760px; }
.tags { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; scrollbar-width: none; }
.tags::-webkit-scrollbar { display: none; }
.tags a { flex: none; padding: 5px 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.tags a:hover { color: var(--text); }
.tags a.active { background: var(--text); border-color: var(--text); color: var(--bg); }
.result-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; }
.result-head h1 { font-size: 20px; margin: 0; }
.result-head a { color: var(--primary); font-size: 14px; }
.empty { text-align: center; color: var(--muted); padding: 90px 0; }

/* ---------- 瀑布流 ---------- */
.grid { display: flex; gap: 12px; align-items: flex-start; }
.col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.card { display: block; position: relative; border-radius: 12px; overflow: hidden; background: var(--surface); outline-offset: 2px; }
.card-media { position: relative; overflow: hidden; background: var(--surface); }
.card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s, transform .4s; }
.card-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; pointer-events: none; }
.card-media.loaded img, .card-media.loaded video { opacity: 1; }
.card:hover .card-media img { transform: scale(1.03); }
.no-thumb { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
.play-icon { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: rgba(0,0,0,.45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); border: 1px solid rgba(255,255,255,.25); }
.play-icon::after { content: ""; position: absolute; left: 18px; top: 14px; border-left: 14px solid #fff; border-top: 9px solid transparent; border-bottom: 9px solid transparent; }
.card .badge { position: absolute; right: 8px; bottom: 8px; padding: 1px 7px; border-radius: 6px; background: rgba(0,0,0,.6); font-size: 12px; font-variant-numeric: tabular-nums; }
.card-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 12px 10px; background: linear-gradient(transparent, rgba(0,0,0,.72)); opacity: 0; transition: opacity .2s; pointer-events: none; }
.card.is-video .card-cap { padding-right: 64px; }
.card:hover .card-cap, .card:focus-visible .card-cap { opacity: 1; }
.card-title { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loader { display: flex; justify-content: center; padding: 28px 0; }
.loader span { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.plain-list { columns: 2; }

/* ---------- 预览浮层 ---------- */
html.lb-open { overflow: hidden; }
.lb { position: fixed; inset: 0; z-index: 100; background: rgba(5, 5, 8, .96); display: none; flex-direction: column; }
.lb.show { display: flex; }
.lb-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 56px 72px 12px; overflow: auto; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; background: #000; }
.lb-stage img { cursor: zoom-in; }
.lb-stage img.zoomed { max-width: none; max-height: none; cursor: zoom-out; margin: auto; }
.lb-btn { position: absolute; border: 0; background: rgba(255,255,255,.08); color: #fff; width: 48px; height: 48px; border-radius: 50%; font-size: 30px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0 0 3px; }
.lb-btn:hover { background: rgba(255,255,255,.18); }
.lb-btn:disabled { opacity: .2; cursor: default; }
.lb-close { top: calc(10px + env(safe-area-inset-top)); right: 12px; width: 42px; height: 42px; font-size: 28px; }
.lb-prev, .lb-next { top: 50%; margin-top: -24px; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lb-info { display: flex; gap: 20px; align-items: flex-end; justify-content: space-between; padding: 12px 24px calc(18px + env(safe-area-inset-bottom)); max-height: 34vh; overflow: auto; }
.lb-text { min-width: 0; }
.lb-info h2 { font-size: 17px; margin: 0; }
.lb-meta { color: var(--muted); font-size: 13px; margin: 2px 0 0; }
.lb-desc { font-size: 14px; color: #c9c9d1; margin: 8px 0 0; white-space: pre-line; max-width: 820px; }
.lb-tags { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; }
.lb-tags:empty { display: none; }
.lb-tags a, .detail-tags a { color: var(--primary); }
.lb-actions { display: flex; gap: 8px; flex: none; }

/* ---------- 详情页 ---------- */
.detail { max-width: 1280px; }
.detail-stage { display: flex; justify-content: center; background: #000; border-radius: 14px; overflow: hidden; }
.detail-stage img, .detail-stage video { display: block; max-width: 100%; max-height: 78vh; width: auto; height: auto; object-fit: contain; }
.detail-stage.is-video video { width: 100%; }
.detail-info { display: flex; gap: 20px; justify-content: space-between; align-items: flex-start; padding: 18px 2px; border-bottom: 1px solid var(--line); }
.detail-info h1 { font-size: 22px; margin: 0; }
.detail-info .meta { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
.detail-info .desc { color: #c9c9d1; margin: 12px 0 0; max-width: 820px; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0 0; }
.detail-actions { display: flex; gap: 8px; flex: none; }
.detail-nav { display: flex; justify-content: space-between; gap: 10px; padding: 18px 0; }

.footer { color: var(--muted); font-size: 13px; padding: 22px 0 calc(22px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,.06); text-align: center; }

/* ---------- 手机 ---------- */
@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; height: auto; gap: 10px; padding: 10px 0; }
  .brand span:last-child { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .type-nav { margin-left: auto; }
  .type-nav a { padding: 4px 11px; }
  .search { order: 3; width: 100%; margin-left: 0; }
  .main { padding-top: 12px; }
  .grid, .col { gap: 8px; }
  .card { border-radius: 9px; }
  .card-cap { display: none; }
  .play-icon { width: 36px; height: 36px; margin: -18px 0 0 -18px; }
  .play-icon::after { left: 14px; top: 10px; border-left-width: 11px; border-top-width: 7px; border-bottom-width: 7px; }
  .lb-stage { padding: calc(56px + env(safe-area-inset-top)) 0 8px; }
  .lb-prev, .lb-next { display: none; }
  .lb-info { flex-direction: column; align-items: stretch; gap: 12px; padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); }
  .lb-actions { flex-wrap: wrap; }
  .lb-actions .btn { flex: 1; padding: 0 10px; }
  .detail-stage { border-radius: 0; margin: -12px -16px 0; }
  .detail-info { flex-direction: column; }
  .detail-actions { width: 100%; }
  .detail-actions .btn { flex: 1; }
}
