:root,
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f4f1ea;
  --muted: #8f939e;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.12);
  --panel: rgba(16, 18, 26, 0.78);
  --panel-solid: #13151d;
  --bg: #080a0f;
  --surface: #0c0e14;
  --surface-2: #171a23;
  --surface-3: #101219;
  --sidebar-bg: rgba(7, 9, 14, 0.82);
  --input-bg: rgba(10, 12, 18, 0.92);
  --input-border: rgba(255, 255, 255, 0.1);
  --label: #d5d4dc;
  --nav: #7f8491;
  --chip: #c4c4ce;
  --elevated: #141720;
  --hero-from: #171a25;
  --hero-to: #0f1118;
  --poster-from: #1c2030;
  --poster-to: #0d1017;
  --search-bg: rgba(14, 16, 24, 0.88);
  --body-glow: #1c2235;
  --ghost-bg: rgba(255, 255, 255, 0.045);
  --soft-bg: rgba(255, 255, 255, 0.03);
  --violet: #8f7cff;
  --violet-2: #6d5ce0;
  --cyan: #6fe3cf;
  --coral: #f0927c;
  --gold: #e8cf8a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34), 0 2px 0 rgba(255, 255, 255, 0.02) inset;
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.42);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --ring: 0 0 0 3px rgba(143, 124, 255, 0.16);
  --theme-meta: #080a0f;
  font-family: "SF Pro Display", "SF Pro Text", Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html[data-theme="black"] {
  color-scheme: dark;
  --ink: #f3f3f3;
  --muted: #8b8b8b;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.12);
  --panel: rgba(14, 14, 14, 0.9);
  --panel-solid: #0d0d0d;
  --bg: #000000;
  --surface: #050505;
  --surface-2: #121212;
  --surface-3: #090909;
  --sidebar-bg: rgba(0, 0, 0, 0.92);
  --input-bg: #0a0a0a;
  --input-border: rgba(255, 255, 255, 0.1);
  --label: #d2d2d2;
  --nav: #7a7a7a;
  --chip: #c2c2c2;
  --elevated: #0f0f0f;
  --hero-from: #141414;
  --hero-to: #050505;
  --poster-from: #171717;
  --poster-to: #050505;
  --search-bg: rgba(12, 12, 12, 0.94);
  --body-glow: #181818;
  --ghost-bg: rgba(255, 255, 255, 0.04);
  --soft-bg: rgba(255, 255, 255, 0.028);
  --violet: #9b8cff;
  --violet-2: #7565e8;
  --cyan: #6fe0cb;
  --coral: #f0927c;
  --gold: #e8cf8a;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 30px 90px rgba(0, 0, 0, 0.65);
  --theme-meta: #000000;
}

html[data-theme="light"] {
  color-scheme: light;
  --ink: #17181f;
  --muted: #6a6f7c;
  --line: rgba(24, 28, 40, 0.08);
  --line-strong: rgba(24, 28, 40, 0.14);
  --panel: rgba(255, 255, 255, 0.82);
  --panel-solid: #ffffff;
  --bg: #f2efe7;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --surface-3: #f8f5ee;
  --sidebar-bg: rgba(255, 255, 255, 0.78);
  --input-bg: #ffffff;
  --input-border: rgba(24, 28, 40, 0.12);
  --label: #3c4050;
  --nav: #686e7c;
  --chip: #4a4f5c;
  --elevated: #ffffff;
  --hero-from: #ffffff;
  --hero-to: #efe9dc;
  --poster-from: #ebe5d8;
  --poster-to: #f6f2e9;
  --search-bg: rgba(255, 255, 255, 0.9);
  --body-glow: #e5dece;
  --ghost-bg: rgba(24, 28, 40, 0.04);
  --soft-bg: rgba(24, 28, 40, 0.03);
  --violet: #6d58ef;
  --violet-2: #5845d4;
  --cyan: #1a9a88;
  --coral: #d86a52;
  --gold: #b8943c;
  --shadow: 0 14px 40px rgba(48, 42, 28, 0.08), 0 1px 0 rgba(255, 255, 255, 0.7) inset;
  --shadow-lg: 0 28px 70px rgba(48, 42, 28, 0.12);
  --ring: 0 0 0 3px rgba(109, 88, 239, 0.14);
  --theme-meta: #f2efe7;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(ellipse 70% 45% at 70% -8%, color-mix(in srgb, var(--violet) 18%, transparent), transparent 55%),
    radial-gradient(ellipse 50% 35% at 8% 100%, color-mix(in srgb, var(--cyan) 10%, transparent), transparent 50%),
    radial-gradient(circle at 50% -10%, var(--body-glow) 0, transparent 42%),
    var(--bg);
  transition: background 220ms ease, color 220ms ease;
}
::selection { background: color-mix(in srgb, var(--violet) 38%, transparent); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
a { color: inherit; }
.is-hidden { display: none !important; }

/* refined scrollbars */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 35%, transparent); border-radius: 999px; }
*::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--muted) 55%, transparent); }
*::-webkit-scrollbar-track { background: transparent; }

