/* ===================== 设计变量 ===================== */
:root {
  --bg: #f4f5fb;
  --card: #ffffff;
  --ink: #1a1d29;
  --ink-2: #5b6072;
  --ink-3: #969bad;
  --line: #eceef5;
  --primary: #2f6bff;
  --primary-2: #22a7ff;
  --grad: linear-gradient(135deg, #2f6bff 0%, #21b0ff 100%);
  --quark: #3f68ff;
  --baidu: #06a7ff;
  --aliyun: #ff7a1f;
  --other: #7c889c;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 6px 20px rgba(38, 43, 80, .06);
  --shadow-lg: 0 12px 34px rgba(38, 43, 80, .12);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.ic-svg { width: 1em; height: 1em; display: inline-block; vertical-align: -0.14em; flex: none; }
.clear-btn, .sheet-close, .rp-x { display: inline-grid; place-items: center; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { text-decoration: none; color: inherit; }
input { font-family: inherit; }

.app { max-width: 720px; margin: 0 auto; min-height: 100vh; position: relative; padding-bottom: 40px; }

/* ===================== 顶部品牌区 ===================== */
.hero {
  position: relative;
  padding: 22px 18px 20px;
  color: #fff;
  overflow: hidden;
  border-radius: 0 0 26px 26px;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background: var(--grad);
}
.hero-bg::before, .hero-bg::after {
  content: ''; position: absolute; border-radius: 50%;
}
.hero-bg::before { width: 220px; height: 220px; right: -60px; top: -80px; background: rgba(255, 255, 255, .14); }
.hero-bg::after { width: 150px; height: 150px; left: -40px; bottom: -70px; background: rgba(255, 255, 255, .10); }
.hero > *:not(.hero-bg) { position: relative; z-index: 1; }

.hero-bar { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 20px; font-weight: 800; letter-spacing: .5px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .22);
  display: grid; place-items: center; font-size: 19px; backdrop-filter: blur(4px);
}
.admin-entry {
  font-size: 12.5px; background: rgba(255, 255, 255, .2); padding: 6px 13px; border-radius: 20px;
  backdrop-filter: blur(4px); font-weight: 500;
}
.hero-desc { margin: 12px 2px 0; font-size: 13px; opacity: .92; }

/* 统计卡片 */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.stat {
  min-width: 0;
  background: rgba(255, 255, 255, .16); border-radius: 14px; padding: 10px 4px; text-align: center;
  backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, .12);
}
.stat .num { font-size: 18px; font-weight: 800; line-height: 1.1; }
.stat .lbl { font-size: 11px; opacity: .88; margin-top: 3px; white-space: nowrap; }
.skeleton-stat { height: 54px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .6; } 50% { opacity: .3; } }

/* ===================== 吸顶搜索 ===================== */
.stickybar {
  position: sticky; top: 0; z-index: 30;
  padding: 12px 16px 8px;
  background: linear-gradient(var(--bg) 78%, rgba(244, 245, 251, 0));
}
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border-radius: 26px; padding: 5px 5px 5px 16px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.si { font-size: 15px; opacity: .55; }
#searchInput { flex: 1; border: none; outline: none; background: transparent; font-size: 15px; height: 40px; color: var(--ink); }
#searchInput::placeholder { color: var(--ink-3); }
.clear-btn { color: var(--ink-3); font-size: 13px; padding: 4px 6px; }
.search-go {
  background: var(--grad); color: #fff; height: 40px; padding: 0 20px; border-radius: 22px;
  font-size: 14px; font-weight: 700; box-shadow: 0 4px 12px rgba(99, 102, 241, .35);
}

/* ===================== 轮播图 ===================== */
.carousel { margin: 4px 16px 12px; border-radius: 16px; overflow: hidden; position: relative; box-shadow: var(--shadow); }
.car-track { display: flex; transition: transform .4s cubic-bezier(.2, .8, .3, 1); }
.car-slide { flex: 0 0 100%; height: 150px; position: relative; }
.car-slide img { width: 100%; height: 100%; object-fit: cover; display: block; background: #e8ecf5; }
.car-slide .car-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 14px 10px; color: #fff;
  font-size: 13.5px; font-weight: 600; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); }
