/* ==========================================================================
   片库 · 多 IP 视频管理
   ========================================================================== */

:root {
  --bg: #f4f1eb;
  --surface: #ffffff;
  --surface-2: #fbf9f5;
  --line: #e7e1d6;
  --line-strong: #d8d0c1;
  --ink: #1f2328;
  --ink-2: #4b5158;
  --muted: #818791;
  --faint: #a8adb5;

  --raw: #5b6b7d;
  --raw-soft: #eef1f5;
  --raw-line: #dde3ea;

  --ready: #b96a12;
  --ready-strong: #a85c07;
  --ready-soft: #fcf2e2;
  --ready-line: #f0ddba;

  --published: #2c7a58;
  --published-soft: #e9f5ee;
  --published-line: #cfe7da;

  --danger: #c0392b;
  --danger-soft: #fcefec;

  --side-bg: #1b1e22;
  --side-panel: #252a30;
  --side-line: rgba(255, 255, 255, 0.08);
  --side-ink: #f2ede2;
  --side-muted: #8d939b;

  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(28, 26, 22, 0.04);
  --shadow: 0 1px 2px rgba(28, 26, 22, 0.04), 0 10px 24px -18px rgba(28, 26, 22, 0.35);
  --shadow-lift: 0 2px 4px rgba(28, 26, 22, 0.05), 0 18px 34px -22px rgba(28, 26, 22, 0.45);
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
button { font-family: inherit; font-size: inherit; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: inherit; }
svg.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
::selection { background: #f4d9a8; }

/* --------------------------------------------------------------------------
   整体布局
   -------------------------------------------------------------------------- */

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

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 420px at 100% 0%, #eaf2ed 0%, rgba(234, 242, 237, 0) 58%),
    radial-gradient(1000px 480px at 0% 0%, #fdf6e9 0%, rgba(253, 246, 233, 0) 55%),
    var(--bg);
}

/* --------------------------------------------------------------------------
   侧栏：IP 视频库
   -------------------------------------------------------------------------- */

.sidebar {
  width: 268px;
  flex: none;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--side-ink);
  background:
    radial-gradient(520px 260px at 10% 0%, #2a3037 0%, rgba(42, 48, 55, 0) 65%),
    var(--side-bg);
  border-right: 1px solid rgba(0, 0, 0, 0.35);
}

.side-brand { display: flex; align-items: center; gap: 11px; padding: 20px 18px 14px; }
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: #f2e9d9;
  color: #1b1e22;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}
.brand-mark .ico { width: 20px; height: 20px; stroke-width: 1.7; }
.brand-text h1 { font-size: 16px; font-weight: 700; color: #f7f2e8; letter-spacing: 0.02em; }
.brand-text p { font-size: 10.5px; color: var(--side-muted); letter-spacing: 0.05em; }

.brand-add { display: none; }

.side-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 2px 18px 14px;
  font-size: 11px;
  color: var(--side-muted);
}
.side-summary b { color: #d9d3c6; font-weight: 600; }
.side-summary .pending { color: #e7b06a; font-weight: 600; }

.ip-list {
  flex: 0 1 auto;
  min-height: 0;
  max-height: calc(100vh - 250px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 10px 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}
.ip-list::-webkit-scrollbar { width: 6px; }
.ip-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 3px; }

.ip-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}
.ip-item:hover { background: rgba(255, 255, 255, 0.05); }
.ip-item.active { background: #2b3037; box-shadow: inset 2px 0 0 var(--lc, #c2703e); }
.ip-avatar {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--lc, #c2703e);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.ip-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ip-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #f1ece1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ip-meta {
  font-size: 10px;
  color: var(--side-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.ip-badge {
  flex: none;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 6px;
  background: #e9ae5f;
  color: #2a1c0a;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.ip-new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: none;
  width: calc(100% - 20px);
  height: 38px;
  margin: 2px 10px 10px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: transparent;
  color: #c9c2b3;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ip-new:hover { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.34); color: #f1ece1; }
.ip-new .ico { width: 15px; height: 15px; }

.side-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 14px;
  border-top: 1px solid var(--side-line);
}
.me-select {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 34px;
  padding: 0 2px 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  background: var(--side-panel);
  color: #cfc9bd;
}
.me-select .ico { width: 14px; height: 14px; color: var(--side-muted); }
.me-select select {
  appearance: none;
  -webkit-appearance: none;
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 16px 0 4px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #eae4d8;
  font-size: 11.5px;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, #8d939b 50%), linear-gradient(135deg, #8d939b 50%, transparent 50%);
  background-position: calc(100% - 8px) 15px, calc(100% - 4px) 15px;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}
.me-select option { color: #1f2328; background: #fff; }

.side-icon {
  width: 34px;
  height: 34px;
  box-shadow: none;
  background: var(--side-panel);
  border-color: rgba(255, 255, 255, 0.1);
  color: #cfc9bd;
}
.side-icon:hover { background: #2e343b; border-color: rgba(255, 255, 255, 0.2); }

/* --------------------------------------------------------------------------
   主区头部：当前 IP 概览
   -------------------------------------------------------------------------- */

.lib-head {
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 26px clamp(18px, 2.6vw, 34px) 18px;
}
.lib-title { min-width: 0; }
.lib-name-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lib-name-row h1 {
  font-size: 27px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.2;
  word-break: break-word;
}
.lib-platform {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: #ece6da;
  color: #6f6758;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.lib-counts { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 9px; }
.lc { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.lc b { font-size: 15px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.lc .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot.raw { background: var(--raw); }
.dot.ready { background: var(--ready); }
.dot.published { background: var(--published); }
.lc.total { padding-left: 18px; border-left: 1px solid var(--line); }
.lc.total b { color: var(--ink-2); }
.c-drive-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 5px 9px;
  border: 1px solid var(--ready-line);
  border-radius: 7px;
  background: var(--ready-soft);
  color: var(--ready-strong);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.c-drive-hint:hover { background: #f9e9cf; }
.c-drive-hint .ico { width: 13px; height: 13px; }

.lib-actions { display: flex; align-items: center; gap: 8px; flex: none; }

/* --------------------------------------------------------------------------
   看板
   -------------------------------------------------------------------------- */

.board {
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 clamp(18px, 2.6vw, 34px) 30px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.col {
  --c: var(--raw);
  --c-soft: var(--raw-soft);
  --c-line: var(--raw-line);
  display: flex;
  flex-direction: column;
  min-height: 220px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--c-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.62) 0%, rgba(255, 255, 255, 0.25) 100%);
  transition: background 0.16s, border-color 0.16s, box-shadow 0.16s;
}
.col[data-status="ready"] {
  --c: var(--ready);
  --c-soft: var(--ready-soft);
  --c-line: var(--ready-line);
  background: linear-gradient(180deg, rgba(252, 242, 226, 0.5) 0%, rgba(252, 242, 226, 0.14) 100%);
}
.col[data-status="published"] {
  --c: var(--published);
  --c-soft: var(--published-soft);
  --c-line: var(--published-line);
}
.col.dragover { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 15%, transparent); background: var(--c-soft); }
.col.file-over { border-style: dashed; border-color: var(--c); background: var(--c-soft); }

.col-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 11px; }
.col-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 15%, transparent); }
.col-name { font-size: 13.5px; font-weight: 700; letter-spacing: 0.01em; }
.col-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--c-soft);
  color: var(--c);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}
.col-body { display: flex; flex-direction: column; gap: 10px; min-height: 60px; }

/* 卡片 */

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, opacity 0.16s;
}
.board.first .card { animation: cardIn 0.22s ease both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.card:hover { transform: translateY(-2px); border-color: #d6cec0; box-shadow: var(--shadow-lift); }
.card:active { transform: translateY(0); }
.card.dragging { opacity: 0.35; transform: rotate(1deg) scale(0.99); }
.card.dup { border-color: #ecc9c2; }
.card.missing { opacity: 0.72; }
.card.processing .thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.28) 45%, transparent 70%);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.thumb { position: relative; aspect-ratio: 16 / 9; background: #20242a; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.35);
  background: radial-gradient(120% 100% at 20% 0%, #3a4149 0%, #22262b 55%, #191c20 100%);
}
.thumb .ph .ico { width: 30px; height: 30px; stroke-width: 1.3; }
.thumb .ph .ext {
  position: absolute;
  bottom: 8px;
  left: 9px;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.4);
}
.thumb::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 42%;
  background: linear-gradient(180deg, transparent, rgba(10, 12, 14, 0.55));
  z-index: 1;
  pointer-events: none;
}

.card-top-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  z-index: 3;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 0.15s, transform 0.15s;
}
.card:hover .card-top-actions { opacity: 1; transform: none; }
.mini-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgba(20, 22, 25, 0.62);
  color: #f5f2ea;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.15s;
}
.mini-btn:hover { background: rgba(20, 22, 25, 0.85); }
.mini-btn .ico { width: 15px; height: 15px; }

.chip {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  backdrop-filter: blur(6px);
}
.chip.dur { left: 8px; bottom: 8px; background: rgba(15, 17, 20, 0.72); color: #f3efe5; font-variant-numeric: tabular-nums; }
.chip.res { left: 64px; bottom: 8px; background: rgba(15, 17, 20, 0.5); color: #ded9cd; font-weight: 500; }
.chip.dup { top: 8px; left: 8px; background: rgba(192, 57, 43, 0.92); color: #fff; }
.chip.err { top: 8px; left: 8px; background: rgba(160, 96, 20, 0.92); color: #fff; }
.chip.proc { top: 8px; left: 8px; background: rgba(15, 17, 20, 0.72); color: #f0e9da; font-weight: 500; }
.chip.lost { top: 8px; left: 8px; background: rgba(120, 40, 30, 0.92); color: #fff; }
.chip.wait { position: static; background: var(--ready-soft); color: var(--ready-strong); height: 20px; padding: 0 7px; }

.card-body { padding: 10px 12px 11px; }
.card-title {
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.38;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.card-meta { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.who { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-weight: 500; }
.who i {
  font-style: normal;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #eae5db;
  color: #6d6455;
  display: inline-grid;
  place-items: center;
  font-size: 9.5px;
  font-weight: 700;
  flex: none;
}
.who.empty { color: var(--faint); }
.sep { color: #d5cfc4; }

.pub-line { display: flex; align-items: center; gap: 5px; margin-top: 7px; font-size: 11px; color: var(--published); font-weight: 500; }
.pub-line .ico { width: 12px; height: 12px; }
.pub-line a { text-decoration: none; border-bottom: 1px solid currentColor; opacity: 0.9; }
.pub-missing { color: var(--ready); font-weight: 700; }

.col-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 34px 16px;
  border: 1px dashed var(--c-line);
  border-radius: 12px;
  text-align: center;
  color: var(--faint);
  background: rgba(255, 255, 255, 0.3);
}
.empty-icon { color: var(--c); opacity: 0.55; margin-bottom: 4px; }
.empty-icon .ico { width: 22px; height: 22px; stroke-width: 1.5; }
.empty-title { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.empty-sub { font-size: 11px; line-height: 1.55; max-width: 230px; }

/* --------------------------------------------------------------------------
   空状态：还没有 IP 库
   -------------------------------------------------------------------------- */

.zero {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 40px 20px 80px;
}
.zero-card { max-width: 430px; text-align: center; }
.zero-icon {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  color: #6b6455;
  box-shadow: var(--shadow);
}
.zero-icon .ico { width: 28px; height: 28px; stroke-width: 1.5; }
.zero-card h1 { font-size: 22px; font-weight: 750; letter-spacing: -0.01em; }
.zero-card p { margin: 8px 0 22px; font-size: 13px; line-height: 1.75; color: var(--muted); }

/* --------------------------------------------------------------------------
   详情抽屉
   -------------------------------------------------------------------------- */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(26, 25, 22, 0.36);
  backdrop-filter: blur(2px);
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  width: min(460px, 100vw);
  display: flex;
  flex-direction: column;
  background: #faf8f4;
  border-left: 1px solid var(--line);
  box-shadow: -30px 0 60px -30px rgba(20, 20, 18, 0.4);
  transform: translateX(102%);
  transition: transform 0.26s cubic-bezier(0.22, 0.8, 0.3, 1);
}
.drawer.open { transform: none; }
.drawer-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 248, 244, 0.9);
  backdrop-filter: blur(10px);
}
.drawer-head .label { font-size: 11.5px; color: var(--muted); letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-head .spacer { flex: 1; }
.drawer-close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink-2);
  flex: none;
}
.drawer-close:hover { background: #f1ede5; }

.drawer-scroll { overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.player { background: #0b0d0f; width: min(100%, 320px); aspect-ratio: 9 / 16; margin: 14px auto; display: grid; place-items: center; overflow: hidden; border-radius: 10px; }
.player.tall { aspect-ratio: 9 / 16; }
.player video { width: 100%; height: 100%; display: block; object-fit: contain; background: #0b0d0f; }
.player .no-file { color: #9a9386; font-size: 12px; text-align: center; padding: 20px; line-height: 1.7; }
.file-player {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #cfc8ba;
  background: radial-gradient(120% 100% at 20% 0%, #3a4149 0%, #22262b 55%, #191c20 100%);
}
.file-ext { font-size: 30px; font-weight: 750; letter-spacing: 0.08em; color: #f2e9d9; }
.file-tip { font-size: 12px; color: #9a9386; }
.file-player .btn { margin-top: 8px; background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); color: #f6f2e8; }
.file-player .btn:hover { background: rgba(255, 255, 255, 0.16); }

.drawer-body { padding: 16px; display: flex; flex-direction: column; gap: 16px; }

.status-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px;
  border-radius: 12px;
  background: #efece5;
  border: 1px solid #e5e0d6;
}
.status-switch button {
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 8px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.status-switch button:hover { color: var(--ink); }
.status-switch button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.status-switch button.active[data-s="ready"] { color: var(--ready-strong); }
.status-switch button.active[data-s="published"] { color: var(--published); }
.status-switch button.active[data-s="raw"] { color: var(--raw); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: 0.04em; }
.field input[type="text"], .field input[type="date"], .field input[type="url"], .field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  outline: 0;
  font-size: 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  padding: 9px 30px 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  outline: 0;
  font-size: 13px;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, #9aa0a8 50%), linear-gradient(135deg, #9aa0a8 50%, transparent 50%);
  background-position: calc(100% - 15px) 18px, calc(100% - 10px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: #c9bda6; box-shadow: 0 0 0 3px rgba(201, 189, 166, 0.2); }
.field textarea { resize: vertical; min-height: 68px; line-height: 1.6; }
.field .hint { font-size: 11px; color: var(--faint); }
.req { color: var(--danger); font-size: 10.5px; font-weight: 700; margin-left: 4px; }

.path-row { display: flex; gap: 8px; align-items: stretch; }
.path-row input { flex: 1; min-width: 0; }
.path-row .btn { flex: none; height: 38px; }

/* 文件夹选择器 */
.picker-path {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 9px;
  background: #f2eee6;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 11.5px;
  color: var(--ink-2);
  word-break: break-all;
}
.picker-path .path-text { flex: 1; min-width: 0; }
.picker-up {
  flex: none;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  color: var(--ink-2);
}
.picker-up:disabled { opacity: 0.35; cursor: not-allowed; }
.picker-roots { display: flex; flex-wrap: wrap; gap: 6px; }
.picker-root {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  padding: 5px 9px;
  font-size: 11.5px;
  cursor: pointer;
  color: var(--ink-2);
}
.picker-root:hover { border-color: var(--line-strong); background: #fbf8f2; }
.picker-list {
  height: 280px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.picker-row {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 11px;
  border: 0;
  border-bottom: 1px solid #f5f1e9;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--ink-2);
}
.picker-row:last-child { border-bottom: 0; }
.picker-row:hover { background: #f8f4ed; }
.picker-row .ico { width: 16px; height: 16px; color: #b08a4a; }
.picker-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-empty { padding: 32px 16px; text-align: center; color: var(--faint); font-size: 12px; }
.picker-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11.5px; color: var(--muted); }
.picker-meta .ok { color: var(--published); font-weight: 600; }
.picker-meta .warn { color: var(--danger); font-weight: 600; }
.picker-new { display: flex; gap: 8px; }
.picker-new input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  outline: 0;
  background: #fff;
}
.picker-new input:focus { border-color: #c9bda6; box-shadow: 0 0 0 3px rgba(201, 189, 166, 0.2); }

.field input[type="file"] {
  width: 100%;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  background: #fff;
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
}
.field input[type="file"]::file-selector-button {
  border: 1px solid var(--line);
  background: #f4f0e8;
  color: var(--ink);
  border-radius: 6px;
  padding: 5px 10px;
  margin-right: 10px;
  font-size: 12px;
  cursor: pointer;
}

.member-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.member-chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  color: var(--ink-2);
}
.member-chip:hover { border-color: var(--line-strong); }
.member-chip.active { background: var(--ink); border-color: var(--ink); color: #fbf7ee; }

.pub-box { border: 1px solid var(--published-line); background: var(--published-soft); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.pub-box .head { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--published); }
.pub-box .head .ico { width: 14px; height: 14px; }
.pub-box .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pub-box input { background: #fffdfa; border-color: var(--published-line); }

.dup-warn {
  display: flex;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #f0cfc8;
  background: var(--danger-soft);
  color: #8a3024;
  font-size: 12px;
  line-height: 1.55;
}
.dup-warn .ico { width: 16px; height: 16px; margin-top: 1px; flex: none; }
.dup-warn b { font-weight: 700; }
.dup-warn a { text-decoration: underline; cursor: pointer; }
.dup-ack {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px dashed rgba(138, 48, 36, 0.25);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.dup-ack input { width: 15px; height: 15px; accent-color: var(--danger); cursor: pointer; }

.file-info { border-top: 1px dashed var(--line); padding-top: 12px; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 11.5px; color: var(--muted); }
.file-info dt { color: var(--faint); }
.file-info dd { margin: 0; color: var(--ink-2); word-break: break-all; }

.drawer-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.save-state { font-size: 11.5px; color: var(--faint); }
.save-state.ok { color: var(--published); }

/* --------------------------------------------------------------------------
   按钮 / 弹层
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { background: #f7f4ee; border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn .ico { width: 15px; height: 15px; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fbf7ed; }
.btn.primary:hover { background: #2c3137; }
.btn.danger { color: var(--danger); border-color: #eed3cd; background: #fffafa; }
.btn.danger:hover { background: #fdf1ef; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:disabled:hover { background: #fff; border-color: var(--line); }

.btn-upload { height: 42px; padding: 0 18px; border-radius: 11px; box-shadow: 0 10px 22px -16px rgba(15, 15, 12, 0.8); }
.btn-upload .ico { width: 17px; height: 17px; }

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  color: var(--ink-2);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}
.icon-btn:hover { background: #fff; border-color: var(--line-strong); transform: translateY(-1px); }
.icon-btn:active { transform: translateY(0); }
.icon-btn.spin .ico { animation: spin 0.9s linear infinite; }
.icon-btn.more { width: 42px; height: 42px; border-radius: 11px; }
@keyframes spin { to { transform: rotate(360deg); } }

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(24, 23, 20, 0.45);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.18s ease;
}
.modal {
  width: min(460px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: #fdfbf7;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 40px 80px -30px rgba(15, 15, 12, 0.55);
  animation: modalIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: flex-start; gap: 10px; padding: 20px 22px 0; }
.modal-head h2 { font-size: 16px; font-weight: 700; letter-spacing: 0.01em; }
.modal-head p { font-size: 12px; color: var(--muted); margin-top: 3px; }
.modal-head .spacer { flex: 1; }
.modal-close { border: 0; background: transparent; color: var(--faint); cursor: pointer; padding: 2px; border-radius: 6px; }
.modal-close:hover { color: var(--ink); background: rgba(0, 0, 0, 0.05); }
.modal-body { padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 0 22px 20px; }
.modal-foot .btn { height: 40px; padding: 0 18px; }

.chip-picker { display: flex; flex-wrap: wrap; gap: 7px; }
.chip-opt {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--ink-2);
  transition: all 0.14s;
}
.chip-opt:hover { border-color: var(--line-strong); }
.chip-opt.active { background: var(--ink); border-color: var(--ink); color: #fbf7ee; }

.setup-note { font-size: 12px; color: var(--ink-2); background: #f3efe7; border-radius: 10px; padding: 10px 12px; line-height: 1.65; }
.setup-note b { color: var(--ink); }
.lib-path {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 11.5px;
  background: #f0ece4;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  word-break: break-all;
  color: var(--ink-2);
}

.menu-list { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px 12px; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink);
}
.menu-item:hover { background: #f2eee6; }
.menu-item .ico { width: 17px; height: 17px; color: var(--muted); }
.menu-item small { margin-left: auto; font-size: 11px; color: var(--faint); max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger .ico { color: var(--danger); }

/* 换库选择 */
.lib-choices { display: flex; flex-direction: column; gap: 7px; max-height: 300px; overflow-y: auto; }
.lib-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.lib-choice:hover { border-color: var(--line-strong); }
.lib-choice.active { border-color: var(--ink); box-shadow: 0 0 0 2px rgba(31, 35, 40, 0.08); }
.lib-choice-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lib-choice-main b { font-size: 13px; font-weight: 650; color: var(--ink); }
.lib-choice-main small { font-size: 10.5px; color: var(--muted); }
.lib-choice-dot { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line-strong); flex: none; }
.lib-choice.active .lib-choice-dot { border-color: var(--ink); background: var(--ink); box-shadow: inset 0 0 0 3px #fff; }

/* --------------------------------------------------------------------------
   Toast / 上传进度
   -------------------------------------------------------------------------- */

.toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(460px, calc(100vw - 32px));
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 10px 15px;
  border-radius: 10px;
  background: rgba(30, 32, 35, 0.93);
  color: #f6f2e8;
  font-size: 12.5px;
  box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.22s ease;
  backdrop-filter: blur(8px);
}
.toast.error { background: rgba(150, 45, 33, 0.95); }
.toast.ok { background: rgba(38, 92, 68, 0.95); }
.toast .ico { width: 15px; height: 15px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.upload-progress {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 99;
  width: min(380px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(28, 30, 33, 0.95);
  color: #f6f2e8;
  font-size: 12px;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
}
.upload-progress .line { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.upload-progress .bar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.18); overflow: hidden; }
.upload-progress .bar i { display: block; height: 100%; width: 0; background: #f3c677; border-radius: 4px; transition: width 0.15s; }

/* --------------------------------------------------------------------------
   二级：分类概览 / 三级：视频网格
   -------------------------------------------------------------------------- */

.board.library-mode, .board.category-mode { display: block; }
.board.category-mode { padding-bottom: 110px; }
.board.library-mode { padding-bottom: 30px; }

.cat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; width: 100%; }

.cat-tile {
  --tc: var(--raw);
  --tsoft: var(--raw-soft);
  --tline: var(--raw-line);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 210px;
  padding: 20px;
  border: 1px solid var(--tline);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, var(--tsoft) 100%);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.cat-tile[data-cat="ready"] { --tc: var(--ready); --tsoft: var(--ready-soft); --tline: var(--ready-line); }
.cat-tile[data-cat="published"] { --tc: var(--published); --tsoft: var(--published-soft); --tline: var(--published-line); }
.cat-tile:hover { transform: translateY(-3px); border-color: var(--tc); box-shadow: var(--shadow-lift); }
.cat-tile::after {
  content: "";
  position: absolute;
  right: -46px;
  bottom: -58px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: var(--tsoft);
  opacity: 0.8;
  pointer-events: none;
}
.cat-head { display: flex; align-items: center; gap: 8px; width: 100%; font-size: 13px; font-weight: 700; color: var(--ink); position: relative; z-index: 1; }
.cat-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--tc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tc) 15%, transparent); flex: none; }
.cat-arrow { margin-left: auto; color: var(--tc); opacity: 0.55; font-size: 16px; font-weight: 600; }
.cat-count { display: block; margin-top: 20px; font-size: 52px; font-weight: 750; line-height: 1; letter-spacing: -0.05em; color: var(--ink); position: relative; z-index: 1; font-variant-numeric: tabular-nums; }
.cat-count small { margin-left: 4px; font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.cat-desc { display: block; margin-top: 8px; font-size: 12px; color: var(--ink-2); position: relative; z-index: 1; }
.cat-note { display: block; margin-top: auto; padding-top: 14px; font-size: 11.5px; font-weight: 600; color: var(--tc); position: relative; z-index: 1; }

.cat-name-row { gap: 10px; }
.back-btn {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink-2);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.back-btn:hover { background: #f7f4ee; border-color: var(--line-strong); }
.back-btn .ico { width: 17px; height: 17px; }

.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; width: 100%; }

.video-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  user-select: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, opacity 0.15s;
}
.video-card:hover { transform: translateY(-2px); border-color: #d6cec0; box-shadow: var(--shadow-lift); }
.video-card.selected { border-color: var(--ink); box-shadow: 0 0 0 2px rgba(31, 35, 40, 0.12); }
.video-card.dragging { opacity: 0.45; }
.vthumb { position: relative; aspect-ratio: 16 / 9; background: #20242a; overflow: hidden; }
.vthumb::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 42%;
  background: linear-gradient(180deg, transparent, rgba(10, 12, 14, 0.52));
  z-index: 1;
  pointer-events: none;
}
.vthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vthumb .ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.35);
  background: radial-gradient(120% 100% at 20% 0%, #3a4149 0%, #22262b 55%, #191c20 100%);
}
.vthumb .ph .ico { width: 26px; height: 26px; stroke-width: 1.3; }
.vthumb .ph .ext { position: absolute; bottom: 7px; left: 8px; font-size: 9px; letter-spacing: 0.1em; color: rgba(255, 255, 255, 0.4); }

.v-actions {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: flex;
  gap: 4px;
  z-index: 4;
  opacity: 0.72;
  transform: none;
  transition: opacity 0.15s, transform 0.15s;
}
.video-card:hover .v-actions { opacity: 1; transform: none; }
.v-actions .mini-btn { width: 24px; height: 24px; border-radius: 6px; background: rgba(15, 17, 20, 0.7); }
.v-actions .mini-btn.danger:hover { background: rgba(192, 57, 43, 0.92); }
.v-actions .mini-btn.publish { background: rgba(44, 122, 88, 0.88); }
.v-actions .mini-btn.publish:hover { background: rgba(36, 104, 74, 0.95); }
.v-actions .ico { width: 13px; height: 13px; }

.video-card .chip.dup,
.video-card .chip.lost,
.video-card .chip.proc,
.video-card .chip.err { left: auto; right: 7px; top: 7px; }
.video-card .chip.dur { left: 7px; bottom: 7px; height: 18px; font-size: 10px; }

.sel-dot {
  position: absolute;
  top: 7px;
  left: 7px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  background: rgba(15, 17, 20, 0.35);
  z-index: 4;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.video-card.selected .sel-dot { background: #fff; border-color: #fff; }
.video-card.selected .sel-dot::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid var(--ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.vbody { padding: 8px 9px 9px; }
.vbody h3 {
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.35;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  min-height: 34px;
}
.vmeta { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 5px; font-size: 10.5px; color: var(--muted); }
.vmeta .who { font-size: 10.5px; }
.vmeta .who i { width: 14px; height: 14px; font-size: 8.5px; }
.vmeta .sep { font-size: 10px; }
.v-wait { color: var(--ready); font-weight: 600; }
.vpub { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 4px; font-size: 10.5px; color: var(--published); font-weight: 500; }
.vpub .ico { width: 11px; height: 11px; }
.vpub .sep { color: #d5cfc4; }

.cat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 80px 20px;
  text-align: center;
  color: var(--muted);
}
.cat-empty .empty-icon { color: var(--ink-2); opacity: 0.55; margin-bottom: 4px; }
.cat-empty .empty-icon .ico { width: 30px; height: 30px; stroke-width: 1.4; }
.cat-empty h2 { font-size: 18px; font-weight: 700; color: var(--ink); }
.cat-empty p { max-width: 430px; font-size: 12.5px; line-height: 1.7; }
.cat-empty .btn { margin-top: 8px; }

.board.category-mode.file-over .video-grid { outline: 2px dashed var(--published); outline-offset: 10px; border-radius: 12px; }

/* 批量选择 */

.batch-bar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: calc(100vw - 32px);
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(28, 30, 33, 0.96);
  color: #f6f2e8;
  box-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
}
.batch-count { font-size: 12.5px; white-space: nowrap; }
.batch-count b { font-size: 14px; color: #f3c677; }
.batch-hint { font-size: 11px; color: #a9a196; white-space: nowrap; }
.batch-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.batch-bar .btn { height: 32px; padding: 0 10px; font-size: 12px; background: transparent; border-color: rgba(255, 255, 255, 0.18); color: #f6f2e8; }
.batch-bar .btn:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.32); }
.batch-bar .btn.danger { color: #ffb4a8; border-color: rgba(255, 120, 100, 0.32); }
.batch-bar .btn.danger:hover { background: rgba(192, 57, 43, 0.25); }

.marquee {
  position: fixed;
  z-index: 88;
  border: 1px solid rgba(44, 122, 88, 0.85);
  background: rgba(44, 122, 88, 0.1);
  border-radius: 3px;
  pointer-events: none;
}
body.marquee-active { user-select: none; cursor: crosshair; }

/* 顶部换库 HUD */

.drag-hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 95;
  padding: 14px clamp(16px, 3vw, 32px) 16px;
  background: rgba(20, 22, 25, 0.96);
  color: #f4efe4;
  box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(16px);
  transform: translateY(-105%);
  transition: transform 0.18s ease;
}
.drag-hud.open { transform: none; }
.hud-inner { max-width: 1200px; margin: 0 auto; }
.hud-title { margin-bottom: 10px; font-size: 11.5px; color: #a9a196; letter-spacing: 0.04em; }
.hud-libs { display: flex; gap: 9px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.hud-lib {
  flex: 0 0 200px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px dashed rgba(255, 255, 255, 0.24);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.hud-lib.over { background: rgba(233, 174, 95, 0.18); border-style: solid; border-color: #e9ae5f; transform: translateY(-1px); }
.hud-lib .ip-avatar { width: 28px; height: 28px; font-size: 11px; }
.hud-lib-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hud-lib-text b { font-size: 12px; font-weight: 650; color: #f1ece1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-lib-text small { font-size: 10px; color: #9aa0a8; white-space: nowrap; }

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  .sidebar { width: 240px; }
  .board { grid-template-columns: repeat(3, minmax(260px, 1fr)); overflow-x: auto; }
}

@media (max-width: 900px) {
  .app { display: block; }
  .sidebar {
    position: static;
    width: auto;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.3);
  }
  .side-brand { padding: 13px 16px 6px; }
  .brand-mark { width: 32px; height: 32px; border-radius: 9px; }
  .brand-text h1 { font-size: 15px; }
  .brand-text p { display: none; }
  .brand-add {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    margin-left: auto;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.06);
    color: #e6dfd1;
    cursor: pointer;
  }
  .brand-add .ico { width: 16px; height: 16px; }
  .side-summary { padding: 0 16px 9px; }
  .ip-list {
    flex: none;
    max-height: none;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 16px 10px;
    gap: 8px;
    scroll-snap-type: x proximity;
  }
  .ip-item { flex: 0 0 auto; width: auto; min-width: 156px; max-width: 230px; padding: 8px 10px; scroll-snap-align: start; }
  .ip-new { display: none; }
  .ip-avatar { width: 27px; height: 27px; border-radius: 8px; font-size: 11px; }
  .side-foot { padding: 8px 16px 12px; }
  .me-select { max-width: 170px; flex: none; }

  .lib-head { flex-wrap: wrap; align-items: flex-start; padding: 18px 16px 14px; gap: 12px; }
  .lib-name-row h1 { font-size: 22px; }
  .lib-counts { gap: 13px; margin-top: 7px; }
  .lc { font-size: 11px; }
  .lc b { font-size: 14px; }
  .lc.total { padding-left: 13px; }
  .lib-actions { margin-left: auto; }
  .btn-upload { height: 38px; padding: 0 14px; }

  .board {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0 16px 22px;
    align-items: flex-start;
  }
  .col { flex: 0 0 86vw; max-width: 420px; scroll-snap-align: center; }
  .zero { padding: 50px 24px 70px; }
}

@media (max-width: 560px) {
  .lib-head { padding-bottom: 12px; }
  .lib-name-row { gap: 8px; }
  .lib-name-row h1 { font-size: 20px; }
  .lib-platform { height: 19px; font-size: 10px; }
  .lc.total { display: none; }
  .lib-actions { gap: 6px; }
  .btn-upload { padding: 0 12px; font-size: 12px; }
  .icon-btn.more { width: 38px; height: 38px; }
  .drawer { width: 100vw; }
  .modal { border-radius: 16px; }
  .ip-meta { max-width: 155px; }
}

@media (max-width: 900px) {
  .board.library-mode, .board.category-mode {
    display: block;
    overflow: visible;
    padding: 0 16px 30px;
    scroll-snap-type: none;
  }
  .board.category-mode { padding-bottom: 110px; }
  .cat-grid { gap: 10px; }
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
  .drag-hud { padding: 12px 16px 14px; }
}

@media (max-width: 760px) {
  .cat-grid { grid-template-columns: 1fr; }
  .cat-tile { min-height: 150px; padding: 16px; }
  .cat-count { margin-top: 12px; font-size: 40px; }
  .cat-desc { margin-top: 6px; }
  .cat-note { padding-top: 10px; }
}

@media (max-width: 560px) {
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .vbody h3 { font-size: 11.5px; min-height: 31px; }
  .vmeta { font-size: 10px; gap: 3px; }
  .vpub { font-size: 10px; }
  .batch-bar {
    left: 10px;
    right: 10px;
    bottom: 10px;
    transform: none;
    flex-wrap: wrap;
    gap: 8px;
    padding: 9px 10px;
    justify-content: space-between;
  }
  .batch-hint { display: none; }
  .batch-actions { width: 100%; justify-content: flex-end; }
  .batch-bar .btn { height: 30px; font-size: 11.5px; }
  .hud-lib { flex-basis: 165px; }
  .lib-actions .btn { padding: 0 10px; font-size: 11.5px; }
}

@media (hover: none) {
  .v-actions { opacity: 1; transform: none; }
}

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

/* ---------------- 本地助手（主设置内） ---------------- */

.local-helper {
  margin-bottom: 16px;
  padding: 13px 13px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #faf8f3;
}
.lh-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.lh-head h3 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.01em; }
.lh-head p { margin: 2px 0 0; font-size: 10.5px; color: var(--muted); }
.lh-status {
  margin-left: auto;
  flex: none;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
  background: #f0ede6;
  color: var(--muted);
}
.lh-status.ok { background: var(--published-soft); color: var(--published); }
.lh-status.off { background: #fcefec; color: var(--danger); }
.lh-conn { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.lh-field { display: flex; align-items: center; gap: 5px; flex: 1; min-width: 170px; }
.lh-field span { flex: none; font-size: 10px; color: var(--muted); }
.lh-field input {
  flex: 1;
  min-width: 0;
  height: 28px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 10.5px;
  outline: 0;
}
.lh-field input:focus { border-color: #c9bda6; box-shadow: 0 0 0 2px rgba(201, 189, 166, 0.16); }
.lh-watches { display: flex; flex-direction: column; gap: 6px; }
.lh-watch {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.lh-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--raw); }
.lh-dot.ready { background: var(--ready); }
.lh-dot.published { background: var(--published); }
.lh-watch-main { flex: 1; min-width: 0; }
.lh-watch-main b {
  display: block;
  font-size: 10.5px;
  font-weight: 550;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lh-watch-main small { display: block; margin-top: 2px; font-size: 10px; color: var(--muted); }
.lh-empty { padding: 9px 2px; font-size: 10.5px; color: var(--muted); }
.lh-add { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.lh-picked {
  flex: 1;
  min-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10.5px;
  color: var(--muted);
}
.lh-add select {
  height: 30px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 11px;
}
.lh-sync {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 9px;
  font-size: 10.5px;
  color: var(--muted);
}
.lh-sync button { margin-left: auto; }
.lh-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}
.lh-foot .hint { font-size: 10px; }

@media (max-width: 560px) {
  .lh-sync button { margin-left: 0; }
  .lh-add .lh-picked { flex-basis: 100%; }
}
.modal-foot {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding-top: 12px;
  background: #fdfbf7;
  border-top: 1px solid var(--line);
}

/* ---------------- 只统计记录（不存视频） ---------------- */

.remote-preview {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 100% at 30% 0%, #343a42 0%, #212529 60%, #191c20 100%);
  overflow: hidden;
}
.remote-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.remote-preview .ph { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #8b939c; }
.remote-preview .ph svg { width: 30px; height: 30px; }
.remote-preview .ph .ext { font-size: 12px; font-weight: 650; letter-spacing: 0.08em; }
.remote-note {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 5px;
  padding: 18px 12px 9px;
  background: linear-gradient(to top, rgba(10, 12, 14, 0.78), transparent);
  color: rgba(255, 255, 255, 0.78);
  font-size: 10px;
  letter-spacing: 0.01em;
}
.remote-note svg { width: 13px; height: 13px; flex: none; }
.player-source {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 8px 16px 0;
  padding: 7px 9px;
  border-radius: 8px;
  background: #f5f1e9;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
  word-break: break-all;
}
.player-source svg { width: 13px; height: 13px; flex: none; margin-top: 1px; }

.source-card {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 11px 12px;
  background: #fcfaf6;
}
.source-card + .source-card { margin-top: 10px; }
.source-head { display: flex; align-items: center; gap: 9px; }
.source-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--faint); }
.source-dot.on { background: var(--published); box-shadow: 0 0 0 3px rgba(44, 122, 88, 0.12); }
.source-head b { display: block; font-size: 12.5px; font-weight: 650; }
.source-host { font-family: ui-monospace, Consolas, monospace; font-size: 10.5px; color: var(--muted); margin-top: 2px; word-break: break-all; }
.source-state { margin-left: auto; flex: none; font-size: 10px; color: var(--muted); }
.source-state.on { color: var(--published); }
.source-count { flex: none; font-size: 10px; padding: 2px 7px; border-radius: 999px; background: #f0ede6; color: var(--muted); }
.source-last { margin-top: 6px; font-size: 10px; color: var(--faint); }
.source-list { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.source-row { padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.source-row-main { display: flex; align-items: baseline; gap: 7px; }
.source-row-main b { font-size: 11px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-row-main small { flex: none; font-size: 10px; color: var(--muted); }
.source-row .lib-path { margin-top: 4px; font-size: 10px; }
.source-empty { padding: 10px 2px; font-size: 10.5px; color: var(--muted); }

/* ==========================================================================
   皮肤库
   ========================================================================== */

.skin-picker {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface-2);
  margin-bottom: 4px;
}
.skin-picker-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.skin-picker-head h3 { font-size: 13px; font-weight: 700; }
.skin-picker-head p { margin-top: 2px; font-size: 10.5px; color: var(--muted); }
.skin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.skin-card {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.skin-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.skin-card.active { border-color: var(--ink); box-shadow: 0 0 0 2px rgba(31, 35, 40, 0.08); }
.skin-preview { width: 42px; height: 42px; flex: none; border-radius: 7px; border: 1px solid rgba(0,0,0,.12); }
.skin-preview.paper { background: linear-gradient(135deg, #f4f1eb 0 56%, #c2703e 56% 100%); }
.skin-preview.pixel { background: conic-gradient(#2b2340 0 25%, #f2c14e 0 50%, #e8752d 0 75%, #f7e8c8 0 100%); }
.skin-preview.scifi { background: #05090d; box-shadow: inset 0 0 0 1px #58b6d8, inset 0 0 16px rgba(88,182,216,.22); }
.skin-preview.film { background: radial-gradient(circle at 30% 30%, #e0a35a 0 12%, transparent 13%), repeating-linear-gradient(90deg, #241b14 0 8px, #3a2b1e 8px 16px); }
.skin-card-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.skin-card-text b { font-size: 11.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.skin-card-text small { font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ==========================================================================
   皮肤 1：像素游戏
   ========================================================================== */

html[data-skin="pixel"] {
  --bg: #f7e8c8;
  --surface: #fff8e6;
  --surface-2: #f9edcf;
  --line: #2b2340;
  --line-strong: #2b2340;
  --ink: #241c3a;
  --ink-2: #3c3050;
  --muted: #6b5a49;
  --faint: #9a876d;
  --raw: #2f6db3;
  --raw-soft: #d9ecff;
  --raw-line: #2f6db3;
  --ready: #d95f1e;
  --ready-strong: #b94a10;
  --ready-soft: #ffe3c4;
  --ready-line: #d95f1e;
  --published: #1f8a5b;
  --published-soft: #d8f5e6;
  --published-line: #1f8a5b;
  --danger: #c93636;
  --danger-soft: #ffe0dc;
  --side-bg: #2b2340;
  --side-panel: #3a2f57;
  --side-line: #120e1f;
  --side-ink: #fff8e6;
  --side-muted: #b9add1;
  --radius: 0px;
  --shadow-sm: 2px 2px 0 #2b2340;
  --shadow: 4px 4px 0 #2b2340;
  --shadow-lift: 6px 6px 0 #2b2340;
  --font: "Microsoft YaHei", "SimHei", "Consolas", monospace;
}
html[data-skin="pixel"] body {
  background-color: #f7e8c8;
  background-image: radial-gradient(#dcc79f 1.2px, transparent 1.2px);
  background-size: 18px 18px;
  font-weight: 500;
}
html[data-skin="pixel"] .sidebar {
  background-color: #2b2340;
  background-image:
    linear-gradient(45deg, rgba(255,255,255,.045) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.045) 75%),
    linear-gradient(45deg, rgba(255,255,255,.045) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.045) 75%);
  background-size: 18px 18px;
  background-position: 0 0, 9px 9px;
  border-right: 3px solid #120e1f;
}
html[data-skin="pixel"] .brand-mark { border-radius: 0; border: 2px solid #120e1f; background: #f2c14e; box-shadow: 3px 3px 0 #120e1f; }
html[data-skin="pixel"] .brand-text h1 { font-weight: 800; letter-spacing: .04em; }
html[data-skin="pixel"] .ip-item { border-radius: 0; border: 2px solid transparent; }
html[data-skin="pixel"] .ip-item.active { background: #f7e8c8; color: #241c3a; border-color: #120e1f; box-shadow: 3px 3px 0 #120e1f; }
html[data-skin="pixel"] .ip-item.active .ip-name { color: #241c3a; }
html[data-skin="pixel"] .ip-item.active .ip-meta { color: #6b5a49; }
html[data-skin="pixel"] .ip-avatar { border-radius: 0; border: 2px solid #120e1f; box-shadow: 2px 2px 0 #120e1f; }
html[data-skin="pixel"] .ip-badge { border-radius: 0; border: 2px solid #120e1f; background: #f2c14e; color: #241c3a; }
html[data-skin="pixel"] .ip-new { border: 2px dashed #b9add1; border-radius: 0; color: #fff8e6; }
html[data-skin="pixel"] .ip-new:hover { background: #3a2f57; border-color: #f2c14e; color: #f2c14e; }
html[data-skin="pixel"] .side-foot { border-top: 2px solid #120e1f; }
html[data-skin="pixel"] .me-select { border-radius: 0; border: 2px solid #120e1f; background: #3a2f57; }
html[data-skin="pixel"] .side-icon { border-radius: 0; border: 2px solid #120e1f; background: #3a2f57; box-shadow: 2px 2px 0 #120e1f; }
html[data-skin="pixel"] .main { background: transparent; }
html[data-skin="pixel"] .lib-head { border-bottom: 3px solid #2b2340; }
html[data-skin="pixel"] .lib-name-row h1 { font-size: 32px; font-weight: 800; letter-spacing: 0; }
html[data-skin="pixel"] .lib-name-row h1::after { content: "▮"; color: #d95f1e; margin-left: 4px; font-size: 20px; }
html[data-skin="pixel"] .cat-grid { gap: 16px; }
html[data-skin="pixel"] .cat-tile {
  border-radius: 0;
  border: 3px solid #2b2340;
  box-shadow: 6px 6px 0 #2b2340;
  background: var(--tsoft);
}
html[data-skin="pixel"] .cat-tile:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 #2b2340; }
html[data-skin="pixel"] .cat-count { font-size: 62px; font-weight: 800; font-family: Consolas, monospace; }
html[data-skin="pixel"] .cat-label { font-weight: 800; letter-spacing: .04em; }
html[data-skin="pixel"] .video-grid { gap: 16px; }
html[data-skin="pixel"] .video-card {
  border-radius: 0;
  border: 3px solid #2b2340;
  box-shadow: 5px 5px 0 #2b2340;
  background: #fff8e6;
}
html[data-skin="pixel"] .video-card:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 #2b2340; border-color: #2b2340; }
html[data-skin="pixel"] .vthumb { border-bottom: 3px solid #2b2340; }
html[data-skin="pixel"] .vbody { background: #fff8e6; }
html[data-skin="pixel"] .vtitle { font-weight: 700; }
html[data-skin="pixel"] .chip, html[data-skin="pixel"] .status-pill, html[data-skin="pixel"] .c-drive-hint {
  border-radius: 0;
  border: 2px solid currentColor;
  box-shadow: 2px 2px 0 #2b2340;
}
html[data-skin="pixel"] .c-drive-hint { border-color: #b94a10; }
html[data-skin="pixel"] .btn, html[data-skin="pixel"] .icon-btn, html[data-skin="pixel"] .mini-btn, html[data-skin="pixel"] .chip-opt, html[data-skin="pixel"] .member-chip, html[data-skin="pixel"] .lib-choice {
  border-radius: 0 !important;
  border: 2px solid #2b2340;
  box-shadow: 2px 2px 0 #2b2340;
}
html[data-skin="pixel"] .btn:hover, html[data-skin="pixel"] .icon-btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 #2b2340; }
html[data-skin="pixel"] .btn.primary { background: #2b2340; color: #fff8e6; border-color: #120e1f; }
html[data-skin="pixel"] .mini-btn { border-width: 2px; }
html[data-skin="pixel"] .field input, html[data-skin="pixel"] .field select, html[data-skin="pixel"] .field textarea, html[data-skin="pixel"] .modal input, html[data-skin="pixel"] .modal select, html[data-skin="pixel"] .modal textarea {
  border-radius: 0;
  border: 2px solid #2b2340;
  background: #fffdf5;
}
html[data-skin="pixel"] .modal { border-radius: 0; border: 3px solid #2b2340; box-shadow: 9px 9px 0 #120e1f; background: #fff8e6; }
html[data-skin="pixel"] .modal-head { border-bottom: 3px solid #2b2340; }
html[data-skin="pixel"] .modal-foot { border-top: 3px solid #2b2340; background: #fff8e6; }
html[data-skin="pixel"] .drawer { border-left: 3px solid #2b2340; background: #fff8e6; }
html[data-skin="pixel"] .player { border: 3px solid #2b2340; border-radius: 0; }
html[data-skin="pixel"] .status-switch { border: 2px solid #2b2340; border-radius: 0; }
html[data-skin="pixel"] .status-switch button { border-radius: 0; }
html[data-skin="pixel"] .status-switch button.active { background: #2b2340; color: #fff8e6; }
html[data-skin="pixel"] .file-info { border: 2px solid #2b2340; border-radius: 0; }
html[data-skin="pixel"] .batch-bar, html[data-skin="pixel"] .drag-hud { border-radius: 0; border: 3px solid #2b2340; box-shadow: 6px 6px 0 #120e1f; }
html[data-skin="pixel"] .toast { border-radius: 0; border: 2px solid #120e1f; box-shadow: 4px 4px 0 #120e1f; }
html[data-skin="pixel"] .skin-picker { border-radius: 0; border: 3px solid #2b2340; }
html[data-skin="pixel"] .skin-card { border-radius: 0; border: 2px solid #2b2340; box-shadow: 2px 2px 0 #2b2340; }
html[data-skin="pixel"] .source-card, html[data-skin="pixel"] .source-row { border-radius: 0; border: 2px solid #2b2340; }
html[data-skin="pixel"] .empty, html[data-skin="pixel"] .zero { font-weight: 600; }
html[data-skin="pixel"] ::selection { background: #f2c14e; color: #241c3a; }

/* ==========================================================================
   皮肤 2：深空科技（流浪地球式 HUD）
   ========================================================================== */

html[data-skin="scifi"] {
  --bg: #05090d;
  --surface: #0a1218;
  --surface-2: #081017;
  --line: rgba(95, 215, 255, 0.2);
  --line-strong: rgba(95, 215, 255, 0.48);
  --ink: #d9edf7;
  --ink-2: #a9c3d0;
  --muted: #6f8b99;
  --faint: #4d6673;
  --raw: #58b6d8;
  --raw-soft: rgba(88, 182, 216, 0.1);
  --raw-line: rgba(88, 182, 216, 0.4);
  --ready: #ffb347;
  --ready-strong: #ffc56b;
  --ready-soft: rgba(255, 179, 71, 0.1);
  --ready-line: rgba(255, 179, 71, 0.38);
  --published: #49d6a4;
  --published-soft: rgba(73, 214, 164, 0.1);
  --published-line: rgba(73, 214, 164, 0.38);
  --danger: #ff6b5e;
  --danger-soft: rgba(255, 107, 94, 0.1);
  --side-bg: #060b10;
  --side-panel: #0b151c;
  --side-line: rgba(95, 215, 255, 0.12);
  --side-ink: #d9edf7;
  --side-muted: #64808d;
  --radius: 2px;
  --shadow-sm: 0 0 14px -8px rgba(95, 215, 255, 0.5);
  --shadow: 0 0 24px -14px rgba(95, 215, 255, 0.5);
  --shadow-lift: 0 0 34px -14px rgba(95, 215, 255, 0.6);
  --font: "Bahnschrift", "Segoe UI", "Microsoft YaHei", sans-serif;
}
html[data-skin="scifi"] body {
  background-color: #05090d;
  background-image:
    linear-gradient(rgba(95, 215, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(95, 215, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
}
html[data-skin="scifi"] body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,0.026) 0 1px, transparent 1px 4px);
  opacity: .55;
}
html[data-skin="scifi"] .sidebar {
  background: linear-gradient(180deg, #081018 0%, #050a0e 100%);
  border-right: 1px solid rgba(95, 215, 255, 0.22);
  box-shadow: inset -1px 0 0 rgba(95, 215, 255, 0.08);
}
html[data-skin="scifi"] .brand-mark {
  border-radius: 2px;
  background: rgba(95, 215, 255, 0.08);
  border: 1px solid rgba(95, 215, 255, 0.55);
  color: #8ee7ff;
  box-shadow: 0 0 18px -6px rgba(95, 215, 255, 0.7);
}
html[data-skin="scifi"] .brand-text h1 { color: #e6f7ff; letter-spacing: .12em; font-weight: 600; }
html[data-skin="scifi"] .brand-text p { color: #5f7d8b; letter-spacing: .16em; }
html[data-skin="scifi"] .side-summary { color: #5f7d8b; letter-spacing: .06em; }
html[data-skin="scifi"] .side-summary b { color: #9dd9ec; }
html[data-skin="scifi"] .ip-item { border-radius: 2px; border-left: 2px solid transparent; }
html[data-skin="scifi"] .ip-item:hover { background: rgba(95, 215, 255, 0.06); }
html[data-skin="scifi"] .ip-item.active { background: rgba(95, 215, 255, 0.1); border-left-color: #5fd7ff; box-shadow: inset 0 0 22px -18px #5fd7ff; }
html[data-skin="scifi"] .ip-avatar { border-radius: 2px; box-shadow: none; border: 1px solid rgba(255,255,255,.18); }
html[data-skin="scifi"] .ip-name { color: #d9edf7; letter-spacing: .03em; }
html[data-skin="scifi"] .ip-meta { color: #678391; font-family: Consolas, monospace; }
html[data-skin="scifi"] .ip-badge { border-radius: 2px; background: rgba(255, 179, 71, 0.14); color: #ffc56b; border: 1px solid rgba(255, 179, 71, 0.4); font-family: Consolas, monospace; }
html[data-skin="scifi"] .ip-new { border: 1px solid rgba(95, 215, 255, 0.25); border-radius: 2px; color: #6f8b99; letter-spacing: .08em; }
html[data-skin="scifi"] .ip-new:hover { background: rgba(95, 215, 255, 0.07); border-color: #5fd7ff; color: #bfefff; }
html[data-skin="scifi"] .side-foot { border-top: 1px solid rgba(95, 215, 255, 0.12); }
html[data-skin="scifi"] .me-select { border-radius: 2px; border: 1px solid rgba(95, 215, 255, 0.2); background: #081017; color: #9dd9ec; }
html[data-skin="scifi"] .side-icon { border-radius: 2px; background: #081017; border: 1px solid rgba(95, 215, 255, 0.22); color: #8ee7ff; }
html[data-skin="scifi"] .side-icon:hover { background: rgba(95, 215, 255, 0.1); border-color: #5fd7ff; }
html[data-skin="scifi"] .main { background: transparent; }
html[data-skin="scifi"] .lib-head { border-bottom: 1px solid rgba(95, 215, 255, 0.18); }
html[data-skin="scifi"] .lib-name-row h1 { color: #e6f7ff; font-weight: 600; letter-spacing: .06em; text-shadow: 0 0 20px rgba(95, 215, 255, 0.18); }
html[data-skin="scifi"] .lib-name-row h1::before { content: "// "; color: #5fd7ff; font-weight: 400; }
html[data-skin="scifi"] .lib-head .hint, html[data-skin="scifi"] .lib-head .meta { color: #5f7d8b; }
html[data-skin="scifi"] .cat-grid { gap: 12px; }
html[data-skin="scifi"] .cat-tile {
  border-radius: 2px;
  border: 1px solid var(--tline);
  background:
    linear-gradient(135deg, rgba(95, 215, 255, 0.06) 0%, transparent 40%),
    #0a1218;
  box-shadow: 0 0 30px -22px rgba(95, 215, 255, 0.6);
}
html[data-skin="scifi"] .cat-tile::before {
  content: "";
  position: absolute;
  left: 8px; top: 8px;
  width: 14px; height: 14px;
  border-left: 1px solid #5fd7ff;
  border-top: 1px solid #5fd7ff;
  opacity: .55;
  pointer-events: none;
}
html[data-skin="scifi"] .cat-tile:hover { border-color: #5fd7ff; box-shadow: 0 0 34px -16px rgba(95, 215, 255, 0.55); }
html[data-skin="scifi"] .cat-count { color: var(--tc); font-family: Consolas, monospace; font-weight: 400; text-shadow: 0 0 22px currentColor; }
html[data-skin="scifi"] .cat-label { letter-spacing: .12em; color: #b9d7e3; }
html[data-skin="scifi"] .cat-note { color: #5f7d8b; letter-spacing: .04em; }
html[data-skin="scifi"] .video-grid { gap: 12px; }
html[data-skin="scifi"] .video-card {
  border-radius: 2px;
  border: 1px solid rgba(95, 215, 255, 0.2);
  background: #0a1218;
  box-shadow: 0 0 26px -20px rgba(95, 215, 255, 0.5);
}
html[data-skin="scifi"] .video-card::before {
  content: "";
  position: absolute;
  right: 6px; bottom: 6px;
  width: 10px; height: 10px;
  border-right: 1px solid rgba(95, 215, 255, 0.65);
  border-bottom: 1px solid rgba(95, 215, 255, 0.65);
  z-index: 3;
  pointer-events: none;
}
html[data-skin="scifi"] .video-card:hover { border-color: #5fd7ff; box-shadow: 0 0 32px -14px rgba(95, 215, 255, 0.5); transform: translateY(-2px); }
html[data-skin="scifi"] .vthumb { border-bottom: 1px solid rgba(95, 215, 255, 0.12); background: #03070a; }
html[data-skin="scifi"] .vbody { background: #0a1218; }
html[data-skin="scifi"] .vtitle { color: #d9edf7; letter-spacing: .02em; }
html[data-skin="scifi"] .vmeta, html[data-skin="scifi"] .vpub { color: #6f8b99; font-family: Consolas, monospace; font-size: 10px; }
html[data-skin="scifi"] .chip, html[data-skin="scifi"] .status-pill, html[data-skin="scifi"] .c-drive-hint {
  border-radius: 2px;
  border: 1px solid currentColor;
  background: rgba(5, 9, 13, 0.72);
  font-family: Consolas, monospace;
  letter-spacing: .03em;
}
html[data-skin="scifi"] .c-drive-hint { color: #ffc56b; }
html[data-skin="scifi"] .btn, html[data-skin="scifi"] .icon-btn, html[data-skin="scifi"] .mini-btn, html[data-skin="scifi"] .chip-opt, html[data-skin="scifi"] .member-chip, html[data-skin="scifi"] .lib-choice {
  border-radius: 2px;
  border: 1px solid rgba(95, 215, 255, 0.3);
  background: rgba(8, 17, 23, 0.9);
  color: #b9d7e3;
  box-shadow: none;
}
html[data-skin="scifi"] .btn:hover, html[data-skin="scifi"] .icon-btn:hover { border-color: #5fd7ff; color: #e6f7ff; box-shadow: 0 0 20px -10px rgba(95, 215, 255, 0.8); }
html[data-skin="scifi"] .btn.primary { background: rgba(95, 215, 255, 0.14); border-color: #5fd7ff; color: #c9f2ff; }
html[data-skin="scifi"] .btn.primary:hover { background: rgba(95, 215, 255, 0.22); }
html[data-skin="scifi"] .mini-btn.publish { background: rgba(73, 214, 164, 0.16); border-color: rgba(73, 214, 164, 0.55); }
html[data-skin="scifi"] .field input, html[data-skin="scifi"] .field select, html[data-skin="scifi"] .field textarea,
html[data-skin="scifi"] .modal input, html[data-skin="scifi"] .modal select, html[data-skin="scifi"] .modal textarea {
  border-radius: 2px;
  border: 1px solid rgba(95, 215, 255, 0.22);
  background: #060d12;
  color: #d9edf7;
}
html[data-skin="scifi"] .field label { color: #6f8b99; letter-spacing: .1em; }
html[data-skin="scifi"] .modal { border-radius: 2px; border: 1px solid rgba(95, 215, 255, 0.35); background: #081017; box-shadow: 0 0 60px -20px rgba(95, 215, 255, 0.4); }
html[data-skin="scifi"] .modal-head { border-bottom: 1px solid rgba(95, 215, 255, 0.14); }
html[data-skin="scifi"] .modal-head h2 { color: #e6f7ff; letter-spacing: .08em; }
html[data-skin="scifi"] .modal-head p { color: #5f7d8b; }
html[data-skin="scifi"] .modal-foot { background: #081017; border-top: 1px solid rgba(95, 215, 255, 0.14); }
html[data-skin="scifi"] .drawer { background: #081017; border-left: 1px solid rgba(95, 215, 255, 0.25); }
html[data-skin="scifi"] .drawer-head { border-bottom: 1px solid rgba(95, 215, 255, 0.12); }
html[data-skin="scifi"] .player { border: 1px solid rgba(95, 215, 255, 0.25); border-radius: 2px; }
html[data-skin="scifi"] .status-switch { border: 1px solid rgba(95, 215, 255, 0.2); border-radius: 2px; background: #060d12; }
html[data-skin="scifi"] .status-switch button { border-radius: 2px; color: #6f8b99; }
html[data-skin="scifi"] .status-switch button.active { background: rgba(95, 215, 255, 0.14); color: #c9f2ff; box-shadow: inset 0 0 0 1px rgba(95, 215, 255, 0.45); }
html[data-skin="scifi"] .file-info { border: 1px solid rgba(95, 215, 255, 0.14); border-radius: 2px; background: #060d12; }
html[data-skin="scifi"] .file-info dt { color: #5f7d8b; letter-spacing: .06em; }
html[data-skin="scifi"] .file-info dd { color: #b9d7e3; font-family: Consolas, monospace; }
html[data-skin="scifi"] .batch-bar, html[data-skin="scifi"] .drag-hud { border-radius: 2px; border: 1px solid rgba(95, 215, 255, 0.35); background: #060d12; box-shadow: 0 0 50px -20px rgba(95, 215, 255, 0.45); }
html[data-skin="scifi"] .toast { border-radius: 2px; border: 1px solid rgba(95, 215, 255, 0.35); background: #0a1218; color: #d9edf7; }
html[data-skin="scifi"] .skin-picker { border-radius: 2px; border: 1px solid rgba(95, 215, 255, 0.2); background: #060d12; }
html[data-skin="scifi"] .skin-card { border-radius: 2px; border: 1px solid rgba(95, 215, 255, 0.2); background: #081017; }
html[data-skin="scifi"] .skin-card.active { border-color: #5fd7ff; box-shadow: 0 0 0 1px rgba(95, 215, 255, 0.35); }
html[data-skin="scifi"] .source-card, html[data-skin="scifi"] .source-row { border-radius: 2px; border: 1px solid rgba(95, 215, 255, 0.18); background: #060d12; }
html[data-skin="scifi"] .source-host, html[data-skin="scifi"] .source-last, html[data-skin="scifi"] .source-count { font-family: Consolas, monospace; }
html[data-skin="scifi"] .setup-note { background: rgba(95, 215, 255, 0.06); border: 1px solid rgba(95, 215, 255, 0.18); color: #8fb2c0; }
html[data-skin="scifi"] ::selection { background: rgba(95, 215, 255, 0.35); color: #e6f7ff; }

/* ==========================================================================
   皮肤 3：胶片暗房
   ========================================================================== */

html[data-skin="film"] {
  --bg: #171310;
  --surface: #211a15;
  --surface-2: #1c1612;
  --line: #4a3b2d;
  --line-strong: #7a5f45;
  --ink: #f2e6d0;
  --ink-2: #d8c7ad;
  --muted: #a58c70;
  --faint: #7a6754;
  --raw: #9db4c0;
  --raw-soft: #2a3033;
  --raw-line: #4a5a60;
  --ready: #e0a35a;
  --ready-strong: #f0b76f;
  --ready-soft: #3a2b1c;
  --ready-line: #7a5a35;
  --published: #7fb08a;
  --published-soft: #233128;
  --published-line: #3f5a48;
  --danger: #e06b5a;
  --danger-soft: #3a211d;
  --side-bg: #120e0b;
  --side-panel: #241b14;
  --side-line: rgba(224, 163, 90, 0.16);
  --side-ink: #f2e6d0;
  --side-muted: #a58c70;
  --radius: 5px;
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow: 0 20px 40px -30px #000;
  --shadow-lift: 0 24px 46px -28px #000;
  --font: "PingFang SC", "Microsoft YaHei", "Noto Serif SC", sans-serif;
}
html[data-skin="film"] body {
  background-color: #171310;
  background-image: radial-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 3px 3px;
}
html[data-skin="film"] .sidebar {
  background: linear-gradient(180deg, #17110d 0%, #100c09 100%);
  border-right: 1px solid #3a2b1e;
}
html[data-skin="film"] .sidebar::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0;
  bottom: 0;
  width: 7px;
  background-image: radial-gradient(circle, rgba(224, 163, 90, 0.55) 2px, transparent 2.6px);
  background-size: 7px 18px;
  opacity: .35;
  pointer-events: none;
}
html[data-skin="film"] .brand-mark { border-radius: 4px; background: #e0a35a; color: #171310; box-shadow: 0 0 0 1px #3a2b1e; }
html[data-skin="film"] .brand-text h1 { font-family: "Songti SC", "Noto Serif SC", Georgia, serif; font-weight: 600; color: #f4e9d4; letter-spacing: .04em; }
html[data-skin="film"] .brand-text p { color: #a58c70; letter-spacing: .12em; }
html[data-skin="film"] .side-summary { color: #a58c70; }
html[data-skin="film"] .side-summary b { color: #e0a35a; }
html[data-skin="film"] .ip-item { border-radius: 4px; }
html[data-skin="film"] .ip-item:hover { background: rgba(224, 163, 90, 0.07); }
html[data-skin="film"] .ip-item.active { background: #2a2018; box-shadow: inset 2px 0 0 #e0a35a; }
html[data-skin="film"] .ip-avatar { border-radius: 4px; box-shadow: none; }
html[data-skin="film"] .ip-name { color: #f2e6d0; }
html[data-skin="film"] .ip-meta { color: #a58c70; }
html[data-skin="film"] .ip-badge { border-radius: 3px; background: #e0a35a; color: #171310; }
html[data-skin="film"] .ip-new { border: 1px dashed #5a4430; border-radius: 4px; color: #c7b090; }
html[data-skin="film"] .ip-new:hover { background: rgba(224, 163, 90, 0.08); border-color: #e0a35a; color: #f0b76f; }
html[data-skin="film"] .side-foot { border-top: 1px solid #3a2b1e; }
html[data-skin="film"] .me-select { border-radius: 4px; border: 1px solid #3a2b1e; background: #241b14; color: #d8c7ad; }
html[data-skin="film"] .side-icon { border-radius: 4px; background: #241b14; border: 1px solid #3a2b1e; color: #d8c7ad; }
html[data-skin="film"] .side-icon:hover { border-color: #e0a35a; color: #f0b76f; }
html[data-skin="film"] .main { background: transparent; }
html[data-skin="film"] .lib-head { border-bottom: 1px solid #3a2b1e; }
html[data-skin="film"] .lib-name-row h1 { font-family: "Songti SC", "Noto Serif SC", Georgia, serif; font-weight: 600; color: #f4e9d4; letter-spacing: .02em; }
html[data-skin="film"] .cat-grid { gap: 14px; }
html[data-skin="film"] .cat-tile { border-radius: 5px; border: 1px solid #4a3b2d; background: linear-gradient(160deg, #2a2018, #211a15); box-shadow: var(--shadow); }
html[data-skin="film"] .cat-tile::after { opacity: .55; }
html[data-skin="film"] .cat-tile:hover { border-color: #7a5f45; }
html[data-skin="film"] .cat-count { color: #e0a35a; font-family: "Songti SC", Georgia, serif; font-weight: 600; }
html[data-skin="film"] .cat-label { color: #f2e6d0; }
html[data-skin="film"] .cat-note { color: #a58c70; }
html[data-skin="film"] .video-grid { gap: 14px; }
html[data-skin="film"] .video-card { border-radius: 4px; border: 1px solid #4a3b2d; background: #211a15; box-shadow: var(--shadow); }
html[data-skin="film"] .video-card:hover { border-color: #7a5f45; box-shadow: var(--shadow-lift); }
html[data-skin="film"] .vthumb { border-bottom: 1px solid #3a2b1e; }
html[data-skin="film"] .vthumb img { filter: sepia(.16) contrast(1.04); }
html[data-skin="film"] .vbody { background: #211a15; }
html[data-skin="film"] .vtitle { color: #f2e6d0; }
html[data-skin="film"] .vmeta, html[data-skin="film"] .vpub { color: #a58c70; }
html[data-skin="film"] .chip, html[data-skin="film"] .status-pill, html[data-skin="film"] .c-drive-hint { border-radius: 3px; border: 1px solid currentColor; background: rgba(23,19,16,.75); }
html[data-skin="film"] .c-drive-hint { color: #e0a35a; }
html[data-skin="film"] .btn, html[data-skin="film"] .icon-btn, html[data-skin="film"] .mini-btn, html[data-skin="film"] .chip-opt, html[data-skin="film"] .member-chip, html[data-skin="film"] .lib-choice { border-radius: 4px; border: 1px solid #4a3b2d; background: #241b14; color: #d8c7ad; }
html[data-skin="film"] .btn:hover, html[data-skin="film"] .icon-btn:hover { border-color: #e0a35a; color: #f0b76f; background: #2a2018; }
html[data-skin="film"] .btn.primary { background: #e0a35a; border-color: #e0a35a; color: #171310; font-weight: 600; }
html[data-skin="film"] .btn.primary:hover { background: #f0b76f; }
html[data-skin="film"] .field input, html[data-skin="film"] .field select, html[data-skin="film"] .field textarea,
html[data-skin="film"] .modal input, html[data-skin="film"] .modal select, html[data-skin="film"] .modal textarea { border-radius: 4px; border: 1px solid #4a3b2d; background: #1c1612; color: #f2e6d0; }
html[data-skin="film"] .field label { color: #a58c70; }
html[data-skin="film"] .modal { border-radius: 6px; border: 1px solid #4a3b2d; background: #1c1612; box-shadow: 0 40px 80px -30px #000; }
html[data-skin="film"] .modal-head { border-bottom: 1px solid #3a2b1e; }
html[data-skin="film"] .modal-head h2 { font-family: "Songti SC", "Noto Serif SC", Georgia, serif; color: #f4e9d4; }
html[data-skin="film"] .modal-foot { background: #1c1612; border-top: 1px solid #3a2b1e; }
html[data-skin="film"] .drawer { background: #1c1612; border-left: 1px solid #3a2b1e; }
html[data-skin="film"] .drawer-head { border-bottom: 1px solid #3a2b1e; }
html[data-skin="film"] .player { border: 1px solid #4a3b2d; border-radius: 4px; }
html[data-skin="film"] .status-switch { border: 1px solid #4a3b2d; border-radius: 4px; background: #171310; }
html[data-skin="film"] .status-switch button { border-radius: 3px; color: #a58c70; }
html[data-skin="film"] .status-switch button.active { background: #e0a35a; color: #171310; }
html[data-skin="film"] .file-info { border: 1px solid #4a3b2d; border-radius: 4px; background: #171310; }
html[data-skin="film"] .file-info dt { color: #a58c70; }
html[data-skin="film"] .file-info dd { color: #d8c7ad; }
html[data-skin="film"] .batch-bar, html[data-skin="film"] .drag-hud { border-radius: 5px; border: 1px solid #4a3b2d; background: #1c1612; box-shadow: 0 30px 60px -30px #000; }
html[data-skin="film"] .toast { border-radius: 4px; border: 1px solid #4a3b2d; background: #241b14; color: #f2e6d0; }
html[data-skin="film"] .skin-picker { border-radius: 5px; border: 1px solid #4a3b2d; background: #1c1612; }
html[data-skin="film"] .skin-card { border-radius: 4px; border: 1px solid #4a3b2d; background: #241b14; }
html[data-skin="film"] .skin-card.active { border-color: #e0a35a; }
html[data-skin="film"] .source-card, html[data-skin="film"] .source-row { border-radius: 4px; border: 1px solid #4a3b2d; background: #1c1612; }
html[data-skin="film"] .setup-note { background: #1c1612; border: 1px solid #3a2b1e; color: #a58c70; }
html[data-skin="film"] ::selection { background: #e0a35a; color: #171310; }

/* 对比度修正 */
html[data-skin="pixel"] .side-icon { color: #fff8e6; }
html[data-skin="scifi"] .side-icon { color: #8ee7ff; }
html[data-skin="film"] .side-icon { color: #e0a35a; }
html[data-skin="film"] .cat-head { color: #f2e6d0; }
html[data-skin="film"] .cat-desc { color: #d8c7ad; }
html[data-skin="film"] .vbody h3 { color: #f7ecd8; }
html[data-skin="film"] .vmeta, html[data-skin="film"] .vmeta .who { color: #c9b69c; }
html[data-skin="film"] .cat-note { color: #e0a35a; }

html[data-skin="film"] .cat-head { font-size: 13.5px; font-weight: 800; letter-spacing: .02em; }
html[data-skin="film"] .cat-desc { font-size: 12.5px; }
html[data-skin="film"] .vbody h3 { font-size: 13px; font-weight: 700; }

/* 来源电脑备注编辑 */
.source-identity { min-width: 0; overflow-wrap: anywhere; }
.source-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.source-editor input { min-width: 0; }
.source-editor .btn { white-space: nowrap; }

/* ==========================================================================
   云端控制台：登录门禁、监控大盘、应用下发、非视频筛选
   ========================================================================== */

.side-pill {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(95, 191, 143, 0.16);
  color: #5fbf8f;
}
.side-pill:empty { display: none; }
.side-user-bar {
  margin-top: 6px;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--side-muted, #9aa0a6);
  font-size: 10.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.side-user-bar b { color: var(--side-ink, #f2ede2); font-weight: 600; }

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--bg);
}
.auth-card {
  width: min(390px, 100%);
  padding: 26px 24px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.auth-brand h1 { font-size: 17px; font-weight: 750; }
.auth-brand p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.auth-error {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--danger-soft, #fcefec);
  color: var(--danger);
  font-size: 11.5px;
}
.auth-submit { height: 38px; width: 100%; margin-top: 2px; }

.kind-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.kind-tab {
  height: 26px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.kind-tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.monitor-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.monitor-kpi {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.monitor-kpi small { display: block; font-size: 10.5px; color: var(--muted); }
.monitor-kpi b { display: block; margin-top: 3px; font-size: 16px; font-weight: 750; }
.monitor-kpi span { display: block; margin-top: 2px; font-size: 10px; color: var(--muted); }

.source-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.s-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 6px;
  font-size: 10.5px; font-weight: 600;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.s-badge.ok { background: var(--published-soft); color: var(--published); border-color: transparent; }
.s-badge.warn { background: var(--ready-soft); color: var(--ready); border-color: transparent; }
.s-badge.err { background: var(--danger-soft, #fcefec); color: var(--danger); border-color: transparent; }

.watch-health-list { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.watch-health-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 7px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 11px;
}
.watch-health-item .wh-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--published); flex: none; }
.watch-health-item.err .wh-dot { background: var(--danger); }
.watch-health-item .wh-path { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, Consolas, monospace; }
.watch-health-item .wh-msg { font-size: 10px; color: var(--muted); flex: none; }
.watch-health-item.err .wh-msg { color: var(--danger); font-weight: 600; }

.source-ops { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.source-ops .btn { height: 29px; padding: 0 10px; font-size: 11px; }

.log-console {
  max-height: 360px; overflow: auto;
  padding: 12px; border-radius: 9px;
  background: #16191d; color: #c7d0d9;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px; line-height: 1.65;
  white-space: pre-wrap; word-break: break-all;
}

.user-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface);
}
.user-row + .user-row { margin-top: 6px; }
.user-row-info { flex: 1; min-width: 0; }
.user-row-info b { font-size: 12.5px; }
.user-row-info small { display: block; font-size: 10.5px; color: var(--muted); }
.user-role {
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 5px;
  background: var(--raw-soft); color: var(--raw);
}
.user-role.admin { background: var(--ready-soft); color: var(--ready); }

.quality-bar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin: 8px 16px 0;
}
.quality-bar .btn { height: 27px; padding: 0 10px; font-size: 11px; }

.release-box {
  padding: 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface-2);
  display: flex; flex-direction: column; gap: 10px;
}
.release-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 680px) {
  .monitor-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