.ambient { position: fixed; pointer-events: none; filter: blur(110px); opacity: 0.14; border-radius: 50%; z-index: 0; }
html[data-theme="light"] .ambient { opacity: 0.1; }
html[data-theme="black"] .ambient { opacity: 0.07; }
.ambient-a { width: 460px; height: 460px; background: var(--violet); right: -180px; top: -140px; }
.ambient-b { width: 340px; height: 340px; background: var(--cyan); left: 12%; bottom: -230px; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--cyan);
  font-size: 10px;
  letter-spacing: 0.2em;
  font-weight: 800;
  text-transform: uppercase;
}
.button {
  border: 0;
  border-radius: var(--radius-sm);
  min-height: 42px;
  padding: 0 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:disabled { opacity: 0.55; cursor: wait; transform: none; }
.button.primary {
  background: linear-gradient(135deg, var(--violet), var(--violet-2));
  color: white;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--violet) 28%, transparent), 0 1px 0 rgba(255,255,255,0.12) inset;
}
.button.primary:hover { box-shadow: 0 14px 34px color-mix(in srgb, var(--violet) 34%, transparent), 0 1px 0 rgba(255,255,255,0.16) inset; }
.button.ghost {
  background: var(--ghost-bg);
  color: var(--muted);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.button.ghost:hover { color: var(--ink); border-color: var(--line-strong); background: color-mix(in srgb, var(--ghost-bg) 70%, var(--violet) 8%); }
.button.wide { width: 100%; }

.brand-mark {
  display: flex;
  width: 58px;
  height: 58px;
  align-items: end;
  justify-content: center;
  gap: 4px;
  padding: 13px;
  border-radius: 18px;
  background: linear-gradient(145deg, #a294ff, #5b4ad0);
  transform: rotate(-5deg);
  box-shadow: 0 14px 32px rgba(91, 74, 208, 0.36), 0 1px 0 rgba(255,255,255,0.22) inset;
}
.brand-mark span { width: 6px; border-radius: 6px; background: white; box-shadow: 0 0 10px rgba(255,255,255,0.35); }
.brand-mark span:nth-child(1) { height: 16px; opacity: 0.7; }
.brand-mark span:nth-child(2) { height: 29px; }
.brand-mark span:nth-child(3) { height: 22px; opacity: 0.82; }
.brand-mark.small { width: 40px; height: 40px; padding: 9px; border-radius: 13px; gap: 3px; }
.brand-mark.small span { width: 4px; }
.brand-mark.small span:nth-child(1) { height: 12px; }
.brand-mark.small span:nth-child(2) { height: 20px; }
.brand-mark.small span:nth-child(3) { height: 15px; }

.login-shell { position: relative; z-index: 2; min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(100%, 470px);
  padding: 46px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel-solid) 88%, white 4%), var(--panel));
  backdrop-filter: blur(28px) saturate(1.15);
  box-shadow: var(--shadow-lg);
}
.login-card .brand-mark { margin-bottom: 34px; }
.login-card h1 { margin: 0; font-size: clamp(32px, 7vw, 48px); letter-spacing: -0.05em; font-weight: 800; }
.login-copy { color: var(--muted); line-height: 1.75; margin: 16px 0 32px; }
.login-form label, .stacked-form label { display: block; margin-bottom: 9px; font-size: 12px; font-weight: 800; color: var(--label); }
.input-row { display: flex; gap: 10px; }
input, textarea, select {
  width: 100%;
  color: var(--ink);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  outline: none;
  transition: border 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
input:focus, textarea:focus, select:focus { border-color: color-mix(in srgb, var(--violet) 65%, transparent); box-shadow: var(--ring); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { resize: vertical; line-height: 1.5; }
.form-error { min-height: 18px; margin: 10px 0 0; color: var(--coral); font-size: 12px; }

.app-shell { position: relative; z-index: 1; min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; transition: grid-template-columns 200ms cubic-bezier(0.22, 1, 0.36, 1); }
.app-shell.sidebar-collapsed { grid-template-columns: 76px 1fr; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--sidebar-bg) 92%, white 3%), var(--sidebar-bg));
  border-right: 1px solid var(--line);
  backdrop-filter: blur(28px) saturate(1.2);
}
.brand-lockup { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.brand-lockup strong { display: block; font-size: 17px; letter-spacing: 0.06em; font-weight: 800; }
.brand-lockup small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; letter-spacing: 0.18em; }
.sidebar-toggle {
  margin-left: auto;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--ghost-bg);
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.sidebar-toggle:hover { color: var(--ink); border-color: var(--line-strong); }
.sidebar-collapsed .sidebar { padding-inline: 10px; }
.sidebar-collapsed .brand-lockup { justify-content: center; }
.sidebar-collapsed .brand-lockup > div:not(.brand-mark), .sidebar-collapsed .nav-item > span:last-child, .sidebar-collapsed .sidebar-note > div, .sidebar-collapsed .logout-button { display: none; }
.sidebar-collapsed .sidebar-toggle { position: absolute; right: -14px; top: 34px; transform: rotate(180deg); background: var(--surface-2); }
.sidebar-collapsed .nav-item { justify-content: center; padding-inline: 8px; }
.sidebar-collapsed .sidebar-note { justify-content: center; padding: 12px; }
.sidebar-collapsed .theme-switcher { flex-direction: column; gap: 4px; padding: 4px; }
.sidebar-collapsed .theme-switcher button { min-height: 28px; padding: 0 2px; font-size: 10px; letter-spacing: 0; }
.main-nav {
  display: grid;
  gap: 4px;
  padding: 4px;
  overflow-y: auto;
  mask-image: linear-gradient(180deg, #000 92%, transparent);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  background: transparent;
  color: var(--nav);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  font-weight: 700;
  font-size: 13px;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}
.nav-item:hover { color: var(--ink); background: var(--ghost-bg); }
.nav-item.active {
  color: var(--ink);
  background: linear-gradient(90deg, color-mix(in srgb, var(--violet) 20%, transparent), color-mix(in srgb, var(--violet) 4%, transparent));
  box-shadow: inset 3px 0 0 var(--violet), 0 0 0 1px color-mix(in srgb, var(--violet) 10%, transparent);
}
.nav-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-size: 15px;
  text-align: center;
  background: var(--soft-bg);
  border: 1px solid transparent;
  transition: background 150ms ease, border-color 150ms ease;
}
.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  background: color-mix(in srgb, var(--violet) 14%, transparent);
  border-color: color-mix(in srgb, var(--violet) 18%, transparent);
}
.theme-switcher {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin-top: auto;
  margin-bottom: 10px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--soft-bg) 80%, black 4%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.03) inset;
}
.nav-theme-switcher {
  margin: 6px 0 0;
  flex: none;
}
.main-nav .nav-theme-switcher {
  /* 桌面侧栏里主题条放导航底部 */
  margin-top: 8px;
}
.theme-switcher button {
  min-height: 34px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}
.theme-switcher button:hover { color: var(--ink); background: var(--ghost-bg); }
.theme-switcher button.active {
  color: var(--ink);
  background: color-mix(in srgb, var(--violet) 18%, var(--panel-solid));
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 4px 14px color-mix(in srgb, var(--violet) 16%, transparent);
}
.sidebar-note {
  display: flex;
  gap: 11px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px 13px;
  border-radius: 14px;
  background: var(--soft-bg);
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255,255,255,0.02) inset;
}
button.sidebar-note { width: 100%; color: inherit; cursor: pointer; text-align: left; transition: border-color 160ms ease, background 160ms ease, transform 160ms ease; }
button.sidebar-note:hover { border-color: color-mix(in srgb, var(--violet) 35%, var(--line)); background: color-mix(in srgb, var(--ghost-bg) 80%, var(--violet) 6%); }
.status-dot { width: 9px; height: 9px; flex: none; border-radius: 50%; background: #6b7080; box-shadow: 0 0 0 4px rgba(107,112,128,0.12); }
.status-dot[data-level="ok"] { background: #3dd68c; box-shadow: 0 0 0 4px rgba(61,214,140,0.14), 0 0 14px rgba(61,214,140,0.4); }
.status-dot[data-level="warn"] { background: #f0b429; box-shadow: 0 0 0 4px rgba(240,180,41,0.14), 0 0 14px rgba(240,180,41,0.35); }
.status-dot[data-level="error"] { background: #f07178; box-shadow: 0 0 0 4px rgba(240,113,120,0.14), 0 0 14px rgba(240,113,120,0.35); }
.status-dot[data-level="pending"] { background: var(--cyan); box-shadow: 0 0 0 4px rgba(114,231,210,0.09), 0 0 16px rgba(114,231,210,0.45); animation: pulse-dot 1.4s ease-in-out infinite; }
@keyframes pulse-dot { 50% { opacity: 0.45; } }
.sidebar-note strong, .sidebar-note small { display: block; }
.sidebar-note strong { font-size: 11px; font-weight: 800; }
.sidebar-note small { color: var(--muted); margin-top: 3px; font-size: 9px; line-height: 1.4; }
.logout-button { width: 100%; border-radius: 12px; }

/* 桌面端主内容区占满侧栏右侧全部宽度，封面网格可横向铺开 */
.workspace {
  min-width: 0;
  width: 100%;
  max-width: none;
  padding: 22px clamp(14px, 1.6vw, 28px) 64px;
  margin: 0;
}
.nav-chrome { display: flex; align-items: center; gap: 10px; min-height: 0; margin: 0 0 10px; }
.nav-back-button { min-height: 36px; padding: 0 14px; font-size: 13px; border-radius: 999px; }
.nav-back-button.is-hidden { display: none; }
.global-search-shell { position: relative; z-index: 12; margin: 0 0 18px; }
.global-search-box {
  width: min(100%, 920px);
  display: grid;
  grid-template-columns: 118px minmax(0,1fr) auto;
  gap: 8px;
  margin-inline: auto;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--search-bg) 92%, white 4%), var(--search-bg));
  box-shadow: var(--shadow), 0 1px 0 rgba(255,255,255,0.04) inset;
  backdrop-filter: blur(18px) saturate(1.15);
}
.global-search-box > select { padding-block: 10px; border: 0; background-color: var(--ghost-bg); border-radius: 11px; }
.global-search-box > .search-box { width: 100%; border: 0; background: transparent; }
.global-search-box > .button { min-height: 40px; border-radius: 11px; }
.global-search-results {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  width: min(100%, 720px);
  max-height: 58vh;
  overflow-y: auto;
  transform: translateX(-50%);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--elevated) 94%, transparent);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
}
.global-result-row { width: 100%; display: grid; grid-template-columns: 44px minmax(0,1fr); gap: 11px; align-items: center; padding: 8px; border: 0; border-radius: 11px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; transition: background 140ms ease; }
.global-result-row:hover { background: var(--ghost-bg); }
.global-result-row img, .global-result-fallback { width: 44px; height: 34px; display: grid; place-items: center; object-fit: contain; border-radius: 7px; background: var(--poster-from); }
.global-result-row strong, .global-result-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.global-result-row strong { font-size: 11px; }
.global-result-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.global-search-empty { padding: 18px; color: var(--muted); text-align: center; font-size: 10px; }
.search-filter-stack { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-bottom: 10px; }
.search-filter-stack .filter-group { flex-wrap: wrap; }
.search-facet-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#search-grid.compact-search-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
#search-grid.compact-search-grid .source-card .poster { aspect-ratio: 16 / 9; }
#search-grid.compact-search-grid .source-card .card-title {
  min-height: 0;
  font-size: 11px;
  white-space: nowrap;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
