/* VodLite 后台样式：单文件、无框架、浅色后台风格，桌面与移动共用 */
:root {
  --bg: #f5f7fb;
  --bg-deep: #eef2f9;
  --panel: #ffffff;
  --panel-2: #f7f9fd;
  --panel-3: #eef2f9;
  --line: #e6ebf4;
  --line-2: #d9e1ee;
  --text: #18202f;
  --text-2: #2f3d54;
  --muted: #5b6b85;
  --muted-2: #8b9ab1;
  --accent: #3d5afe;
  --accent-2: #6b7cff;
  --accent-deep: #2f47d6;
  --accent-soft: rgba(61, 90, 254, .09);
  --danger: #dc3b41;
  --gold: #c8860d;
  --blue: #1f74d8;
  --green: #0f9d58;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 28px rgba(16, 24, 40, .07);
  --shadow-lg: 0 18px 48px rgba(16, 24, 40, .12);
  --sidebar-w: 232px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; color: var(--text); }

::selection { background: rgba(61, 90, 254, .18); }

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

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

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafe 100%);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  transition: transform .22s ease;
}

.brand {
  padding: 20px 20px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-deep));
  display: grid; place-items: center;
  font-weight: 700; font-size: 15px; color: #fff;
  box-shadow: 0 6px 16px rgba(61, 90, 254, .28);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text b { font-size: 15px; letter-spacing: .2px; color: var(--text); }
.brand-text span { font-size: 11px; color: var(--muted-2); }

.nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-label {
  font-size: 11px; color: var(--muted-2); letter-spacing: 1px;
  padding: 12px 10px 6px; text-transform: uppercase;
}
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--muted); font-size: 14px;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--panel-3); color: var(--text); text-decoration: none; }
.nav a.active {
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 500;
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav .ico { width: 18px; text-align: center; opacity: .9; font-size: 14px; }

.side-foot {
  padding: 14px 20px; border-top: 1px solid var(--line);
  font-size: 11px; color: var(--muted-2); line-height: 1.7;
}

.main {
  flex: 1; min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
}

.topbar {
  height: 62px; flex: 0 0 62px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 22px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.topbar h1 { font-size: 17px; letter-spacing: .2px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.user-chip .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 3px rgba(15, 157, 88, .14);
}

.content { padding: 22px; max-width: 1400px; width: 100%; }

/* ---------- 卡片 ---------- */

.cards {
  display: grid; gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.card::after {
  content: ""; position: absolute; right: -34px; top: -34px;
  width: 96px; height: 96px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(61, 90, 254, .06), transparent 70%);
}
.card .label { color: var(--muted); font-size: 12px; letter-spacing: .3px; }
.card .value { font-size: 28px; font-weight: 700; margin-top: 4px; letter-spacing: .3px; color: var(--text); }
.card .hint { color: var(--muted-2); font-size: 12px; margin-top: 2px; }
.card.red .value { color: var(--danger); }
.card.gold .value { color: var(--gold); }
.card.blue .value { color: var(--blue); }
.card.green .value { color: var(--green); }

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); margin-top: 16px; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fdfefe, #fbfcfe);
}
.panel-head h2 { font-size: 14px; }
.panel-head .sub { color: var(--muted-2); font-size: 12px; }
.panel-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.panel-body { padding: 16px 18px; }
.panel-body.tight { padding: 0; }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 16px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #fff;
  font-size: 13px; font-weight: 500; cursor: pointer;
  box-shadow: 0 2px 6px rgba(61, 90, 254, .22);
  transition: filter .15s, background .15s, border-color .15s, box-shadow .15s, color .15s;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.04); text-decoration: none; box-shadow: 0 4px 12px rgba(61, 90, 254, .26); }
