/* 网盘资源聚合站 - 访客端样式（靛蓝紫主题，移动端优先） */
:root {
  --primary: #5b5bd6;
  --primary-dark: #4a4ac4;
  --primary-light: #eceafe;
  --bg: #f6f6fb;
  --card: #ffffff;
  --text: #23233a;
  --text-sub: #82829a;
  --border: #e8e8f2;
  --green: #16a34a;
  --green-bg: #e7f7ee;
  --gray: #9ca3af;
  --gray-bg: #f1f1f5;
  --radius: 16px;
  --shadow: 0 2px 12px rgba(91, 91, 214, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Hero 搜索区 ---------- */
.hero {
  background: linear-gradient(135deg, #5b5bd6 0%, #7c5bd6 60%, #a855f7 100%);
  color: #fff;
  padding: 60px 16px 46px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 120%, rgba(255,255,255,.18) 0%, transparent 50%),
              radial-gradient(circle at 80% -20%, rgba(255,255,255,.12) 0%, transparent 45%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}
.brand-logo { font-size: 36px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.2)); }
.brand h1 { font-size: 26px; font-weight: 800; letter-spacing: .5px; }
.qr-trigger {
  margin-left: 8px;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.2);
  color: #fff;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: transform .15s, background .15s;
}
.qr-trigger:hover { background: rgba(255,255,255,.32); transform: scale(1.08); }
.refresh-trigger {
  margin-left: 4px;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.2);
  color: #fff;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: transform .15s, background .15s;
}
.refresh-trigger:hover { background: rgba(255,255,255,.32); }
.refresh-trigger.spinning { animation: spin .6s ease; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.hero-desc {
  font-size: 14.5px;
  opacity: .88;
  margin-bottom: 24px;
  line-height: 1.55;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}
.hero-search {
  display: flex;
  background: #fff;
  border-radius: 999px;
  overflow: hidden;
  max-width: 520px;
  margin: 0 auto 18px;
  box-shadow: 0 8px 28px rgba(0,0,0,.18);
}
.hero-search input {
  flex: 1;
  border: none;
  outline: none;
  padding: 14px 22px;
  font-size: 15px;
  min-width: 0;
  color: var(--text);
}
.hero-search input::placeholder { color: #a0a0b8; }
.hero-search button {
  border: none;
  background: var(--primary-light);
  color: var(--primary);
  padding: 0 22px;
  font-size: 18px;
  font-weight: 700;
}
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  font-size: 12.5px;
  opacity: .82;
}
.hero-tags span, .hero-tag {
  background: rgba(255,255,255,.15);
  padding: 5px 12px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
a.hero-tag:hover { background: rgba(255,255,255,.28); }

/* ---------- 公告 ---------- */
.announcement {
  background: #fff8e6;
  color: #92600a;
  font-size: 13px;
  padding: 9px 16px;
  text-align: center;
  border-bottom: 1px solid #f3e5bd;
}

/* ---------- 分类条 ---------- */
.cat-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 16px;
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
}
.cat-chip {
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-sub);
  transition: all .15s;
  box-shadow: var(--shadow);
}
.cat-chip.active, .cat-chip:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ---------- 子分类条 ---------- */
.sub-cat-bar {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
}
.sub-cat-bar::-webkit-scrollbar { display: none; }
.sub-chip {
  flex-shrink: 0;
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--primary-light);
  border: 1px solid transparent;
  font-size: 12px;
  color: var(--primary-dark);
  transition: all .15s;
}
.sub-chip.active, .sub-chip:hover {
  background: var(--primary);
  color: #fff;
}

/* ---------- 主体 ---------- */
.container {
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 8px 16px 40px;
  flex: 1;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 24px 0 14px;
}
.section-title {
  font-size: 17px;
  font-weight: 800;
}
.section-count {
  font-size: 12.5px;
  color: var(--text-sub);
}
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
}
.grid.layout-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- 资源卡片（长条行） ---------- */
.res-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: row;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
  position: relative;
}
.res-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(91, 91, 214, 0.12);
}
.res-card.invalid { opacity: .55; filter: grayscale(.45); }