#search-grid.compact-search-grid .source-card .source-card-tags span:nth-child(n + 3) {
  display: none;
}
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.topbar h1 { margin: 0; font-size: clamp(26px, 3vw, 34px); letter-spacing: -0.045em; font-weight: 800; }
.topbar h1 small { margin-left: 8px; color: var(--muted); font-size: 12px; vertical-align: middle; font-weight: 700; }
.topbar .button span { font-size: 19px; margin-right: 4px; }
.topbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.topbar-actions .button { min-height: 38px; padding: 0 12px; font-size: 13px; border-radius: 999px; }
.empty-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }
.settings-index-actions { justify-content: flex-start; margin-top: 14px; }
.index-status-card { margin-bottom: 18px; }
.directory-grid .actor-ranking-card { min-height: 88px; }
.source-empty p { margin: 0 0 8px; max-width: 36rem; }

.hero-card {
  min-height: 285px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 40px;
  padding: clamp(28px, 5vw, 52px);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 72% 28%, color-mix(in srgb, var(--violet) 34%, transparent), transparent 28%),
    radial-gradient(circle at 12% 90%, color-mix(in srgb, var(--cyan) 10%, transparent), transparent 28%),
    linear-gradient(135deg, var(--hero-from), var(--hero-to) 72%);
  box-shadow: var(--shadow-lg);
}
.hero-card::after {
  content: "";
  position: absolute;
  width: 270px;
  height: 270px;
  right: 17%;
  top: -70px;
  border: 1px solid color-mix(in srgb, white 12%, transparent);
  border-radius: 48% 52% 67% 33% / 55% 35% 65% 45%;
  transform: rotate(18deg);
  box-shadow: inset 0 0 60px color-mix(in srgb, var(--violet) 12%, transparent), 0 0 80px color-mix(in srgb, var(--violet) 8%, transparent);
}
.hero-copy { max-width: 650px; position: relative; z-index: 1; }
.pill {
  display: inline-flex;
  padding: 7px 11px;
  margin-bottom: 22px;
  border: 1px solid color-mix(in srgb, var(--cyan) 26%, transparent);
  border-radius: 999px;
  color: var(--cyan);
  background: color-mix(in srgb, var(--cyan) 8%, transparent);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.16em;
  backdrop-filter: blur(8px);
}
.hero-copy h2 { margin: 0; font-size: clamp(31px, 5vw, 56px); line-height: 1.04; letter-spacing: -0.055em; font-weight: 800; }
.hero-copy p { max-width: 590px; margin: 18px 0 0; color: var(--muted); font-size: 14px; line-height: 1.75; }
.hero-metric { position: relative; z-index: 1; min-width: 145px; padding-left: 24px; border-left: 1px solid var(--line); }
.hero-metric span, .hero-metric small { display: block; color: var(--muted); font-size: 9px; letter-spacing: 0.14em; }
.hero-metric strong { display: block; font-size: 68px; line-height: 1; letter-spacing: -0.08em; font-variant-numeric: tabular-nums; font-weight: 800; }

.toolbar, .compact-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 18px; }
.search-box {
  width: min(420px, 100%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft-bg);
  color: var(--muted);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.search-box:focus-within { border-color: color-mix(in srgb, var(--violet) 45%, var(--line)); box-shadow: var(--ring); }
.search-box input { border: 0; background: transparent; box-shadow: none; padding-left: 0; }
.filter-group {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--soft-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.02) inset;
}
.filter-button {
  border: 0;
  border-radius: 9px;
  padding: 8px 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}
