:root {
  --bg: #0b0e13;
  --bg2: #11161f;
  --panel: #151b26;
  --panel2: #1c2431;
  --line: #232d3d;
  --txt: #e9eef7;
  --dim: #8a98ad;
  --dim2: #5f6c80;
  --accent: #3ddc97;
  --accent-d: #17a86c;
  --blue: #5aa2ff;
  --gold: #ffc247;
  --radius: 10px;
  /* 主题相关（深色为默认值，浅色见下方 [data-theme="light"]） */
  --topbar-bg: rgba(11, 14, 19, .86);
  --glass: rgba(11, 15, 21, .72);
  --glass-2: rgba(11, 15, 21, .85);
  --fill: rgba(255, 255, 255, .06);
  --fill-2: rgba(255, 255, 255, .12);
  --fill-faint: rgba(255, 255, 255, .025);
  --hairline: rgba(255, 255, 255, .1);
  --hairline-2: rgba(255, 255, 255, .2);
  --soft: #e7edf7;
  --on-accent: #04231a;
  --hover-line: #33415a;
  --sh-sm: 0 2px 10px rgba(0, 0, 0, .35);
  --sh-md: 0 10px 26px rgba(0, 0, 0, .55);
  --sh-lg: 0 16px 40px rgba(0, 0, 0, .6);
}

/* 白天模式：同一套变量换成浅色值，组件样式不用改 */
:root[data-theme="light"] {
  --bg: #f4f6f9;
  --bg2: #ffffff;
  --panel: #ffffff;
  --panel2: #eef2f7;
  --line: #e2e8f0;
  --txt: #17202c;
  --dim: #5d6a7c;
  --dim2: #8a96a6;
  --accent: #0f9d6a;
  --accent-d: #0b7d54;
  --blue: #2f6fd0;
  --gold: #a9761c;
  --topbar-bg: rgba(255, 255, 255, .88);
  --glass: rgba(255, 255, 255, .82);
  --glass-2: rgba(255, 255, 255, .92);
  --fill: rgba(20, 32, 48, .05);
  --fill-2: rgba(20, 32, 48, .1);
  --fill-faint: rgba(20, 32, 48, .025);
  --hairline: rgba(20, 32, 48, .1);
  --hairline-2: rgba(20, 32, 48, .18);
  --soft: #24303f;
  --on-accent: #ffffff;
  --hover-line: #bfc9d8;
  --sh-sm: 0 1px 3px rgba(20, 32, 48, .1);
  --sh-md: 0 8px 22px rgba(20, 32, 48, .14);
  --sh-lg: 0 14px 34px rgba(20, 32, 48, .18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; }
button { font-family: inherit; }

/* ---------------- 顶栏 ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 20px;
  height: 62px;
  padding: 0 22px;
  background: var(--topbar-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .5px;
  white-space: nowrap;
  color: var(--txt);
}
.brand span { color: var(--accent); }

.search {
  flex: 1;
  max-width: 620px;
  display: flex;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 6px 0 16px;
  transition: border-color .18s, background .18s;
}
.search:focus-within {
  border-color: var(--accent);
  background: var(--panel2);
}
.search input {
  flex: 1;
  height: 40px;
  background: none;
  border: 0;
  outline: none;
  color: var(--txt);
  font-size: 14.5px;
}
.search input::placeholder { color: var(--dim2); }

/* 白天 / 黑夜切换：贴顶栏右侧 */
.theme-btn {
  margin-left: auto;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--txt);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .18s, color .18s, transform .18s;
}
.theme-btn:hover { border-color: var(--accent); color: var(--accent); transform: rotate(12deg); }
.theme-btn:active { transform: scale(.94); }
.search button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
  transition: filter .15s;
}
.search button:hover { filter: brightness(1.1); }

.nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 8px;
  color: var(--dim);
  font-size: 14px;
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.nav a:hover { color: var(--txt); background: var(--panel); }
.nav a.active { color: var(--accent); background: rgba(61, 220, 151, .1); }

.pill {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

/* ---------------- 主区 ---------------- */

.view {
  max-width: 1560px;
  margin: 0 auto;
  padding: 24px 22px 80px;
}

.loading, .empty {
  padding: 80px 0;
  text-align: center;
  color: var(--dim2);
  font-size: 14px;
}

/* 请求失败时的重试按钮：弱网下比让用户自己下拉刷新省事 */
.retry-btn {
  margin-top: 14px;
  padding: 7px 20px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--fill);
  color: var(--txt);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .16s, background .16s;
}
.retry-btn:hover { border-color: var(--hover-line); background: var(--fill-2); }

/* 分类 tabs */
.libbar {
  margin: 0 0 14px;
  color: var(--dim);
  font-size: 13px;
}
.libbar b { color: var(--accent); font-weight: 600; }