.res-thumb {
  position: relative;
  width: 88px;
  height: 88px;
  min-height: 88px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #e8e8f2, #f1f1f5);
  overflow: hidden;
  align-self: center;
  border-radius: 10px;
  margin: 10px 0 10px 10px;
}
.res-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.res-thumb.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.92);
  gap: 4px;
  background: linear-gradient(135deg, #b8b8d8, #9c9cc0);
}
.thumb-icon { font-size: 34px; }

.tag-corner {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 8px;
  font-weight: 700;
  z-index: 2;
}
.tag-corner.new { background: #ff5b5b; }

.res-card-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  justify-content: center;
  min-width: 0;
}
.res-name {
  font-size: 18px;
  font-weight: 900;
  line-height: 1.35;
  color: var(--text);
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.res-name mark { background: #ffe58f; color: inherit; border-radius: 3px; padding: 0 1px; }
.res-desc {
  font-size: 13.5px;
  color: var(--text-sub);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.res-desc-wrap { position: relative; }
.desc-toggle {
  display: inline-block;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 2px;
  user-select: none;
}
.res-desc.expanded {
  -webkit-line-clamp: unset;
  display: block;
}
.res-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.res-tag {
  font-size: 12.5px;
  color: var(--primary-dark);
  background: var(--primary-light);
  padding: 4px 10px;
  border-radius: 7px;
}
.badge-row { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.pan-badge {
  font-size: 12.5px;
  padding: 4px 10px;
  border-radius: 7px;
  font-weight: 600;
  color: #fff;
}
.pan-quark { background: #2f6bff; }
.pan-baidu { background: #5a7bb0; }
.pan-aliyun, .pan-alipan { background: #00a2c2; }
.pan-xunlei { background: #f08c1e; }
.pan-uc { background: #e6572f; }
.pan-other { background: #8b8ba3; }
.status-badge { font-size: 12px; padding: 3px 9px; border-radius: 7px; }
.status-valid { color: var(--green); background: var(--green-bg); }
.status-invalid { color: var(--gray); background: var(--gray-bg); }
.status-unknown { color: #a16207; background: #fef6dd; }
.res-meta {
  display: flex;
  gap: 10px;
  font-size: 11.5px;
  color: var(--text-sub);
}
.copy-btn {
  margin-top: auto;
  border: none;
  background: linear-gradient(135deg, var(--primary), #7c5bd6);
  color: #fff;
  padding: 10px;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 600;
  transition: opacity .15s;
}
.copy-btn:hover { opacity: .88; }
.res-card.invalid .copy-btn {
  background: var(--gray-bg);
  color: var(--gray);
  cursor: not-allowed;
}

/* ---------- 紧凑列表布局 ---------- */
.res-list-item {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.res-list-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(91, 91, 214, 0.11);
}
.res-list-item.invalid { opacity: .55; filter: grayscale(.45); }
.res-list-thumb {
  position: relative;
  width: 90px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, #e8e8f2, #f1f1f5);
}
.res-list-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.res-list-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.res-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.res-list-head .res-name {
  -webkit-line-clamp: 1;
  flex: 1;
  min-width: 140px;
}
.res-list-item .res-desc {
  -webkit-line-clamp: 1;
}
.res-list-item .copy-btn.small {
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 12.5px;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .res-list-item {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .res-list-thumb { width: 72px; height: 52px; }
  .res-list-main { width: calc(100% - 86px); }
  .res-list-item .copy-btn.small {
    width: 100%;
    margin-top: 4px;
  }
}

/* ---------- 空状态/分页 ---------- */
.empty {
  text-align: center;
  padding: 60px 0;
  color: var(--text-sub);
}
.empty-icon { font-size: 42px; margin-bottom: 10px; }
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  font-size: 13px;
  color: var(--text-sub);
}
.pager-btn {
  border: 1px solid var(--border);
  background: var(--card);
  padding: 8px 20px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: var(--shadow);
}
.pager-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- 页脚 ---------- */
.site-footer {
  text-align: center;
  padding: 26px 16px 34px;
  font-size: 12px;
  color: var(--text-sub);
  background: #fff;
  border-top: 1px solid var(--border);
}
.disclaimer {
  margin-top: 12px;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
  color: #a0a0b0;
  font-size: 11.5px;
}

/* ---------- 二维码浮层 ---------- */
.qr-modal {
  position: relative;
  text-align: center;
  padding: 28px 24px 22px;
  max-width: 340px;
}
.qr-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 30px; height: 30px;
  border: none;
  background: var(--gray-bg);
  color: var(--text-sub);
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
}
.qr-box {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 14px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
}
.qr-box img { display: block; width: 100%; height: 100%; }
.qr-logo {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.qr-logo::before {
  content: '';
  width: 46px; height: 46px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.qr-logo::after {
  content: '📦';
  position: absolute;
  font-size: 26px;
}
.qr-tip {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.qr-url {
  font-size: 12px;
  color: var(--text-sub);
  word-break: break-all;
  line-height: 1.5;
  margin-bottom: 14px;
}
.qr-modal .btn { flex: none; padding: 10px 20px; }

/* ---------- 复制浮层 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 40, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
}
.modal {
  background: #fff;
  border-radius: 18px;
  padding: 22px;
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  overflow-y: auto;
}
.modal h3 { font-size: 16px; margin-bottom: 14px; }
.modal-links { display: flex; flex-direction: column; gap: 10px; }
.modal-link-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-link-item .pan-badge { flex-shrink: 0; }
.modal-link-text {
  flex: 1;
  font-size: 12px;
  color: var(--text-sub);
  word-break: break-all;
  line-height: 1.5;
}
.modal-link-item .copy-one {
  flex-shrink: 0;
  border: none;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
}
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.btn {
  flex: 1;
  border: none;
  border-radius: 11px;
  padding: 11px;
  font-size: 14px;
  font-weight: 600;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-ghost { background: var(--gray-bg); color: var(--text); }

/* ---------- 图片预览浮层 ---------- */
.gallery-mask { background: rgba(10, 10, 24, .92); }
.gallery-modal {
  position: relative;
  width: 100%;
  max-width: 900px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.gallery-modal img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
}
.gallery-close {
  position: fixed;
  top: 16px;
  right: 20px;
  border: none;
  background: rgba(255,255,255,.15);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 20px;
}
.gallery-prev, .gallery-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: rgba(255,255,255,.12);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 26px;
}
.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }
.gallery-dots {
  position: fixed;
  bottom: 24px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.gallery-dots span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.35);
  cursor: pointer;
}
.gallery-dots span.active { background: #fff; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 60px;
  transform: translateX(-50%);
  background: rgba(35, 35, 58, .92);
  color: #fff;
  font-size: 13px;
  padding: 10px 22px;
  border-radius: 999px;
  z-index: 99;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .hero { padding: 46px 16px 36px; padding-top: calc(46px + env(safe-area-inset-top)); }
  .brand h1 { font-size: 22px; }
  .hero-desc { font-size: 13.5px; margin-bottom: 18px; }
  .hero-search { margin-bottom: 14px; }
  .hero-search input { padding: 12px 16px; font-size: 14px; }
  .hero-search button { padding: 0 16px; }
  .hero-tags { font-size: 11.5px; gap: 6px; }
  .res-thumb { width: 72px; height: 72px; min-height: 72px; margin: 8px 0 8px 8px; border-radius: 8px; }
  .thumb-icon { font-size: 26px; }
  .res-card-body { padding: 8px 10px; gap: 4px; }
  .res-name { font-size: 16px; }
  .res-desc { font-size: 12.5px; -webkit-line-clamp: 2; }
  .copy-btn { padding: 11px; font-size: 13px; }
  .container { padding: 8px 12px 32px; padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
  .cat-bar { padding: 12px 12px; gap: 8px; }
  .cat-chip { padding: 6px 12px; font-size: 12.5px; }
  .section-head { margin: 18px 0 10px; }
  .toast { white-space: normal; max-width: 88vw; text-align: center; bottom: calc(40px + env(safe-area-inset-bottom)); }
  .modal { padding: 18px; border-radius: 14px; }
  .modal-link-item { flex-wrap: wrap; }
  .modal-link-item .copy-one { width: 100%; text-align: center; margin-top: 4px; }
  .pager { gap: 10px; }
  .pager-btn { padding: 8px 16px; }
  .site-footer { padding: 22px 12px 28px; padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
}
