/* ============ 动漫剧场 · 后台样式 ============ */
:root {
  --bg: #0b0c11;
  --panel: #14161d;
  --panel-2: #191b25;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f2f4f8;
  --muted: #9299a8;
  --muted-2: #666d7c;
  --brand: #ff5b2e;
  --brand-2: #ff2e88;
  --green: #38d39f;
  --gold: #ffc555;
  --red: #ff5566;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(800px 400px at 8% -6%, rgba(255, 86, 46, 0.12), transparent 62%),
    radial-gradient(700px 400px at 96% 0%, rgba(124, 74, 255, 0.13), transparent 60%);
}

/* ---------- 通用 ---------- */
.btn {
  height: 38px; padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 13px; font-family: inherit; font-weight: 600;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  text-decoration: none;
  transition: 0.18s;
  white-space: nowrap;
}
.btn:hover { border-color: rgba(255, 255, 255, 0.24); background: rgba(255, 255, 255, 0.09); }
.btn.primary {
  border: 0;
  background: linear-gradient(100deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 18px rgba(255, 60, 90, 0.3);
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: #ff9aa4; border-color: rgba(255, 85, 102, 0.35); background: rgba(255, 85, 102, 0.08); }
.btn.danger:hover { background: rgba(255, 85, 102, 0.16); }
.btn.block { width: 100%; height: 44px; }

.input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: 0.18s;
}
.input::placeholder { color: var(--muted-2); }
.input:focus { border-color: rgba(255, 110, 70, 0.6); background: rgba(255, 255, 255, 0.07); }
.input.small { height: 38px; width: 190px; }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.7; }

/* ---------- 登录 ---------- */
.login-mask {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: radial-gradient(800px 500px at 50% 20%, rgba(255, 91, 46, 0.16), transparent 65%), #08090d;
  padding: 20px;
}
.login-mask.hide { display: none; }
.login-card {
  width: 100%; max-width: 360px;
  padding: 34px 26px 24px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(20, 22, 29, 0.9);
  backdrop-filter: blur(14px);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.6);
  text-align: center;
}
.login-logo {
  width: 52px; height: 52px; margin: 0 auto 14px;
  border-radius: 15px;
  display: grid; place-items: center;
  font-size: 26px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 26px rgba(255, 70, 60, 0.4);
}
.login-card h1 { font-size: 19px; margin: 0 0 6px; letter-spacing: 0.5px; }
.login-sub { color: var(--muted); font-size: 12.5px; margin: 0 0 20px; }
.login-card .input { text-align: center; height: 44px; margin-bottom: 12px; letter-spacing: 2px; }
.login-tip { color: var(--muted-2); font-size: 11.5px; margin: 14px 0 0; }