/* 短剧页的自动识别条 */
.libbar.shortbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--fill-faint);
  font-size: 13px;
}
.scan-btn {
  padding: 4px 12px;
  border: 1px solid rgba(61, 220, 151, .45);
  border-radius: 999px;
  background: rgba(61, 220, 151, .1);
  color: var(--accent);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.scan-btn:hover { background: var(--accent); color: var(--on-accent); }
.scan-btn:disabled { opacity: .6; cursor: default; }
.scan-hint { color: var(--dim2); font-size: 12px; }

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 14px;
  margin-bottom: 6px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--dim);
  font-size: 13.5px;
  cursor: pointer;
  transition: all .16s;
}
.tab:hover { color: var(--txt); border-color: var(--hover-line); }
.tab.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 26px 0 16px;
  font-size: 17px;
  font-weight: 600;
}
.section-title small { color: var(--dim2); font-size: 12.5px; font-weight: 400; }

/* ---------------- 卡片网格 ---------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 20px 16px;
}

.card { display: block; }

.card .poster {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--sh-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover .poster {
  transform: translateY(-4px);
  box-shadow: var(--sh-md);
}
.card .poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.card:hover .poster img { transform: scale(1.04); }

.card .ph {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--dim2);
  font-size: 12px;
  text-align: center;
  padding: 10px;
}

.badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(61, 220, 151, .92);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}

/* 按 ID 精确命中的角标：贴右上，避开右下评分 */
.badge-id {
  left: auto;
  right: 8px;
  background: rgba(90, 162, 255, .92);
  color: #06121f;
}
.score {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .72);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(4px);
}

.card .meta { padding: 9px 2px 0; }
.card .meta b {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card .meta small { color: var(--dim2); font-size: 12px; }
/* 剧集进度分色：连载=绿、完结=金、未播=灰 */
.card .meta .ep { font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.card .meta .ep.live { color: var(--accent); }
.card .meta .ep.done { color: var(--gold); }
.card .meta .ep.soon { color: var(--dim2); }

/* 滚动到底自动加载 */
.sentinel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 72px;
  margin-top: 20px;
  color: var(--dim2);
  font-size: 13px;
}
.sentinel:empty { min-height: 8px; margin-top: 0; }
.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 详情页 ---------------- */

.detail-hero {
  position: relative;
  margin: -24px -22px 0;
  padding: 40px 22px 30px;
  overflow: hidden;
}
.detail-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--bd);
  background-size: cover;
  background-position: center 22%;
  filter: blur(2px) brightness(.42);
  transform: scale(1.06);
}
.detail-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11,14,19,.55) 0%, rgba(11,14,19,.75) 55%, var(--bg) 100%);
}
.detail-inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start; /* 不加这行 flex 会 stretch 海报，aspect-ratio 失效→海报被拉高 */
  gap: 30px;
  max-width: 1300px;
  margin: 0 auto;
}
.detail-left {
  flex: 0 0 240px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.detail-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--sh-lg);
}
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }

/* 播放 / 待下载：贴在海报下方，两个并排、小尺寸 */
.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.detail-actions .btn {
  width: 100%;
  padding: 8px 6px;
  font-size: 12.5px;
  border-radius: 8px;
  gap: 4px;
  white-space: nowrap;
  justify-content: center;
}

.detail-info {
  flex: 1;
  min-width: 0;
  padding-top: 6px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  grid-template-areas: "head side" "main side";
  align-items: start;
  column-gap: 30px;
  row-gap: 0;
}
.di-head { grid-area: head; min-width: 0; }
.di-main { grid-area: main; min-width: 0; }
.di-side {
  grid-area: side;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}
.di-side .chips { margin-bottom: 0; }
.di-side .scores { margin: 0; flex-direction: column; gap: 8px; }
.di-side .score-card { min-width: 0; width: 100%; }
/* 几个 ID（TMDB / 豆瓣 / IMDb）挪到右侧栏，一行一个、右对齐 */
.di-side .idrow {
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  margin: 2px 0 0;
}
.detail-info h1 {
  margin: 0 0 4px;
  font-size: 32px;
  line-height: 1.25;
  font-weight: 700;
}
.detail-info .orig { color: var(--dim); font-size: 14px; margin-bottom: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
  padding: 4px 11px;
  border-radius: 7px;
  background: var(--fill);
  border: 1px solid var(--hairline);
  font-size: 12.5px;
  color: var(--soft);
}
.chip.rating { color: var(--gold); font-weight: 700; }
.chip.lib { background: rgba(61,220,151,.15); border-color: rgba(61,220,151,.4); color: var(--accent); }

