:root {
  color-scheme: light;
  --page: #f5f6fb;
  --surface: rgba(255, 255, 255, 0.85);
  --surface-solid: #ffffff;
  --surface-soft: #f2f4f8;
  --text: #1a2233;
  --muted: #5d6678;
  --subtle: #8a93a6;
  --line: #e6e9f0;
  --brand: #5b63e8;
  --brand-dark: #4851d8;
  --brand-soft: #eef0ff;
  --violet: #8d5cf6;
  --success: #19a974;
  --shadow-sm: 0 6px 18px rgba(28, 36, 62, 0.045);
  --shadow-lg: 0 22px 64px rgba(59, 65, 126, 0.12);
  --radius: 14px;
  --radius-lg: 18px;
  /* 网盘专属色（与卡片 tag 保持一致） */
  --disk-baidu: #2f5fd0;
  --disk-baidu-bg: #e8f0ff;
  --disk-quark: #7a3fc0;
  --disk-quark-bg: #f2e8ff;
  --disk-xunlei: #c05c1a;
  --disk-xunlei-bg: #fff0e2;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --page: #0c1019;
  --surface: rgba(23, 28, 41, 0.85);
  --surface-solid: #161b27;
  --surface-soft: #1f2535;
  --text: #eef1f7;
  --muted: #a4adbf;
  --subtle: #747d92;
  --line: #283149;
  --brand: #7b83ff;
  --brand-dark: #9399ff;
  --brand-soft: #1e2547;
  --violet: #ad7cff;
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.22);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.36);
  --disk-baidu: #7fa3ff;
  --disk-baidu-bg: #1c2a48;
  --disk-quark: #cf9cff;
  --disk-quark-bg: #2c1f44;
  --disk-xunlei: #ffb38d;
  --disk-xunlei-bg: #3a2616;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Inter, system-ui, -apple-system, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--brand) 22%, transparent); color: var(--text); }

/* -------------------- Header -------------------- */
.site-header {
  position: relative;
  z-index: 50;
  height: 68px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-solid) 92%, transparent);
  backdrop-filter: blur(14px);
}
.is-results .site-header {
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
  backdrop-filter: blur(18px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1180px, calc(100% - 48px));
  height: 100%;
  margin: 0 auto;
}
.is-results .header-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 11px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  line-height: 1.2;
  flex-shrink: 0;
}
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--violet));
  box-shadow: 0 6px 16px rgba(89, 101, 242, 0.22);
}
.brand-mark svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.brand-copy { display: flex; flex-direction: column; }
.brand-copy b { font-size: 18px; letter-spacing: 0.04em; }
.brand-copy small { color: var(--subtle); font-size: 9px; letter-spacing: 0.18em; }

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  line-height: 1;
  color: var(--muted);
  box-shadow: var(--shadow-sm);
  transition: 0.15s ease;
}
.icon-button:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }
.icon-button .icon-moon { fill: currentColor; stroke: none; }
.icon-button .icon-sun { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-button svg { width: 20px; height: 20px; }
.icon-button .icon-sun { display: none; }
.icon-button.is-dark .icon-moon { display: none; }
.icon-button.is-dark .icon-sun { display: block; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-shrink: 0;
}
.header-action-item { position: relative; }

/* -------------------- 顶部图标浮窗 -------------------- */
.popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  animation: popover-in 0.18s ease;
}
.popover-inner {
  min-width: 320px;
  max-width: 460px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-lg);
}
@keyframes popover-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* 网盘资源群：横向二维码 */
.popover-qr-row {
  display: flex;
  gap: 14px;
}
.popover-qr-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}
.popover-qr-img {
  width: 108px;
  height: 108px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
}
.popover-qr-name { font-size: 13px; font-weight: 600; color: var(--text); }