/* ---------- 顶栏 ---------- */
.admin { position: relative; z-index: 1; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 12, 17, 0.85);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 20;
}
.tb-left { display: flex; align-items: center; gap: 11px; }
.tb-logo {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center; font-size: 19px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.tb-title { font-size: 15px; font-weight: 700; line-height: 1.2; }
.tb-sub { font-size: 11px; color: var(--muted-2); }
.tb-right { display: flex; gap: 8px; flex-wrap: wrap; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 22px 20px 60px; }

/* ---------- 统计 ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat {
  padding: 15px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
}
.stat-label { font-size: 11.5px; color: var(--muted); }
.stat-num { font-size: 24px; font-weight: 800; letter-spacing: 0.5px; margin-top: 4px; }
.stat-num small { font-size: 12px; font-weight: 500; color: var(--muted-2); margin-left: 4px; }
.stat-num.green { color: var(--green); }
.stat-num.gold { color: var(--gold); }
.stat-num.brand { color: #ff8664; }

/* ---------- 面板 ---------- */
.panel {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 { font-size: 16px; margin: 0; }
.panel-sub { font-size: 12px; color: var(--muted-2); margin: 2px 0 0; }
.panel-tools { display: flex; gap: 8px; }
@media (max-width: 560px) {
  .panel-tools { width: 100%; }
  .panel-tools .input.small { flex: 1; width: auto; }
}

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 780px; }
.table th {
  text-align: left;
  padding: 11px 14px;
  font-size: 11.5px; font-weight: 600;
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
  font-size: 13px;
}
.table tr:hover td { background: rgba(255, 255, 255, 0.025); }
.td-poster { width: 74px; }
.td-poster img {
  width: 44px; height: 58px; border-radius: 8px;
  object-fit: cover; display: block;
  background: #22242d;
}
.td-title { font-weight: 600; font-size: 13.5px; }
.td-sub { font-size: 11.5px; color: var(--muted-2); }
.td-muted { color: var(--muted); font-size: 12.5px; }
.td-rating { color: var(--gold); font-weight: 700; }

.status-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
}
.status-tag.on { color: #7ef0c0; background: rgba(56, 211, 159, 0.13); }
.status-tag.off { color: #a8afbd; background: rgba(255, 255, 255, 0.07); }
.status-tag::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mini-btn {
  height: 28px; padding: 0 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  color: #ccd1da;
  font-size: 12px; font-family: inherit;
  cursor: pointer;
  transition: 0.16s;
}
.mini-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.mini-btn.del:hover { color: #ff9aa4; border-color: rgba(255, 85, 102, 0.4); background: rgba(255, 85, 102, 0.1); }

.table-empty { padding: 40px; text-align: center; color: var(--muted-2); font-size: 13px; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 80;
  display: none;
  align-items: flex-start; justify-content: center;
  padding: 24px 16px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(4px);
  overflow-y: auto;
}
.modal-mask.on { display: flex; }
.modal {
  width: 100%; max-width: 660px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: #13151c;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65);
  animation: pop 0.24s ease;
}
.modal.narrow { max-width: 460px; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }

.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 15.5px; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent; color: var(--muted);
  cursor: pointer; font-size: 13px;
}
.icon-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

.modal-body { padding: 18px 20px 8px; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px 14px;
}
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; color: var(--muted); }
.field.span2 { grid-column: 1 / -1; }
.switch-row { flex-direction: row; align-items: center; justify-content: space-between; }

.poster-editor { display: flex; gap: 14px; align-items: flex-start; }
.poster-preview {
  flex: 0 0 108px;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background: #1b1d26 center/cover no-repeat;
  display: grid; place-items: center;
  color: var(--muted-2); font-size: 11px;
  overflow: hidden;
}
.poster-tools { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.hint { color: var(--muted-2); font-size: 11px; margin: 0; }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; }
.switch input { display: none; }
.switch i {
  width: 42px; height: 24px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  position: relative; transition: 0.2s;
}
.switch i::after {
  content: ""; position: absolute; left: 3px; top: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: 0.2s;
}
.switch input:checked + i { background: linear-gradient(100deg, var(--brand), var(--brand-2)); }
.switch input:checked + i::after { left: 21px; }
.switch em { font-style: normal; font-size: 12.5px; color: var(--muted); }

.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--line);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 40px; z-index: 300;
  transform: translate(-50%, 16px);
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(30, 33, 42, 0.97);
  border: 1px solid var(--line);
  color: #fff; font-size: 13px;
  opacity: 0; pointer-events: none;
  transition: 0.26s;
  white-space: nowrap;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 影片库扫描 ---------- */
.scan-panel { margin-bottom: 18px; }
.scan-body { padding: 16px 18px 18px; }
.scan-line { display: flex; align-items: center; gap: 12px; }
.scan-bar {
  flex: 1; height: 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.scan-bar i {
  display: block; height: 100%; width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width 0.4s ease;
}
.scan-pct { font-size: 12px; color: var(--muted); min-width: 38px; text-align: right; }
.scan-msg { font-size: 12.5px; color: var(--muted); margin: 9px 0 14px; }
.src-box {
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}
.src-title { font-size: 11.5px; color: var(--muted-2); margin-bottom: 8px; }
.src-box .input { font-size: 12.5px; line-height: 1.8; }
.src-actions { display: flex; align-items: center; gap: 12px; margin-top: 9px; flex-wrap: wrap; }

/* ---------- 置顶标记 ---------- */
.pin-flag {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 10px; font-weight: 700;
  vertical-align: 1px;
  color: #ffd9c9;
  background: linear-gradient(100deg, rgba(255, 91, 46, 0.9), rgba(255, 46, 136, 0.9));
}
.mini-btn.active {
  color: #ffd9c9;
  border-color: rgba(255, 110, 60, 0.45);
  background: rgba(255, 91, 46, 0.14);
}
.no-poster {
  width: 44px; height: 58px; border-radius: 8px;
  background: #22242d; color: #6b7280;
  display: grid; place-items: center; font-size: 11px;
}
.table { min-width: 880px; }