.car-dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.car-dots i { width: 6px; height: 6px; border-radius: 4px; background: rgba(255, 255, 255, .6); transition: .2s; }
.car-dots i.on { width: 16px; background: #fff; }

/* ===================== 公告跑马灯 ===================== */
.notice-bar { display: flex; align-items: center; gap: 8px; margin: 0 16px 12px; background: #fff;
  border-radius: 12px; padding: 8px 12px; box-shadow: var(--shadow); overflow: hidden; }
.notice-ico { font-size: 14px; flex: none; }
.notice-viewport { flex: 1; overflow: hidden; white-space: nowrap; }
.notice-track { display: inline-block; white-space: nowrap; font-size: 12.5px; color: var(--ink-2); padding-left: 100%;
  animation: notice-scroll 18s linear infinite; }
@keyframes notice-scroll { from { transform: translateX(0); } to { transform: translateX(-100%); } }

/* ===================== 筛选 ===================== */
.filters { padding: 4px 16px 0; }

/* 网盘：分段控件 */
.seg {
  display: flex; gap: 4px; background: #eaecf4; border-radius: 14px; padding: 4px; margin-bottom: 14px;
}
.seg-item {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 13px; color: var(--ink-2); font-weight: 600; padding: 9px 4px; border-radius: 11px;
  transition: .18s; white-space: nowrap;
}
.seg-item.active { background: var(--card); color: var(--ink); box-shadow: 0 2px 8px rgba(38, 43, 80, .1); }
.seg-item .dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.quark { background: var(--quark); } .dot.baidu { background: var(--baidu); }
.dot.aliyun { background: var(--aliyun); } .dot.other { background: var(--other); }

/* 分类 chips */
.cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 6px; }
.cats::-webkit-scrollbar { display: none; }
.cats { -ms-overflow-style: none; scrollbar-width: none; }
.cat {
  flex: none; background: var(--card); color: var(--ink-2); font-size: 12.5px; white-space: nowrap;
  padding: 7px 14px; border-radius: 20px; border: 1px solid var(--line); transition: .15s;
}
.cat .c-cnt { color: var(--ink-3); font-size: 11px; margin-left: 3px; }
.cat-group { flex: none; align-self: center; font-size: 11.5px; font-weight: 700; color: var(--ink-3); padding: 0 4px 0 8px; white-space: nowrap; }
.cat.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 3px 8px rgba(99, 102, 241, .28); }
.cat.active .c-cnt { color: rgba(255, 255, 255, .8); }

