* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #f4f6f5;
  --sidebar: #14201c;
  --sidebar-2: #1c2b26;
  --primary: #2f7d5b;
  --primary-2: #3a946d;
  --text: #1a2420;
  --text-2: #6b7772;
  --border: #e3e8e5;
  --card: #ffffff;
  --accent: #94d8c3;
}
body {
  font-family: -apple-system, "PingFang SC", "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
.app { display: flex; min-height: 100vh; }

/* 侧边栏 */
.sidebar {
  width: 220px; background: var(--sidebar); color: #cdd8d3;
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-logo { width: 32px; height: 32px; border-radius: 9px; background: var(--primary); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; }
.brand-text { font-weight: 700; color: #fff; font-size: 15px; }
.nav { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 3px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; cursor: pointer; color: #b9c6c0; font-size: 13.5px; transition: .15s; user-select: none; }
.nav-item span { font-size: 15px; }
.nav-item:hover { background: var(--sidebar-2); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; }
.sidebar-footer { padding: 14px; border-top: 1px solid rgba(255,255,255,.07); }
.mode-badge { font-size: 11px; text-align: center; padding: 7px; border-radius: 8px; background: rgba(255,255,255,.08); color: #cdd8d3; }
.mode-badge.live { background: rgba(58,148,109,.25); color: #8fe0b8; }

/* 主区 */
.main { flex: 1; margin-left: 220px; display: flex; flex-direction: column; }
.topbar {
  background: var(--card); border-bottom: 1px solid var(--border);
  padding: 16px 26px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 18px; font-weight: 700; }
.content { padding: 24px 26px; }

/* 按钮 */
.btn { border: 1px solid var(--border); background: #fff; padding: 8px 14px; border-radius: 9px; cursor: pointer; font-size: 13px; color: var(--text); transition: .15s; }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-2); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn-ghost:hover { background: rgba(47,125,91,.08); }

/* 卡片 / 网格 */
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.card-title { font-size: 14px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }
.stat .stat-label { font-size: 12.5px; color: var(--text-2); }
.stat .stat-value { font-size: 26px; font-weight: 700; margin-top: 6px; }
.stat .stat-sub { font-size: 11.5px; color: var(--text-2); margin-top: 4px; }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 10px 12px; color: var(--text-2); font-weight: 500; font-size: 12px; border-bottom: 1px solid var(--border); }
td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(47,125,91,.02); }

/* 标签 */
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; background: rgba(47,125,91,.1); color: var(--primary); margin: 1px 2px; }
.tag-platform { background: rgba(139,200,234,.18); color: #2b6b8a; }
.status { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; }
.status-new, .status-draft, .status-pending { background: #fef3e2; color: #b87416; }
.status-done, .status-confirmed, .status-published, .status-online, .status-success { background: #e6f6ec; color: #2f7d5b; }
.status-failed, .status-offline { background: #fdeaea; color: #c0392b; }
.status-manual, .status-skipped { background: #eef0f2; color: #6b7280; }

/* 表单 */
.form-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--text-2); }
.field input, .field select { padding: 8px 11px; border: 1px solid var(--border); border-radius: 9px; font-size: 13px; background: #fff; min-width: 140px; }
.field input:focus, .field select:focus { outline: none; border-color: var(--primary); }

/* 分镜 */
.shot { border: 1px solid var(--border); border-radius: 11px; padding: 13px; margin-bottom: 10px; background: #fafcfb; }
.shot-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.shot-time { font-size: 11.5px; color: var(--text-2); }
.shot-line { font-size: 13px; line-height: 1.6; margin: 6px 0; }
.shot-visual { font-size: 12px; color: var(--text-2); line-height: 1.6; }

/* 视频 */
.video-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.video-card video { width: 100%; display: block; background: #000; }
.video-card .vc-body { padding: 13px; }
.video-card .vc-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.video-card .vc-meta { font-size: 11.5px; color: var(--text-2); }

/* 提示 */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #1c2b26; color: #fff; padding: 11px 20px; border-radius: 10px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 100; max-width: 80vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.empty { text-align: center; color: var(--text-2); padding: 40px 20px; font-size: 13px; }
.muted { color: var(--text-2); }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.flex { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spinner { display: inline-block; width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress { height: 6px; background: var(--border); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.progress-bar { height: 100%; background: var(--primary); transition: .3s; }

/* toggle 开关 */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; cursor: pointer; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch::before { content: ""; position: absolute; inset: 0; background: #cbd2cf; border-radius: 26px; transition: .2s; }
.switch::after { content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch:has(input:checked)::before { background: var(--primary); }
.switch:has(input:checked)::after { transform: translateX(20px); }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.code-block { background: #f6f8f7; border: 1px solid var(--border); border-radius: 9px; padding: 12px; font-family: monospace; font-size: 12px; white-space: pre-wrap; word-break: break-all; color: #374151; }

@media (max-width: 760px) {
  .sidebar { width: 64px; }
  .brand-text, .nav-item span + *, .sidebar-footer { display: none; }
  .nav-item { justify-content: center; }
  .brand { justify-content: center; padding: 18px 0; }
  .main { margin-left: 64px; }
  .topbar { padding: 14px 16px; }
  .content { padding: 16px; }
}