.filter-button:hover { color: var(--ink); }
.filter-button.active {
  color: var(--ink);
  background: color-mix(in srgb, var(--panel-solid) 70%, var(--violet) 8%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset, 0 4px 12px color-mix(in srgb, var(--violet) 10%, transparent);
}
.compact-select { width: auto; min-width: 128px; padding-block: 10px; font-size: 10px; border-radius: 11px; }
.compact-count { margin-left: auto; color: var(--muted); font-size: 10px; }
.compact-count strong { color: var(--ink); font-size: 16px; }

.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

/* 列表卡片：封面优先；番号+评分一行，标题一行，日期+标签一行 */
.media-card.cover-first {
  display: flex;
  flex-direction: column;
}
.media-card.cover-first .poster {
  flex: none;
  aspect-ratio: 16 / 9;
}
.media-card.cover-first .card-body {
  display: grid;
  gap: 5px;
  padding: 10px 12px 11px;
}
.media-card.cover-first .card-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.media-card.cover-first .card-line-code .card-code {
  margin: 0;
  min-width: 0;
  flex: 1 1 auto;
  font-size: 10px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.media-card.cover-first .card-line-code .rating {
  flex: none;
  margin: 0;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.media-card.cover-first .card-line-code .rating:empty {
  display: none;
}
.media-card.cover-first .card-title {
  min-height: 0;
  height: auto;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.35;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-card.cover-first .card-line-meta {
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--muted);
  font-size: 9px;
}
.media-card.cover-first .card-date {
  flex: none;
  max-width: 42%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-card.cover-first .card-date:empty {
  display: none;
}
.media-card.cover-first .source-card-tags {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
  margin: 0;
  overflow: hidden;
}
.media-card.cover-first .source-card-tags:empty {
  display: none;
}
.media-card.cover-first .source-card-tags span {
  flex: none;
  max-width: 5.5em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cyan) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--cyan) 14%, transparent);
  color: var(--cyan);
  font-size: 8px;
  font-weight: 800;
}
.drive-browser { margin-bottom: 22px; }
.drive-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.drive-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; flex: 1 1 220px; color: var(--muted); font-size: 12px; }
.drive-breadcrumb button { border: 0; background: transparent; color: var(--cyan); cursor: pointer; padding: 0; font-weight: 700; }
.drive-breadcrumb button:hover { text-decoration: underline; }
.drive-breadcrumb .sep { opacity: 0.45; }
.drive-sort-controls {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft-bg);
  flex: 0 1 auto;
  max-width: 100%;
  overflow-x: auto;
}
.drive-sort-label {
  flex: none;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.drive-sort-controls select {
  flex: none;
  min-width: 112px;
  width: auto;
  height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}
.drive-sort-controls #drive-order {
  flex: none;
  min-width: 78px;
  height: 34px;
  padding: 0 10px;
  white-space: nowrap;
}
.drive-folders-first {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.drive-folders-first input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--violet);
}
.drive-sort-controls {
  box-shadow: 0 1px 0 rgba(255,255,255,0.02) inset;
}
.drive-sort-controls #drive-order {
  border-radius: 999px;
}
.drive-search-box { width: min(100%, 240px); }
.drive-grid { margin-top: 10px; }
.drive-card .card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}
.drive-card .card-meta span:last-child {
  margin-left: auto;
  text-align: right;
}
.drive-card .poster { aspect-ratio: 1 / 1; display: grid; place-items: center; }
.drive-card .poster-icon { font-size: 42px; opacity: 0.85; line-height: 1; }
.drive-card.is-folder .poster { background: linear-gradient(145deg, var(--poster-from), var(--poster-to)); }
.drive-card.is-video .poster { background: linear-gradient(145deg, #3a2f55, var(--poster-to)); }
html[data-theme="light"] .drive-card.is-video .poster { background: linear-gradient(145deg, #ddd4f3, var(--poster-to)); }
.drive-player-shell { margin: 0 0 16px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--panel-solid) 92%, black 8%); box-shadow: var(--shadow); }
.drive-player-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.drive-player-heading strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel-solid) 88%, white 3%), var(--panel));
  cursor: pointer;
  transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1), border-color 180ms ease, box-shadow 200ms ease;
  box-shadow: 0 1px 0 rgba(255,255,255,0.03) inset;
}
.media-card:hover {
  transform: translateY(-6px) scale(1.01);
  border-color: color-mix(in srgb, var(--violet) 42%, var(--line));
  box-shadow: 0 22px 50px rgba(0,0,0,0.28), 0 0 0 1px color-mix(in srgb, var(--violet) 12%, transparent);
}
html[data-theme="light"] .media-card:hover { box-shadow: 0 18px 40px rgba(40,36,28,0.12), 0 0 0 1px color-mix(in srgb, var(--violet) 14%, transparent); }
.poster {
  position: relative;
  /* 封面多为横屏，用接近 16:10 的比例，避免上下大块留白 */
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(150deg, var(--poster-from), var(--poster-to));
}
.poster::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 48%;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--bg) 62%, transparent));
  pointer-events: none;
  opacity: 0.7;
  z-index: 1;
}
.poster img {
  width: 100%;
  height: 100%;
  display: block;
  /* cover 铺满容器，去掉 letterbox 空白；略偏上，避免裁掉标题区 */
  object-fit: cover;
  object-position: center 20%;
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}
.media-card:hover .poster img { transform: scale(1.04); }
.poster-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: color-mix(in srgb, var(--ink) 18%, transparent);
  font-weight: 900;
  font-size: 36px;
  letter-spacing: -0.05em;
}
.card-badge {
  position: absolute;
  left: 11px;
  top: 11px;
  z-index: 2;
  padding: 6px 8px;
  border-radius: 999px;
  backdrop-filter: blur(14px) saturate(1.2);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border: 1px solid color-mix(in srgb, white 8%, transparent);
  color: var(--ink);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.06em;
}
.ready-mark {
  position: absolute;
  right: 11px;
  top: 11px;
  z-index: 2;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #8af0d8, var(--cyan));
  color: #07110f;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--cyan) 30%, transparent);
}
.card-body { padding: 14px 15px 15px; }
.card-code { margin: 0 0 6px; color: var(--cyan); font-size: 10px; font-weight: 900; letter-spacing: 0.08em; }
.card-title {
  min-height: 42px;
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 13.5px;
  line-height: 1.48;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}
.rating { color: var(--gold); font-weight: 800; }

