/* ===== 管理后台样式 ===== */
.admin-body { background: var(--bg-soft); }

.login-layer {
  min-height: calc(100vh - var(--header-h));
  display: flex; align-items: center; justify-content: center; padding: 30px 16px;
}
.login-card {
  width: min(400px, 100%); background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 38px 34px; text-align: center;
  display: flex; flex-direction: column; gap: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.login-logo { font-size: 46px; }
.login-card h1 { font-size: 24px; font-weight: 800; }
.login-card p { color: var(--muted); font-size: 13.5px; }
.login-card input {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 16px; color: var(--text); font-size: 14px; outline: none;
}
.login-card input:focus { border-color: var(--accent); }
.login-tip { font-size: 12px !important; }
.login-tip code { background: var(--bg-soft); padding: 2px 6px; border-radius: 6px; }
.login-card .err { color: #ff5f7a; font-size: 13px; }

.admin-topbar { display: flex; align-items: center; justify-content: space-between; padding: 30px 0 6px; flex-wrap: wrap; gap: 12px; }
.admin-topbar h1 { font-size: 26px; font-weight: 800; }
.admin-actions { display: flex; gap: 10px; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 18px 0 22px; }
.stat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
}
.stat-card .ico { font-size: 26px; width: 50px; height: 50px; border-radius: 13px; background: rgba(255,255,255,.06); display: flex; align-items: center; justify-content: center; }
.stat-card b { font-size: 22px; display: block; }
.stat-card span { color: var(--muted); font-size: 12.5px; }

.admin-layout { display: grid; grid-template-columns: 400px 1fr; gap: 20px; align-items: start; padding-bottom: 70px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; position: sticky; top: calc(var(--header-h) + 16px); }
.panel-wide { position: static; }
.panel-title { font-size: 17px; font-weight: 700; margin-bottom: 18px; }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 15px; flex: 1; }
.field > span { font-size: 13px; color: var(--muted); font-weight: 500; }
.field input, .field select, .field textarea {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 13px; color: var(--text); font-size: 14px; outline: none; width: 100%;
  transition: border-color .2s; resize: vertical;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field-row { display: flex; gap: 12px; }

.check-field { display: flex; align-items: center; gap: 10px; font-size: 14px; margin: 4px 0 18px; cursor: pointer; }
.check-field input { width: 17px; height: 17px; accent-color: var(--accent); }

.cover-drop, .video-drop {
  border: 1.6px dashed rgba(255,255,255,.22); border-radius: 12px; cursor: pointer;
  transition: border-color .2s, background .2s; background: var(--bg-soft);
}
.cover-drop:hover, .video-drop:hover { border-color: var(--accent); }
.cover-drop.drag, .video-drop.drag { border-color: var(--accent); background: rgba(255,47,106,.08); }
.cover-preview { padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.cover-preview svg { width: 30px; height: 30px; }
.cover-preview b { color: var(--text); font-size: 14px; }
.cover-preview img { max-height: 190px; border-radius: 8px; margin-bottom: 8px; }
.cover-preview.has-img span { display: none; }
.video-drop { padding: 14px 16px; font-size: 13.5px; color: var(--muted); }
.video-drop.has-file { color: #6ee7a0; border-color: rgba(110,231,160,.5); }

/* 上传进度条 */
.upload-progress { margin: -6px 0 14px; }
.progress-track { height: 9px; border-radius: 5px; background: var(--bg-soft); border: 1px solid var(--line); overflow: hidden; }
.progress-bar { height: 100%; width: 0%; border-radius: 5px; background: var(--grad); transition: width .15s linear; }
.progress-text { font-size: 12.5px; color: var(--muted); margin-top: 6px; display: block; }
.form-btns .btn:disabled, .ep-add-form .btn:disabled { opacity: .6; cursor: wait; }

.form-btns { display: flex; gap: 12px; }
.form-btns .btn { flex: 1; }

/* 剧集表格 */
.series-row {
  display: flex; align-items: center; gap: 14px; padding: 13px;
  border-radius: 12px; border: 1px solid transparent; transition: all .15s;
}
.series-row:hover { background: var(--bg-soft); border-color: var(--line); }
.series-row .cover-thumb {
  flex: 0 0 52px; aspect-ratio: 2/3; border-radius: 8px; overflow: hidden; background: var(--bg-soft);
}
.series-row .cover-thumb img { width: 100%; height: 100%; object-fit: cover; }
.series-row .s-info { flex: 1; min-width: 0; }
.series-row .s-title { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.series-row .s-meta { color: var(--muted); font-size: 12px; margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; }
.series-row .s-meta .st { padding: 1px 8px; border-radius: 999px; font-size: 11px; }
.series-row .s-meta .st.on { background: rgba(110,231,160,.15); color: #6ee7a0; }
.series-row .s-meta .st.done { background: rgba(139,92,246,.2); color: #c4b5fd; }
.series-row .s-acts { display: flex; gap: 8px; flex-shrink: 0; }
.icon-btn {
  padding: 8px 13px; border-radius: 9px; font-size: 12.5px; font-weight: 600;
  background: var(--card-2); color: var(--text); transition: all .15s; white-space: nowrap;
}
.icon-btn:hover { background: var(--accent); color: #fff; }
.icon-btn.danger:hover { background: #e11d48; }
.icon-btn.ep { background: rgba(139,92,246,.18); color: #c4b5fd; }
.icon-btn.ep:hover { background: var(--accent-2); color: #fff; }
.table-empty { text-align: center; color: var(--muted); padding: 46px 0; font-size: 14px; }

/* 抽屉 */
.drawer-mask {
  position: fixed; inset: 0; z-index: 190; background: rgba(0,0,0,.55);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.drawer-mask.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 200;
  width: min(480px, 94vw); background: var(--bg-soft); border-left: 1px solid var(--line);
  transform: translateX(105%); transition: transform .3s ease; display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { font-size: 18px; font-weight: 700; }
.drawer-sub { color: var(--muted); font-size: 12.5px; }
.drawer-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.ep-add-form { padding-bottom: 8px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }

.ep-manage-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; background: var(--card);
}
.ep-manage-item .num {
  flex: 0 0 40px; height: 40px; border-radius: 10px; background: rgba(139,92,246,.16); color: #c4b5fd;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
.ep-manage-item .e-info { flex: 1; min-width: 0; }
.ep-manage-item .e-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-manage-item .e-state { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.ep-manage-item .e-state.ok { color: #6ee7a0; }

@media (max-width: 1020px) {
  .admin-layout { grid-template-columns: 1fr; }
  .panel { position: static; }
}
@media (max-width: 560px) {
  .field-row { flex-direction: column; gap: 0; }
  .series-row { flex-wrap: wrap; }
}