.toolbar { display: flex; align-items: center; margin: 8px 2px 14px; }
.sort-tabs { display: flex; background: #eaecf4; border-radius: 10px; padding: 3px; }
.sort { font-size: 13px; color: var(--ink-2); font-weight: 600; padding: 5px 14px; border-radius: 8px; transition: .15s; }
.sort.active { background: var(--card); color: var(--primary); box-shadow: 0 1px 4px rgba(38, 43, 80, .1); }
.result-count { margin-left: auto; font-size: 12px; color: var(--ink-3); }

/* ===================== 卡片列表 ===================== */
.list { padding: 0 16px; display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .list { grid-template-columns: 1fr 1fr; } }

.card {
  background: var(--card); border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow); border: 1px solid rgba(236, 238, 245, .8);
  display: grid; grid-template-columns: 46px 1fr; gap: 12px;
  transition: transform .14s, box-shadow .14s; cursor: pointer;
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card:active { transform: scale(.99); }

.pan-ico { width: 46px; height: 46px; border-radius: 13px; overflow: hidden; flex: none; }
.pan-ico svg { width: 100%; height: 100%; display: block; }

.c-body { min-width: 0; }
.c-title {
  font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.c-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 8px; }
.chip-cat { font-size: 11.5px; color: var(--primary); background: #eef0ff; padding: 3px 9px; border-radius: 7px; font-weight: 600; }
.chip-cat.ghost { color: var(--ink-2); background: #f2f3f8; font-weight: 500; }
.c-views { font-size: 11.5px; color: var(--ink-3); margin-left: auto; }
.c-desc {
  font-size: 12.5px; color: var(--ink-3); margin-top: 8px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.c-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; row-gap: 8px; }
.code-chip {
  font-size: 11.5px; color: #b26a00; background: #fff6e6; padding: 5px 10px; border-radius: 8px; font-weight: 600;
}
.code-chip b { font-family: ui-monospace, monospace; letter-spacing: .5px; }
.c-btns { margin-left: auto; display: flex; gap: 8px; }
.btn { font-size: 12.5px; padding: 7px 14px; border-radius: 9px; font-weight: 700; transition: .15s; white-space: nowrap; }
.btn.ghost { color: var(--primary); background: #eef0ff; }
.btn.ghost:active { background: #e2e5ff; }
.btn.solid { color: #fff; background: var(--grad); box-shadow: 0 3px 9px rgba(99, 102, 241, .3); }

/* 骨架卡片 */
.card.skeleton { pointer-events: none; }
.card.skeleton .sk { background: linear-gradient(90deg, #eef0f6 25%, #f6f7fb 37%, #eef0f6 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ===================== 状态 ===================== */
.empty { text-align: center; padding: 60px 20px; color: var(--ink-3); }
.empty-emoji { font-size: 46px; margin-bottom: 12px; }
.empty p { margin: 0; font-size: 15px; color: var(--ink-2); font-weight: 600; }
.empty span { font-size: 12.5px; }
.list-footer { text-align: center; padding: 20px 0 6px; }
.load-more { background: var(--card); color: var(--primary); font-size: 13.5px; font-weight: 700; padding: 10px 30px; border-radius: 22px; box-shadow: var(--shadow); }
.loading { color: var(--ink-3); font-size: 12.5px; display: inline-flex; align-items: center; gap: 8px; }
.spinner { width: 14px; height: 14px; border: 2px solid #dfe2ee; border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.no-more { color: var(--ink-3); font-size: 12px; }
.foot { text-align: center; color: #c2c6d4; font-size: 11.5px; padding: 16px; }

/* ===================== 详情弹层 ===================== */
.sheet { position: fixed; inset: 0; z-index: 60; }
.sheet-mask { position: absolute; inset: 0; background: rgba(18, 20, 34, .5); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet-panel {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: 720px; background: var(--card);
  border-radius: 24px 24px 0 0; padding: 12px 22px calc(26px + env(safe-area-inset-bottom));
  animation: slideUp .26s cubic-bezier(.2, .8, .3, 1);
}
@keyframes slideUp { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
.sheet-grip { display: block; width: 40px; height: 4px; border-radius: 4px; background: #e2e4ee; margin: 0 auto 14px; }
.sheet-close { position: absolute; right: 16px; top: 14px; font-size: 15px; color: var(--ink-3); width: 30px; height: 30px; border-radius: 50%; background: #f2f3f8; }
.sheet-title { font-size: 17px; font-weight: 800; padding-right: 30px; line-height: 1.4; }
.sheet-row { display: flex; gap: 8px; align-items: center; margin-top: 13px; flex-wrap: wrap; }
.sheet-label { font-size: 12.5px; color: var(--ink-3); width: 52px; flex: none; }
.sheet-val { font-size: 13.5px; color: var(--ink-2); word-break: break-all; }
.pan-tag { font-size: 12px; font-weight: 700; color: #fff; padding: 4px 11px; border-radius: 8px; }
.pan-tag.quark { background: var(--quark); } .pan-tag.baidu { background: var(--baidu); }
.pan-tag.aliyun { background: var(--aliyun); } .pan-tag.other { background: var(--other); }
.sheet-link { font-size: 12.5px; color: var(--primary); background: #eef0ff; padding: 11px 13px; border-radius: 12px; word-break: break-all; margin-top: 6px; display: block; line-height: 1.5; }
.sheet-btns { display: flex; gap: 10px; margin-top: 20px; }
.sheet-btns .btn { flex: 1; text-align: center; padding: 13px; font-size: 14.5px; border-radius: 13px; }

/* ===================== Toast ===================== */
.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%);
  background: rgba(18, 20, 34, .92); color: #fff; font-size: 13px; padding: 11px 20px;
  border-radius: 22px; z-index: 100; animation: toastIn .22s; box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ===================== 举报 / 海报弹窗 ===================== */
.rp-modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 24px; }
.rp-mask { position: absolute; inset: 0; background: rgba(18, 20, 34, .55); }
.rp-card { position: relative; background: #fff; border-radius: 18px; width: 100%; max-width: 400px; padding: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); animation: rpPop .2s; }
@keyframes rpPop { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.rp-head { display: flex; align-items: center; justify-content: space-between; font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.rp-x { width: 30px; height: 30px; border-radius: 50%; background: #f2f3f8; color: var(--ink-3); font-size: 14px; }
.rp-res { font-size: 13px; color: var(--ink-2); background: #f5f6fa; padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; word-break: break-all; }
#rpReason, #rpContact { width: 100%; border: 1px solid #dbe2ee; border-radius: 10px; padding: 10px 12px; font-size: 14px; outline: none; margin-bottom: 12px; font-family: inherit; }
#rpReason:focus, #rpContact:focus { border-color: var(--primary); }
.rp-contact { font-size: 12px; color: var(--ink-3); margin-bottom: 12px; line-height: 1.6; }
.rp-submit { width: 100%; height: 44px; border: none; border-radius: 12px; background: var(--grad); color: #fff; font-size: 15px; font-weight: 700; }
.poster-card { max-width: 340px; text-align: center; }
.poster-img { width: 100%; border-radius: 12px; display: block; }
.poster-loading { padding: 60px 0; color: var(--ink-3); font-size: 13px; }
.poster-tip { font-size: 12px; color: var(--ink-3); margin-top: 12px; }
.poster-card .rp-x { position: absolute; right: 12px; top: 12px; z-index: 2; }
