:root {
  --bg: #f7f5f0;
  --paper: #fffefb;
  --ink: #2c2418;
  --muted: #6b6258;
  --line: #e6dfd4;
  --gold: #c9a227;
  --gold-soft: #f4ead0;
  --red: #c0392b;
  --green: #2e7d4f;
  --blue: #2b6cb0;
  --shadow: 0 10px 30px rgba(44, 36, 24, 0.08);
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(1200px 400px at 50% -80px, #fff6d8 0%, transparent 60%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.7;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

.wrap {
  width: min(880px, calc(100% - 24px));
  margin: 0 auto;
  padding: 20px 0 calc(64px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  min-height: 44px;
}
.brand {
  font-weight: 700;
  letter-spacing: 0.04em;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(16px, 4.2vw, 20px);
}
.nav {
  display: flex;
  flex-shrink: 0;
  gap: 4px;
}
.nav a {
  margin-left: 0;
  color: var(--muted);
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 8px;
}
.nav a:hover, .nav a.active { color: var(--ink); }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 28px 26px;
}

.banner {
  text-align: center;
  padding: 8px 0 4px;
}
.banner h1 {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 700;
}
.gold { color: #b8860b; }
.green { color: var(--green); }
.red { color: var(--red); }
.blue { color: var(--blue); }
.yellow { color: #d4a017; }

.note {
  margin: 6px 0;
  font-size: 15px;
}
.divider {
  height: 1px;
  background: var(--line);
  margin: 18px 0;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  margin: 8px 0 16px;
}

.cats {
  display: grid;
  gap: 12px;
}
.cat-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fcfaf6;
  transition: transform .15s ease, box-shadow .15s ease;
  min-height: 48px;
}
.cat-link:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.folder { font-size: 20px; }

.thanks {
  text-align: center;
  color: var(--muted);
}
.thanks h2 {
  color: var(--red);
  font-size: 18px;
  margin: 0 0 8px;
}
.thanks p { margin: 6px 0; }

.search-row {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}
.search-row input {
  flex: 1;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px;
  background: #fff;
  outline: none;
}
.search-row input:focus, .search-row select:focus { border-color: var(--gold); }
.search-row select {
  flex: 0 0 42%;
  max-width: 180px;
  min-width: 120px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 10px;
  font-size: 15px;
  background: #fff;
  outline: none;
  color: var(--ink);
}
.heat { margin-left: auto; }

.meta {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 14px;
}

.list { display: grid; gap: 12px; }
.item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: #fff;
}
.item h3 { margin: 0 0 6px; font-size: 16px; word-break: break-word; }
.item p { margin: 0 0 10px; color: var(--muted); font-size: 14px; word-break: break-word; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-primary { background: var(--gold-soft); color: #7a5a00; }
.btn-ghost { background: #f3eee6; color: var(--ink); }
.empty { color: var(--muted); text-align: center; padding: 28px 0; }

.disclaimer h1 { font-size: 24px; text-align: center; margin-top: 0; }
.disclaimer h2 { font-size: 17px; margin: 22px 0 8px; }
.disclaimer p { margin: 8px 0; color: #3d3428; }
.disclaimer .lead { text-align: center; font-weight: 600; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: #2c2418;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.back-top {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: #2c2418;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(44, 36, 24, 0.25);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: .2s ease;
  z-index: 20;
}
.back-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@media (max-width: 640px) {
  .card { padding: 16px 14px; border-radius: 14px; }
  .banner h1 { font-size: clamp(15px, 4.6vw, 18px); }
  .note, .thanks p, .disclaimer p { font-size: 14px; }
  .actions .btn { flex: 1 1 calc(50% - 8px); }
  .toast { bottom: max(80px, env(safe-area-inset-bottom)); }
}

@media (max-width: 380px) {
  .nav a { padding: 8px 6px; font-size: 13px; }
}

.sort { display:inline-block; min-width:2em; color:#b8860b; font-size:13px; margin-right:6px; }

.tabs { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 16px; }
.tabs .tab {
  padding:8px 12px; border:1px solid var(--line); border-radius:999px;
  background:#fcfaf6; font-size:14px; color:var(--muted);
}
.tabs .tab.active { background:var(--gold-soft); color:#7a5a00; border-color:#e6d19a; font-weight:700; }
.cat-page-title {
  font-size: clamp(22px, 5vw, 28px);
  font-weight: 800;
  letter-spacing: 0.06em;
  margin: 4px 0 18px;
  color: var(--ink);
}
.item h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.item-title { min-width: 0; }
.heat {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
}
.flame-ico { width: 18px; height: 18px; display: block; }
.pan-badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}
.pan-baidu { background: #e8f1ff; color: #2b6cb0; }
.pan-ali { background: #e8f6ff; color: #0b76b7; }
.pan-quark { background: #fff3e0; color: #ef6c00; }
.pan-xunlei { background: #e3f2fd; color: #1565c0; }
.pan-123 { background: #e8f5e9; color: #2e7d32; }
.pan-lanzou { background: #f3e5f5; color: #7b1fa2; }
.pan-weiyun { background: #e3f2fd; color: #0277bd; }
.pan-189 { background: #fff8e1; color: #f57f17; }
.pan-uc { background: #ffebee; color: #c62828; }
.pan-google { background: #e8f5e9; color: #2e7d32; }
.pan-onedrive { background: #e3f2fd; color: #0277bd; }
.pan-dropbox { background: #e3f2fd; color: #1565c0; }
.pan-other { background: #f3eee6; color: #6b6258; }
#resetFilter { flex: 0 0 auto; white-space: nowrap; }
.search-row { align-items: center; }
.heat {
  display: inline-flex;
  align-items: flex-end;
  gap: 1px;
  margin-left: auto;
  padding: 2px 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,248,230,.7), rgba(255,236,210,.25));
}
.flame-ico {
  width: 22px;
  height: 22px;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(183, 28, 28, 0.28));
}
.heat-lv1 .flame-ico { transform: scale(.9); }
.heat-lv5 .flame-ico { filter: drop-shadow(0 1px 3px rgba(90, 0, 0, 0.45)); }
.qr-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin: 4px 0 12px;
}
.qr-img {
  width: 168px;
  height: 168px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 6px;
  box-sizing: border-box;
}
.qr-tip {
  font-size: 12px;
  color: var(--muted);
}
.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(28, 22, 14, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.qr-dialog {
  background: #fff;
  border-radius: 16px;
  padding: 20px 22px 18px;
  max-width: 92vw;
  width: 280px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
}
.qr-dialog-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  word-break: break-word;
}
.qr-dialog .qr-img {
  width: 220px;
  height: 220px;
  margin: 0 auto 8px;
  display: block;
}
.qr-dialog .btn { width: 100%; margin-top: 10px; }