.source-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 360px);
  gap: 24px;
  align-items: center;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 85% 0, color-mix(in srgb, var(--cyan) 12%, transparent), transparent 38%),
    linear-gradient(180deg, color-mix(in srgb, var(--panel-solid) 90%, white 3%), var(--panel));
  box-shadow: var(--shadow);
}
.source-intro .pill { margin-bottom: 12px; }
.source-intro h2 { margin: 0; font-size: clamp(23px, 3vw, 31px); letter-spacing: -0.035em; }
.source-intro p { margin: 13px 0 0; color: var(--muted); line-height: 1.7; font-size: 12px; }
.source-rights-row { align-self: end; margin: 0 !important; padding: 16px; border: 1px solid rgba(114,231,210,0.16); border-radius: 14px; background: rgba(114,231,210,0.05); }
.source-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 10px; }
.source-toolbar .filter-group { flex-wrap: wrap; }
.source-filter-selects { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.source-filter-selects .compact-select { min-width: 120px; }
.source-filter-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  align-items: start;
}
.source-filter-row .compact-select {
  width: 100%;
  min-width: 0;
}
.source-facet-inline {
  margin: 0;
  padding: 0 10px;
  min-height: 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: 12px;
}
.source-facet-inline summary {
  padding: 8px 0;
  list-style: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
}
.source-facet-inline[open] {
  grid-column: 1 / -1;
}
.source-facet-inline .facet-grid {
  padding-bottom: 10px;
}
.source-toolbar-actions {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}
.source-toolbar-actions .button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}
.page-jump-card {
  width: min(100%, 400px);
}
.page-jump-picker {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  margin: 0 0 12px;
  padding: 2px;
  -webkit-overflow-scrolling: touch;
}
.page-jump-picker:empty {
  display: none;
}
.page-jump-num {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ghost-bg);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.page-jump-num:hover {
  border-color: color-mix(in srgb, var(--violet) 40%, var(--line));
  background: color-mix(in srgb, var(--violet) 12%, transparent);
}
.page-jump-num.is-current {
  color: white;
  border-color: transparent;
  background: linear-gradient(135deg, var(--violet), color-mix(in srgb, var(--cyan) 55%, var(--violet)));
  box-shadow: 0 6px 16px color-mix(in srgb, var(--violet) 28%, transparent);
}
.page-jump-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.page-jump-actions .button {
  flex: 1;
}
.page-jump-trigger {
  min-width: 88px;
  font-variant-numeric: tabular-nums;
}
body.view-settings .global-search-shell {
  display: none !important;
}
.facet-panel { margin: 10px 0; padding: 0 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--soft-bg); }
.facet-panel summary { padding: 10px 0; color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 800; }
.facet-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; padding: 0 0 12px; }
.facet-grid-three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.facet-grid label { color: var(--muted); font-size: 9px; }
.facet-grid select { width: 100%; margin-top: 5px; }
.source-status { margin: 0; color: var(--muted); font-size: 10px; text-align: right; }
.source-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
/* 主页：卡片更大，宽屏下封面更易看清 */
#source-view .source-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 16px;
}
.source-card { border-radius: 15px; }
.source-card .poster { aspect-ratio: 16 / 9; }
.source-card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.source-card-tags span {
  padding: 4px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cyan) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--cyan) 14%, transparent);
  color: var(--cyan);
  font-size: 8px;
  font-weight: 800;
}
.rank-badge {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 2;
  min-width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  border-radius: 11px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--violet) 92%, white 8%), var(--violet-2));
  color: white;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--violet) 35%, transparent);
  font-size: 12px;
  font-weight: 900;
}
.ranked-card:nth-child(-n+3) .rank-badge { background: linear-gradient(135deg, #f5d989, #bd804b); color: #21150a; box-shadow: 0 8px 20px rgba(189,128,75,0.28); }
.ranking-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 10px; }
.ranking-controls .filter-group { flex-wrap: wrap; }
.ranking-status { margin: 0 0 22px; text-align: left; }
.ranking-summary { min-width: 155px; display: grid; justify-items: end; }
.ranking-summary strong { font-size: 52px; line-height: 1; letter-spacing: -0.07em; }
.ranking-summary span { margin-top: 7px; color: var(--muted); font-size: 10px; letter-spacing: 0.08em; }
.actor-ranking-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.actor-ranking-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel-solid) 90%, white 3%), var(--panel));
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  box-shadow: 0 1px 0 rgba(255,255,255,0.03) inset;
}
.actor-ranking-card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--cyan) 36%, var(--line));
  box-shadow: 0 16px 36px rgba(0,0,0,0.22);
}
.actor-ranking-card img, .actor-avatar-fallback { width: 100%; aspect-ratio: 1 / 1.2; display: grid; place-items: center; object-fit: cover; background: linear-gradient(145deg, #292d3b, #151720); color: rgba(255,255,255,0.3); font-size: 42px; font-weight: 900; }
.actor-ranking-card > div:last-child { padding: 13px; }
.actor-ranking-card strong, .actor-ranking-card small { display: block; }
.actor-ranking-card strong { font-size: 12px; }
.actor-ranking-card small { margin-top: 5px; color: var(--cyan); font-size: 8px; }
.actor-rank-number { position: absolute; z-index: 1; left: 9px; top: 9px; min-width: 32px; height: 32px; display: grid; place-items: center; padding: 0 7px; border-radius: 9px; background: rgba(5,7,10,0.78); color: white; font-size: 9px; font-weight: 900; }
.award-year-section { grid-column: 1 / -1; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,0.02); }
.award-year-section + .award-year-section { margin-top: 12px; }
.award-year-heading h2 { margin: 0 0 20px; font-size: 32px; }
.award-actor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: 12px; }
.award-movie-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 14px; margin-top: 18px; }
.source-empty { grid-column: 1 / -1; min-height: 180px; display: grid; place-items: center; padding: 24px; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); text-align: center; }
.view-loading {
  grid-column: 1 / -1;
  min-height: 220px;
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  background: rgba(255,255,255,0.02);
}
.view-loading-spinner,
.drawer-loading-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(143,124,255,0.22);
  border-top-color: var(--violet);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.view-loading strong { color: var(--ink); font-size: 13px; }