/* 浮窗内复制按钮 */
.popover-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  transition: 0.15s;
}
.popover-copy:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.popover-copy-label { color: var(--subtle); flex-shrink: 0; }
.popover-copy-value {
  color: var(--text);
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
}
/* 网盘资源群里的群号/微信号：强制单行完整显示，不折行不截断 */
.popover-qr-item .popover-copy-value {
  white-space: nowrap;
  word-break: normal;
}
/* 千问口令值用红色强调 */
.popover-copy-value-accent { color: #e5484d; }
html[data-theme="dark"] .popover-copy-value-accent { color: #f87171; }
.popover-copy svg { width: 14px; height: 14px; flex-shrink: 0; }

/* 吃大餐：上下两块 */
.popover-meal-item { padding: 2px 0; }
.popover-meal-item + .popover-meal-item {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.popover-meal-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.popover-meal-desc {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  margin-bottom: 9px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--brand-soft);
}
.popover-meal-img {
  width: 100%;
  max-width: 220px;
  border-radius: 10px;
  border: 2px solid var(--line);
  display: block;
  margin: 0 auto 10px;
}

.top-search {
  display: none;
  position: relative;
  align-items: center;
  min-width: 0;
}
.is-results .top-search {
  display: flex;
  max-width: 620px;
  width: 100%;
  justify-self: center;
}
.top-search input {
  width: 100%;
  height: 44px;
  padding: 0 46px 0 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  color: var(--text);
  background: var(--surface-soft);
  transition: 0.18s ease;
  font-size: 14px;
}
.top-search input:focus {
  border-color: var(--brand);
  background: var(--surface-solid);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
.search-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  z-index: 1;
  display: grid;
  place-items: center;
  color: var(--subtle);
  pointer-events: none;
  transform: translateY(-50%);
}
.search-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.input-clear {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 9px;
  color: var(--subtle);
  background: transparent;
  cursor: pointer;
  font-size: 21px;
  line-height: 1;
  transform: translateY(-50%);
}
.input-clear:hover { color: var(--text); background: var(--surface-soft); }
/* 隐藏浏览器 input[type=search] 自带的清除按钮，只保留自定义叉叉，避免出现两个 */
.top-search input::-webkit-search-cancel-button,
.hero-search input::-webkit-search-cancel-button,
.top-search input::-webkit-search-decoration,
.hero-search input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

/* 结果页搜索框历史下拉 */
.search-history {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 80;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-lg);
}
.search-history-title {
  display: block;
  margin-bottom: 8px;
  color: var(--subtle);
  font-size: 12px;
}
.search-history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.search-history-item {
  padding: 5px 11px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-soft);
  cursor: pointer;
  font-size: 13px;
  transition: 0.15s;
}
.search-history-item:hover { color: var(--brand); background: var(--brand-soft); }
.search-history-empty { color: var(--subtle); font-size: 13px; }

/* -------------------- Hero -------------------- */
.home-view {
  position: relative;
  min-height: calc(100vh - 68px);
  overflow: clip;
  padding: 38px 24px 96px;
}
.home-view::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 500px;
  background:
    radial-gradient(circle at 50% -28%, color-mix(in srgb, var(--brand-soft) 90%, transparent), transparent 58%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface-solid) 75%, transparent), transparent 94%);
  pointer-events: none;
  z-index: 0;
}
html[data-theme="dark"] .home-view::before {
  background:
    radial-gradient(circle at 50% -28%, color-mix(in srgb, var(--brand-soft) 60%, transparent), transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface-solid) 30%, transparent), transparent 92%);
}
.hero-inner {
  position: relative;
  z-index: 1;
  width: min(900px, 100%);
  margin: 0 auto;
  text-align: center;
}
.hero-inner h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 46px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.035em;
}
.hero-search {
  width: min(720px, 100%);
  height: 64px;
  margin: 30px auto 0;
  padding: 6px 6px 6px 54px;
  display: flex;
  align-items: center;
  position: relative;
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line));
  border-radius: 18px;
  background: var(--surface-solid);
  box-shadow: 0 14px 38px rgba(44, 54, 104, 0.1);
}
.hero-search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 18px 48px rgba(89, 101, 242, 0.18), 0 0 0 4px var(--brand-soft);
}
.hero-search-icon {
  position: absolute;
  top: 50%;
  left: 21px;
  display: grid;
  place-items: center;
  color: var(--brand);
  transform: translateY(-50%);
}
.hero-search-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.hero-search input {
  min-width: 0;
  flex: 1;
  height: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 16px;
}
.hero-search input::placeholder { color: var(--subtle); }
.hero-search-button {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--violet));
  box-shadow: 0 8px 22px rgba(89, 101, 242, 0.28);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: 0.15s ease;
}
.hero-search-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.hero-search-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.recent-searches {
  min-height: 28px;
  margin: 12px auto 0;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--subtle);
  font-size: 12px;
}
.recent-chip {
  padding: 4px 10px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-soft);
  cursor: pointer;
  transition: 0.15s;
}
.recent-chip:hover { color: var(--brand); background: var(--brand-soft); }

