* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f0f3f8; color: #1f2733; font-size: 14px;
}
.layout { display: flex; min-height: 100vh; }

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: 230px; background: linear-gradient(180deg, #1b2a4a, #16213a);
  color: #fff; display: flex; flex-direction: column; position: sticky;
  top: 0; height: 100vh; flex-shrink: 0;
}
.logo { display: flex; gap: 10px; align-items: center; padding: 20px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.logo-icon {
  width: 40px; height: 40px; border-radius: 10px; background: #3370ff;
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700;
}
.logo-title { font-size: 16px; font-weight: 600; }
.logo-sub { font-size: 11px; color: rgba(255,255,255,.5); margin-top: 2px; }
.sidebar nav { flex: 1; padding: 14px 10px; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  padding: 11px 14px; border-radius: 8px; cursor: pointer; color: rgba(255,255,255,.72);
  transition: all .15s; user-select: none;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: #3370ff; color: #fff; }
.sidebar-footer {
  padding: 12px 18px; font-size: 12px; color: rgba(255,255,255,.55);
  border-top: 1px solid rgba(255,255,255,.08); line-height: 1.6;
}

/* ---------- 主区域 ---------- */
.main { flex: 1; padding: 28px 36px; max-width: 1180px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }
h1 { font-size: 22px; margin-bottom: 6px; }
.page-desc { color: #6b7686; margin-bottom: 20px; line-height: 1.6; }
.card {
  background: #fff; border-radius: 12px; padding: 20px 24px; margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(20,30,60,.06);
}
.card h2 { font-size: 15px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #4a5464; }
input, select, textarea {
  border: 1px solid #d6dce6; border-radius: 8px; padding: 9px 12px; font-size: 14px;
  outline: none; background: #fff; transition: border .15s; font-family: inherit;
}
input:focus, select:focus, textarea:focus { border-color: #3370ff; box-shadow: 0 0 0 3px rgba(51,112,255,.12); }
textarea { width: 100%; resize: vertical; line-height: 1.7; }
.check-line { display: flex; gap: 8px; align-items: center; margin-top: 14px; color: #4a5464; cursor: pointer; }
.check-group { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; }
.check-group .check-line { margin-top: 4px; }

.btn {
  border: none; border-radius: 8px; padding: 10px 22px; font-size: 14px; cursor: pointer;
  transition: all .15s; font-family: inherit;
}
.btn.primary { background: #3370ff; color: #fff; }
.btn.primary:hover { background: #245bdb; }
.btn.success { background: #18a058; color: #fff; }
.btn.success:hover { background: #0e8547; }
.btn.ghost { background: #fff; border: 1px solid #d6dce6; color: #4a5464; }
.btn.ghost:hover { border-color: #3370ff; color: #3370ff; }
.btn.danger-link { background: none; color: #d03050; padding: 4px 8px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 12px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.muted { color: #98a2b3; font-size: 13px; }

.sop-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.chip {
  background: #eef3ff; color: #3370ff; border-radius: 20px; padding: 5px 12px; font-size: 12px;
}

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; padding: 10px 12px; background: #f6f8fb; color: #6b7686;
  font-weight: 500; white-space: nowrap; border-bottom: 1px solid #e8ecf2;
}
.tbl td { padding: 10px 12px; border-bottom: 1px solid #f0f3f8; vertical-align: top; }
.tbl tr:hover td { background: #fafbfd; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; }
.badge.ok { background: #e6f7ee; color: #18a058; }
.badge.fail { background: #fdecef; color: #d03050; }
.badge.mock { background: #fff4e0; color: #d48806; }

.stat-row { display: flex; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.stat-box { background: #f6f8fb; border-radius: 10px; padding: 12px 22px; text-align: center; min-width: 100px; }
.stat-box .num { font-size: 24px; font-weight: 700; }
.stat-box .lbl { font-size: 12px; color: #6b7686; margin-top: 2px; }
.stat-box.ok .num { color: #18a058; }
.stat-box.fail .num { color: #d03050; }

/* ---------- 文案库 ---------- */
.copy-list { list-style: none; }
.copy-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 9px 4px; border-bottom: 1px dashed #eef1f6; line-height: 1.5;
}
.copy-list li:last-child { border-bottom: none; }
.copy-text { flex: 1; }
.copy-meta { color: #98a2b3; font-size: 12px; white-space: nowrap; }

/* ---------- 素材库 ---------- */
.upload-zone {
  border: 2px dashed #c4cdda; border-radius: 12px; padding: 36px; text-align: center;
  cursor: pointer; transition: all .15s; color: #6b7686;
}
.upload-zone:hover, .upload-zone.dragover { border-color: #3370ff; background: #f5f8ff; color: #3370ff; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.asset-card { border: 1px solid #e8ecf2; border-radius: 10px; overflow: hidden; background: #fff; }
.asset-card img { width: 100%; aspect-ratio: 1140/640; object-fit: cover; display: block; background: #f0f3f8; }
.asset-card .meta { padding: 8px 12px; font-size: 12px; color: #6b7686; display: flex; justify-content: space-between; align-items: center; }

/* ---------- 定向模版 ---------- */
.tpl-list { display: flex; flex-direction: column; gap: 10px; }
.tpl-card {
  border: 1px solid #e8ecf2; border-radius: 10px; padding: 14px 18px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
}
.tpl-card .name { font-weight: 600; margin-bottom: 4px; }
.tpl-card .dims { font-size: 12px; color: #6b7686; display: flex; gap: 10px; flex-wrap: wrap; }
.tpl-card .dims span { background: #f6f8fb; padding: 2px 8px; border-radius: 6px; }

/* ---------- API 设置 ---------- */
.code-block {
  background: #10141c; color: #c8e0b8; border-radius: 8px; padding: 14px;
  font-size: 12px; overflow-x: auto; margin-top: 14px; line-height: 1.6; white-space: pre-wrap;
}
.notice {
  margin-top: 16px; background: #fff8e6; border: 1px solid #ffe1a8; color: #8a6d3b;
  padding: 12px 16px; border-radius: 8px; font-size: 13px; line-height: 1.7;
}
.notice code { background: #fdeec7; padding: 1px 6px; border-radius: 4px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%) translateY(-80px);
  background: #1f2733; color: #fff; padding: 11px 24px; border-radius: 8px;
  font-size: 14px; transition: transform .25s; z-index: 99; max-width: 70vw;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err { background: #d03050; }

/* ---------- v1.5 下拉多选 ---------- */
.msel { position: relative; margin-top: 8px; }
.msel-btn {
  width: 100%; text-align: left; background: #fff; border: 1px solid #d8dfea;
  border-radius: 8px; padding: 9px 12px; font-size: 14px; color: #1f2733; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.msel-btn:after { content: "▾"; float: right; color: #8a94a6; margin-left: 8px; }
.msel-panel {
  position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; right: 0;
  background: #fff; border: 1px solid #e3e8f0; border-radius: 8px;
  box-shadow: 0 10px 28px rgba(31,39,51,.14); padding: 8px;
}
.msel-panel input {
  width: 100%; border: 1px solid #e3e8f0; border-radius: 6px; padding: 7px 10px;
  font-size: 13px; margin-bottom: 8px; box-sizing: border-box;
}
.msel-list { flex-direction: column; gap: 4px; max-height: 240px; overflow: auto; margin-top: 0 !important; }
.msel-list .check-line { margin-top: 0; padding: 4px 6px; border-radius: 6px; }
.msel-list .check-line:hover { background: #f2f6ff; }

/* ---------- v1.5 封面缩略图 ---------- */
.cover-thumbs { display: flex; gap: 6px; }
.cover-thumbs img { width: 62px; height: 35px; object-fit: cover; border-radius: 4px; border: 1px solid #e3e8f0; }

/* ---------- v1.5 提交进度遮罩 ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(15,20,28,.55); z-index: 98;
  display: flex; align-items: center; justify-content: center;
}
.overlay-box {
  background: #fff; border-radius: 12px; padding: 28px 36px; width: 420px; max-width: 86vw;
  text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.overlay-text { font-size: 15px; font-weight: 600; color: #1f2733; margin-bottom: 18px; }
.progress-bar { height: 10px; background: #edf1f7; border-radius: 6px; overflow: hidden; }
.progress-fill {
  height: 100%; width: 0; background: linear-gradient(90deg, #3370ff, #6ea8ff);
  border-radius: 6px; transition: width .3s;
}
.overlay-meta { margin-top: 10px; font-size: 13px; color: #6b7686; }