.view-is-loading { opacity: 0.95; }
.source-pagination { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 30px; color: var(--muted); font-size: 11px; }
.source-magnet-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 22px 0 10px; }
.source-magnet-heading h3 { margin: 0; font-size: 20px; }
.source-magnet-heading > span { color: var(--muted); font-size: 11px; }
.source-magnet-list { display: grid; gap: 10px; }
.source-magnet-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft-bg);
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}
.source-magnet-row:hover {
  border-color: color-mix(in srgb, var(--violet) 28%, var(--line));
  background: color-mix(in srgb, var(--ghost-bg) 80%, var(--violet) 5%);
}
.magnet-index {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: color-mix(in srgb, var(--violet) 14%, transparent);
  color: color-mix(in srgb, var(--violet) 70%, white 30%);
  font-size: 9px;
  font-weight: 900;
}
.source-magnet-row strong, .source-magnet-row small { display: block; }
.source-magnet-row strong { overflow-wrap: anywhere; font-size: 11px; line-height: 1.5; }
.source-magnet-row small { margin-top: 7px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.source-magnet-row .button { min-height: 38px; padding: 0 12px; font-size: 10px; }
.source-magnet-actions { display: flex; align-items: center; gap: 7px; }
.variant-play-list { display: grid; gap: 8px; }
.variant-play-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,0.03); }
.variant-play-row strong, .variant-play-row small { display: block; }
.variant-play-row strong { font-size: 11px; }
.variant-play-row small { margin-top: 5px; color: var(--muted); font-size: 8px; overflow-wrap: anywhere; }
.source-preview-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 20px 0 10px; }
.source-preview-heading h3 { margin: 0; font-size: 20px; }
.source-preview-heading > span { color: var(--muted); font-size: 10px; }
.source-preview-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.source-preview-item { position: relative; aspect-ratio: 16 / 10; overflow: hidden; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); cursor: zoom-in; }
.source-preview-item img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform 180ms ease; }
.source-preview-item:hover img { transform: scale(1.05); }
.source-preview-item span { position: absolute; right: 6px; bottom: 6px; padding: 4px 6px; border-radius: 6px; background: rgba(5,7,10,0.78); color: white; font-size: 8px; font-weight: 900; }
.actor-profile-card { display: flex; align-items: center; gap: 22px; margin-bottom: 28px; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: radial-gradient(circle at 10% 10%, rgba(143,124,255,0.18), transparent 45%), var(--panel); }
.actor-compact-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.actor-compact-bar strong { font-size: 14px; }
.actor-compact-bar span { flex: 1; color: var(--muted); font-size: 10px; }
.favorite-action { min-height: 34px; padding-inline: 12px; font-size: 10px; }
.favorite-action.active { border-color: rgba(255,157,162,0.36); color: #ff9da2; }
.favorite-fab {
  position: absolute;
  z-index: 3;
  right: 9px;
  bottom: 9px;
  width: 32px;
  height: 32px;
  border: 1px solid color-mix(in srgb, white 14%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  color: white;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: transform 150ms ease, background 150ms ease, color 150ms ease;
}
.favorite-fab:hover { transform: scale(1.08); }
.favorite-fab.active { color: #ff9da2; background: rgba(70,18,27,0.88); border-color: rgba(255,157,162,0.28); }
.card-meta-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  flex: none;
}
.card-meta-actions .rank-badge {
  position: static;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 7px;
  box-shadow: none;
  font-size: 10px;
}
.card-meta-actions .favorite-fab {
  position: static;
  width: 26px;
  height: 26px;
  flex: none;
  padding: 0;
  backdrop-filter: none;
  font-size: 13px;
}
.card-versions { font-size: 9px; color: var(--muted); white-space: nowrap; }
.media-card.cover-first .card-extra-tags {
  justify-content: flex-start;
  margin-top: 0;
}
.actor-profile-card .pill { margin-bottom: 10px; }
.actor-profile-card h2 { margin: 0; font-size: 30px; }
.actor-profile-card p { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.actor-monogram { flex: none; width: 82px; height: 82px; display: grid; place-items: center; border-radius: 24px; background: linear-gradient(145deg, rgba(143,124,255,0.85), rgba(114,231,210,0.55)); color: white; font-size: 34px; font-weight: 900; }
.drawer-loading {
  min-height: 55vh;
  display: grid;
  place-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.drawer-loading strong { color: var(--ink); font-size: 13px; }

.settings-status-card {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 8% 0, color-mix(in srgb, var(--violet) 16%, transparent), transparent 40%),
    linear-gradient(180deg, color-mix(in srgb, var(--panel-solid) 90%, white 3%), var(--panel));
  box-shadow: var(--shadow);
}
.settings-status-icon { flex: none; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 18px; background: var(--ghost-bg); color: var(--muted); font-size: 25px; }
.settings-status-card.is-ready .settings-status-icon { background: color-mix(in srgb, var(--cyan) 12%, transparent); color: var(--cyan); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cyan) 22%, transparent); }
.settings-status-card h2 { margin: 0; font-size: 21px; }
.settings-status-card p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr); gap: 20px; align-items: start; }
.settings-panel {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel-solid) 90%, white 2%), var(--panel));
  box-shadow: var(--shadow);
}
.settings-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.settings-heading > span {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: color-mix(in srgb, var(--violet) 14%, transparent);
  color: color-mix(in srgb, var(--violet) 70%, white 30%);
  font-size: 10px;
  font-weight: 900;
}
.settings-heading .eyebrow { margin-bottom: 4px; }
.settings-heading h2 { margin: 0; font-size: 21px; }
.settings-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.settings-form .full { grid-column: 1 / -1; }
.settings-field label, .qr-login-form label { display: block; margin-bottom: 8px; color: var(--label); font-size: 11px; font-weight: 800; }
.settings-field small, .settings-help { display: block; margin-top: 7px; color: var(--muted); font-size: 9px; line-height: 1.55; }
.settings-check { align-self: center; margin: 24px 0 0 !important; }
.mount-steps { display: grid; gap: 12px; margin: 0 0 18px; padding: 0; list-style: none; counter-reset: mount-step; }
.mount-steps li { position: relative; padding: 13px 14px 13px 44px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,0.025); counter-increment: mount-step; }
.mount-steps li::before { content: counter(mount-step); position: absolute; left: 14px; top: 14px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 7px; background: rgba(114,231,210,0.1); color: var(--cyan); font-size: 8px; font-weight: 900; }
.mount-steps strong, .mount-steps small { display: block; }
.mount-steps strong { font-size: 11px; }
.mount-steps small { margin-top: 5px; color: var(--muted); font-size: 9px; line-height: 1.55; }
.auth-notice { margin: 12px 0 18px; }
.qr-login-card { display: grid; place-items: center; gap: 16px; margin-top: 18px; padding: 22px; border: 1px solid rgba(114,231,210,0.18); border-radius: 16px; background: rgba(114,231,210,0.035); }
.qr-image-shell { width: min(100%, 260px); aspect-ratio: 1; padding: 12px; border-radius: 16px; background: white; box-shadow: 0 18px 50px rgba(0,0,0,0.28); }
.qr-image-shell img { display: block; width: 100%; height: 100%; object-fit: contain; }
.qr-login-copy { display: flex; align-items: center; justify-content: center; gap: 11px; text-align: left; }
.qr-login-copy strong, .qr-login-copy small { display: block; }
.qr-login-copy strong { color: var(--ink); font-size: 12px; }
.qr-login-copy small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.qr-pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 0 rgba(114,231,210,0.45); animation: qr-pulse 1.8s infinite; }
@keyframes qr-pulse { 70% { box-shadow: 0 0 0 9px rgba(114,231,210,0); } 100% { box-shadow: 0 0 0 0 rgba(114,231,210,0); } }

.empty-state { min-height: 370px; display: grid; place-items: center; align-content: center; text-align: center; color: var(--muted); }
.empty-state h2 { margin: 22px 0 8px; color: var(--ink); }
.empty-state p { margin: 0 0 22px; }
.empty-orbit { width: 74px; height: 74px; display: grid; place-items: center; border: 1px solid rgba(143,124,255,0.35); border-radius: 50%; }
.empty-orbit::before { content: ""; width: 50px; height: 50px; border: 1px dashed rgba(114,231,210,0.4); border-radius: 50%; }
.empty-orbit span { position: absolute; width: 11px; height: 11px; transform: translate(29px, -20px); background: var(--violet); border-radius: 50%; box-shadow: 0 0 20px var(--violet); }

.modal-backdrop, .drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 4, 7, 0.72);
  backdrop-filter: blur(18px) saturate(1.1);
}
html[data-theme="light"] .modal-backdrop,
html[data-theme="light"] .drawer-backdrop { background: rgba(28, 26, 22, 0.28); }
.modal-card {
  position: relative;
  width: min(100%, 610px);
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--elevated) 94%, white 4%), var(--elevated));
  box-shadow: var(--shadow-lg);
}
.modal-card.compact { width: min(100%, 620px); max-height: calc(100vh - 40px); overflow-y: auto; }
.modal-card h2 { margin: 0; font-size: 30px; letter-spacing: -0.035em; }
.modal-copy { margin: 14px 0 28px; color: var(--muted); line-height: 1.65; }
code { padding: 2px 5px; border-radius: 5px; background: rgba(255,255,255,0.07); color: var(--cyan); }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,0.04); color: var(--muted); cursor: pointer; font-size: 22px; }
.modal-close { position: absolute; right: 18px; top: 18px; }
.stacked-form { display: grid; gap: 10px; }
.custom-media-fields { display: grid; gap: 8px; }
.path-picker-row, .create-folder-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.compact-copy { margin: 0; font-size: 9px; }
.notice-box { display: flex; gap: 12px; margin: 8px 0; padding: 14px; border-radius: 12px; background: rgba(114,231,210,0.05); border: 1px solid rgba(114,231,210,0.14); color: var(--muted); font-size: 11px; line-height: 1.6; }
.notice-box > span { flex: none; width: 21px; height: 21px; display: grid; place-items: center; border-radius: 50%; background: var(--cyan); color: #0a1211; font-weight: 900; }
.notice-box p { margin: 0; }
.check-row { display: flex !important; align-items: flex-start; gap: 10px; margin: 8px 0 !important; color: var(--muted) !important; font-weight: 500 !important; line-height: 1.5; }
.check-row input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--violet); }

