:root {
  --bg: #0b1020;
  --bg-soft: #121a2f;
  --card: #161f38;
  --card-2: #1c2745;
  --line: #26314f;
  --text: #e6ecf7;
  --muted: #93a1c0;
  --primary: #3b82f6;
  --primary-2: #2563eb;
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 20% -10%, #17233f 0%, var(--bg) 55%);
  color: var(--text);
  font: 14px/1.55 -apple-system, "Segoe UI", "Microsoft YaHei", Roboto, sans-serif;
}

h1 { font-size: 19px; margin: 0; }
h1 small { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 8px; }
h2 { font-size: 15px; margin: 0 0 12px; }
h3 { font-size: 13px; margin: 18px 0 8px; color: var(--muted); font-weight: 600; }
p { margin: 6px 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }

.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 14px 24px; border-bottom: 1px solid var(--line);
  background: rgba(11, 16, 32, 0.85); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), #7c3aed); font-weight: 700; letter-spacing: 1px;
}
.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  font-size: 11px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card-2); color: var(--muted); white-space: nowrap;
}
.badge.ok { color: #b9f6ca; border-color: #1b5e20; background: #10261a; }
.badge.warn { color: #ffe0a3; border-color: #7a5300; background: #2a1f07; }

.alert { margin: 12px 24px 0; padding: 10px 14px; border-radius: var(--radius); font-size: 13px; }
.alert.error { background: #2a1214; border: 1px solid #7f1d1d; color: #fecaca; }
.alert.warn { background: #2a2109; border: 1px solid #a16207; color: #fde68a; }
.alert.info { background: #10203a; border: 1px solid #1e3a8a; color: #c7ddff; }

/* ---------------- 导航：AI 科技风卡片 ----------------
 *
 * 设计口径（为什么不只是一排按钮）：
 *  这 11 个页签其实是**一条业务流水线**（一张图 → 内容 → 成片 → 分发 → 直播 → 复盘 → 合规），
 *  排成卡片后每张能写清"这一步做什么"，运营不用猜；选中态用霓虹描边 + 呼吸光表达"当前所在环节"。
 *  纯 CSS 实现（无图片/无字体依赖）：零请求、离线可用，也不破坏"零依赖"的交付前提。 */
.tabs {
  display: grid;
  /* 3×4 栅格：3 列固定，11 张导航卡 + 1 块运行状态砖 = 12 格，正好排满 4 行 */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 24px 4px;
}
@media (max-width: 980px) { .tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .tabs { grid-template-columns: 1fr; } }
.tab {
  position: relative;
  display: flex; flex-direction: column; gap: 4px;
  text-align: left; cursor: pointer; overflow: hidden;
  padding: 12px 13px 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background:
    linear-gradient(160deg, rgba(59,130,246,.10), rgba(11,16,32,0) 55%),
    linear-gradient(180deg, var(--card), var(--card-2));
  color: var(--text);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
/* 左侧霓虹指示条：默认弱，hover 变亮，选中态常亮 */
.tab::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--primary), #22d3ee);
  opacity: .35; transition: opacity .18s ease;
}
/* 右上角扫光：科技感的"数据流"暗示 */
.tab::after {
  content: ''; position: absolute; right: -40%; top: -60%; width: 80%; height: 220%;
  background: radial-gradient(closest-side, rgba(34,211,238,.16), transparent 70%);
  opacity: 0; transition: opacity .2s ease;
}
.tab:hover { transform: translateY(-2px); border-color: #3b82f6aa; box-shadow: 0 8px 22px rgba(2,6,23,.55); }
.tab:hover::after { opacity: 1; }
.tab.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(59,130,246,.45), 0 10px 26px rgba(37,99,235,.28);
  animation: tab-breathe 3.2s ease-in-out infinite;
}
.tab.active::before { opacity: 1; }
@keyframes tab-breathe {
  0%, 100% { box-shadow: 0 0 0 1px rgba(59,130,246,.45), 0 10px 26px rgba(37,99,235,.22); }
  50% { box-shadow: 0 0 0 1px rgba(59,130,246,.75), 0 12px 30px rgba(37,99,235,.42); }
}
@media (prefers-reduced-motion: reduce) { .tab.active { animation: none; } .tab:hover { transform: none; } }

.tab-head { display: flex; align-items: center; gap: 8px; }
.tab-no {
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  color: #bfdbfe; background: rgba(59,130,246,.16);
  border: 1px solid rgba(59,130,246,.35); border-radius: 7px;
  min-width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
}
.tab.active .tab-no { background: var(--primary-2); border-color: var(--primary); color: #fff; }
.tab-ico { font-size: 15px; line-height: 1; filter: saturate(1.2); }
.tab-title { font-size: 13.5px; font-weight: 650; letter-spacing: .2px; }
.tab-desc { font-size: 11px; color: var(--muted); line-height: 1.35; }
.tab.active .tab-desc { color: #c7ddff; }
.tab-badge {
  position: absolute; right: 9px; top: 9px; font-size: 10px;
  padding: 1px 6px; border-radius: 999px;
  background: rgba(34,197,94,.16); border: 1px solid rgba(34,197,94,.45); color: #bbf7d0;
}
.tab-badge.warn { background: rgba(245,158,11,.16); border-color: rgba(245,158,11,.5); color: #fde68a; }
@media (max-width: 700px) { .tabs { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); } .tab-desc { display: none; } }

/* 第 12 格：运行状态砖（不参与页签切换 —— 刻意不带 class="tab"/data-tab，
   否则点击会把所有面板隐藏成 'tab-undefined' 的状态） */
.nav-tile {
  display: flex; flex-direction: column; gap: 6px; justify-content: center;
  padding: 12px 14px; border-radius: 14px;
  border: 1px dashed #334155;
  background:
    linear-gradient(160deg, rgba(34,211,238,.08), rgba(11,16,32,0) 60%),
    repeating-linear-gradient(0deg, rgba(148,163,184,.05) 0 1px, transparent 1px 14px),
    linear-gradient(180deg, #101828, #0d1428);
  color: var(--muted); font-size: 11.5px; line-height: 1.5;
}
.nav-tile-title { font-size: 12px; font-weight: 650; color: #c7ddff; display: flex; align-items: center; gap: 6px; }
.nav-tile-title::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 8px var(--ok); animation: pulse-dot 2.4s ease-in-out infinite;
}
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.nav-tile-row { display: flex; justify-content: space-between; gap: 8px; }
.nav-tile-row b { color: var(--text); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .nav-tile-title::before { animation: none; } }

main { padding: 16px 24px 40px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
@media (max-width: 1000px) { .grid.two { grid-template-columns: 1fr; } }

.card {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
}
.mini-card { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.mini-card h4 { margin: 0 0 6px; font-size: 14px; }
.mini-card p { margin: 3px 0; font-size: 12px; color: var(--muted); }

.dropzone {
  border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center;
  cursor: pointer; transition: border-color .2s, background .2s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: rgba(59,130,246,.08); }
.preview { max-width: 100%; max-height: 220px; border-radius: 10px; margin-top: 12px; }

.form-row { display: flex; gap: 10px; align-items: flex-end; margin: 12px 0; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 140px; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; min-width: 0; }
.field span { font-size: 12px; color: var(--muted); }

input, select, textarea {
  background: #0d1428; border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 8px 10px; font: inherit; width: 100%;
}
input[type=file] { padding: 6px; }
textarea { resize: vertical; }
select[multiple] { height: auto; }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.checkbox input { width: auto; }

.btn {
  background: var(--card-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 14px; cursor: pointer; font: inherit; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); }
.btn.primary { background: var(--primary-2); border-color: var(--primary); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn.danger { background: #7f1d1d; border-color: #b91c1c; color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }

.progress-wrap { margin-top: 14px; }
.progress { height: 8px; background: #0d1428; border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), #22d3ee); transition: width .3s; }

.log, .feed, .list { list-style: none; margin: 0; padding: 0; max-height: 380px; overflow: auto; }

/* 列表项：热点榜单/历史文案用（左侧勾选框 + 右侧多行文本，长文本要能换行不撑破卡片） */
.list-item { display: flex; gap: 8px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: none; }
.list-item > span { flex: 1; min-width: 0; word-break: break-word; }
.list-item input[type="checkbox"] { margin-top: 4px; }
.list-item .pill { margin-right: 4px; }
.log li, .feed li, .list li {
  padding: 7px 10px; border-bottom: 1px solid var(--line); font-size: 12.5px;
}
.log li:last-child, .feed li:last-child, .list li:last-child { border-bottom: none; }
.log time, .feed time { color: var(--muted); margin-right: 8px; font-variant-numeric: tabular-nums; }
.feed .q { color: #c7ddff; }
.feed .a { color: #b9f6ca; }
.feed .blocked { color: #fecaca; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; background: rgba(255,255,255,.02); position: sticky; top: 0; }
tr:hover td { background: rgba(255,255,255,.02); }

.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  background: var(--card-2); border: 1px solid var(--line); color: var(--muted);
}
.pill.on { background: var(--primary-2); color: #fff; border-color: var(--primary); }
.pill.danger { background: #7f1d1d; color: #fff; border-color: #b91c1c; }
.pill.warn { background: #78350f; color: #ffe0a3; border-color: #b45309; }
.pill.ok { background: #14532d; color: #bbf7d0; border-color: #15803d; }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.kpi { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.kpi b { display: block; font-size: 20px; }
.kpi span { font-size: 12px; color: var(--muted); }

.detail { font-size: 13px; }
.detail dl { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 0; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; }
.detail section { margin-bottom: 16px; }
.detail h4 { margin: 14px 0 6px; font-size: 13px; color: #c7ddff; }

.shot-table td:first-child { white-space: nowrap; }
.bar { height: 6px; border-radius: 999px; background: #0d1428; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #22d3ee); }

.img-frame { background: #0d1428; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 8px; }
.img-frame img, .img-frame object { width: 100%; display: block; }

.footer { padding: 14px 24px 30px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }
code { background: #0d1428; padding: 1px 5px; border-radius: 5px; font-size: 12px; }
a { color: #7dd3fc; }
