/* 电驴哥 · 短视频矩阵运营宝 —— 主样式 */
:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --border: #e6e9f0;
  --text: #1e2430;
  --text-2: #5b6472;
  --text-3: #8b95a5;
  --primary: #2b6cf6;
  --primary-d: #1a55d8;
  --green: #16a34a;
  --orange: #ea8a0b;
  --red: #e0453c;
  --purple: #7c3aed;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(20,30,50,.06), 0 8px 24px rgba(20,30,50,.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }

/* ============ 登录页 ============ */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a2b6b 0%, #2b6cf6 55%, #5b8cff 100%);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 400px; background: #fff; border-radius: 18px;
  padding: 40px 36px; box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.login-brand { text-align: center; margin-bottom: 28px; }
.brand-logo {
  width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 18px;
  background: linear-gradient(135deg, #2b6cf6, #7c3aed);
  display: flex; align-items: center; justify-content: center; font-size: 32px;
  box-shadow: 0 8px 24px rgba(43,108,246,.35);
}
.brand-logo.sm { width: 38px; height: 38px; font-size: 20px; border-radius: 11px; margin: 0; }
.login-brand h1 { font-size: 22px; margin-bottom: 6px; letter-spacing: .5px; }
.login-brand p { color: var(--text-3); font-size: 13px; }
.login-form label { display: block; margin-bottom: 16px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.login-form input {
  width: 100%; padding: 12px 14px; margin-top: 7px; border: 1.5px solid var(--border);
  border-radius: 10px; font-size: 14px; outline: none; transition: .2s; background: #fafbfd;
}
.login-form input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(43,108,246,.1); }
.login-err { color: var(--red); font-size: 13px; min-height: 20px; margin-bottom: 6px; }
.login-tip { text-align: center; color: var(--text-3); font-size: 12px; margin-top: 18px; }

/* ============ 布局 ============ */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: #fff; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: fixed; height: 100vh; z-index: 10;
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 20px 18px; border-bottom: 1px solid var(--border); }
.side-brand strong { display: block; font-size: 15px; }
.side-brand small { color: var(--text-3); font-size: 11.5px; }
.side-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 11px 14px; margin-bottom: 3px;
  border-radius: 9px; color: var(--text-2); cursor: pointer; font-size: 14px;
  transition: .15s; text-decoration: none; user-select: none;
}
.nav-item:hover { background: #f2f5fa; color: var(--text); }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 500; box-shadow: 0 3px 10px rgba(43,108,246,.3); }
.nav-item span { font-size: 16px; }
.side-foot { padding: 14px; border-top: 1px solid var(--border); }
.side-user { font-size: 13px; color: var(--text-2); margin-bottom: 9px; text-align: center; }

.main { flex: 1; margin-left: 220px; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 62px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; position: sticky; top: 0; z-index: 5;
}
.topbar h2 { font-size: 18px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.pill {
  background: #eef4ff; color: var(--primary); padding: 6px 13px;
  border-radius: 20px; font-size: 12.5px; font-weight: 500;
}
.clock { color: var(--text-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.page-body { padding: 24px 26px 50px; flex: 1; }

/* ============ 通用组件 ============ */
.btn {
  padding: 8px 15px; border: none; border-radius: 8px; cursor: pointer;
  font-size: 13.5px; font-weight: 500; transition: .15s; font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-d); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover:not(:disabled) { background: #128a3d; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #c5342c; }
.btn-warn { background: var(--orange); color: #fff; }
.btn-ghost { background: #f2f4f8; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: #e7eaf0; }
.btn-block { width: 100%; justify-content: center; }
.btn-lg { padding: 12px; font-size: 15px; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }

.card {
  background: var(--card); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); margin-bottom: 18px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 10px;
}
.card-head h3 { font-size: 15.5px; }

.input, .select, textarea.input {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--border);
  border-radius: 8px; font-size: 13.5px; outline: none; transition: .15s;
  font-family: inherit; background: #fff; color: var(--text);
}
.input:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(43,108,246,.08); }
textarea.input { resize: vertical; min-height: 70px; line-height: 1.6; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat-card::after { content: ''; position: absolute; right: -18px; top: -18px; width: 76px; height: 76px; border-radius: 50%; opacity: .09; background: var(--primary); }
.stat-card.g::after { background: var(--green); }
.stat-card.o::after { background: var(--orange); }
.stat-card.r::after { background: var(--red); }
.stat-card.p::after { background: var(--purple); }
.stat-label { color: var(--text-3); font-size: 12.5px; margin-bottom: 8px; }
.stat-value { font-size: 27px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-sub { color: var(--text-3); font-size: 11.5px; margin-top: 7px; }

/* 徽章 */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px;
  border-radius: 6px; font-size: 12px; font-weight: 500; white-space: nowrap;
}
.badge.green { background: #e8f7ee; color: #12833c; }
.badge.red { background: #fdecea; color: #c5342c; }
.badge.orange { background: #fff4e2; color: #b96f06; }
.badge.blue { background: #e9f1ff; color: #1a55d8; }
.badge.gray { background: #f0f2f6; color: #6b7280; }
.badge.purple { background: #f3ecff; color: #6d28d9; }

/* 表格 */
.table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; background: #fff; font-size: 13.5px; }
thead th {
  background: #f8fafc; padding: 11px 14px; text-align: left; font-weight: 600;
  color: var(--text-2); font-size: 12.5px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
tbody td { padding: 12px 14px; border-bottom: 1px solid #f0f2f6; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfd; }
td .actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* 账号卡片网格 */
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }
.acc-card {
  background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 16px; cursor: pointer; transition: .18s; position: relative;
}
.acc-card:hover { border-color: var(--primary); box-shadow: 0 4px 16px rgba(43,108,246,.12); transform: translateY(-2px); }
.acc-card.selected { border-color: var(--primary); background: #f5f9ff; box-shadow: 0 0 0 3px rgba(43,108,246,.13); }
.acc-card.disabled { opacity: .55; }
.acc-head { display: flex; align-items: center; gap: 11px; margin-bottom: 11px; }
.acc-avatar {
  width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg,#2b6cf6,#7c3aed);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 600; flex-shrink: 0; overflow: hidden;
}
.acc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.acc-name { font-weight: 600; font-size: 14.5px; margin-bottom: 3px; word-break: break-all; }
.acc-remark { color: var(--text-3); font-size: 12px; word-break: break-all; }
.acc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid #f0f2f6; }
.acc-check {
  position: absolute; top: 12px; right: 12px; width: 21px; height: 21px;
  border: 2px solid #cbd2dd; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 12px; color: transparent;
}
.acc-card.selected .acc-check { background: var(--primary); border-color: var(--primary); color: #fff; }

/* 视频卡片 */
.vid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.vid-card { background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: .18s; }
.vid-card:hover { border-color: var(--primary); box-shadow: 0 4px 16px rgba(43,108,246,.12); }
.vid-thumb {
  width: 100%; aspect-ratio: 16/9; background: #0f1420; position: relative;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.vid-thumb video, .vid-thumb img { width: 100%; height: 100%; object-fit: cover; }
.vid-thumb .play {
  position: absolute; width: 46px; height: 46px; border-radius: 50%;
  background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 17px; backdrop-filter: blur(4px);
}
/* 文件已清理的素材卡片 */
.vid-card .vid-thumb[style*="background:#0f1420"] { background: #f4f6fa !important; }
.checkbox-inline { width: auto; margin: 0; }

/* ============ 视频播放器 ============ */
.player-wrap {
  background: #0b0f17;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dlg-player {
  width: 100%;
  max-height: 62vh;
  background: #000;
  display: block;
  outline: none;
}
.player-meta { margin-top: 14px; }
.player-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.player-actions .btn, .player-actions a.btn {
  text-decoration: none;
}
/* 短标题展示 */
.vid-short {
  font-size: 11.5px;
  color: var(--purple);
  background: #f3ecff;
  border-radius: 5px;
  padding: 2px 7px;
  margin-bottom: 6px;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 选填标记 */
.opt-tag {
  font-size: 11px;
  color: var(--text-3);
  background: #f0f2f6;
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 4px;
  font-weight: 400;
}
.vid-info { padding: 11px 13px; }
.vid-title { font-weight: 600; font-size: 13.5px; margin-bottom: 5px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vid-meta { color: var(--text-3); font-size: 11.5px; display: flex; gap: 8px; flex-wrap: wrap; }
.vid-tags { margin-top: 7px; display: flex; gap: 5px; flex-wrap: wrap; }
.tag { background: #eef4ff; color: var(--primary); padding: 2px 7px; border-radius: 5px; font-size: 11px; }
.vid-acts { padding: 9px 13px; border-top: 1px solid #f0f2f6; display: flex; gap: 6px; }
.vid-acts .btn { flex: 1; justify-content: center; }

/* 工具条 */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .input, .toolbar .select { width: auto; min-width: 150px; }
.toolbar .grow { flex: 1; }

/* 发布页 */
.publish-layout { display: grid; grid-template-columns: 1fr 400px; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .publish-layout { grid-template-columns: 1fr; } }
.publish-sticky { position: sticky; top: 82px; }
.publish-item {
  border: 1.5px solid var(--border); border-radius: 10px; padding: 13px; margin-bottom: 11px;
  background: #fff;
}
.publish-item-head { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.publish-item-head .acc-avatar { width: 34px; height: 34px; font-size: 14px; }
.mode-switch { display: flex; gap: 0; border: 1.5px solid var(--border); border-radius: 9px; overflow: hidden; margin-bottom: 14px; }
.mode-switch button {
  flex: 1; padding: 10px; border: none; background: #fff; cursor: pointer;
  font-size: 13.5px; font-weight: 500; font-family: inherit; transition: .15s; color: var(--text-2);
}
.mode-switch button.on { background: var(--primary); color: #fff; }

/* 空状态 */
.empty { text-align: center; padding: 56px 20px; color: var(--text-3); }
.empty-icon { font-size: 48px; margin-bottom: 14px; opacity: .5; }
.empty h4 { font-size: 15px; margin-bottom: 7px; color: var(--text-2); }
.empty p { font-size: 13px; line-height: 1.7; }

/* 弹窗 */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-mask { position: absolute; inset: 0; background: rgba(15,22,38,.55); backdrop-filter: blur(2px); }
.modal-box {
  background: #fff; border-radius: 14px; width: 100%; max-width: 560px;
  max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 70px rgba(0,0,0,.28); position: relative; animation: pop .18s ease;
}
.modal-box.lg { max-width: 860px; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head { padding: 17px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 16px; }
.modal-close { border: none; background: none; font-size: 18px; cursor: pointer; color: var(--text-3); padding: 4px 8px; border-radius: 6px; }
.modal-close:hover { background: #f0f2f6; color: var(--text); }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { padding: 15px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* 二维码 */
.qr-box { text-align: center; padding: 10px 0; }
.qr-box img { width: 260px; height: 260px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.qr-box p { margin-top: 14px; color: var(--text-2); font-size: 13.5px; }
.qr-tip { background: #fff8ec; border: 1px solid #ffe0b2; color: #b96f06; padding: 11px 14px; border-radius: 9px; font-size: 12.5px; margin-top: 12px; line-height: 1.6; }

/* Toast */
.toast {
  position: fixed; top: 22px; left: 50%; transform: translateX(-50%) translateY(-90px);
  background: #1e2430; color: #fff; padding: 12px 24px; border-radius: 10px;
  font-size: 13.5px; z-index: 999; transition: .28s; box-shadow: 0 8px 28px rgba(0,0,0,.25);
  max-width: 80vw; text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.ok { background: var(--green); }
.toast.err { background: var(--red); }

/* 日志 */
.log-list { max-height: 460px; overflow-y: auto; font-size: 12.5px; }
.log-item { padding: 9px 12px; border-bottom: 1px solid #f0f2f6; display: flex; gap: 10px; }
.log-item:last-child { border-bottom: none; }
.log-time { color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.log-msg { flex: 1; word-break: break-word; }
.lvl-info .dot { background: var(--primary); }
.lvl-warn .dot { background: var(--orange); }
.lvl-error .dot { background: var(--red); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 7px; vertical-align: middle; }

.filter-tabs { display: flex; gap: 7px; flex-wrap: wrap; }
.filter-tab {
  padding: 6px 13px; border-radius: 7px; background: #f2f4f8; color: var(--text-2);
  cursor: pointer; font-size: 13px; transition: .15s; border: none; font-family: inherit;
}
.filter-tab.active { background: var(--primary); color: #fff; font-weight: 500; }

.hint { color: var(--text-3); font-size: 12.5px; line-height: 1.7; }
.kv { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid #f4f6f9; font-size: 13px; }
.kv:last-child { border-bottom: none; }
.kv span { color: var(--text-3); }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