.btn:active { transform: translateY(1px); }
.btn.ghost {
  background: #fff; border-color: var(--line-2); color: var(--muted);
  box-shadow: var(--shadow-sm);
}
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); box-shadow: 0 2px 8px rgba(61, 90, 254, .12); }
.btn.blue { background: linear-gradient(180deg, #4d94ea, var(--blue)); box-shadow: 0 2px 6px rgba(31, 116, 216, .22); }
.btn.gold { background: linear-gradient(180deg, #f0b94a, #e0a223); color: #3a2a05; box-shadow: 0 2px 6px rgba(200, 134, 13, .22); }
.btn.danger { background: #fff; border-color: rgba(220, 59, 65, .38); color: var(--danger); box-shadow: var(--shadow-sm); }
.btn.danger:hover { background: #fff5f5; border-color: var(--danger); box-shadow: 0 2px 8px rgba(220, 59, 65, .14); }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 12px; box-shadow: none; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; box-shadow: none; }

.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  background: #fff; border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); color: var(--muted); cursor: pointer;
  font-size: 16px; box-shadow: var(--shadow-sm);
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.menu-btn { display: none; }

/* ---------- 表格 ---------- */

.table-wrap { width: 100%; overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td {
  padding: 11px 14px; text-align: left; vertical-align: middle;
  border-bottom: 1px solid var(--line);
}
table.tbl th {
  color: var(--muted-2); font-weight: 500; font-size: 12px;
  background: var(--panel-2); white-space: nowrap;
}
table.tbl tbody tr { transition: background .12s; }
table.tbl tbody tr:hover { background: #f9fbff; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl td.name { font-weight: 500; }
table.tbl .actions { text-align: right; white-space: nowrap; }
table.tbl .actions form { display: inline; }

.poster {
  width: 38px; height: 50px; border-radius: 6px; object-fit: cover;
  background: var(--panel-3); display: block; border: 1px solid var(--line);
}
.poster-ph {
  width: 38px; height: 50px; border-radius: 6px;
  background: var(--panel-3); display: grid; place-items: center;
  color: var(--muted-2); font-size: 11px;
}

.cell-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-main .t { min-width: 0; }
.cell-main .t b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.cell-main .t span { color: var(--muted-2); font-size: 12px; }

/* ---------- 徽章 ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; line-height: 18px;
  background: var(--panel-3); color: var(--muted);
  border: 1px solid var(--line-2);
}
.badge.red { color: #b32a30; border-color: rgba(220, 59, 65, .28); background: rgba(220, 59, 65, .08); }
.badge.gold { color: #95620a; border-color: rgba(200, 134, 13, .28); background: rgba(240, 185, 74, .14); }
.badge.green { color: #0a7f47; border-color: rgba(15, 157, 88, .26); background: rgba(15, 157, 88, .09); }
.badge.blue { color: #1b5fae; border-color: rgba(31, 116, 216, .26); background: rgba(31, 116, 216, .09); }

/* ---------- 表单 ---------- */

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.field .help { font-size: 11px; color: var(--muted-2); }

input[type=text], input[type=password], input[type=number], input[type=url],
input[type=search], input[type=file], select, textarea {
  width: 100%; min-height: 40px;
  padding: 8px 12px;
  background: #fff; color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
input:hover, select:hover, textarea:hover { border-color: #c4d0e2; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61, 90, 254, .12);
  background: #fff;
}
input::placeholder, textarea::placeholder { color: #a9b5c7; }
input[readonly] { background: var(--panel-2); color: var(--muted); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 17px, calc(100% - 11px) 17px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }

.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

.form-actions {
  display: flex; gap: 10px; align-items: center;
  padding: 16px 18px; border-top: 1px solid var(--line);
  background: var(--panel-2);
}
.form-actions .spacer { flex: 1; }

.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 8px 16px; font-size: 13px; color: var(--muted); }
.seg input:checked + span { background: var(--accent-soft); color: var(--accent-deep); font-weight: 500; box-shadow: inset 0 -2px 0 var(--accent); }

/* ---------- 提示 ---------- */

.flash {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 14px; border-radius: var(--radius-sm);
  margin-bottom: 14px; font-size: 13px;
  border: 1px solid var(--line-2); background: var(--panel); color: var(--text-2);
  box-shadow: var(--shadow-sm);
}
.flash.success { border-color: rgba(15, 157, 88, .3); background: #f1fbf5; color: #0a6f40; }
.flash.error { border-color: rgba(220, 59, 65, .3); background: #fef4f4; color: #a7272c; }
.flash.info { border-color: rgba(31, 116, 216, .28); background: #f3f9ff; color: #1a528f; }
.flash.warn { border-color: rgba(200, 134, 13, .32); background: #fffaef; color: #86590a; }
.flash .x { margin-left: auto; cursor: pointer; opacity: .55; }
.flash .x:hover { opacity: 1; }

.empty { padding: 42px 16px; text-align: center; color: var(--muted-2); }
.empty b { display: block; color: var(--text-2); margin-bottom: 6px; }

/* ---------- 分页 ---------- */

.pager { display: flex; gap: 6px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; background: var(--panel-2); }
.pager a, .pager span {
  min-width: 34px; height: 32px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-2); border-radius: 8px;
  color: var(--muted); font-size: 12px; background: #fff;
}
.pager a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pager .cur { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500; }
.pager .info { margin-left: auto; border: 0; background: transparent; color: var(--muted-2); }

/* ---------- 登录 ---------- */

.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; }
.auth-side {
  position: relative; padding: 48px;
  background:
    radial-gradient(900px 520px at 8% -10%, rgba(61, 90, 254, .16), transparent 62%),
    radial-gradient(700px 520px at 92% 108%, rgba(31, 116, 216, .14), transparent 62%),
    linear-gradient(160deg, #ffffff, #f2f5fd 60%, #eef2fb);
  display: flex; flex-direction: column; justify-content: space-between;
  border-right: 1px solid var(--line);
}
.auth-side .big { font-size: 34px; line-height: 1.3; font-weight: 700; letter-spacing: .3px; color: var(--text); }
.auth-side .big em { color: var(--accent); font-style: normal; }
.auth-side .desc { color: var(--muted); margin-top: 14px; max-width: 420px; }
.auth-side ul { list-style: none; padding: 0; margin: 26px 0 0; color: var(--muted); font-size: 13px; }
.auth-side li { display: flex; gap: 10px; padding: 6px 0; }
.auth-side li::before { content: "›"; color: var(--accent); font-weight: 700; }
.auth-main { display: grid; place-items: center; padding: 32px 20px; background: var(--bg); }
.auth-card {
  width: 100%; max-width: 372px;
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  padding: 30px 28px; box-shadow: var(--shadow);
}
.auth-card h2 { font-size: 22px; margin-bottom: 6px; }
.auth-card p.sub { color: var(--muted); margin: 0 0 22px; font-size: 13px; }
.auth-card .field { margin-bottom: 14px; }
.auth-card .btn { min-height: 44px; margin-top: 4px; }
.auth-foot { margin-top: 18px; font-size: 12px; color: var(--muted-2); text-align: center; line-height: 1.9; }
.login-err { color: #a7272c; font-size: 12px; min-height: 18px; margin-bottom: 6px; }

/* ---------- Toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px);
  background: #fff; color: var(--text);
  border: 1px solid var(--line-2); border-radius: 10px;
  padding: 10px 16px; font-size: 13px; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  z-index: 100; max-width: calc(100vw - 40px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { border-color: rgba(15, 157, 88, .45); color: #0a6f40; }
.toast.err { border-color: rgba(220, 59, 65, .45); color: #a7272c; }

/* ---------- 小工具 ---------- */

.muted { color: var(--muted); }
.dim { color: var(--muted-2); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.right { margin-left: auto; }
.mt-0 { margin-top: 0; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px; font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px; color: var(--text-2); overflow-x: auto; white-space: pre;
  line-height: 1.7;
}
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--muted-2); }
.kv dd { margin: 0; color: var(--text); word-break: break-all; }

.progress { height: 6px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }

/* ---------- 播放串编辑 ---------- */

.ep-preview { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); }
.ep-line { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.ep-line:last-child { border-bottom: 0; }
.ep-line .h { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.ep-list { display: flex; flex-wrap: wrap; gap: 6px; }
.ep {
  font-size: 11px; padding: 2px 8px; border-radius: 6px;
  background: #fff; color: var(--muted); border: 1px solid var(--line-2);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- 抽屉遮罩 ---------- */

.drawer-mask {
  display: none; position: fixed; inset: 0; background: rgba(24, 32, 47, .38);
  z-index: 35; backdrop-filter: blur(2px);
}

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

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

@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-btn { display: grid; }
  .drawer-mask.show { display: block; }
  .content { padding: 16px; }
  .topbar { padding: 0 14px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-card { padding: 26px 22px; }
}

@media (max-width: 720px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card { padding: 13px 14px; }
  .card .value { font-size: 22px; }
  .form-grid { grid-template-columns: 1fr; }
  .top-actions .btn.preview { display: none; }
  .content { padding: 12px; }
  .panel-head { padding: 12px 14px; flex-wrap: wrap; }
  .panel-body { padding: 14px; }

  /* 表格转卡片 */
  .table-wrap table.responsive thead { display: none; }
  .table-wrap table.responsive,
  .table-wrap table.responsive tbody,
  .table-wrap table.responsive tr,
  .table-wrap table.responsive td { display: block; width: 100%; }
  .table-wrap table.responsive tr {
    border-bottom: 1px solid var(--line); padding: 10px 0;
  }
  .table-wrap table.responsive tr:last-child { border-bottom: 0; }
  .table-wrap table.responsive td {
    border: 0; padding: 5px 14px; display: flex; gap: 12px;
    justify-content: space-between; align-items: center;
  }
  .table-wrap table.responsive td::before {
    content: attr(data-label);
    color: var(--muted-2); font-size: 12px; flex: 0 0 auto;
  }
  .table-wrap table.responsive td.cell-name { display: block; padding-bottom: 8px; }
  .table-wrap table.responsive td.cell-name::before { display: none; }
  .table-wrap table.responsive td.actions { justify-content: flex-end; padding-top: 8px; }
  .table-wrap table.responsive td.actions::before { display: none; }
  .cell-main .t b { max-width: none; white-space: normal; }
  .form-actions { flex-wrap: wrap; }
  .kv { grid-template-columns: 100px 1fr; }
}

@media (max-width: 420px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .brand-text span { display: none; }
  .user-chip { display: none; }
}
