/* ==========================================================================
   Emby-go · 管理控制台 — “胶片档案库” 暗色体系
   Display serif + mono 索引字 + 单一琥珀信号色。无外部字体/图标，全部内联。
   ========================================================================== */

:root {
  --bg: #07090d;
  --bg-soft: #0a0d12;
  --panel: #0f141b;
  --panel-2: #131a23;
  --panel-3: #182230;
  --line: #1c2733;
  --line-strong: #2b3a4a;
  --text: #e7ecf2;
  --muted: #93a2b3;
  --dim: #5c6c7d;
  --accent: #e0b356;
  --accent-strong: #f4cd84;
  --accent-soft: rgba(224, 179, 86, 0.14);
  --accent-ink: #191206;
  --ok: #5fc88a;
  --ok-soft: rgba(95, 200, 138, 0.14);
  --warn: #e0b356;
  --danger: #ff7f87;
  --danger-soft: rgba(255, 127, 135, 0.13);
  --info: #7fc7e8;
  --info-soft: rgba(127, 199, 232, 0.13);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
  --font-serif: "Palatino Linotype", "Book Antiqua", Palatino, "Iowan Old Style", "Noto Serif SC", "Source Han Serif SC", "Songti SC", STSong, serif;
  --font-sans: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "SF Mono", "Cascadia Code", "Roboto Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 14px/1.6 var(--font-sans);
  background:
    radial-gradient(1200px 600px at 82% -10%, rgba(37, 62, 82, 0.35), transparent 60%),
    radial-gradient(900px 520px at -8% 108%, rgba(93, 70, 34, 0.16), transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: var(--accent-ink); }

h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; letter-spacing: 0.01em; }
p { color: var(--muted); line-height: 1.75; }
a { color: var(--info); }

/* ------------------------------------------------------------------ 布局 */

#app-shell { display: flex; min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 244px;
  flex: 0 0 244px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 22px 16px 18px;
  background: linear-gradient(180deg, rgba(13, 18, 25, 0.92), rgba(9, 12, 17, 0.96));
  border-right: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 8px 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.brand-mark {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(150deg, var(--accent-strong), var(--accent) 55%, #b78a3a);
  color: var(--accent-ink);
  font: 700 20px var(--font-serif);
  box-shadow: 0 6px 16px rgba(224, 179, 86, 0.25);
}
.brand-text strong { display: block; font: 600 17px var(--font-serif); letter-spacing: 0.02em; }
.brand-text small { color: var(--dim); font: 500 11px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; }

.nav { display: grid; gap: 3px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font: 500 13.5px var(--font-sans);
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.12s ease;
}
.nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; opacity: 0.85; }
.nav-item:hover { color: var(--text); background: rgba(255, 255, 255, 0.03); }
.nav-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.nav-item.is-active {
  color: var(--text);
  background: linear-gradient(90deg, var(--accent-soft), rgba(255, 255, 255, 0.02));
  border-color: rgba(224, 179, 86, 0.18);
}
.nav-item.is-active::before {
  content: "";
  position: absolute; left: -16px; top: 20%;
  width: 3px; height: 60%;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.nav-item.is-active svg { color: var(--accent); }

.side-foot {
  margin-top: auto;
  padding: 14px 8px 2px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--dim);
  font: 500 11px var(--font-mono);
  letter-spacing: 0.06em;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); flex: none; }
.foot-link { color: var(--dim); text-decoration: none; transition: color .15s ease; }
.foot-link:hover, .foot-link:focus-visible { color: var(--accent); }
.foot-sep { color: var(--dim); opacity: .6; }
.foot-ver { color: var(--dim); }

