:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --border: #e4e7ec;
  --text: #1f2329;
  --muted: #8a919c;
  --primary: #185fa5;
  --primary-dark: #0c447c;
  --green: #0f6e56;
  --green-bg: #e1f5ee;
  --red: #a32d2d;
  --red-bg: #fcebeb;
  --amber: #854f0b;
  --amber-bg: #faeeda;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
a { color: var(--primary); text-decoration: none; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block; padding: 8px 16px; border: 1px solid var(--border);
  border-radius: 8px; background: #fff; color: var(--text); cursor: pointer;
  font-size: 14px; line-height: 1.4;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { opacity: .9; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.15); color: #fff; }
.btn-block { width: 100%; text-align: center; }
.btn-sm { padding: 5px 10px; font-size: 13px; }

/* ---------- 登录页 ---------- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 36px; width: 340px; box-shadow: 0 4px 24px rgba(0,0,0,.05);
}
.login-card h1 { font-size: 20px; font-weight: 600; text-align: center; }
.login-sub { text-align: center; color: var(--muted); margin: 6px 0 20px; }
.login-card label { display: block; margin: 14px 0 6px; font-size: 13px; color: var(--muted); }
.login-card input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px;
}
.login-card input:focus { outline: none; border-color: var(--primary); }
.login-card .btn { margin-top: 20px; }
.login-hint {
  margin-top: 18px; padding: 12px; background: var(--bg); border-radius: 8px;
  color: var(--muted); font-size: 12px; line-height: 1.8;
}

/* ---------- 顶栏 ---------- */
.topbar {
  height: 56px; background: var(--primary-dark); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.me-name { font-size: 14px; }
.badge { padding: 3px 10px; border-radius: 20px; font-size: 12px; }
.badge-role { background: rgba(255,255,255,.2); color: #fff; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: calc(100vh - 56px); }
.sidebar {
  width: 220px; background: var(--panel); border-right: 1px solid var(--border);
  padding: 16px 12px; flex-shrink: 0;
}
.sidebar-head { font-size: 13px; color: var(--muted); margin: 0 4px 10px; }
.shop-list { display: flex; flex-direction: column; gap: 6px; }
.shop-item {
  padding: 10px 12px; border-radius: 8px; cursor: pointer; display: flex;
  justify-content: space-between; align-items: center; border: 1px solid transparent;
}
.shop-item:hover { background: var(--bg); }
.shop-item.active { background: var(--green-bg); color: var(--green); font-weight: 600; }
.shop-item .cnt { font-size: 12px; color: var(--muted); }
.sidebar-foot { margin-top: 16px; }

.content { flex: 1; padding: 20px; min-width: 0; }
.content-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.content-head h2 { font-size: 18px; font-weight: 600; }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- 文件夹 ---------- */
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.folder-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; cursor: pointer; transition: border-color .15s;
}
.folder-card:hover { border-color: var(--primary); }
.folder-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.folder-card-head h3 { font-size: 15px; font-weight: 600; margin-bottom: 0; flex: 1; word-break: break-all; }
.btn-rename { background: none; border: none; color: var(--muted); font-size: 12px; cursor: pointer; padding: 2px 4px; }
.btn-rename:hover { color: var(--primary); }
.folder-card-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-rename.danger:hover { color: var(--red); }
.folder-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.stat { font-size: 12px; padding: 3px 9px; border-radius: 6px; }
.stat-pass { background: var(--green-bg); color: var(--green); }
.stat-reject { background: var(--red-bg); color: var(--red); }
.stat-pending { background: var(--amber-bg); color: var(--amber); }

/* ---------- 视频列表 ---------- */
.video-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; flex-wrap: wrap; }
.video-toolbar-right { display: flex; align-items: center; gap: 12px; }
.filter-tabs { display: flex; gap: 4px; background: var(--primary); padding: 4px; border-radius: 8px; }
.filter-tab { border: none; background: transparent; padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; color: rgba(255,255,255,.85); }
.filter-tab.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.filter-tab:hover:not(.active) { color: #fff; }
.video-list { display: flex; flex-direction: column; gap: 10px; }
.video-item {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; display: flex; align-items: center; gap: 12px;
}
.video-item input[type=checkbox] { width: 18px; height: 18px; flex-shrink: 0; }
.video-thumb {
  width: 88px; height: 52px; border-radius: 6px; background: #000;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff;
  font-size: 20px;
}
.video-info { flex: 1; min-width: 0; }
.video-title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.reject-reason { font-size: 12px; color: var(--red); margin-top: 6px; background: var(--red-bg); padding: 5px 9px; border-radius: 6px; display: inline-block; line-height: 1.5; }
.video-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.status-tag { font-size: 12px; padding: 2px 9px; border-radius: 6px; flex-shrink: 0; }
.status-pending { background: var(--amber-bg); color: var(--amber); }
.status-passed { background: var(--green-bg); color: var(--green); }
.status-rejected { background: var(--red-bg); color: var(--red); }

/* ---------- 弹窗 ---------- */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 100; align-items: center; justify-content: center; padding: 20px; }
.modal.show { display: flex; }
.modal-box { background: #fff; border-radius: 12px; width: 440px; max-width: 100%; max-height: 90vh; overflow: auto; }
.modal-lg { width: 720px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 600; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--muted); }
.modal-body { padding: 20px; }
.modal-body label { display: block; margin: 12px 0 6px; font-size: 13px; color: var(--muted); }
.modal-body select, .modal-body input, .modal-body textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit;
}
.modal-body textarea { resize: vertical; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }
.modal video { width: 100%; max-height: 70vh; background: #000; display: block; }

/* ---------- 管理 ---------- */
.manage-body h3 { font-size: 14px; font-weight: 600; margin: 4px 0 10px; }
.manage-section { margin-bottom: 22px; }
.manage-row { display: flex; gap: 8px; flex-wrap: wrap; }
.manage-row input, .manage-row select { flex: 1; min-width: 100px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.manage-user { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.manage-user-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.manage-user-head .name { font-weight: 600; }
.shop-checkboxes { display: flex; gap: 14px; flex-wrap: wrap; }
.shop-checkboxes label { display: flex; align-items: center; gap: 5px; font-size: 13px; }
.manage-shop-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; }
.assign-actions { display: flex; gap: 8px; align-items: center; }
.assign-user-list { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow: auto; }
.assign-user-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; background: var(--panel); }
.assign-user-row:hover { background: var(--bg); }
.assign-user-row input { width: auto; flex-shrink: 0; }
.assign-user-name { flex: 1; min-width: 0; }
.badge-role { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--bg); color: var(--text); }
.manage-shop-item .name { font-weight: 600; }
.manage-shop-actions { display: flex; gap: 8px; }
.danger-text { color: var(--red); border-color: var(--red); }

/* ---------- 上传/新建文件夹 ---------- */
.content-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- toast ---------- */
#toast-box { position: fixed; top: 68px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 11px 16px; border-radius: 8px; color: #fff; font-size: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.15); }
.toast-error { background: var(--red); }
.toast-ok { background: var(--green); }

/* ---------- 手机适配 ---------- */
@media (max-width: 720px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); padding: 10px; }
  .shop-list { flex-direction: row; overflow-x: auto; }
  .shop-item { flex-shrink: 0; }
  .video-thumb { width: 64px; height: 40px; }
  .video-actions { width: 100%; }
}