.platform-cards {
  width: min(720px, 100%);
  margin: 22px auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
}
.platform-card {
  min-width: 0;
  min-height: 62px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-solid) 92%, transparent);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(25, 33, 58, 0.04);
  transition: 0.2s ease;
}
.platform-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand) 55%, var(--line));
  box-shadow: 0 12px 28px rgba(44, 54, 104, 0.1);
}
.platform-card > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.platform-card b { font-size: 14px; }
.platform-card small { color: var(--subtle); font-size: 11px; white-space: nowrap; }
.platform-card small strong { color: var(--muted); font-weight: 700; }
.platform-card i { color: var(--subtle); font-style: normal; }
.platform-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}
.baidu .platform-icon { background: linear-gradient(135deg, #3877ff, #6958ee); }
.quark .platform-icon { background: linear-gradient(135deg, #8b5cf6, #d04ede); }
.xunlei .platform-icon { background: linear-gradient(135deg, #ffad3d, #f26b45); }

/* -------------------- Home sections -------------------- */
.home-section {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  margin: 80px auto 0;
}
.recommendations-section { margin-top: 74px; }
.section-heading {
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.section-heading > h2,
.section-copy h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.35;
  letter-spacing: -0.025em;
}
.section-copy p { margin: 5px 0 0; color: var(--subtle); font-size: 12px; }
.text-button {
  padding: 8px 4px;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: 0.15s;
}
.text-button:hover { color: var(--brand); }

.category-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.home-category {
  min-width: 0;
  min-height: 96px;
  padding: 16px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-solid);
  cursor: pointer;
  text-align: left;
  box-shadow: 0 4px 14px rgba(25, 33, 58, 0.035);
  transition: 0.2s ease;
  position: relative;
  overflow: hidden;
}
.home-category::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--violet));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.home-category:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--brand) 50%, var(--line)); background: color-mix(in srgb, var(--brand-soft) 32%, var(--surface-solid)); }
.home-category:hover::before { transform: scaleX(1); }
.home-category .category-icon {
  grid-row: 1 / 3;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #5865d8;
  background: var(--brand-soft);
}
.home-category .category-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.home-category:nth-child(2n) .category-icon { color: #9b52bd; background: #f8ecff; }
.home-category:nth-child(3n) .category-icon { color: #c56c28; background: #fff1e7; }
.home-category:nth-child(4n) .category-icon { color: #148c70; background: #e8f8f3; }
.home-category:nth-child(5n) .category-icon { color: #b14a4a; background: #ffe9e9; }
.home-category b { align-self: end; display: block; font-size: 14px; line-height: 1.35; }
.home-category small { align-self: start; display: block; margin-top: 2px; overflow: hidden; color: var(--subtle); font-size: 10px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.more-category { border-style: dashed; }
.more-category .category-icon { color: var(--muted); background: var(--surface-soft); }

/* -------------------- Recommendation cards -------------------- */
.recommendation-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.recommendation-card {
  min-width: 0;
  min-height: 186px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface-solid) 0%, color-mix(in srgb, var(--surface-soft) 55%, var(--surface-solid)) 100%);
  box-shadow: 0 4px 14px rgba(25, 33, 58, 0.035);
  transition: 0.18s ease;
  position: relative;
  overflow: hidden;
}
.recommendation-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
  background: color-mix(in srgb, var(--brand-soft) 36%, var(--surface-solid));
}
.recommendation-main { min-width: 0; flex: 1; }
.recommendation-title {
  min-height: 42px;
  margin-bottom: 12px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.55;
  word-break: break-word;
  color: var(--text);
}
.recommendation-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }

.recommendation-loading { grid-column: 1 / -1; padding: 45px; color: var(--subtle); text-align: center; }

/* -------------------- Card actions (shared) -------------------- */
.card-actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.action-button {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface-solid);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: 0.15s ease;
}
.action-button:hover { color: var(--brand); border-color: var(--brand); }
.action-button.primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--violet));
  box-shadow: 0 6px 14px rgba(89, 101, 242, 0.22);
}
.action-button.primary:hover { color: #fff; filter: brightness(1.05); border-color: transparent; }
.action-button.primary svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* 推荐卡按钮：两个等宽横向排列 */
.recommendation-card .card-actions { margin-top: 14px; }
.recommendation-card .action-button { flex: 1; min-width: 0; padding: 0 8px; }

/* -------------------- Results view -------------------- */
.results-view { min-height: calc(100vh - 72px); }
.results-shell {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 70px;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.filters {
  position: sticky;
  top: 90px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-solid);
  box-shadow: var(--shadow-sm);
}
.filter-mobile-header { display: none; }
.filter-section { padding: 18px 16px; }
.filter-section + .filter-section { border-top: 1px solid var(--line); }
.filter-label {
  padding: 0 10px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.filter-option {
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  transition: 0.12s;
}
.filter-option:hover { color: var(--text); background: var(--surface-soft); }
.filter-option.is-active { background: var(--brand-soft); font-weight: 700; }
.filter-option input { accent-color: var(--brand); }
.filter-option .filter-name { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-count {
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--subtle);
  background: var(--surface-soft);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.filter-option.is-active .filter-count { color: #fff; background: var(--brand); }

/* 侧栏网盘专属颜色（与卡片 tag 一致） */
.filter-option.disk-baidu .filter-name { color: var(--disk-baidu); font-weight: 600; }
.filter-option.disk-quark .filter-name { color: var(--disk-quark); font-weight: 600; }
.filter-option.disk-xunlei .filter-name { color: var(--disk-xunlei); font-weight: 600; }
.filter-option.disk-baidu.is-active { background: var(--disk-baidu-bg); }
.filter-option.disk-quark.is-active { background: var(--disk-quark-bg); }
.filter-option.disk-xunlei.is-active { background: var(--disk-xunlei-bg); }
/* 网盘数量徽章：背景色与网盘字体颜色一致 */
.filter-option.disk-baidu .filter-count { color: #fff; background: var(--disk-baidu); }
.filter-option.disk-quark .filter-count { color: #fff; background: var(--disk-quark); }
.filter-option.disk-xunlei .filter-count { color: #fff; background: var(--disk-xunlei); }

/* Results meta */
.results-main { min-width: 0; }
.results-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
.results-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  min-height: 44px;
  flex: 1;
  min-width: 0;
  margin-bottom: 16px;
  padding: 4px 0;
}
.result-count {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; flex: 1; }
.active-filter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-solid);
  font-size: 11px;
}
.active-filter b { color: var(--text); font-weight: 600; }
.active-filter mark {
  padding: 0 4px;
  border-radius: 4px;
  color: var(--text);
  background: color-mix(in srgb, #ffe28a 82%, transparent);
  font-weight: 600;
}
html[data-theme="dark"] .active-filter mark {
  color: var(--text);
  background: color-mix(in srgb, #ffe28a 30%, transparent);
}
.filter-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: var(--surface-solid);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  transition: 0.15s;
}
.filter-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.filter-toggle:hover { color: var(--brand); border-color: var(--brand); }

/* Result cards：标题铺满 + 按钮右下角横向 */
.result-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.result-card {
  min-width: 0;
  min-height: 130px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface-solid) 0%, color-mix(in srgb, var(--surface-soft) 55%, var(--surface-solid)) 100%);
  box-shadow: var(--shadow-sm);
  transition: 0.18s ease;
}
.result-card:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
  background: color-mix(in srgb, var(--brand-soft) 36%, var(--surface-solid));
  transform: translateY(-2px);
}
.result-card .card-title {
  min-height: 44px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  word-break: break-word;
  color: var(--text);
}
.card-title mark {
  padding: 0 2px;
  border-radius: 3px;
  color: var(--text);
  background: color-mix(in srgb, #ffe28a 80%, transparent);
}
html[data-theme="dark"] .card-title mark { color: var(--text); background: color-mix(in srgb, #ffe28a 28%, transparent); }

.result-card .card-footer {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.result-card .card-actions {
  flex: 1;
  margin-left: auto;
  gap: 8px;
}
.result-card .action-button {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 14px;
}

/* Tags（含网盘三色） */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 10px;
  white-space: nowrap;
  font-weight: 600;
}
.tag.category { color: var(--brand); background: var(--brand-soft); }
.tag.disk::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 5px;
  flex-shrink: 0;
}
.tag.disk-baidu { color: var(--disk-baidu); background: var(--disk-baidu-bg); }
.tag.disk-quark { color: var(--disk-quark); background: var(--disk-quark-bg); }
.tag.disk-xunlei { color: var(--disk-xunlei); background: var(--disk-xunlei-bg); }

.empty-state { padding: 90px 20px; text-align: center; }
.empty-illustration {
  width: 74px;
  height: 74px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 46px;
}
.empty-state h2 { margin: 0 0 6px; }
.empty-state p { margin: 0 0 20px; color: var(--muted); }

.primary-button {
  height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--violet));
  box-shadow: 0 6px 16px rgba(89, 101, 242, 0.22);
  cursor: pointer;
  font-weight: 700;
}
.primary-button:hover { filter: brightness(1.06); }

.pagination { margin-top: 32px; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; }
.page-button {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface-solid);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: 0.15s;
}
.page-button:hover:not(:disabled), .page-button.is-active { color: #fff; border-color: var(--brand); background: var(--brand); }
.page-button.is-active { box-shadow: 0 4px 12px rgba(89, 101, 242, 0.22); }
.page-button:disabled { opacity: 0.38; cursor: default; }
.page-gap { color: var(--subtle); }

/* -------------------- Footer / Toast / Loading -------------------- */
.site-footer {
  width: min(1180px, calc(100% - 40px));
  margin: 30px auto 0;
  padding: 26px 0 38px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  border-top: 1px solid var(--line);
  color: var(--subtle);
  font-size: 11px;
}
.site-footer b { color: var(--muted); }

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 32px;
  padding: 9px 18px;
  border-radius: 999px;
  color: var(--surface-solid);
  background: var(--text);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: 0.2s ease;
  font-size: 12px;
  font-weight: 600;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.loading-bar {
  position: fixed;
  z-index: 120;
  inset: 0 0 auto;
  height: 3px;
  overflow: hidden;
  background: var(--brand-soft);
}
.loading-bar span {
  display: block;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--violet));
  animation: loading 1s infinite ease-in-out;
}
@keyframes loading { from { transform: translateX(-110%); } to { transform: translateX(360%); } }