.main { flex: 1; min-width: 0; padding: 30px 38px 60px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 26px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.crumb {
  margin: 0 0 2px;
  color: var(--accent);
  font: 600 10.5px var(--font-mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.topbar h1 { margin: 0; font-size: 30px; line-height: 1.1; }
.top-actions { display: flex; gap: 10px; flex: 0 0 auto; }

/* ------------------------------------------------------------------ 通用组件 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--text);
  font: 600 13px var(--font-sans);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { background: var(--panel-3); border-color: #3a4c60; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-accent {
  background: linear-gradient(150deg, var(--accent-strong), var(--accent));
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(224, 179, 86, 0.18);
}
.btn-accent:hover { background: linear-gradient(150deg, #f8d893, var(--accent-strong)); }
.btn-danger { color: var(--danger); border-color: rgba(255, 127, 135, 0.35); background: transparent; }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 6px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { color: var(--text); background: var(--panel-3); }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }

.panel {
  position: relative;
  background: linear-gradient(180deg, rgba(18, 24, 33, 0.9), rgba(13, 17, 23, 0.94));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  animation: rise 0.42s ease both;
}
.panel::before {
  content: "";
  position: absolute; top: 0; left: 22px; right: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.55;
}
.panel + .panel { margin-top: 20px; }
.panel > h2 { margin: 0 0 16px; font-size: 19px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head h2 { margin: 0; }
.panel-head .panel-actions { display: flex; gap: 8px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
  gap: 16px;
}
.card {
  position: relative;
  overflow: hidden;
  padding: 18px 20px 16px;
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  animation: rise 0.45s ease both;
}
.card:nth-child(2) { animation-delay: 0.05s; }
.card:nth-child(3) { animation-delay: 0.1s; }
.card:nth-child(4) { animation-delay: 0.15s; }
.card::after {
  content: "";
  position: absolute; inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(224, 179, 86, 0.5), transparent);
}
.card small {
  display: block;
  color: var(--dim);
  font: 600 10.5px var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.card strong {
  display: block;
  font: 600 30px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.card span { color: var(--muted); font-size: 12.5px; }

/* 徽标 / 状态 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font: 600 11.5px var(--font-sans);
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.success   { color: var(--ok);      background: var(--ok-soft);      border-color: rgba(95, 200, 138, 0.28); }
.badge.pending   { color: var(--warn);    background: var(--accent-soft);   border-color: rgba(224, 179, 86, 0.3); }
.badge.incompatible, .badge.failed { color: var(--danger); background: var(--danger-soft); border-color: rgba(255, 127, 135, 0.3); }
.badge.manual    { color: var(--info);    background: var(--info-soft);    border-color: rgba(127, 199, 232, 0.3); }
.badge.skipped   { color: var(--dim);     background: rgba(255, 255, 255, 0.04); border-color: var(--line-strong); }
.badge.running   { color: var(--accent);  background: var(--accent-soft);   border-color: rgba(224, 179, 86, 0.3); }

.protocol {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font: 500 11px var(--font-mono);
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.02);
}
.protocol.http, .protocol.https { color: var(--ok); border-color: rgba(95, 200, 138, 0.35); }
.protocol.ed2k { color: var(--danger); border-color: rgba(255, 127, 135, 0.3); }

/* 表格 */
.table-wrap { overflow-x: auto; margin: 0 -24px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  position: sticky; top: 0;
  background: var(--panel-2);
  text-align: left;
  color: var(--dim);
  font: 600 10.5px var(--font-mono);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: var(--text);
}
tbody tr { transition: background 0.12s ease; }
tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
tbody tr:last-child td { border-bottom: 0; }
td.num, td.mono { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
td strong.title { font-weight: 600; }
td strong.title.is-path { font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; color: var(--muted); word-break: break-all; white-space: normal; }
td .sub { display: block; color: var(--dim); font-size: 12px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* 过滤条 / 药丸筛选 */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.pill {
  padding: 6px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 600 12.5px var(--font-sans);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.pill:hover { color: var(--text); border-color: var(--accent); }
.pill.is-active { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); font-weight: 700; }
.pill.is-active[data-status="incompatible"] { background: var(--danger); border-color: var(--danger); color: #2a0608; }
.pill.is-active[data-status="pending"] { background: var(--warn); border-color: var(--warn); color: #1f1603; }

/* 表单 */
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 16px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field > label { color: var(--dim); font: 600 11px var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; }
input, textarea, select {
  background: #0b1017;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 9px 12px;
  font: 500 13.5px var(--font-sans);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder, textarea::placeholder { color: var(--dim); }
textarea { min-height: 84px; resize: vertical; line-height: 1.6; }
.form-foot { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.hint { color: var(--dim); font-size: 12.5px; margin: 10px 0 0; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.check input { width: 16px; height: 16px; padding: 0; accent-color: var(--accent); }
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* 计划任务：启用开关（复选框外观化为滑块） */
.switch { display: inline-flex; align-items: center; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i { position: relative; display: block; width: 38px; height: 21px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); border: 1px solid var(--line-strong); transition: background 0.15s ease, border-color 0.15s ease; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: var(--dim); transition: transform 0.15s ease, background 0.15s ease; }
.switch input:checked + i { background: var(--accent-soft); border-color: var(--accent); }
.switch input:checked + i::after { transform: translateX(17px); background: var(--accent); }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px var(--accent-soft); }

/* 空状态 */
.empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--dim);
}
.empty svg { width: 40px; height: 40px; opacity: 0.4; margin-bottom: 12px; }
.empty p { margin: 0 0 4px; color: var(--muted); font-weight: 600; }
.empty small { font-size: 12.5px; }

/* toast */
.toasts {
  position: fixed; top: 18px; right: 18px;
  z-index: 60;
  display: grid; gap: 10px;
  width: min(360px, calc(100vw - 36px));
}
.toast {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  animation: toast-in 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.toast.ok { border-color: rgba(95, 200, 138, 0.5); }
.toast.error { border-color: rgba(255, 127, 135, 0.5); }
.toast.out { animation: toast-out 0.25s ease both; }

/* 扫描进度 */
.scan-progress {
  position: fixed; left: 18px; bottom: 18px;
  z-index: 60;
  width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  display: grid; gap: 8px;
}
.scan-progress[hidden] { display: none; }
.scan-progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; }
.scan-progress-head strong { font-weight: 600; }
.scan-progress-head span { color: var(--muted); font-family: var(--font-mono); font-size: 12px; }
.scan-progress-bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.scan-progress-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.25s ease; }
.scan-progress-bar i.is-indeterminate { width: 40% !important; animation: scan-indeterminate 1.1s ease-in-out infinite; }
.scan-progress small { color: var(--dim); font-size: 12px; }
@keyframes scan-indeterminate { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }

/* 探测进度内嵌在媒体墙面板中（不复用左下角浮层，避免与扫描进度互相遮挡） */
.probe-progress {
  display: grid; gap: 8px;
  margin-bottom: 14px; padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--panel-2); border: 1px solid var(--line);
}
.probe-progress[hidden] { display: none; }

/* 骨架 / 加载 */
.skeleton { position: relative; overflow: hidden; background: var(--panel-2); border-radius: var(--radius-sm); }
.skeleton::after {
  content: "";
  position: absolute; inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  animation: shimmer 1.3s infinite;
}

/* ------------------------------------------------------------------ 登录 */
.auth-root {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1000px 520px at 78% -6%, rgba(38, 64, 84, 0.4), transparent 58%),
    radial-gradient(820px 460px at 0% 106%, rgba(99, 76, 38, 0.2), transparent 55%),
    var(--bg);
}
.auth-card {
  width: min(100%, 480px);
  position: relative;
  padding: 40px 44px 36px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(21, 27, 36, 0.96), rgba(12, 16, 22, 0.98));
  box-shadow: var(--shadow);
  animation: rise 0.5s ease both;
}
.auth-card::before {
  content: "";
  position: absolute; top: 0; left: 34px; right: 34px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.eyebrow { margin: 0 0 14px; color: var(--accent); font: 600 11px var(--font-mono); letter-spacing: 0.22em; text-transform: uppercase; }
.auth-card h1 { margin: 0 0 14px; font-size: 34px; line-height: 1.05; }
.auth-copy { color: var(--muted); line-height: 1.85; margin: 0 0 26px; }
.auth-form { display: grid; gap: 15px; }
.auth-form .field { display: grid; gap: 7px; }
.auth-form label { color: var(--dim); font: 600 11px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; }
.auth-form input { padding: 11px 13px; font-size: 15px; }
.auth-error { min-height: 20px; margin: 0; color: var(--danger); font-size: 13px; }
.auth-form .btn { margin-top: 8px; padding: 12px; font-size: 15px; width: 100%; }
.auth-note { margin: 18px 0 0; color: var(--dim); font-size: 12px; text-align: center; }

/* ------------------------------------------------------------------ 动画 */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes toast-in { from { opacity: 0; transform: translateX(16px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* ------------------------------------------------------------------ 响应式 */
@media (max-width: 860px) {
  #app-shell { display: block; }
  .sidebar {
    position: static;
    width: auto;
    height: auto;
    flex: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  }
  .brand { padding-bottom: 10px; margin-bottom: 10px; }
  .brand-mark { width: 32px; height: 32px; font-size: 16px; }
  /* 导航改横向滚动单行，避免 8 个入口堆成 4 行占满首屏 */
  .nav { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 2px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item { flex: 0 0 auto; width: auto; white-space: nowrap; }
  .nav-item.is-active::before { display: none; }
  .side-foot { display: none; }
  .main { padding: 20px max(16px, env(safe-area-inset-left)) 44px max(16px, env(safe-area-inset-left)); }
  .topbar { align-items: flex-start; flex-direction: column; }
  .topbar h1 { font-size: 24px; }
  .top-actions { width: 100%; }
  .top-actions .btn { width: 100%; justify-content: center; }
  .panel { padding: 18px 16px; }
  .table-wrap { margin: 0 -16px; }
  .auth-card { padding: 32px 24px 28px; }
  .auth-card h1 { font-size: 27px; }
  /* iOS 聚焦输入框时若字号 <16px 会强制放大页面 */
  input, textarea, select { font-size: 16px; }
  .icon-btn { width: 40px; height: 40px; }
  .btn-sm { padding: 9px 12px; }
  .lib-id { display: none; }
  td.mono { word-break: break-all; white-space: normal; }
  /* 移动端长路径最多显示两行，避免撑高表格 */
  .lib-path { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-all; }
  .player-overlay { padding: 12px; }
  .player-shell { max-height: calc(100dvh - 24px); }
}
@media (max-width: 720px) {
  /* 移动端详情抽屉全宽（需求 R3b 验收项）。 */
  .detail-drawer { width: 100%; border-left: 0; }
  .detail-hero-body { padding-top: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------- 媒体墙 */
.filters select { padding: 7px 10px; border-radius: var(--radius-sm); background: var(--panel-2); color: var(--text); border: 1px solid var(--line-strong); font-size: 13px; }
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 16px; }
.wall-card { display: grid; gap: 8px; cursor: pointer; }
.wall-poster { position: relative; aspect-ratio: 2 / 3; border-radius: var(--radius-sm); overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); }
.wall-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wall-path { position: absolute; inset: 0; padding: 10px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); word-break: break-all; overflow: hidden; }
.wall-badges { position: absolute; top: 6px; left: 6px; display: flex; gap: 4px; flex-wrap: wrap; }
.wall-badge { font-size: 10.5px; padding: 2px 6px; border-radius: 999px; background: rgba(10, 10, 12, 0.72); border: 1px solid var(--line-strong); color: var(--muted); }
.wall-badge.pending, .wall-badge.incompatible, .wall-badge.failed { color: #ffb4b4; }
.wall-badge.played { color: #8fe0ad; }
.wall-badge.fav { color: #ff9db0; }
.wall-badge.multi { color: var(--accent); }
.wall-badge.confirm { color: #ffd58a; }
.wall-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.12); }
.wall-progress i { display: block; height: 100%; background: var(--accent); }
.wall-actions { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s ease; }
.wall-card:hover .wall-actions { opacity: 1; }
.wall-play { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity 0.15s ease; background: rgba(0, 0, 0, 0.28); border: 0; padding: 0; cursor: pointer; }
.wall-play svg { width: 40px; height: 40px; color: #fff; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6)); }
.wall-card:hover .wall-play { opacity: 1; }
.wall-meta { display: grid; gap: 2px; }
.wall-meta strong { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wall-meta small { color: var(--dim); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 实体筛选芯片（详情抽屉跳转过来时的当前筛选） */
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--accent-soft); border: 1px solid rgba(224, 179, 86, 0.35); color: var(--accent); font-size: 12.5px; }
.chip-x { background: none; border: 0; color: inherit; cursor: pointer; font-size: 12px; line-height: 1; padding: 0 2px; }

/* ---------------------------------------------------------------- 详情抽屉 */
.detail-overlay { position: fixed; inset: 0; z-index: 70; background: rgba(5, 5, 7, 0.6); display: flex; justify-content: flex-end; }
.detail-overlay[hidden] { display: none; }
.detail-drawer { width: min(560px, 100%); height: 100%; overflow-y: auto; background: var(--panel); border-left: 1px solid var(--line-strong); box-shadow: -18px 0 44px rgba(0, 0, 0, 0.5); }
.detail-hero { position: relative; min-height: 190px; background: var(--panel-2); }
.detail-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.42; }
.detail-close { position: absolute; top: 10px; right: 10px; z-index: 2; background: rgba(10, 10, 12, 0.72); }
.detail-hero-body { position: relative; display: flex; gap: 14px; align-items: flex-end; padding: 16px; padding-top: 74px; }
.detail-poster { width: 104px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5); }
.detail-hero-text { min-width: 0; }
.detail-hero-text h2 { font-size: 19px; line-height: 1.3; margin: 0 0 6px; }
.detail-sub { color: var(--muted); font-size: 12.5px; margin: 0 0 8px; }
.detail-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.detail-body { padding: 16px; display: grid; gap: 18px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.detail-section h3 { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.detail-section h3 small { color: var(--muted); letter-spacing: 0; text-transform: none; font-size: 12px; }
.detail-plot { font-size: 13.5px; line-height: 1.7; color: var(--muted); margin: 0; white-space: pre-wrap; }
.detail-meta { margin: 0; display: grid; gap: 6px; }
.detail-meta-row { display: grid; grid-template-columns: 84px 1fr; gap: 10px; align-items: baseline; }
.detail-meta-row dt { color: var(--dim); font-size: 12px; }
.detail-meta-row dd { margin: 0; font-size: 13px; word-break: break-all; }
.entity-link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
.entity-link:hover { color: var(--text); }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; }
.avatar-card { display: grid; gap: 6px; justify-items: center; background: none; border: 0; padding: 0; cursor: pointer; color: var(--muted); }
.avatar-card img, .avatar-fallback { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line-strong); background: var(--panel-2); }
.avatar-fallback { display: grid; place-items: center; font-size: 22px; color: var(--dim); }
.avatar-card small { font-size: 11.5px; text-align: center; overflow: hidden; text-overflow: ellipsis; max-width: 76px; white-space: nowrap; }
.avatar-card:hover small { color: var(--text); }
.detail-file { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 10px; background: rgba(255, 255, 255, 0.015); }
.detail-file-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.detail-file-head strong { font-size: 13px; }
.detail-file-head .mono { font-size: 11.5px; color: var(--muted); flex: 1; word-break: break-all; }
.detail-path { font-size: 11px; color: var(--dim); margin: 6px 0 0; word-break: break-all; }

/* ---------------------------------------------------------------- 刮削 */
.scrape-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(5, 5, 7, 0.72); display: grid; place-items: center; padding: 24px; }
.scrape-overlay[hidden] { display: none; }
.scrape-modal { width: min(1040px, 100%); max-height: calc(100dvh - 48px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55); }
.scrape-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.scrape-head strong { font-size: 14px; }
.scrape-body { padding: 16px; overflow-y: auto; display: grid; gap: 16px; }
.scrape-cols { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 16px; }
@media (max-width: 800px) { .scrape-cols { grid-template-columns: 1fr; } }
.scrape-candidates { display: grid; gap: 8px; align-content: start; }
.scrape-candidate { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.015); cursor: pointer; text-align: left; color: inherit; }
.scrape-candidate.is-active { border-color: var(--accent); background: var(--accent-soft); }
.scrape-candidate img, .scrape-candidate .noimg { width: 52px; height: 74px; object-fit: cover; border-radius: 4px; background: var(--panel-2); display: block; }
.scrape-candidate strong { display: block; font-size: 12.5px; line-height: 1.35; }
.scrape-candidate small { display: block; color: var(--dim); font-size: 11.5px; margin-top: 2px; }
.scrape-detail { display: grid; gap: 14px; align-content: start; }
.scrape-detail-head { display: flex; gap: 14px; }
.scrape-detail-head img { width: 120px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); }
.scrape-diff { margin: 0; display: grid; gap: 4px; }
.scrape-diff-row { display: grid; grid-template-columns: 76px 1fr; gap: 10px; padding: 5px 8px; border-radius: 5px; align-items: baseline; font-size: 12.5px; }
.scrape-diff-row.is-change { background: var(--accent-soft); }
.scrape-diff-row dt { color: var(--dim); font-size: 12px; }
.scrape-diff-row dd { margin: 0; word-break: break-word; }
.scrape-diff-row .old { color: var(--dim); text-decoration: line-through; }
.scrape-diff-row .next { color: var(--accent); }
.scrape-images { display: flex; gap: 12px; flex-wrap: wrap; }
.scrape-image { display: grid; gap: 6px; justify-items: center; font-size: 11.5px; color: var(--dim); }
.scrape-image img { width: 84px; height: 118px; object-fit: cover; border-radius: 4px; background: var(--panel-2); border: 1px solid var(--line); }
.scrape-image.is-kept img { opacity: 0.4; }
.scrape-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.scrape-foot .hint { margin: 0; margin-right: auto; }
.switch-lg { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }

body.player-open { overflow: hidden; }
.player-overlay { position: fixed; inset: 0; z-index: 80; background: rgba(5, 5, 7, 0.82); display: grid; place-items: center; padding: 24px; }
.player-overlay[hidden] { display: none; }
.player-shell { width: min(1100px, 100%); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); display: flex; flex-direction: column; background: #0b0b0e; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.player-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.player-head strong { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-stage { aspect-ratio: 16 / 9; max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px); background: #000; flex: 0 0 auto; }
.player-stage > div { width: 100%; height: 100%; }

/* 触屏设备没有 hover：把悬停才出现的操作/播放按钮改为常显，保证可达 */
@media (hover: none) {
  .wall-actions { opacity: 1; }
  .wall-play { opacity: 1; background: transparent; place-items: end; padding: 8px; }
  .wall-play svg { width: 30px; height: 30px; }
}

.wall-more { text-align: center; color: var(--dim); font-size: 12.5px; padding: 18px 0 4px; min-height: 22px; }