.drawer-backdrop { z-index: 29; display: block; }
.detail-drawer {
  position: fixed;
  z-index: 30;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(100%, 680px);
  overflow-y: auto;
  padding: 28px 28px 40px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-3) 92%, white 3%), var(--surface-3));
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 70px rgba(0,0,0,0.42);
  backdrop-filter: blur(8px);
}
.drawer-close { position: sticky; z-index: 2; left: 100%; top: 0; border-radius: 12px; }
.detail-cover {
  width: 100%;
  height: auto;
  max-height: min(52vh, 420px);
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center 18%;
  border-radius: 16px;
  background: var(--elevated);
  display: block;
  box-shadow: 0 18px 40px rgba(0,0,0,0.22);
}
.detail-heading { margin-top: 22px; }
.detail-heading h2 { margin: 6px 0 0; font-size: 28px; line-height: 1.25; letter-spacing: -0.035em; font-weight: 800; }
.detail-code { color: var(--cyan); font-size: 11px; font-weight: 900; letter-spacing: 0.1em; }
.detail-description {
  margin: 12px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft-bg);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
}
.detail-actions { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 16px 0; }
.detail-actions .wide-action { grid-column: 1 / -1; }
.detail-player-shell {
  margin: 0 0 24px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #05070b;
  box-shadow: 0 12px 30px rgba(0,0,0,0.28);
}
.detail-player { display: block; width: 100%; max-height: 64vh; border-radius: 11px; background: black; }
.detail-player-shell p { margin: 9px 4px 2px; color: var(--muted); font-size: 9px; text-align: center; }

/* 播放器手势层：按住倍速 / 滑动快进 / 双击 ±10s */
.player-gesture-shell {
  position: relative;
  display: block;
  width: 100%;
  border-radius: 11px;
  overflow: hidden;
  background: #000;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.player-gesture-shell .detail-player,
.player-gesture-shell .player-gesture-video,
.player-gesture-shell video {
  display: block;
  width: 100%;
  max-height: 64vh;
  border-radius: 11px;
  background: #000;
  touch-action: none;
}
.player-gesture-hud {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  transform: translate(-50%, -50%);
  min-width: 88px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 10, 16, 0.78);
  color: #f4f5f8;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  transition: opacity 140ms ease, transform 140ms ease;
}
.player-gesture-hud.is-hidden {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.96);
  visibility: hidden;
}
.drive-player-shell .player-gesture-shell {
  margin-top: 2px;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--line);
  box-shadow: 0 1px 0 rgba(255,255,255,0.02) inset;
}
.detail-field { min-height: 54px; padding: 10px 12px; background: var(--panel-solid); }
.detail-field span, .detail-field strong { display: block; }
.detail-field span { color: var(--muted); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; }
.detail-field strong { margin-top: 5px; font-size: 11px; line-height: 1.35; font-weight: 700; }
.detail-meta-link { display: block; width: 100%; margin-top: 4px; padding: 0; border: 0; background: transparent; color: var(--cyan); font-size: 11px; font-weight: 800; line-height: 1.35; text-align: left; cursor: pointer; }
.detail-meta-link:hover { text-decoration: underline; }
.category-list { margin-top: 8px; }
.actor-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 18px 0; }
.actor-chip {
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--ghost-bg);
  color: var(--chip);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease, transform 150ms ease;
}
.actor-link { cursor: pointer; }
.actor-link:hover {
  background: color-mix(in srgb, var(--cyan) 12%, transparent);
  border-color: color-mix(in srgb, var(--cyan) 18%, transparent);
  color: var(--cyan);
  transform: translateY(-1px);
}
.actor-link span { margin-left: 4px; }
.link-form { display: grid; gap: 9px; margin-top: 24px; padding: 18px; border-radius: 15px; background: var(--soft-bg); border: 1px solid var(--line); }
.link-form label { font-size: 10px; font-weight: 800; color: var(--muted); }
.link-form-row { display: flex; gap: 8px; }
.source-attribution { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.6; }
.source-attribution a { color: var(--cyan); }

.toast-stack { position: fixed; z-index: 60; right: 22px; bottom: 22px; display: grid; gap: 10px; }
.toast {
  min-width: 280px;
  max-width: 390px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-2) 92%, transparent);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(16px);
  animation: toast-in 200ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.toast.error { border-color: color-mix(in srgb, var(--coral) 40%, transparent); }
.preview-lightbox { position: fixed; z-index: 80; inset: 0; display: grid; grid-template-columns: 70px minmax(0, 1fr) 70px; align-items: center; gap: 18px; padding: 40px; background: rgba(2,3,6,0.94); backdrop-filter: blur(18px); }
.preview-lightbox figure { width: min(100%, 1280px); max-height: calc(100vh - 80px); margin: 0 auto; display: grid; justify-items: center; }
.preview-lightbox img { max-width: 100%; max-height: calc(100vh - 130px); object-fit: contain; border-radius: 12px; box-shadow: 0 30px 90px rgba(0,0,0,0.55); }
.preview-lightbox figcaption { margin-top: 14px; color: var(--muted); font-size: 10px; text-align: center; }
.preview-close { position: fixed; z-index: 2; right: 24px; top: 24px; }
.preview-arrow { width: 54px; height: 54px; border: 1px solid var(--line); border-radius: 50%; background: rgba(255,255,255,0.055); color: white; cursor: pointer; font-size: 34px; }
.preview-arrow:disabled { opacity: 0.35; cursor: default; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar {
    position: fixed;
    z-index: 15;
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 10px;
    height: 58px;
    padding: 6px 8px;
    flex-direction: row;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    background: color-mix(in srgb, var(--panel-solid) 92%, transparent);
    backdrop-filter: blur(18px) saturate(1.15);
  }
  .brand-lockup, .sidebar-note, .logout-button { display: none; }
  /* 主题条并入底栏，不再浮动左下角 */
  .main-nav .nav-theme-switcher,
  .nav-theme-switcher {
    position: static;
    display: grid;
    grid-template-columns: repeat(3, minmax(28px, 1fr));
    width: auto;
    min-width: 7.5em;
    margin: 0 0 0 4px;
    padding: 3px;
    flex: 0 0 auto;
    align-self: center;
    background: color-mix(in srgb, var(--panel-solid) 88%, transparent);
    box-shadow: none;
  }
  .nav-theme-switcher button {
    min-height: 30px;
    min-width: 28px;
    padding: 0 6px;
    font-size: 10px;
  }

  /* 底栏：显示文字，不显示图标 */
  .main-nav {
    display: flex;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: flex-start;
    align-items: stretch;
    gap: 2px;
    padding: 0;
    mask-image: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .main-nav::-webkit-scrollbar { display: none; }
  .nav-item {
    flex: 1 0 auto;
    min-width: 3.4em;
    max-width: 5.2em;
    justify-content: center;
    align-items: center;
    padding: 6px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    gap: 0;
  }
  .nav-item .nav-icon { display: none !important; }
  .nav-item > span:last-child {
    display: block !important;
    font-size: 11px;
    line-height: 1.15;
    white-space: nowrap;
    text-align: center;
  }
  .nav-item.active {
    box-shadow: none;
    background: color-mix(in srgb, var(--violet) 16%, transparent);
  }

  .workspace { padding: 14px 14px 92px; }
  .global-search-shell { margin: 0 0 12px; }
  /* 顶部搜索：始终单行 */
  .global-search-box {
    width: 100%;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 6px;
    padding: 5px;
    border-radius: 14px;
  }
  .global-search-box > select {
    min-width: 0;
    padding: 8px 22px 8px 8px;
    font-size: 12px;
    font-weight: 700;
  }
  .global-search-box > .search-box {
    min-width: 0;
    padding: 0 8px;
    gap: 6px;
  }
  .global-search-box > .search-box input {
    font-size: 13px;
    padding: 8px 0;
  }
  .global-search-box > .button {
    grid-column: auto;
    min-height: 36px;
    min-width: 58px;
    padding: 0 12px;
    font-size: 13px;
    border-radius: 10px;
  }

  /* 页面内重复搜索框：移动端隐藏（统一用顶部全局搜索） */
  #library-toolbar > .search-box,
  #source-view .source-toolbar > .search-box,
  .page-local-search {
    display: none !important;
  }
  /* 四个筛选项始终同一行 */
  .source-filter-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }
  .source-filter-row .compact-select {
    min-height: 32px;
    padding: 6px 22px 6px 6px;
    font-size: 11px;
  }
  .source-facet-inline {
    min-height: 32px;
    padding: 0 6px;
  }
  .source-facet-inline summary {
    padding: 6px 0;
    font-size: 11px;
    text-align: center;
  }
  /* 展开高级筛选时再占满整行 */
  .source-filter-row .source-facet-inline[open] {
    grid-column: 1 / -1;
  }
  .source-toolbar-actions {
    justify-content: stretch;
  }
  .source-toolbar-actions .button {
    width: 100%;
  }

  .hero-card { min-height: 0; align-items: start; flex-direction: column; }
  .hero-card::after { right: -90px; top: 70px; }
  .hero-metric { border-left: 0; padding-left: 0; }
  .toolbar, .compact-controls {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
  }
  .search-box { width: 100%; }
  .filter-group {
    align-self: stretch;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 3px;
    gap: 3px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .filter-group::-webkit-scrollbar { display: none; }
  .filter-group-scroll { flex-wrap: nowrap; }
  .filter-button {
    flex: none;
    padding: 6px 10px;
    font-size: 11px;
    white-space: nowrap;
  }
  .compact-select {
    width: 100%;
    min-height: 34px;
    padding: 7px 28px 7px 10px;
    font-size: 12px;
    border-radius: 10px;
  }
  .source-intro { grid-template-columns: 1fr; padding: 14px; margin-bottom: 8px; }
  .source-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
  }
  .source-filter-selects {
    width: 100%;
  }
  .source-status {
    text-align: left;
    font-size: 10px;
    margin: 0 0 8px;
  }
  .facet-panel,
  .compact-facet {
    margin: 0 0 8px;
    padding: 0 10px;
    border-radius: 11px;
  }
  .facet-panel summary {
    padding: 8px 0;
    font-size: 11px;
  }
  .facet-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding-bottom: 10px;
  }
  .facet-grid label { font-size: 10px; }
  .facet-grid select {
    margin-top: 4px;
    min-height: 32px;
    padding: 6px 26px 6px 8px;
    font-size: 11px;
  }
  .topbar {
    margin-bottom: 10px;
    gap: 10px;
  }
  .topbar h1 { font-size: 22px; }
  .topbar-actions .button,
  .topbar .button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
  }
  .ranking-controls { align-items: stretch; flex-direction: column; gap: 8px; }
  .settings-layout { grid-template-columns: 1fr; }
  .source-pagination { margin-top: 16px; gap: 10px; }
  .source-pagination .button { min-height: 34px; padding: 0 12px; font-size: 12px; }
}