/* -------------------- Responsive: tablet -------------------- */
@media (max-width: 1100px) {
  .recommendation-grid,
  .category-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .results-shell { grid-template-columns: 1fr; gap: 18px; }
  .filters { position: static; display: none; }
  .filters.is-open { display: block; max-height: calc(100vh - 90px); overflow: auto; }
  .filter-mobile-header {
    position: sticky;
    z-index: 2;
    top: 0;
    padding: 13px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    background: var(--surface-solid);
    font-size: 14px;
  }
  .filter-mobile-header button {
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--muted);
    background: var(--surface-soft);
    cursor: pointer;
    font-size: 12px;
  }
  .filter-toggle { display: inline-flex; }
  .filter-section { display: flex; flex-wrap: wrap; gap: 5px; }
  .filter-label { width: 100%; }
  .filter-option { width: auto; border: 1px solid var(--line); border-radius: 999px; }
  .filter-count { display: none; }
  .recommendation-grid,
  .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .result-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* -------------------- Responsive: mobile -------------------- */
@media (max-width: 720px) {
  .site-header { height: 60px; }
  .header-inner { width: calc(100% - 28px); gap: 9px; }
  .brand { gap: 9px; }
  .brand-copy b { font-size: 15px; letter-spacing: 0.02em; }
  .brand-copy small { display: none; }
  .is-results .brand-copy { display: none; }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .brand-mark svg { width: 19px; height: 19px; }
  .icon-button { width: 36px; height: 36px; border-radius: 10px; }
  .icon-button svg { width: 18px; height: 18px; }
  .header-actions { gap: 12px; }
  .popover {
    position: fixed;
    top: 68px;
    left: 14px;
    right: 14px;
    max-width: none;
    transform: none;
  }
  .popover-inner { width: 100%; max-width: none; padding: 14px; }
  .popover-qr-img { width: 92px; height: 92px; }
  @keyframes popover-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .top-search input { height: 40px; font-size: 13px; padding: 0 38px 0 40px; }

  .home-view { min-height: calc(100vh - 60px); padding: 20px 14px 64px; }
  .home-view::before { height: 400px; }
  .hero-inner h1 { font-size: 27px; letter-spacing: -0.03em; }
  .hero-search { height: 56px; margin-top: 22px; padding: 5px 5px 5px 46px; border-radius: 14px; }
  .hero-search-icon { left: 15px; }
  .hero-search-icon svg { width: 19px; height: 19px; }
  .hero-search input { font-size: 14px; }
  .hero-search-button { width: 46px; height: 46px; border-radius: 11px; }
  .hero-search-button svg { width: 20px; height: 20px; }
  .recent-searches { min-height: 22px; margin-top: 10px; font-size: 11px; }

  /* 移动端网盘卡：图标在上、文字在下，文字不竖排 */
  .platform-cards { margin-top: 18px; gap: 8px; }
  .platform-card {
    min-height: 80px;
    padding: 10px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
  }
  .platform-card > span:nth-child(2) {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    width: 100%;
  }
  .platform-card b { font-size: 13px; line-height: 1.25; white-space: nowrap; }
  .platform-card small { font-size: 10px; white-space: nowrap; }
  .platform-card i { display: none; }
  .platform-icon { width: 32px; height: 32px; border-radius: 9px; font-size: 12px; }

  .home-section { margin-top: 52px; }
  .recommendations-section { margin-top: 48px; }
  .section-heading { margin-bottom: 16px; gap: 12px; }
  .section-heading > h2,
  .section-copy h2 { font-size: 20px; }
  .section-copy p { margin-top: 2px; font-size: 11px; }
  .text-button { font-size: 12px; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .home-category { min-height: 92px; padding: 14px; }
  .home-category .category-icon { width: 36px; height: 36px; border-radius: 10px; }
  .home-category .category-icon svg { width: 19px; height: 19px; }
  .home-category b { font-size: 13px; }
  .home-category small { font-size: 10px; }

  .recommendation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .recommendation-card { min-height: 150px; padding: 12px; border-radius: 14px; }
  .recommendation-title { min-height: 38px; margin-bottom: 8px; font-size: 12px; line-height: 1.5; }
  .recommendation-meta { gap: 4px; }
  .recommendation-meta .tag { padding: 2px 7px; font-size: 9px; }
  .recommendation-card .card-actions { margin-top: 10px; gap: 6px; }
  .recommendation-card .action-button { height: 34px; font-size: 11px; }
  .action-button.primary svg { width: 13px; height: 13px; }

  .results-shell { width: calc(100% - 20px); padding-top: 22px; padding-bottom: 48px; }
  .results-meta { margin-bottom: 12px; }
  .result-count { font-size: 13px; }
  .filter-toggle { height: 34px; padding: 0 12px; font-size: 12px; margin-bottom: 12px; }
  .result-cards { grid-template-columns: 1fr; gap: 10px; }
  .result-card { padding: 14px; min-height: 116px; }
  .result-card .card-title { font-size: 13px; min-height: 40px; }
  .result-card .action-button { min-width: 60px; height: 34px; padding: 0 12px; font-size: 12px; }

  .pagination { margin-top: 24px; gap: 5px; }
  .page-button { min-width: 32px; height: 32px; padding: 0 8px; font-size: 11px; }
  .site-footer { width: calc(100% - 28px); font-size: 10.5px; }
}

@media (max-width: 420px) {
  .hero-inner h1 { font-size: 25px; }
  .hero-search { padding-left: 43px; }
  .hero-search-icon { left: 14px; }
  .platform-cards { gap: 6px; }
  .platform-card { min-height: 74px; padding: 8px 3px; }
  .platform-card b { font-size: 12px; }
  .platform-card small { font-size: 9px; }
  .platform-icon { width: 28px; height: 28px; border-radius: 8px; font-size: 11px; }
  .recommendation-card { padding: 10px; }
  .recommendation-title { font-size: 11px; }
  .result-card .card-footer { flex-wrap: wrap; }
  .result-card .card-actions { margin-left: 0; width: 100%; }
  .result-card .action-button { flex: 1; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