/* 评分卡（豆瓣 / IMDb / 烂番茄） */
.scores { display: flex; flex-wrap: wrap; gap: 10px; margin: 2px 0 18px; }
.score-card {
  display: flex;
  /* 来源 / 分数 / 人数 全部排在同一行，不竖排、不折行 */
  flex-direction: row;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
  min-width: 0;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--fill);
  border: 1px solid var(--hairline);
  text-decoration: none;
}
.score-card .src { font-size: 12px; color: var(--dim2); flex: 0 0 auto; }
.score-card .val {
  flex: 0 0 auto;
  font-size: 23px;
  line-height: 1.15;
  font-weight: 700;
  color: var(--soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.score-card .cnt { font-size: 11px; color: var(--dim2); white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.score-card.douban .val { color: #3ecf8e; }
.score-card.imdb .val { color: #f5c518; }
.score-card.rt .val { color: #fa5a3c; }
.score-card.mtc .val { color: #6ac44a; }
.score-card.muted .val { color: var(--dim2); }
a.score-card:hover { border-color: var(--accent); }

.tagline { color: var(--accent); font-size: 14px; font-style: italic; margin-bottom: 14px; }

/* 标识行：TMDB / 豆瓣 / IMDb */
.idrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 18px; }
.idchip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 4px 3px 10px;
  border-radius: 7px;
  background: var(--fill);
  border: 1px solid var(--hairline);
  font-size: 12.5px;
  color: var(--dim);
  white-space: nowrap;
}
.idchip a { color: inherit; text-decoration: none; }
.idchip a:hover { color: var(--accent); }
.idchip b { color: var(--soft); font-weight: 600; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.idchip.off { color: var(--dim2); padding-right: 10px; border-style: dashed; opacity: .75; }
.idchip.sm { font-size: 11.5px; padding: 2px 3px 2px 8px; }
.idchip .cp {
  border: 0;
  background: transparent;
  color: var(--dim2);
  font-size: 12px;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 5px;
  cursor: pointer;
}
.idchip .cp:hover { background: var(--fill-2); color: var(--accent); }
.idmini { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
/* 补全 Emby 元数据：低调的虚线小按钮，跟 ID 行并排 */
.fill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 7px;
  background: transparent;
  color: var(--dim);
  border: 1px dashed var(--hairline-2);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.fill-btn:hover { color: var(--accent); border-color: var(--accent); }
.fill-btn:disabled { opacity: .55; cursor: default; }
/* 「标为短剧」已标记态 */
.fill-btn.on {
  color: var(--accent);
  border-style: solid;
  border-color: rgba(61, 220, 151, .5);
  background: rgba(61, 220, 151, .1);
}

.meta-list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 7px 14px;
  max-width: 760px;
  margin: 2px 0 20px;
  font-size: 13.5px;
  line-height: 1.65;
}
.meta-list dt { color: var(--dim2); white-space: nowrap; }
.meta-list dd { color: var(--soft); margin: 0; overflow-wrap: anywhere; }

.overview {
  max-width: 860px;
  color: var(--dim);
  font-size: 14.5px;
  line-height: 1.85;
  margin-bottom: 24px;
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border: 0;
  border-radius: 9px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s, transform .1s;
}
.btn:active { transform: scale(.985); }
.btn-play { background: var(--accent); color: var(--on-accent); }
.btn-play:hover { filter: brightness(1.08); }
.btn-wish { background: var(--panel2); color: var(--txt); border: 1px solid var(--line); }
.btn-wish:hover { border-color: var(--blue); color: var(--blue); }
.btn-wish.on { background: rgba(90,162,255,.14); border-color: var(--blue); color: var(--blue); }
.btn-ghost { background: transparent; color: var(--dim); border: 1px solid var(--line); }
.btn-ghost:hover { color: var(--txt); }

/* ---------------- 分集 ---------------- */

.eps-block { max-width: 1300px; margin: 34px auto 0; padding: 0 22px; scroll-margin-top: 78px; }
.season-tabs { padding-bottom: 10px; margin-bottom: 2px; }
.ep-row { display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.ep-row:first-child { border-top: 0; }
.ep-still {
  flex: 0 0 156px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel2);
}
.ep-still img { width: 100%; height: 100%; object-fit: cover; }
.ep-main { flex: 1; min-width: 0; }
.ep-line { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.ep-no {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  letter-spacing: .3px;
}
.ep-title { font-size: 14.5px; font-weight: 600; }
.ep-meta { margin: 1px 0 3px; color: var(--dim2); font-size: 12.3px; }
.ep-ov {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 1000px;
  margin: 0;
  color: var(--dim);
  font-size: 12.8px;
  line-height: 1.55;
}
.dim2 { color: var(--dim2); }

/* ---------------- 资源链接（磁力 / 电驴 / 网盘） ---------------- */

.links-block { max-width: 1300px; margin: 30px auto 0; padding: 0 22px; }
.lk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}
.lk-head .section-title { margin: 0; }

/* 磁力 / 电驴 / 网盘分栏：胶囊标签 + 数量 */
.lk-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.lk-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--dim);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.lk-tab .n {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--dim2);
  font-size: 11.5px;
  font-style: normal;
  text-align: center;
}
.lk-tab:hover { color: var(--txt); border-color: var(--hover-line); }
.lk-tab.active {
  color: var(--accent);
  border-color: rgba(61, 220, 151, .5);
  background: rgba(61, 220, 151, .1);
}
.lk-tab.active .n { background: rgba(61, 220, 151, .2); color: var(--accent); }
.lk-tab[hidden] { display: none; }

/* 来源分组：分类 tab 下方的附加筛选（第二维，视觉比分类弱一档） */
.lk-sources {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: -4px 0 13px;
}
/* 季 tab 行：跟来源行同款按钮，紧贴在它下面 */
.lk-seasons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: -7px 0 13px;
}
.lks-label { color: var(--dim2); font-size: 12px; margin-right: 2px; }
/* 排序行：跟来源 / 季同款按钮，紧贴在季下面 */
.lk-sort {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: -7px 0 13px;
}
.lk-sort .lk-dir {
  color: var(--accent);
  border-color: var(--accent);
}
.lk-sort .lk-dir:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(61, 220, 151, .12);
}
.lk-src {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--dim);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.lk-src .n {
  min-width: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--dim2);
  font-size: 10.5px;
  font-style: normal;
  text-align: center;
}
.lk-src:hover { color: var(--txt); border-color: var(--hover-line); }
.lk-src.on {
  color: #ffd166;
  border-color: rgba(255, 209, 102, .5);
  background: rgba(255, 209, 102, .1);
}
.lk-src.on .n { background: rgba(255, 209, 102, .2); color: #ffd166; }
/* 链接条目上的来源小徽标 */
.lk-srcbadge {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10.5px;
  letter-spacing: .3px;
  border: 1px solid var(--line);
  color: var(--dim);
  background: var(--fill);
}

.lk-add { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.lk-add input,
.lk-add textarea {
  flex: 1 1 380px;
  min-width: 0;
  padding: 10px 13px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--txt);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
/* 多行粘贴要有地方显示「一行一个地址」，所以用 textarea 并且不许手动拉扯 */
.lk-add textarea {
  resize: none;
  line-height: 1.55;
  max-height: 168px;
  overflow-y: auto;
  white-space: pre;
}
.lk-add input::placeholder,
.lk-add textarea::placeholder { color: var(--dim2); }
.lk-add input:focus,
.lk-add textarea:focus {
  border-color: rgba(61, 220, 151, .55);
  box-shadow: 0 0 0 3px rgba(61, 220, 151, .10);
}
.lk-add .lk-label { flex: 0 1 260px; }
.lk-btn {
  flex: 0 0 auto;
  padding: 10px 16px;
  border-radius: 9px;
  border: 1px solid rgba(61, 220, 151, .45);
  background: rgba(61, 220, 151, .12);
  color: var(--accent);
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: background .15s;
}
.lk-btn:hover { background: rgba(61, 220, 151, .2); }
.lk-btn:disabled { opacity: .5; cursor: default; }

.lk-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.lk-empty {
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: 9px;
  color: var(--dim2);
  font-size: 13px;
}
.lk-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
}
.lk-item:hover { border-color: var(--hover-line); }

/* 列表过长时收着放，避免一集一条把详情页撑到几万像素 */
.lk-more {
  align-self: center;
  margin: 2px 0 4px;
  padding: 7px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--dim);
  font-size: 13px;
  cursor: pointer;
  transition: .15s;
}
.lk-more:hover { color: #fff; border-color: var(--hover-line); background: var(--panel2); }

.lk-kind {
  flex: 0 0 auto;
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  letter-spacing: .3px;
  border: 1px solid var(--line);
  color: var(--dim);
  background: var(--fill);
}
.k-magnet { color: #6fd0ff; background: rgba(90, 162, 255, .13); border-color: rgba(90, 162, 255, .32); }
.k-ed2k { color: #b79bff; background: rgba(150, 120, 255, .13); border-color: rgba(150, 120, 255, .32); }
.k-thunder { color: #ffb86b; background: rgba(255, 160, 80, .13); border-color: rgba(255, 160, 80, .32); }
.k-pan { color: var(--accent); background: rgba(61, 220, 151, .12); border-color: rgba(61, 220, 151, .32); }
/* 各网盘一眼分得清 */
.k-115 { color: #5ec8ff; background: rgba(80, 170, 255, .13); border-color: rgba(80, 170, 255, .32); }
.k-quark { color: #8f8bff; background: rgba(120, 110, 255, .14); border-color: rgba(120, 110, 255, .33); }
.k-ali { color: #ff9a5c; background: rgba(255, 140, 70, .13); border-color: rgba(255, 140, 70, .32); }
.k-baidu { color: #6fa8ff; background: rgba(70, 130, 255, .13); border-color: rgba(70, 130, 255, .32); }
.k-189 { color: #58d6d6; background: rgba(70, 200, 200, .13); border-color: rgba(70, 200, 200, .32); }
.k-123 { color: #ffd166; background: rgba(255, 200, 80, .13); border-color: rgba(255, 200, 80, .32); }
.k-uc { color: #ff8f6b; background: rgba(255, 120, 80, .13); border-color: rgba(255, 120, 80, .32); }
.k-xunlei { color: #7fd0ff; background: rgba(90, 190, 255, .13); border-color: rgba(90, 190, 255, .32); }
.k-pikpak { color: #a6e3a1; background: rgba(140, 220, 140, .13); border-color: rgba(140, 220, 140, .32); }
.k-weiyun { color: #6fd9f5; background: rgba(90, 200, 230, .13); border-color: rgba(90, 200, 230, .32); }
.k-lanzou { color: #9cd67a; background: rgba(140, 200, 110, .13); border-color: rgba(140, 200, 110, .32); }
.k-139 { color: #7fc6a8; background: rgba(110, 200, 170, .13); border-color: rgba(110, 200, 170, .32); }
.k-guangya, .k-21cn, .k-other_pan { color: var(--dim); background: var(--fill); border-color: var(--line); }
/* 有明确来源的站点：单独配色，排在 tab 最前 */
.k-jumimi115 { color: #ff8fb1; background: rgba(255, 110, 160, .13); border-color: rgba(255, 110, 160, .32); }
.k-aiying { color: #ffd166; background: rgba(255, 200, 80, .13); border-color: rgba(255, 200, 80, .32); }
.k-yc { color: #a0e7ff; background: rgba(100, 210, 255, .13); border-color: rgba(100, 210, 255, .32); }
.k-gweb { color: #c8a2ff; background: rgba(170, 120, 255, .14); border-color: rgba(170, 120, 255, .33); }

.lk-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 18px;              /* 名称和大小拉开距离，别糊成一片 */
}
a.lk-t {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  font-size: 13.5px;
  color: var(--txt);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
a.lk-t:hover { color: var(--accent); text-decoration: underline; }
/* 资源大小：金色、独立元素，不在链接里 */
.lk-size {
  flex: 0 0 auto;
  color: var(--gold);
  font-size: 12.5px;
  letter-spacing: .2px;
  white-space: nowrap;
}
.lk-u {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  color: var(--dim2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lk-ops { flex: 0 0 auto; display: flex; gap: 6px; }
.lk-mini {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--dim);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.45;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.lk-mini:hover { color: var(--accent); border-color: rgba(61, 220, 151, .5); }
.lk-mini.del:hover { color: #ff7a7a; border-color: rgba(255, 122, 122, .5); }
.lk-mini.save { color: var(--accent); border-color: rgba(61, 220, 151, .5); background: rgba(61, 220, 151, .1); }
.lk-mini.save:hover { background: rgba(61, 220, 151, .2); }
a.lk-mini { display: inline-block; }

/* 内联编辑：点「修改」后该行变成地址 + 备注输入框 */
.lk-item.lk-editing { align-items: flex-start; flex-wrap: wrap; border-color: rgba(61, 220, 151, .4); }
.lk-edit-fields { flex: 1 1 320px; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.lk-edit-fields textarea,
.lk-edit-fields input {
  width: 100%;
  padding: 8px 11px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--bg, #0f141c);
  color: var(--txt);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
}
.lk-edit-fields textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  resize: vertical;
  min-height: 52px;
  max-height: 200px;
  white-space: pre-wrap;
  word-break: break-all;
}
.lk-edit-fields input::placeholder,
.lk-edit-fields textarea::placeholder { color: var(--dim2); }
.lk-edit-fields textarea:focus,
.lk-edit-fields input:focus { border-color: rgba(61, 220, 151, .5); }

.cast-block { max-width: 1300px; margin: 34px auto 0; padding: 0 22px; }
/* 演员行：隐藏滚动条，用左右箭头翻页 */
.cast-wrap { position: relative; }
.cast-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.cast-row::-webkit-scrollbar { display: none; }
.cast-nav {
  position: absolute;
  top: 69px;                       /* 头像 138 的中线 */
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(11, 15, 21, .88);
  color: var(--soft);
  border: 1px solid var(--hairline-2);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
  transition: opacity .15s, background .15s;
}
.cast-wrap.can-scroll .cast-nav { display: flex; }
.cast-nav:hover { background: rgba(30, 40, 54, .95); border-color: var(--accent); color: var(--accent); }
.cast-nav.prev { left: -10px; }
.cast-nav.next { right: -10px; }
.cast-nav:disabled { opacity: 0; pointer-events: none; }
.cast-item { flex: 0 0 92px; text-align: center; }
.cast-item .ava {
  width: 92px;
  height: 138px;
  border-radius: 0;
  overflow: hidden;
  background: var(--panel2);
  margin-bottom: 8px;
  display: grid;
  place-items: center;
  color: var(--dim2);
  font-size: 20px;
}
.cast-item .ava img { width: 100%; height: 100%; object-fit: cover; }
.cast-item b { display: block; font-size: 13px; font-weight: 500; line-height: 1.3; margin-top: 1px; }
.cast-item small { color: var(--dim2); font-size: 11.5px; }
a.cast-item:hover .ava { outline: 1px solid rgba(61, 220, 151, .55); outline-offset: 2px; }
a.cast-item:hover b { color: var(--accent); }

/* ---------------- 演员页 ---------------- */

.person-head { display: flex; gap: 26px; align-items: flex-start; margin-bottom: 30px; }
.person-photo {
  flex: 0 0 200px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .5);
}
.person-photo img { width: 100%; height: 100%; object-fit: cover; }
.person-photo .ph { display: grid; place-items: center; height: 100%; color: var(--dim2); font-size: 44px; }
.person-info { flex: 1; min-width: 0; }
.person-info h1 { margin: 8px 0 4px; font-size: 30px; letter-spacing: .4px; }
.person-sub { color: var(--dim); font-size: 13.5px; margin-bottom: 10px; }
.person-sub b { color: var(--txt); font-weight: 600; }
.person-sub .hi { color: var(--accent); }
.bio-wrap { max-width: 900px; }
.person-bio {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 900px;
  font-size: 13.5px;
}
.person-bio.open { -webkit-line-clamp: unset; overflow: visible; }
.bio-more {
  margin-top: 2px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 12.5px;
  cursor: pointer;
}
#ptabs { margin: 0 0 14px; padding-bottom: 0; }
#ptabs .tab b { font-weight: 600; }

.person-list { display: flex; flex-direction: column; gap: 12px; max-width: 1000px; }
.pcard {
  display: flex;
  gap: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  transition: border-color .18s ease, background .18s ease;
}
.pcard:hover { border-color: rgba(61, 220, 151, .45); background: var(--panel2); }
.pcard-poster {
  flex: 0 0 74px;
  aspect-ratio: 2 / 3;
  border-radius: 7px;
  overflow: hidden;
  background: var(--bg2);
}
.pcard-poster img { width: 100%; height: 100%; object-fit: cover; }
.pcard-poster .ph { display: grid; place-items: center; height: 100%; padding: 4px; text-align: center; color: var(--dim2); font-size: 11px; }
.pcard-body { flex: 1; min-width: 0; }
.pcard-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14.5px; font-weight: 600; }
.pcard-title .yr { color: var(--dim2); font-size: 12.5px; font-weight: 400; }
.pcard-title .badge-in {
  padding: 1px 6px;
  border: 1px solid rgba(61, 220, 151, .45);
  border-radius: 5px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 400;
}
.pcard-sub { margin: 2px 0 4px; color: var(--dim); font-size: 12.5px; }
.pcard-ov {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  color: var(--dim);
  font-size: 12.8px;
  line-height: 1.55;
}

/* ---------------- 待下载清单 ---------------- */

.wish-list { display: flex; flex-direction: column; gap: 12px; }
.wish-row {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color .15s;
}
.wish-row:hover { border-color: var(--hover-line); }
.wish-row .thumb {
  flex: 0 0 56px;
  width: 56px;
  height: 84px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--panel2);
}
.wish-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-ph {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--dim2);
  font-size: 18px;
  font-weight: 600;
}
.wish-row .info { flex: 1; min-width: 0; }
.wish-row .info b { display: block; font-size: 15px; font-weight: 600; }
.wish-row .info small { color: var(--dim2); }
.wish-row .ops { display: flex; gap: 8px; flex-shrink: 0; }
.mini {
  padding: 6px 12px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--dim);
  font-size: 12.5px;
  cursor: pointer;
}
.mini:hover { color: var(--txt); border-color: #3d4b63; }
.mini.done { color: var(--accent); border-color: rgba(61,220,151,.4); }
.mini.del:hover { color: #ff6b6b; border-color: rgba(255,107,107,.45); }

/* ---------------- 提示 ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translate(-50%, 20px);
  padding: 11px 22px;
  border-radius: 9px;
  background: #1e2836;
  border: 1px solid var(--hover-line);
  color: var(--txt);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 200;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 前端版本更新提示（部署后老标签页会看到） */
.ver-bar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 18px;
  border-radius: 10px;
  background: var(--panel2);
  border: 1px solid var(--accent-d);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  color: var(--txt);
  font-size: 14px;
}

.ver-bar button {
  padding: 7px 14px;
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: #07120c;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.ver-bar button:hover { background: #4ce8a6; }

/* ---------------- 响应式 ---------------- */

/* 窄屏放不下右栏 → 评分/标签回到标题下方（放在最前，先看分数） */
@media (max-width: 960px) {
  .detail-info {
    grid-template-columns: 1fr;
    grid-template-areas: "head" "side" "main";
    row-gap: 0;
  }
  .di-side { margin: 14px 0 18px; padding-top: 0; }
  .di-side .scores { flex-direction: row; flex-wrap: wrap; }
  .di-side .idrow { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; }
}

@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 10px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .nav { margin-left: auto; }
  .view { padding: 18px 14px 70px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 16px 11px; }
  .detail-hero { margin: -18px -14px 0; padding: 28px 14px 24px; }
  .detail-inner { flex-direction: column; gap: 18px; }
  .detail-left { flex: 0 0 auto; width: auto; flex-direction: column; }
  .detail-poster { width: 150px; }
  .detail-actions { grid-template-columns: repeat(2, minmax(0, 150px)); }
  .detail-info h1 { font-size: 23px; }
  .cast-block { padding: 0 14px; }
  .eps-block { padding: 0 14px; }
  /* 资源链接：窄屏输入框各占一行，条目竖排，链接不撑破屏幕 */
  .links-block { padding: 0 14px; }
  .lk-head { gap: 8px; }
  .lk-tab { padding: 4px 10px; font-size: 12.5px; }
  .lk-add input, .lk-add textarea, .lk-add .lk-label { flex: 1 1 100%; }
  .lk-btn { flex: 1 1 100%; }
  .lk-item { flex-wrap: wrap; gap: 8px; }
  .lk-main { flex: 1 1 100%; order: 2; align-items: center; }
  .lk-kind { order: 1; }
  .lk-ops { order: 3; flex: 1 1 100%; justify-content: flex-end; }
  /* 手机端：长名称不再三点省略，改成左右拖动查看完整内容（用户 2026-11-21 要求） */
  a.lk-t {
    flex: 1 1 auto;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    text-overflow: clip;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    cursor: grab;
    -webkit-user-drag: none;   /* 禁掉链接原生拖拽，否则拖 5px 就被 dragstart 接管 */
  }
  a.lk-t::-webkit-scrollbar { display: none; }
  a.lk-t.dragging { cursor: grabbing; user-select: none; }
  .ep-still { flex: 0 0 108px; }
  .ep-ov { -webkit-line-clamp: 3; }
  .person-head { flex-direction: column; gap: 14px; }
  .person-photo { flex: 0 0 auto; width: 118px; }
  .person-info h1 { font-size: 24px; }
  .pcard-poster { flex: 0 0 62px; }
  .pcard-ov { -webkit-line-clamp: 3; }
}

/* ---------------- 资源库（三维筛选） ---------------- */
/* 筛选条：不展开时只留这一行，把首屏让给卡片（用户 2026-11-19 要求） */
.rf-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  min-width: 0;
}
.rf-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--dim);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color .16s, background .16s, color .16s;
}
.rf-toggle:hover { border-color: var(--hover-line); color: var(--txt); }
.rf-toggle.on {
  border-color: var(--hover-line);
  background: rgba(90, 162, 255, .12);
  color: var(--accent);
}
.rf-ico { font-size: 13px; line-height: 1; opacity: .85; }
.rf-caret { font-size: 10px; color: var(--dim2); transition: transform .2s; }
.rf-toggle.on .rf-caret { transform: rotate(180deg); }
.rf-n {
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}
.rf-cur {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  color: var(--txt);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rf-cur.idle { color: var(--dim2); }
.rf-reset {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--dim);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: color .16s, border-color .16s;
}
.rf-reset:hover { color: var(--txt); border-color: var(--hover-line); }
.rf-bar .hide { display: none; }
/* 收起 / 展开：max-height 由 JS 按真实高度给，内容跟着向上抽走 */
.rf-wrap {
  overflow: hidden;
  transition: max-height .32s cubic-bezier(.22, .61, .36, 1),
              opacity .22s ease, transform .32s cubic-bezier(.22, .61, .36, 1);
}
.rf-wrap.collapsed { opacity: 0; transform: translateY(-10px); }
.res-filters {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 4px;
  margin-bottom: 14px;
}
.res-filter {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}
.rf-label {
  flex: 0 0 34px;
  color: var(--dim2);
  font-size: 13px;
  line-height: 34px;
  user-select: none;
}
.res-filter .tabs {
  flex: 1;
  gap: 6px;
  padding-bottom: 8px;
  margin-bottom: 0;
  flex-wrap: wrap;
  overflow: visible;
  position: relative;
  /* 右侧给「更多」留位：它绝对定位在第一行最右，选项不会把它挤到下一行 */
  padding-right: 76px;
}
/* 收起状态：单行不换行；「更多」钉在行尾右侧 */
.res-filter[data-open="0"] .tabs { flex-wrap: nowrap; overflow: hidden; }
.res-filter[data-open="0"] .tab.res-more {
  position: absolute;
  right: 0;
  top: 0;
  margin-left: 0;
}
/* 展开状态：正常换行显示全部，更多跟在最后 */
.res-filter[data-open="1"] .tabs { flex-wrap: wrap; padding-right: 0; }
.res-filter[data-open="1"] .tab.res-more { position: static; margin-left: 0; }
.res-filter .tab { padding: 6px 13px; font-size: 13px; }
.res-filter .tab.res-extra { display: none; }
.res-filter .tab.res-extra.show { display: inline-block; }
/* 按宽度自适应折叠（fitFilterRow 算出来的，放不下的选项） */
.res-filter .tab.res-hide { display: none; }
.res-filter .tab.res-more { color: var(--accent); border-color: var(--hover-line); }
.res-filter .tab.res-more.open { background: rgba(90,162,255,.14); }
/* 排序行：与筛选条件用分隔线区开，高亮色更醒目 */
.res-sort-row {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 2px;
  align-items: center;
}
.res-sort-row .rf-label { line-height: 32px; }
.res-sort-row .tabs { padding-bottom: 2px; padding-right: 0; }
/* 正序 / 倒序开关：跟排序维度放一行，配色用 accent 勾勒，和实心的选中态区分开 */
.res-sort-row .tab.res-dir {
  font-size: 12px;
  padding: 6px 11px;
  color: var(--accent);
  border-color: var(--accent);
  opacity: .85;
}
.res-sort-row .tab.res-dir:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(61,220,151,.12);
  opacity: 1;
}
.res-summary {
  color: var(--dim);
  font-size: 13px;
  margin: 0 2px 14px;
}
.res-summary b { color: var(--accent); }

.res-card .res-total {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, .72);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 5px;
}
.rk-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}
.rk {
  font-style: normal;
  font-size: 10.5px;
  line-height: 1.5;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
}
.rk.mag  { background: rgba(90, 162, 255, .14); color: #8ec2ff; }
.rk.pan  { background: rgba(61, 220, 151, .13); color: #6fe3b0; }
.rk.ed2k { background: rgba(255, 194, 71, .13); color: #ffd27a; }

@media (max-width: 600px) {
  .res-filters { padding: 10px 10px 2px; }
  .rf-label { flex-basis: 30px; font-size: 12px; }
  .res-filter .tab { padding: 5px 10px; font-size: 12px; }
  .rf-bar { gap: 8px; margin-bottom: 10px; }
  .rf-toggle { height: 32px; padding: 0 11px; font-size: 12.5px; }
  .rf-cur { font-size: 12px; }
  .rf-reset { height: 28px; padding: 0 9px; font-size: 12px; }
}


/* ---------------- 白天模式的局部校正 ---------------- */
/* 资源类型 / 网盘徽标原按深底设计（亮字 + 淡色底），浅底上要压暗才看得清 */
:root[data-theme="light"] .lk-kind { filter: saturate(1.15) brightness(.72); }
:root[data-theme="light"] .score-card.imdb .val { color: #b8860b; }
:root[data-theme="light"] .score-card.douban .val { color: #1f9d6b; }
:root[data-theme="light"] .score-card.rt .val { color: #d4432a; }
:root[data-theme="light"] .score-card.mtc .val { color: #4e9b2f; }
/* 详情页头图：深色主题是「暗化图片 + 白字」，浅色主题要翻过来，否则深色文字压不住暗图 */
:root[data-theme="light"] .detail-hero::before { filter: blur(2px) brightness(1.08) saturate(.85); }
:root[data-theme="light"] .detail-hero::after {
  background: linear-gradient(180deg, rgba(255,255,255,.62) 0%, rgba(255,255,255,.86) 55%, var(--bg) 100%);
}