@media (max-width: 560px) {
  .global-search-box {
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 5px;
  }
  .global-search-box > select {
    padding-inline: 6px 20px;
    font-size: 11px;
  }
  .global-search-box > .button {
    min-width: 52px;
    padding: 0 10px;
    font-size: 12px;
  }
  .topbar { align-items: center; }
  .topbar .eyebrow { display: none; }
  .topbar h1 { font-size: 20px; }
  .topbar .button:not(.topbar-actions .button) { width: 40px; padding: 0; font-size: 0; }
  .topbar .button:not(.topbar-actions .button) span { margin: 0; font-size: 18px; }
  .topbar-actions { width: auto; justify-content: flex-end; }
  .topbar-actions .button { width: auto; padding: 0 10px; font-size: 12px; }
  .hero-card { padding: 22px; }
  .hero-copy h2 { font-size: 32px; }
  .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .source-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .poster { aspect-ratio: 16 / 9; }
  .card-body { padding: 8px 10px 10px; }
  .card-title { font-size: 11px; min-height: 0; }
  .media-card.cover-first .card-body { padding: 8px 10px 10px; gap: 4px; }
  .media-card.cover-first .card-title { font-size: 11px; }
  .detail-cover { max-height: min(36vh, 280px); }
  .login-card, .modal-card { padding: 30px 22px; }
  .input-row { flex-direction: column; }
  .detail-drawer { padding: 22px; }
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
  .source-intro { display: none; }
  .source-magnet-row { grid-template-columns: 1fr; }
  .magnet-index { display: none; }
  .source-magnet-row .button { width: 100%; }
  .source-magnet-actions { width: 100%; }
  .variant-play-row { grid-template-columns: 1fr; }
  .variant-play-row .button { width: 100%; }
  .facet-grid { grid-template-columns: 1fr 1fr; }
  .source-preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preview-lightbox { grid-template-columns: 1fr; padding: 70px 16px 24px; }
  .preview-arrow { position: fixed; z-index: 2; bottom: 24px; }
  .preview-arrow.previous { left: 24px; }
  .preview-arrow.next { right: 24px; }
  .actor-profile-card { padding: 18px; }
  .actor-monogram { width: 62px; height: 62px; border-radius: 18px; font-size: 26px; }
  .settings-panel { padding: 20px; }
  .settings-form { grid-template-columns: 1fr; }
  .settings-form .full { grid-column: auto; }

  /* 底栏文字再短一点更易排 */
  .nav-item { min-width: 3em; max-width: 4.6em; padding: 6px 4px; }
  .nav-item > span:last-child { font-size: 0; line-height: 0; }
  .nav-item > span:last-child::after {
    font-size: 10px;
    line-height: 1.15;
    font-weight: 800;
  }
  .nav-item[data-view="library"] > span:last-child::after { content: "媒体"; }
  .nav-item[data-view="custom"] > span:last-child::after { content: "115"; }
  .nav-item[data-view="source"] > span:last-child::after { content: "主页"; }
  .nav-item[data-view="directory"][data-directory-kind="actor"] > span:last-child::after { content: "演员"; }
  .nav-item[data-view="directory"][data-directory-kind="series"] > span:last-child::after { content: "系列"; }
  .nav-item[data-view="directory"][data-directory-kind="maker"] > span:last-child::after { content: "片商"; }
  .nav-item[data-view="rankings"] > span:last-child::after { content: "排行"; }
  .nav-item[data-view="favorites"] > span:last-child::after { content: "收藏"; }
  .nav-item[data-view="history"] > span:last-child::after { content: "历史"; }
  .nav-item[data-view="footprints"] > span:last-child::after { content: "足迹"; }
  .nav-item[data-view="settings"] > span:last-child::after { content: "设置"; }
  #open-custom-task > span:last-child::after { content: "任务"; }
}

/* 演员/系列/片商及作品页：隐藏与顶部全局搜索重复的本地搜索框 */
.page-local-search {
  display: none !important;
}

/* 桌面：主页筛选四列保持一行；宽屏加大封面卡 */
@media (min-width: 861px) {
  #source-view .source-toolbar.source-filters {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  #source-view .source-toolbar-actions {
    justify-content: flex-start;
    width: auto;
  }
  #source-view .source-toolbar-actions .button {
    width: auto;
  }
  #source-view .source-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
  }
}

@media (min-width: 1400px) {
  #source-view .source-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
  }
}

@media (min-width: 1800px) {
  #source-view .source-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 22px;
  }
}
