:root {
  --pink: #ff4d6d;
  --pink-strong: #f5335c;
  --pink-soft: #ffe9ef;
  --pink-line: #ffd0dc;
  --purple: #8b74ff;
  --purple-soft: #f1edff;
  --ink: #1f1f27;
  --ink-2: #55555f;
  --ink-3: #8e8e99;
  --line: #ececf1;
  --bg: #ffffff;
  --bg-soft: #fafafb;
  --card: #ffffff;
  --shadow: 0 2px 10px rgba(31, 31, 39, 0.05);
  --shadow-lg: 0 18px 50px rgba(31, 31, 39, 0.14);
  --radius: 14px;
  --sidebar-w: 216px;
}

html[data-theme='dark'] {
  --ink: #eef0f4;
  --ink-2: #b6b9c4;
  --ink-3: #868a97;
  --line: #2a2b34;
  --bg: #14151a;
  --bg-soft: #191a20;
  --card: #1c1d24;
  --pink-soft: #3a1f2a;
  --pink-line: #53303d;
  --purple-soft: #241f3d;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'PingFang SC', 'HarmonyOS Sans SC', 'Noto Sans SC', 'Microsoft YaHei', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }

.app { display: flex; min-height: 100vh; }

/* ================= 侧边栏 ================= */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--card);
  transition: width 0.22s ease, flex-basis 0.22s ease;
  z-index: 20;
}
.app.collapsed .sidebar { width: 76px; flex-basis: 76px; }
.app.collapsed .ni-label,
.app.collapsed .brand-text { display: none; }
.app.collapsed .nav-item { justify-content: center; padding-inline: 0; }
.app.collapsed .brand { justify-content: center; padding-left: 0; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid var(--line);
}
.brand-logo {
  width: 40px; height: 40px;
  border-radius: 13px;
  background: linear-gradient(140deg, #ff5f7e, #f5335c);
  display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(245, 51, 92, 0.3);
  flex: 0 0 auto;
}
.brand-logo.lg { width: 44px; height: 44px; border-radius: 14px; }
.brand-text { font-size: 19px; margin: 0; letter-spacing: 0.5px; font-weight: 700; color: var(--pink); }

.nav { padding: 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px;
  border-radius: 11px;
  color: var(--ink-2);
  font-size: 14px;
  position: relative;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav-item:hover { background: var(--bg-soft); color: var(--ink); }
.nav-item.active {
  background: linear-gradient(90deg, var(--pink-soft), rgba(255, 233, 239, 0.35));
  color: var(--pink-strong);
  font-weight: 600;
}
html[data-theme='dark'] .nav-item.active { background: var(--pink-soft); }
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0;
  background: var(--pink);
}
.ni-icon { display: grid; place-items: center; width: 20px; flex: 0 0 20px; }

.sidebar-foot { padding: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.foot-row { display: flex; gap: 8px; justify-content: center; }
.icon-btn {
  width: 36px; height: 34px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  display: grid; place-items: center;
}
.icon-btn:hover { color: var(--ink); border-color: var(--ink-3); }

/* ================= 主区 ================= */
.main { flex: 1; min-width: 0; padding: 34px 40px 60px; }

/* 创作中心顶部 */
.hero { max-width: 1080px; margin: 0 auto; text-align: center; }
.pill-tag {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--purple-soft); color: #7c63f5;
  padding: 7px 15px; border-radius: 999px; font-size: 13px; font-weight: 500;
}
.hero h1 {
  font-size: 46px;
  margin: 18px 0 10px;
  letter-spacing: 1px;
  background: linear-gradient(100deg, #ff9db4 0%, #c7a6ff 55%, #a9b8ff 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}
.hero-sub { color: var(--ink-3); font-size: 13.5px; margin: 0 0 26px; display: inline-flex; align-items: center; gap: 6px; }

/* 输入卡片 */
.composer {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 18px 18px 14px;
  text-align: left;
  position: relative;
}
.composer-top { position: relative; }
.link-row { display: flex; gap: 10px; }
.link-row input {
  flex: 1; border: 1px solid var(--pink-line); border-radius: 11px;
  padding: 13px 15px; font-size: 13.5px; outline: none; background: var(--bg-soft); color: var(--ink);
}
.link-row input:focus { border-color: var(--pink); background: var(--card); }
.btn-parse {
  border: 0; border-radius: 11px; padding: 0 26px; font-size: 14px; font-weight: 600;
  background: linear-gradient(160deg, #ff7995, #f5335c); color: #fff;
}
.btn-parse:disabled { background: #f3c9d3; cursor: not-allowed; }
html[data-theme='dark'] .btn-parse:disabled { background: #4a2a34; }

.topic-area { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 14px; }
.topic-area textarea {
  width: 100%; border: 0; outline: none; resize: vertical; min-height: 92px;
  font-size: 14px; line-height: 1.75; background: transparent; color: var(--ink);
}
.topic-area textarea::placeholder { color: var(--ink-3); }

.composer-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  border-radius: 9px; padding: 7px 11px; font-size: 12.5px;
}
.chip:hover { border-color: var(--pink-line); color: var(--pink-strong); }
.chip.accent { border-color: var(--pink-line); color: var(--pink-strong); background: var(--pink-soft); }
.spacer { flex: 1; }
.btn-go {
  border: 0; border-radius: 11px; padding: 11px 20px; font-size: 14px; font-weight: 600;
  background: linear-gradient(160deg, #ff5f7e, #f5335c); color: #fff;
  display: inline-flex; align-items: center; gap: 7px;
  box-shadow: 0 6px 16px rgba(245, 51, 92, 0.22);
}
.btn-go:disabled { background: #f0cfd7; color: #fff; box-shadow: none; cursor: not-allowed; }
html[data-theme='dark'] .btn-go:disabled { background: #46262f; color: #8d7c84; }

/* 生成中 */
.gen-state { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.gen-head { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-2); }
.spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--pink-line); border-top-color: var(--pink);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.gen-stream {
  margin-top: 12px; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; font-size: 12px; line-height: 1.7;
  color: var(--ink-3); max-height: 150px; overflow: hidden; white-space: pre-wrap;
  word-break: break-all; font-family: ui-monospace, Menlo, monospace;
  mask-image: linear-gradient(to bottom, transparent, #000 30%);
}
.progress-bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 12px; }
.progress-bar i { display: block; height: 100%; width: 30%; border-radius: 4px; background: linear-gradient(90deg, #ff9db4, #f5335c); transition: width 0.4s; }

/* 结果 */
.results { max-width: 1080px; margin: 34px auto 0; }
.results:empty { display: none; margin: 0; }
.results-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.results-head h2 { font-size: 20px; margin: 0; }
.results-head .meta { font-size: 12.5px; color: var(--ink-3); }

.note-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 20px; margin-bottom: 22px; box-shadow: var(--shadow);
}
.note-head { display: flex; align-items: flex-start; gap: 12px; }
.note-title { font-size: 18px; font-weight: 700; margin: 0 0 6px; line-height: 1.5; }
.note-hook { display: inline-block; font-size: 12px; color: #7c63f5; background: var(--purple-soft); padding: 3px 9px; border-radius: 6px; }
.note-body {
  margin: 14px 0 0; font-size: 14px; line-height: 1.9; color: var(--ink-2);
  white-space: pre-wrap; background: var(--bg-soft); border-radius: 12px; padding: 14px 16px;
  border: 1px solid var(--line);
}
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.tag { font-size: 12px; color: var(--pink-strong); background: var(--pink-soft); padding: 4px 10px; border-radius: 999px; }

.img-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 14px; margin-top: 18px; }
.img-cell { position: relative; border-radius: 13px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-soft); }
.img-cell .ph { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; }
.img-cell .cap { padding: 9px 10px 11px; font-size: 12px; color: var(--ink-2); line-height: 1.55; }
.img-cell .cap b { display: block; color: var(--ink); font-size: 12.5px; margin-bottom: 3px; }
.img-cell .cap small { color: var(--ink-3); font-size: 11px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.img-cell .badge {
  position: absolute; left: 8px; top: 8px; font-size: 10px; padding: 3px 8px; border-radius: 20px;
  font-weight: 600; background: rgba(255, 255, 255, 0.9); color: var(--ink-2);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
}
.img-cell .badge.tone-run { background: rgba(122, 92, 196, .14); color: #6a4bc4; }
.img-cell .badge.tone-ok { background: rgba(76, 175, 80, .15); color: #2e7d32; }
.img-cell .badge.tone-err { background: rgba(229, 115, 115, .16); color: #c62828; }
.img-cell .badge.tone-idle { background: rgba(255, 255, 255, .9); color: var(--ink-3); }
.note-foot { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

/* ================= 页头（内页） ================= */
.page-head { max-width: 1080px; margin: 0 auto 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 27px; margin: 0 0 6px; }
.page-head p { margin: 0; color: var(--ink-3); font-size: 13px; }
.search-box { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 11px; padding: 9px 13px; background: var(--card); min-width: 260px; }
.search-box input { border: 0; outline: none; background: transparent; font-size: 13px; flex: 1; color: var(--ink); }

.work-grid { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.work-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.work-card .cover { aspect-ratio: 3/4; position: relative; }
.work-card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.work-card .info { padding: 11px 13px 13px; }
.work-card .info h3 { font-size: 13.5px; margin: 0 0 6px; line-height: 1.5; }
.work-card .info p { margin: 0; font-size: 11.5px; color: var(--ink-3); }
.empty { text-align: center; padding: 70px 0; color: var(--ink-3); }
.empty .ic { font-size: 44px; margin-bottom: 12px; opacity: 0.6; }
.empty h3 { margin: 0 0 6px; color: var(--ink-2); font-size: 16px; }

.notice {
  max-width: 1080px; margin: 0 auto 18px; display: flex; align-items: center; gap: 9px;
  background: var(--pink-soft); border: 1px solid var(--pink-line); color: var(--pink-strong);
  border-radius: 12px; padding: 11px 15px; font-size: 12.5px;
}

/* ================= 弹窗 ================= */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20, 20, 26, 0.45);
  display: grid; place-items: center; z-index: 100;
  backdrop-filter: blur(3px);
  animation: fade 0.16s ease;
}
.modal-mask[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  background: var(--card); border-radius: 20px; padding: 26px;
  width: min(520px, calc(100vw - 32px));
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: pop 0.2s ease;
  max-height: 88vh; overflow-y: auto;
}
@keyframes pop { from { transform: translateY(8px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-x { position: absolute; right: 16px; top: 14px; border: 0; background: none; font-size: 15px; color: var(--ink-3); }
.modal-x:hover { color: var(--ink); }

/* 创作设置 */
.sheet h3 { margin: 0 0 4px; font-size: 17px; }
.sheet .sub { margin: 0 0 18px; font-size: 12.5px; color: var(--ink-3); }
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { border: 1px solid var(--line); border-radius: 9px; padding: 8px 13px; font-size: 12.5px; background: var(--card); color: var(--ink-2); }
.opt.on { border-color: var(--pink); color: var(--pink-strong); background: var(--pink-soft); font-weight: 600; }
.sheet-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* 素材抽屉 */
.material-list { display: flex; flex-direction: column; gap: 8px; }
.material-item { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: 12.5px; color: var(--ink-2); }
.material-item .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pink); }

/* toast */
.toast-wrap { position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast {
  background: rgba(31, 31, 39, 0.92); color: #fff; font-size: 13px;
  padding: 10px 18px; border-radius: 10px; box-shadow: var(--shadow-lg);
  animation: toastIn 0.2s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 移动端 */
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); }
  .app.mobile-open .sidebar { transform: none; }
  .main { padding: 20px 16px 50px; }
  .hero h1 { font-size: 23px; line-height: 1.35; letter-spacing: -0.3px; }
  .hero-sub { font-size: 12.5px; line-height: 1.65; margin-bottom: 20px; }
  .hero { padding-top: 6px; }
  .pill-tag { font-size: 11.5px; margin-bottom: 14px; }
  .link-row { flex-direction: column; }
  .btn-parse { padding: 12px 0; }
}

/* emoji 图标不被压扁 */
.chip .ic, .chip.ic-only, .ti, .empty .ic { font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
.chip .ic { font-size: 13px; line-height: 1; display: inline-block; }
.chip.ic-only { padding: 7px 10px; }

/* 出图交互 */
.ph-wrap { position: relative; }
.ph-wrap .ph { transition: filter 0.2s; }
.img-gen {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  border: 0; border-radius: 999px; padding: 7px 14px; font-size: 12px; font-weight: 600;
  background: rgba(255, 255, 255, 0.95); color: var(--pink-strong);
  box-shadow: 0 4px 14px rgba(31, 31, 39, 0.18);
  white-space: nowrap; opacity: 0.92; transition: opacity 0.16s, transform 0.16s;
}
.img-cell:hover .img-gen { opacity: 1; transform: translateX(-50%) translateY(-2px); box-shadow: 0 6px 18px rgba(245, 51, 92, 0.3); }
.img-gen:disabled { opacity: 1; transform: translateX(-50%); color: var(--ink-3); cursor: default; }
.img-gen.again { opacity: 0.92; }
.img-busy {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 8px;
  align-items: center; justify-content: center; font-size: 12px; color: var(--ink-2);
  background: rgba(255, 255, 255, 0.78); backdrop-filter: blur(2px);
}
html[data-theme='dark'] .img-busy { background: rgba(20, 21, 26, 0.78); }
.img-busy.err { color: #e8455f; font-weight: 600; padding: 0 12px; text-align: center; }

/* 内联图标对齐 */
.hero-sub .ico, .chip .ico { display: inline-flex; align-items: center; margin-right: 5px; color: currentColor; }
.hero-sub .ico { color: #7c63f5; }
.note-foot .chip svg { vertical-align: -2px; margin-right: 4px; }
.img-gen svg { vertical-align: -2px; margin-right: 3px; }

/* ===== 解析结果卡片 ===== */
.parsed-card {
  margin-top: 14px; border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; background: var(--bg-soft); text-align: left;
}
.parsed-card.loading { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-2); }
.parsed-card.ok { border-color: var(--pink-line); background: linear-gradient(180deg, var(--pink-soft), transparent 70%); }
.parsed-card.fail { border-color: #ffd8a8; background: #fffaf2; }
html[data-theme='dark'] .parsed-card.fail { background: #2a2318; border-color: #6b5636; }
.parsed-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); margin-bottom: 8px; }
.parsed-head b { color: var(--ink); font-size: 13px; }
.dot-ok, .dot-bad { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; }
.dot-ok { background: #25a06c; box-shadow: 0 0 0 3px rgba(37,160,108,.16); }
.dot-bad { background: #f08a24; box-shadow: 0 0 0 3px rgba(240,138,36,.16); }
.parsed-badge { font-size: 11px; padding: 2px 7px; border-radius: 5px; background: var(--card); color: var(--pink-strong); border: 1px solid var(--pink-line); }
.parsed-stat { font-size: 11.5px; color: var(--ink-3); }
.parsed-x { margin-left: auto; border: 0; background: none; color: var(--ink-3); font-size: 13px; }
.parsed-x:hover { color: var(--ink); }
.parsed-title { font-size: 15px; font-weight: 700; line-height: 1.5; margin-bottom: 5px; }
.parsed-sub { font-size: 12px; color: var(--ink-3); margin-bottom: 8px; }
.parsed-text { font-size: 13px; line-height: 1.8; color: var(--ink-2); white-space: pre-wrap; max-height: 120px; overflow: hidden; position: relative; }
.parsed-text::after { content: ''; position: absolute; inset: auto 0 0; height: 32px; background: linear-gradient(transparent, var(--bg-soft)); }
.parsed-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; margin: 10px 0 2px; }
.parsed-imgs img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); }
.parsed-msg { font-size: 12.5px; color: var(--ink-2); line-height: 1.7; margin: 6px 0 10px; }
.parsed-warn { font-size: 11.5px; color: #b26a00; background: rgba(255,193,94,.16); border-radius: 8px; padding: 7px 10px; margin-top: 8px; line-height: 1.6; }
.parsed-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* 空状态与提示图标 */
.empty .ic svg { width: 34px; height: 34px; opacity: 0.45; }
.search-box .ico, .notice .ico, .note-hook .ico { display: inline-flex; align-items: center; margin-right: 5px; }
.notice .ico { vertical-align: -2px; }
.note-hook .ico { color: #f0a020; }

/* 移动端导航开关 */
.m-menu { display: none; }
@media (max-width: 900px) {
  .m-menu {
    display: inline-grid; place-items: center;
    position: fixed; left: 14px; top: 12px; z-index: 60;
    width: 38px; height: 38px; border-radius: 11px;
    background: var(--card); border: 1px solid var(--line);
    color: var(--ink); box-shadow: var(--shadow);
  }
  .m-mask {
    position: fixed; inset: 0; z-index: 45;
    background: rgba(20, 20, 26, 0.38);
  }
  .m-mask[hidden] { display: none; }
  .app.mobile-open .sidebar { z-index: 55; box-shadow: 0 0 40px rgba(0,0,0,.18); }
  .main { padding-top: 62px; }
}
.app.mobile-open .m-menu { display: none; }

/* 主按钮（此前缺失定义，导致弹窗按钮为浏览器默认样式） */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 11px; padding: 10px 22px;
  font-size: 13.5px; font-weight: 600; color: #fff;
  background: linear-gradient(160deg, #ff6b86, #f5335c);
  box-shadow: 0 6px 16px rgba(245, 51, 92, 0.24);
  cursor: pointer; transition: filter 0.15s, transform 0.15s;
}
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-primary:active { transform: none; }
.btn-primary.ghost {
  background: var(--bg-soft); color: var(--ink-2);
  border: 1px solid var(--line); box-shadow: none;
}
.btn-primary.w100 { width: 100%; }

/* ================= 配图来源 4 选 1 ================= */
.img-swap {
  position: absolute; right: 8px; top: 8px;
  width: 28px; height: 28px; border-radius: 50%;
  border: 0; background: rgba(255, 255, 255, 0.9); color: var(--ink-2);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(31, 31, 39, 0.16);
  cursor: pointer; opacity: 0.9; transition: opacity 0.16s, transform 0.16s;
}
html[data-theme='dark'] .img-swap { background: rgba(30, 31, 38, 0.9); color: var(--ink-2); }
.img-cell:hover .img-swap { opacity: 1; transform: scale(1.06); }

.src-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.src-tab {
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px;
  font-size: 12.5px; background: var(--card); color: var(--ink-2); cursor: pointer;
}
.src-tab.on { border-color: var(--pink); color: var(--pink-strong); background: var(--pink-soft); font-weight: 600; }

.src-panel { min-height: 120px; }
.src-panel-ai { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; padding: 8px 0; }
.src-panel-ai p { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.7; }

.src-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.src-pick {
  position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  padding: 0; background: var(--bg-soft); cursor: pointer; transition: border-color 0.15s;
}
.src-pick img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; }
.src-pick span {
  position: absolute; left: 6px; bottom: 6px; font-size: 10.5px; color: #fff;
  background: rgba(31, 31, 39, 0.62); padding: 2px 7px; border-radius: 999px;
}
.src-pick:hover { border-color: var(--pink); }

.src-empty { padding: 22px 10px; text-align: center; font-size: 12.5px; color: var(--ink-3); grid-column: 1 / -1; }

.src-prod-list { display: flex; flex-direction: column; gap: 14px; }
.src-prod-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.src-prod-head b { font-size: 13.5px; color: var(--ink); }
.src-prod-head span { font-size: 11.5px; color: var(--ink-3); }

.src-search-bar { display: flex; gap: 8px; margin-bottom: 14px; }
.src-search-bar input {
  flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 10px 13px;
  font-size: 13px; background: var(--bg-soft); color: var(--ink); outline: none;
}

/* ================= 产品档案 ================= */
.prod-admin-list { display: flex; flex-direction: column; gap: 10px; max-height: 46vh; overflow-y: auto; }
.prod-admin-item {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
.prod-admin-cover {
  width: 52px; height: 52px; border-radius: 9px; overflow: hidden; flex-shrink: 0;
  background: var(--bg-soft); border: 1px solid var(--line);
}
.prod-admin-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prod-admin-info { flex: 1; min-width: 0; }
.prod-admin-info b { font-size: 13px; color: var(--ink); display: block; margin-bottom: 4px; }
.prod-admin-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 4px; }
.prod-admin-info small { font-size: 11px; color: var(--ink-3); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.prod-upload {
  border: 1.5px dashed var(--line); border-radius: 12px; padding: 22px;
  text-align: center; font-size: 13px; color: var(--ink-3); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: border-color 0.15s, color 0.15s;
}
.prod-upload:hover { border-color: var(--pink); color: var(--pink-strong); }
.prod-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.prod-thumbs img { width: 56px; height: 56px; border-radius: 9px; object-fit: cover; border: 1px solid var(--line); }

@media (max-width: 520px) {
  .src-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ================= 历史批量操作 ================= */
.work-card { position: relative; }
.work-check {
  position: absolute; left: 10px; top: 10px; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.work-check input { position: absolute; opacity: 0; pointer-events: none; }
.work-check span {
  width: 22px; height: 22px; border-radius: 7px;
  background: rgba(255, 255, 255, 0.92); border: 2px solid var(--line);
  box-shadow: 0 2px 8px rgba(31, 31, 39, 0.16); transition: all 0.15s;
}
html[data-theme='dark'] .work-check span { background: rgba(30, 31, 38, 0.92); }
.work-check input:checked + span {
  background: var(--pink); border-color: var(--pink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
  background-size: 14px; background-position: center; background-repeat: no-repeat;
}

/* ================= 创作设置对齐红鸦 ================= */
textarea.viral-prompt {
  min-height: 300px !important;
  font-size: 12.5px !important;
  line-height: 1.75 !important;
}
/* 爆款复刻·首页紧凑提示区：一句说明 + 可选补充要求小框（替代整屏模板文字） */
.viral-hint { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); padding: 6px 2px 8px; }
.viral-hint .chip.mini { flex: none; font-size: 11px; padding: 3px 10px; }
textarea.viral-extra { min-height: 44px !important; height: 44px; font-size: 12.5px; line-height: 1.6; resize: vertical; }
.viral-prompt-view { white-space: pre-wrap; word-break: break-word; font-size: 12.5px; line-height: 1.8; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; max-height: 55vh; overflow: auto; margin: 0; font-family: inherit; color: var(--ink); }
.setting-box { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--bg-soft); }
.setting-box-row { display: flex; gap: 16px; }
.setting-box-col { flex: 1; min-width: 0; }
.setting-count-col { flex: 0 0 150px; }
.setting-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 9px; }
.setting-note { font-weight: 400; color: var(--ink-3); font-size: 11.5px; margin-left: 4px; }
.setting-hint { margin: 8px 0 0; font-size: 11.5px; color: var(--ink-3); line-height: 1.55; }
.seg2 { display: flex; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 4px; }
.seg2-item {
  flex: 1; border: 0; border-radius: 8px; padding: 9px 6px; font-size: 12.5px;
  background: transparent; color: var(--ink-2); cursor: pointer; display: flex;
  align-items: center; justify-content: center; gap: 5px; white-space: nowrap;
}
.seg2-item.on { background: var(--pink-soft); color: var(--pink-strong); font-weight: 600; }
.seg2-ic { display: inline-flex; }
.count-stepper { display: flex; align-items: center; gap: 4px; margin-bottom: 10px; }
.count-stepper button {
  width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink); font-size: 15px; cursor: pointer;
}
.count-stepper button:hover { border-color: var(--pink); color: var(--pink-strong); }
.count-stepper span { min-width: 28px; text-align: center; font-size: 15px; font-weight: 600; }
.count-stepper em { font-style: normal; font-size: 12px; color: var(--ink-3); }
.switch-line { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); cursor: pointer; }
.switch-line input { position: absolute; opacity: 0; pointer-events: none; }
.switch {
  width: 30px; height: 17px; border-radius: 999px; background: var(--line);
  position: relative; transition: background 0.18s;
}
.switch::after {
  content: ''; position: absolute; left: 2px; top: 2px; width: 13px; height: 13px;
  border-radius: 50%; background: #fff; transition: transform 0.18s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch-line input:checked + .switch { background: var(--pink); }
.switch-line input:checked + .switch::after { transform: translateX(13px); }

.style-cards { display: flex; gap: 10px; }
.style-card {
  flex: 1; text-align: left; border: 1.5px solid var(--line); border-radius: 13px;
  padding: 14px; background: var(--card); cursor: pointer; position: relative;
  display: flex; flex-direction: column; gap: 5px; transition: border-color 0.15s, background 0.15s;
}
.style-card:hover { border-color: var(--pink-line); }
.style-card.on { border-color: var(--pink); background: var(--pink-soft); }
.style-card b { font-size: 13.5px; color: var(--ink); }
.style-card small { font-size: 11.5px; color: var(--ink-3); line-height: 1.5; }
.style-card .radio {
  position: absolute; right: 12px; top: 12px; width: 16px; height: 16px;
  border-radius: 50%; border: 1.5px solid var(--line);
}
.style-card.on .radio { border-color: var(--pink); box-shadow: inset 0 0 0 4px var(--card); background: var(--pink); }
.preset-pick { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.adv-details { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.adv-details summary { font-size: 12.5px; color: var(--ink-3); cursor: pointer; }
.setting-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line);
}
.setting-foot > span { font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.setting-foot small { font-size: 11px; color: var(--ink-3); }

@media (max-width: 520px) {
  .setting-box-row { flex-direction: column; }
  .setting-count-col { flex: 1; }
  .style-cards { flex-direction: column; }
}

/* ================= 精选案例 ================= */
.cases { max-width: 1080px; margin: 30px auto 10px; }
.cases-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; justify-content: center; }
.cases-head h2 { margin: 0; font-size: 18px; }
.cases-head .meta { color: var(--ink-3); font-size: 12.5px; }
.cases-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; justify-content: center; }
.case-tab {
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  padding: 6px 14px; border-radius: 20px; font-size: 13px; transition: all 0.15s;
}
.case-tab.on { background: var(--pink); border-color: var(--pink); color: #fff; }
.cases-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.case-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: box-shadow 0.15s, transform 0.15s;
  width: 190px; flex: 0 0 190px;
}
.case-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.case-cover { position: relative; cursor: pointer; aspect-ratio: 3/4; background: var(--bg-soft); overflow: hidden; }
.case-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.case-pages {
  position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,0.55); color: #fff;
  font-size: 11px; padding: 3px 8px; border-radius: 10px;
}
.case-info { padding: 10px 12px 4px; }
.case-cat { display: inline-block; font-size: 11px; color: var(--pink-strong); background: var(--pink-soft); border-radius: 10px; padding: 2px 8px; margin-bottom: 6px; }
.case-title {
  margin: 0; font-size: 13.5px; line-height: 1.4; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.case-actions { display: flex; gap: 8px; padding: 8px 12px 12px; margin-top: auto; }
.case-actions .chip { flex: 1; justify-content: center; font-size: 12.5px; padding: 7px 10px; }

/* 案例详情弹层 */
.case-cert {
  background: var(--purple-soft); color: var(--purple); font-size: 11.5px;
  border-radius: 10px; padding: 8px 10px; line-height: 1.5; margin: 6px 0 10px;
}
.case-body {
  white-space: pre-wrap; font-size: 13.5px; line-height: 1.7; color: var(--ink-2);
  max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 12px;
  margin-bottom: 10px;
}
.case-imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.case-imgs img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 8px; background: var(--bg-soft); }
.case-actions { display: flex; gap: 10px; margin-top: 14px; }
.case-actions .btn-primary { flex: 1; justify-content: center; }

/* ================= 敏感词检测 ================= */
.review-loading { text-align: center; padding: 30px 0; color: var(--ink-3); }
.review-clean { text-align: center; padding: 26px 0; font-size: 15px; color: #2e9e6b; }
.review-doc { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 8px 0 14px; }
.review-doc-sec { padding: 12px; border-bottom: 1px solid var(--line); }
.review-doc-sec:last-child { border-bottom: none; }
.rd-label { display: inline-block; font-size: 11px; color: var(--pink-strong); background: var(--pink-soft); border-radius: 8px; padding: 2px 8px; margin-bottom: 8px; }
.rd-text { font-size: 13.5px; line-height: 1.8; color: var(--ink-2); white-space: pre-wrap; }
mark.hl { background: #ffe0e6; color: var(--pink-strong); padding: 0 2px; border-radius: 3px; font-weight: 700; }
mark.hl.high { background: #ffd6dc; }
mark.hl.medium { background: #fff1d6; color: #c97a1e; }
.review-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.review-item { border: 1px solid var(--line); border-left: 3px solid #f0a64a; border-radius: 10px; padding: 10px 12px; background: var(--bg-soft); }
.review-item.high { border-left-color: var(--pink-strong); }
.review-item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.lvl { font-size: 11px; padding: 2px 8px; border-radius: 8px; color: #fff; }
.lvl.high { background: var(--pink-strong); }
.lvl.medium { background: #f0a64a; }
.review-item .cat { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.review-item .field { font-size: 11px; color: var(--ink-3); }
.review-item .word { color: var(--pink-strong); font-size: 13px; }
.review-ctx { font-size: 12.5px; color: var(--ink-2); margin-bottom: 4px; }
.review-reason { font-size: 12px; color: var(--ink-3); margin-bottom: 3px; }
.review-sug { font-size: 12px; color: #2e9e6b; }
.review-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.review-actions .chip { font-size: 12.5px; }

/* ================= 手机码发布 ================= */
.pub-qr { text-align: center; margin: 12px 0; }
.pub-qr svg { width: 220px; height: 220px; border: 1px solid var(--line); border-radius: 14px; padding: 8px; background: #fff; }
.pub-link { font-size: 11.5px; color: var(--ink-3); word-break: break-all; text-align: center; margin-bottom: 12px; padding: 8px; background: var(--bg-soft); border-radius: 8px; }
.pub-actions { display: flex; gap: 10px; justify-content: center; margin-bottom: 10px; }
.pub-actions .chip { font-size: 13px; }
.pub-note { font-size: 11.5px; color: var(--ink-3); text-align: center; line-height: 1.6; }

/* ================= 案例管理 ================= */
.admin-case-grid {
  max-width: 1080px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px;
}
.admin-case-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s;
}
.admin-case-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.admin-case-card .cover { position: relative; aspect-ratio: 3/4; background: var(--bg-soft); overflow: hidden; }
.admin-case-card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.admin-case-card .cover .cnt {
  position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.55); color: #fff;
  font-size: 11px; padding: 3px 8px; border-radius: 10px;
}
.admin-case-card .info { padding: 12px 13px 13px; display: flex; flex-direction: column; flex: 1; }
.admin-case-card .cat {
  align-self: flex-start; font-size: 11px; color: var(--pink-strong); background: var(--pink-soft);
  border-radius: 10px; padding: 2px 8px; margin-bottom: 7px;
}
.admin-case-card h3 { margin: 0 0 5px; font-size: 13.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.admin-case-card p { margin: 0 0 10px; font-size: 11.5px; color: var(--ink-3); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.admin-case-card .row { display: flex; gap: 8px; margin-top: auto; }
.admin-case-card .row .chip { flex: 1; justify-content: center; font-size: 12px; padding: 7px 8px; }
.chip.danger { color: #d0445e; border-color: #f0c4cd; }
.chip.danger:hover { background: #fff0f3; border-color: #d0445e; }

/* 案例编辑弹层 */
.ce-f {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 13px; line-height: 1.6;
  background: var(--bg-soft); color: var(--ink); outline: none; resize: vertical;
}
.ce-f:focus { border-color: var(--pink); }
.ce-imgs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.ce-img { position: relative; aspect-ratio: 3/4; border-radius: 9px; overflow: hidden; background: var(--bg-soft); border: 1px solid var(--line); }
.ce-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ce-img-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; padding: 3px 5px; background: linear-gradient(transparent, rgba(0,0,0,.72)); }
.ce-img-bar span { color: #fff; font-size: 10px; }
.ce-img-bar button { border: none; background: rgba(255,255,255,.9); color: #333; border-radius: 5px; font-size: 11px; width: 20px; height: 20px; line-height: 1; cursor: pointer; }
.ce-img-bar button:disabled { opacity: .35; cursor: not-allowed; }
.ce-img-bar button[data-ce-rm] { color: #d0445e; }
.ce-empty { grid-column: 1/-1; text-align: center; padding: 22px; color: var(--ink-3); font-size: 12.5px; border: 1px dashed var(--line); border-radius: 10px; }
.ce-upload-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ce-upload-row .hint { font-size: 11px; color: var(--ink-3); }

@media (max-width: 640px) {
  .ce-imgs { grid-template-columns: repeat(3, 1fr); }
}

/* ================= 批量导入 ================= */
.bi-drop {
  border: 2px dashed var(--pink-line); border-radius: 14px; background: var(--bg-soft);
  padding: 26px 16px; text-align: center; color: var(--ink-2); font-size: 13px; cursor: pointer;
  transition: all .15s; margin-bottom: 12px;
}
.bi-drop:hover, .bi-drop.on { border-color: var(--pink); background: var(--pink-soft); }
.bi-drop-ic { font-size: 28px; color: var(--pink); margin-bottom: 6px; }
.bi-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.bi-toolbar .hint { font-size: 11px; color: var(--ink-3); }
#biPasteBox { margin-bottom: 12px; }
.bi-list { display: flex; flex-direction: column; gap: 10px; max-height: 46vh; overflow-y: auto; margin-bottom: 8px; }
.bi-empty { text-align: center; color: var(--ink-3); font-size: 12.5px; padding: 24px; border: 1px dashed var(--line); border-radius: 12px; }
.bi-group { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.bi-group-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: var(--bg-soft); }
.bi-idx { width: 22px; height: 22px; border-radius: 50%; background: var(--pink); color: #fff; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bi-file { font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bi-group-head .chip { font-size: 11.5px; padding: 5px 10px; }
.bi-summary { padding: 10px 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bi-summary b { font-size: 13px; }
.bi-summary .hint { font-size: 11.5px; color: var(--ink-3); }
.bi-tag { font-size: 11px; color: var(--pink-strong); background: var(--pink-soft); border-radius: 10px; padding: 2px 8px; }
.bi-fields { padding: 12px; }
.bi-fields .field { margin-bottom: 10px; }
.bi-fields .field > label { font-size: 12px; margin-bottom: 5px; }
.bi-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bi-imgs { display: flex; flex-wrap: wrap; gap: 6px; }
.bi-img { position: relative; width: 52px; height: 52px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.bi-img img { width: 100%; height: 100%; object-fit: cover; }
.bi-img button { position: absolute; top: 0; right: 0; border: none; background: rgba(0,0,0,.6); color: #fff; font-size: 10px; width: 16px; height: 16px; line-height: 16px; border-radius: 0 0 0 6px; cursor: pointer; }
@media (max-width: 640px) { .bi-grid2 { grid-template-columns: 1fr; } }

.case-warning { background: #fff8e6; color: #a86a15; border: 1px solid #f5e0b0; border-radius: 10px; padding: 9px 12px; font-size: 12px; line-height: 1.6; margin: 8px 0 12px; }

/* ================= 作品卡片操作 ================= */
.work-card .cover[data-open-work] { cursor: pointer; }
.work-card .info h3[data-open-work] { cursor: pointer; }
.work-card .info h3[data-open-work]:hover { color: var(--pink-strong); }
.work-star { position: absolute; right: 8px; top: 8px; font-size: 16px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.3)); }
.work-ops { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.work-ops .chip { flex: 1; justify-content: center; font-size: 11.5px; padding: 6px 8px; min-width: 0; }

/* ================= 作品详情 / 编辑与另存为 ================= */
.wd-wrap { max-width: 1080px; margin: 0 auto; }
.wd-toolbar {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 12px; margin-bottom: 14px; position: sticky; top: 8px; z-index: 5;
  box-shadow: var(--shadow-lg);
}
.wd-tool {
  display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink-2); border-radius: 20px;
  padding: 7px 13px; font-size: 12.5px; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.wd-tool:hover { border-color: var(--pink); color: var(--pink-strong); background: var(--pink-soft); }
.wd-tool.primary { background: var(--pink); border-color: var(--pink); color: #fff; font-weight: 600; }
.wd-tool.primary:hover { filter: brightness(1.05); color: #fff; }
.wd-tool.accent { background: var(--purple-soft); border-color: var(--purple); color: var(--purple); font-weight: 600; }
.wd-tool.danger { color: #d0445e; border-color: #f0c4cd; }
.wd-tool.danger:hover { background: #fff0f3; }
.wd-tool-spacer { flex: 1; }
.wd-notice {
  display: flex; align-items: center; gap: 8px; background: #fff8e6; color: #a86a15;
  border: 1px solid #f5e0b0; border-radius: 12px; padding: 10px 14px;
  font-size: 12.5px; line-height: 1.5; margin-bottom: 16px;
}
html[data-theme='dark'] .wd-notice { background: #3a2f18; border-color: #6b5426; color: #f0c877; }
.wd-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 20px; margin-bottom: 14px;
}
.wd-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--line);
}
.wd-card-head > span { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; color: var(--ink); }
.wd-field { margin-bottom: 14px; position: relative; }
.wd-field:last-child { margin-bottom: 0; }
.wd-field > label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 7px; color: var(--ink-2); }
.wd-field .ce-f { width: 100%; }
.wd-field textarea.ce-f { line-height: 1.75; }
.wd-count { position: absolute; right: 4px; bottom: -16px; font-size: 11px; color: var(--ink-3); }
.wd-style { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0 18px; margin-bottom: 18px; }
.wd-style summary { padding: 14px 0; font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--ink); }
.wd-style summary .hint { font-weight: 400; color: var(--ink-3); font-size: 12px; }
.wd-style-body { padding: 0 0 16px; font-size: 12.5px; color: var(--ink-2); line-height: 1.7; }
.wd-section-head { margin-bottom: 12px; }
.wd-img-wall { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.wd-img-cell { width: 190px; position: relative; }
.wd-page {
  position: absolute; left: 8px; top: 8px; z-index: 2; background: rgba(0,0,0,.6); color: #fff;
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 10px;
}
.wd-img-ph {
  position: relative; aspect-ratio: 3/4; border-radius: 12px 12px 0 0; overflow: hidden;
  background: var(--bg-soft); border: 1px solid var(--line); border-bottom: none;
}
.wd-img-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 操作条从图片上移出，放在图片下方一行，图片不再被遮住、按钮也不会挤 */
.wd-img-ops {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 6px 8px; background: var(--card);
  border: 1px solid var(--line); border-top: none; border-radius: 0 0 12px 12px;
}
.wd-img-ops .wd-ops-mini { display: flex; gap: 4px; }
.wd-img-ops button {
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--ink-2); border-radius: 8px;
  width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 12px; padding: 0; transition: all .15s;
}
.wd-img-ops button:hover { background: #fff; color: var(--ink); border-color: var(--pink); }
/* 主操作：方案（次要，白底）/ 重出（主色填充） */
.wd-img-ops button.wd-op-plan,
.wd-img-ops button.wd-op-gen {
  width: auto; height: 26px; padding: 0 8px; gap: 3px; font-size: 11.5px; font-weight: 600;
  white-space: nowrap;
}
.wd-img-ops button.wd-op-plan { background: #fff; }
.wd-img-ops button.wd-op-gen { background: var(--pink, #ff4d6d); border-color: var(--pink, #ff4d6d); color: #fff; }
.wd-img-ops button.wd-op-gen:hover { filter: brightness(1.05); color: #fff; }
.wd-img-ops button.wd-op-plan span,
.wd-img-ops button.wd-op-gen span { white-space: nowrap; }
.wd-img-cap { margin-top: 6px; font-size: 11.5px; color: var(--ink-3); text-align: center; }
.wd-add-page {
  width: 190px; aspect-ratio: 3/4; border: 2px dashed var(--line); border-radius: 12px;
  background: var(--bg-soft); color: var(--ink-3); font-size: 30px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  transition: all .15s;
}
.wd-add-page:hover { border-color: var(--pink); color: var(--pink-strong); background: var(--pink-soft); }
.wd-add-page span { font-size: 12.5px; }
@media (max-width: 640px) {
  .wd-img-wall { gap: 10px; }
  .wd-img-cell, .wd-add-page { width: calc(50% - 5px); }
  .wd-img-ops { padding: 5px 6px; gap: 4px; }
  .wd-img-ops button.wd-op-plan,
  .wd-img-ops button.wd-op-gen { padding: 0 6px; font-size: 11px; }
  .wd-img-ops button.wd-op-plan svg { display: none; }
  .wd-img-ops .wd-ops-mini { gap: 3px; }
  .wd-toolbar { position: static; }
}

/* 复刻换场景选择 */
.clone-scene-row { margin: 4px 0 12px; }
.clone-scene-row label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; font-weight: 600; }
.clone-scene-row select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 11px; font-size: 13px; background: var(--bg-soft); color: var(--ink); outline: none;
}
.clone-scene-row select:focus { border-color: var(--pink); }

/* 视角标注徽标 */
.parsed-badge.badge-merchant { background: #fff3e6; color: #c2681f; border-color: #f5d3ae; }
.parsed-badge.badge-personal { background: #e9f7ef; color: #1f8a5c; border-color: #bfe7d2; }

/* 生图方案编辑 */
.img-cell .cap .chip.mini { margin-top: 7px; padding: 4px 9px; font-size: 11px; border-radius: 7px; }
.plan-ref {
  margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: 12px; line-height: 1.6;
  background: var(--pink-soft); color: var(--pink-strong); border: 1px solid var(--pink-line);
}

/* ================= 爆款复刻·改编方案审核 ================= */
.adapt-notice {
  display: flex; align-items: flex-start; gap: 9px;
  background: #fff8e6; color: #a86a15; border: 1px solid #f5e0b0;
  border-radius: 12px; padding: 11px 14px; font-size: 12.5px; line-height: 1.6;
  margin-bottom: 16px;
}
html[data-theme='dark'] .adapt-notice { background: #3a2f18; border-color: #6b5426; color: #f0c877; }
.adapt-notice .ico { flex-shrink: 0; margin-top: 1px; }
.adapt-page-hint {
  background: var(--pink-soft); color: var(--pink-strong); border: 1px solid var(--pink-line, #f3c1d0);
  border-radius: 12px; padding: 10px 14px; font-size: 12.5px; line-height: 1.6; margin-bottom: 16px;
}
.adapt-note { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; margin-bottom: 22px; box-shadow: var(--shadow); }
.adapt-section-head { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.adapt-section-head b { font-size: 14px; color: var(--ink); }
.adapt-sec-tag { background: var(--pink-soft); color: var(--pink-strong); border-radius: 999px; padding: 3px 11px; font-size: 11.5px; font-weight: 600; }
.adapt-copy { margin-bottom: 6px; }
.adapt-img-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.adapt-img-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--bg-soft); }
.adapt-img-thumb { position: relative; aspect-ratio: 3/4; border-radius: 10px; overflow: hidden; background: var(--card); border: 1px solid var(--line); margin-bottom: 12px; }
.adapt-img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.adapt-img-thumb .badge { position: absolute; left: 8px; top: 8px; font-size: 10px; padding: 3px 7px; border-radius: 6px; background: rgba(0,0,0,.6); color: #fff; }
.adapt-img-head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.adapt-img-head .adapt-img-title { flex: 1; font-size: 13px; color: var(--ink); line-height: 1.4; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adapt-img-head .adapt-img-idx { font-size: 11px; color: var(--ink-2, #888); white-space: nowrap; }
.adapt-img-card.collapsed .adapt-img-head { margin-bottom: 0; }
.adapt-img-card.collapsed .adapt-img-body { display: none; }
.adapt-img-card .field { margin-bottom: 10px; }
.adapt-img-card .field > label { font-size: 12px; margin-bottom: 5px; }
.adapt-scene-preset { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font-size: 13px; background: var(--card); color: var(--ink); outline: none; margin-bottom: 8px; }
.adapt-scene-preset:focus { border-color: var(--pink); }
.adapt-note-foot { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.adapt-global-foot { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; padding: 6px 0 20px; position: sticky; bottom: 0; }
@media (max-width: 640px) { .adapt-img-grid { grid-template-columns: 1fr; } }

/* 重拆后字段更新高亮：让用户一眼看到哪几项变了 */
@keyframes flashField {
  0% { box-shadow: 0 0 0 0 rgba(255, 110, 145, .55); background: #fff4f7; }
  60% { box-shadow: 0 0 0 5px rgba(255, 110, 145, 0); background: #fff4f7; }
  100% { box-shadow: 0 0 0 0 rgba(255, 110, 145, 0); }
}
.flash-updated { animation: flashField 1.6s ease-out 1; border-color: var(--pink) !important; }
.adapt-img-card.flash-updated { animation: flashField 1.6s ease-out 1; }

/* ---- 产品档案页 ---- */
.pf-fields { display: flex; flex-direction: column; gap: 5px; margin: 8px 0 12px; padding: 9px 10px; background: var(--bg-soft); border-radius: 9px; }
.pf-fields > div { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; }
.pf-fields span { color: var(--ink-3); flex-shrink: 0; }
.pf-fields b { color: var(--ink-1); font-weight: 600; text-align: right; word-break: break-all; }
.pf-view { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.pf-view > div { display: flex; gap: 12px; font-size: 12.5px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.pf-view span { color: var(--ink-3); min-width: 72px; flex-shrink: 0; }
.pf-view b { color: var(--ink-1); font-weight: 600; word-break: break-all; }
.pf-scope-list { margin: 0; padding-left: 20px; font-size: 12.5px; line-height: 1.8; color: var(--ink-2); }
.pf-form { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }

/* ---- 适用范围命中检测提示（只检测不改） ---- */
.scope-check { margin: 8px 0 12px; border-radius: 10px; padding: 9px 11px; font-size: 12px; border: 1px solid; }
.scope-check.scope-ok { background: #eefaf1; border-color: #b7e4c6; color: #1c6b3a; }
.scope-check.scope-warn { background: #fff5f5; border-color: #f3b9b9; color: #b3261e; }
html[data-theme='dark'] .scope-check.scope-ok { background: #1e3a29; border-color: #2e6b42; color: #8ee0ab; }
html[data-theme='dark'] .scope-check.scope-warn { background: #3f2222; border-color: #7d3535; color: #ff9c94; }
.scope-head { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; line-height: 1.5; }
.scope-head span { font-weight: 400; opacity: .85; }
.scope-lines { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.scope-line { display: flex; gap: 8px; align-items: flex-start; line-height: 1.5; }
.scope-flag { flex-shrink: 0; font-weight: 700; font-size: 11px; padding: 1px 6px; border-radius: 5px; }
.scope-line.hit .scope-flag { background: rgba(28,107,58,.12); }
.scope-line.miss .scope-flag { background: rgba(179,38,30,.12); }
.scope-text { word-break: break-all; }
.scope-text em { font-style: normal; opacity: .7; }
.scope-foot { margin-top: 7px; padding-top: 6px; border-top: 1px dashed currentColor; opacity: .85; font-size: 11.5px; line-height: 1.5; }
.scope-recheck { margin: -2px 0 10px; font-size: 11.5px; opacity: .8; }
.scope-recheck:hover { opacity: 1; }

/* ---- 审核区一键合规检测 ---- */
.ar-field { margin-top: 8px; padding-top: 8px; border-top: 1px dashed currentColor; }
.ar-field-name { font-size: 12px; opacity: .9; }
.ar-item { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 5px; font-size: 11.5px; line-height: 1.5; }
.ar-item .lvl { flex-shrink: 0; font-weight: 700; font-size: 10.5px; padding: 1px 6px; border-radius: 5px; background: rgba(179,38,30,.14); }
.ar-item .lvl.medium { background: rgba(200,120,20,.15); }
.ar-word { color: inherit; }
.ar-reason { opacity: .8; flex: 1; min-width: 200px; }
.ar-ok { font-size: 11px; opacity: .9; }
.ar-item.approved { opacity: .75; }

/* 改编方案草稿恢复横幅 */
.draft-banner{display:flex;align-items:center;justify-content:space-between;gap:10px;background:linear-gradient(90deg,#fff7e6,#fff);border:1px solid #f5d08c;border-radius:12px;padding:10px 14px;margin-bottom:14px;font-size:13px;color:#8a5a00}
.draft-banner.result-draft{background:linear-gradient(90deg,#eef6ff,#fff);border-color:#a8cdf0;color:#1a5a95}
/* 使用说明弹窗 */
.help-doc{max-height:66vh;overflow:auto;padding-right:4px}
.help-sec{margin-bottom:18px}
.help-sec h4{margin:0 0 8px;font-size:14px;color:var(--pink-strong);display:flex;align-items:center;gap:6px}
.help-sec ul,.help-sec ol{margin:0;padding-left:20px;font-size:12.5px;line-height:1.9;color:var(--ink-2)}
.help-sec li{margin-bottom:2px}
.help-sec li b,.help-sec p b{color:var(--ink)}
.help-sec p{margin:0;font-size:12.5px;line-height:1.85;color:var(--ink-2)}
/* 结果页工具条 */
.results-tools{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}
.results-tools .chip{font-size:12px}
/* 一键同款·还原度对比弹窗 */
.case-compare-head{display:grid;grid-template-columns:1fr auto 1fr;gap:12px;align-items:center;margin-bottom:10px}
.case-compare-arrow{width:30px;height:30px;border-radius:50%;background:linear-gradient(135deg,#7a5cc4,#e0417f);color:#fff;font-size:17px;display:flex;align-items:center;justify-content:center;box-shadow:0 3px 10px rgba(224,65,127,.28)}
.case-compare-head>div{display:flex;flex-direction:column;gap:3px;padding:8px 12px;background:var(--bg-soft);border-radius:10px;border:1px solid var(--line)}
.case-compare-head b{font-size:12px;color:var(--pink-strong)}
.case-compare-head span{font-size:12px;color:var(--ink-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.case-compare-body{display:flex;flex-direction:column;gap:12px;max-height:62vh;overflow:auto}
.case-compare-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.cmp-shot{position:relative;border:1px solid var(--line);border-radius:10px;overflow:hidden;background:var(--bg-soft);aspect-ratio:3/4}
.cmp-shot img{width:100%;height:100%;object-fit:contain;display:block}
.cmp-shot span{position:absolute;left:8px;top:8px;background:rgba(0,0,0,.6);color:#fff;font-size:10.5px;padding:3px 7px;border-radius:6px}
.cmp-shot.empty{display:flex;align-items:center;justify-content:center;font-size:12px;color:var(--ink-3)}
@media(max-width:760px){.case-compare-head,.case-compare-row{grid-template-columns:1fr}}
/* 出图进度总览条 */
.gen-progress{background:var(--bg-soft);border:1px solid var(--line);border-radius:12px;padding:11px 14px;margin-bottom:16px}
.gen-progress .gp-bar{height:6px;border-radius:6px;background:rgba(127,127,127,.15);overflow:hidden}
.gen-progress .gp-bar span{display:block;height:100%;border-radius:6px;background:linear-gradient(90deg,var(--pink),#7a5cc4);transition:width .4s ease}
.gen-progress .gp-meta{display:flex;align-items:center;gap:6px;margin-top:8px;font-size:12.5px;color:var(--ink-2)}
.gen-progress .gp-meta b{color:var(--ink)}
.gen-progress .gp-pct{margin-left:auto;font-weight:600;color:var(--pink-strong)}
.gen-progress .gp-retry{margin-top:9px;font-size:11.5px}

/* 详情页图格：重绘状态覆盖层 */
.wd-img-ph{position:relative}
.wd-img-ph .img-busy{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;background:rgba(0,0,0,.45);border-radius:12px;color:#fff;font-size:13px}
.wd-img-ph .img-busy.err{background:rgba(40,0,0,.72);color:#ffb3b3}
.wd-op-gen[disabled],.wd-op-plan[disabled],.wd-ops-mini button[disabled]{opacity:.5;cursor:not-allowed}

/* 生图方案：原文拆解 vs 新方案 左右对比（五组分区） */
.cmp-cols-head{display:grid;grid-template-columns:1fr auto 1fr;gap:10px;align-items:center;margin:4px 0 10px;font-weight:600;font-size:12px;color:var(--ink-2,#666)}
.cmp-cols-head .cols-l{color:#7a5cc4;display:flex;align-items:center;gap:7px}
.cmp-cols-head .cols-r{color:var(--pink-strong,#e0417f);display:flex;align-items:center;justify-content:flex-end;gap:7px}
.cmp-cols-head .col-ico{width:18px;height:18px;border-radius:6px;color:#fff;font-size:10.5px;font-weight:700;font-style:normal;display:inline-flex;align-items:center;justify-content:center;flex:none}
.cmp-cols-head .col-ico.src{background:#7a5cc4}
.cmp-cols-head .col-ico.out{background:var(--pink-strong,#e0417f)}
.cmp-cols-head .cols-arrow{width:32px;height:32px;border-radius:50%;background:linear-gradient(135deg,#7a5cc4,#e0417f);color:#fff;font-size:18px;line-height:1;display:flex;align-items:center;justify-content:center;box-shadow:0 3px 10px rgba(224,65,127,.28);flex:none}
/* 板块序号圆形徽标 */
.cmp-k .sec-num{width:17px;height:17px;border-radius:50%;color:#fff;font-size:10.5px;font-weight:700;font-style:normal;display:inline-flex;align-items:center;justify-content:center;flex:none;margin-right:1px}
.cmp-k .sec-num.src{background:#7a5cc4}
.cmp-k .sec-num.out{background:var(--pink-strong,#e0417f)}
/* 出图状态点缀徽标 */
.img-state{font-size:10px;padding:2px 9px;border-radius:20px;font-weight:600;white-space:nowrap}
.img-state.ok{background:rgba(76,175,80,.13);color:#2e7d32}
.img-state.err{background:rgba(229,115,115,.14);color:#c62828}
.cmp-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;align-items:start}
.cmp-orig,.cmp-new{display:flex;flex-direction:column;gap:10px;min-width:0}
.cmp-cell{background:rgba(127,127,127,.06);border:1px solid rgba(127,127,127,.14);border-radius:10px;padding:8px 10px}
.cmp-k{display:block;font-size:11px;font-weight:700;color:#7a5cc4;margin-bottom:4px}
.cmp-new .cmp-k{color:var(--pink-strong,#e0417f)}
.cmp-text{font-size:12.5px;line-height:1.55;white-space:pre-wrap;word-break:break-all}
.cmp-text.keep{color:#1d8a4e;font-weight:500}
.cmp-text.mono{font-family:ui-monospace,Menlo,monospace;font-size:11px;line-height:1.7}
@media (max-width:760px){.cmp-grid,.cmp-cols-head{grid-template-columns:1fr}}

/* 生图方案弹窗加宽版 */
.sheet.sheet-wide{width:min(960px,calc(100vw - 32px));padding:30px}
/* 拆解历史选择行 */
.cmp-hist-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.cmp-hist-row select{flex:1;min-width:180px;border:1px solid var(--line);border-radius:9px;padding:8px 10px;font-size:12.5px;background:var(--card);color:var(--ink)}

/* 叠字层级徽标 */
.ov-badge{display:inline-block;font-size:10px;font-weight:700;border-radius:4px;padding:1px 5px;margin-right:6px;vertical-align:1px}
.ov-badge.big{background:#ffe1ef;color:#c2255c}
.ov-badge.sm{background:#e7f0ff;color:#2b6cb0}
.ov-pos{font-style:normal;font-size:10px;color:#999;margin-right:5px}

/* 全局大图预览（lightbox） */
#lightbox{position:fixed;inset:0;z-index:2000;background:rgba(10,8,14,.82);display:flex;align-items:center;justify-content:center;cursor:zoom-out;backdrop-filter:blur(4px)}
#lightbox figure{margin:0;max-width:min(92vw,760px);max-height:88vh;display:flex;flex-direction:column;gap:10px}
#lightbox img{max-width:100%;max-height:82vh;object-fit:contain;border-radius:14px;box-shadow:0 20px 60px rgba(0,0,0,.5)}
#lightbox figcaption{text-align:center;color:rgba(255,255,255,.75);font-size:13px}
#lightbox .lb-x{position:fixed;top:16px;right:20px;width:40px;height:40px;border-radius:50%;border:none;background:rgba(255,255,255,.14);color:#fff;font-size:17px;cursor:pointer}
#lightbox .lb-x:hover{background:rgba(255,255,255,.28)}
/* 可点击看大图的缩略图统一手势 */
.wd-img-ph img,.adapt-img-thumb img,.swap-thumb img{cursor:zoom-in}

/* 左列对比区顶部的原图 */
.cmp-src-wrap{position:relative;border-radius:12px;overflow:hidden;border:1px solid rgba(127,127,127,.18)}
.cmp-src{display:block;width:100%;cursor:zoom-in}
.cmp-src-tag{position:absolute;left:8px;bottom:8px;background:rgba(0,0,0,.55);color:#fff;font-size:11px;border-radius:6px;padding:2px 8px;pointer-events:none}

/* 左右逐行配对对齐 */
.cmp-rows{display:flex;flex-direction:column;gap:10px}
.cmp-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;align-items:stretch}
.cmp-row>.cmp-cell{margin:0;min-width:0}
/* 原图 / 出图小图（对比区首行） */
.cmp-src-wrap.small{max-width:220px}
.cmp-media .cmp-src-wrap{margin:0 auto}
/* 右列出图占位 */
.cmp-out-ph{width:220px;max-width:100%;aspect-ratio:3/4;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;border:1.5px dashed rgba(127,127,127,.4);border-radius:12px;text-align:center;font-size:13px;color:var(--ink-2,#777);padding:12px}
.cmp-out-ph.busy{border-color:#f5b940;color:#b07d00;background:rgba(255,214,120,.08)}
.cmp-out-ph.err{border-color:#e57373;color:#c62828;background:rgba(229,115,115,.08)}
/* 弹窗内出图 / 换一张按钮 */
.out-ops{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}
.out-ops .btn-primary{font-size:13px;padding:8px 14px}
/* 方案卡片原图缩略改小 */
.adapt-img-thumb{width:150px;min-width:150px}

/* 方案弹窗工具栏：按钮合并为一行小芯片 */
.plan-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:4px 0 10px;padding-bottom:10px;border-bottom:1px dashed rgba(127,127,127,.2)}
.hist-inline{display:inline-flex;align-items:center;gap:6px;margin-left:auto;font-size:11px;color:var(--ink-2,#777)}
.hist-inline select{max-width:210px;border:1px solid var(--line);border-radius:8px;padding:4px 8px;font-size:11.5px;background:var(--card);color:var(--ink)}
/* 叠字左右对齐行：徽标+位置+原文/新文案 */
.ov-line{display:flex;align-items:center;gap:8px;padding:5px 0;border-bottom:1px dashed rgba(127,127,127,.14);min-height:34px}
.ov-line:last-child{border-bottom:none}
.ov-text{font-size:12.5px;word-break:break-all;flex:1}
.ov-empty{opacity:.45;font-style:normal}
.ov-edit{flex:1;min-width:0;border:1px solid var(--line);border-radius:8px;padding:5px 9px;font-size:12.5px;background:var(--card);color:var(--ink)}
.ov-edit:focus{outline:none;border-color:#e0417f;box-shadow:0 0 0 2px rgba(224,65,127,.12)}

/* 每个板块右下角 ↻ 单独重拆按钮 */
.cmp-cell{position:relative}
.repart-btn{position:absolute;right:8px;bottom:8px;width:24px;height:24px;border-radius:7px;border:1px solid rgba(127,127,127,.25);background:var(--card,#fff);color:var(--ink-2,#777);font-size:13px;line-height:1;cursor:pointer;opacity:.55}
.repart-btn:hover{opacity:1;color:#7a5cc4;border-color:#7a5cc4}
.repart-btn:disabled{opacity:.4;cursor:wait}

/* ================= 违规案例库 ================= */
.viol-toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.viol-toolbar .search-box{min-width:300px}
.viol-toolbar select.chip{cursor:pointer}
.viol-patterns{margin:4px 0 18px}
.vp-title{font-size:13px;font-weight:700;color:var(--ink-2);margin-bottom:10px;display:flex;align-items:center;gap:7px}
.vp-title:before{content:"";width:4px;height:14px;border-radius:3px;background:linear-gradient(180deg,#e0417f,#f5a623)}
.vp-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:10px}
.vp-card{background:var(--card);border:1px solid var(--line);border-left:3px solid #ccc;border-radius:10px;padding:11px 13px}
.vp-card.lv-high{border-left-color:#e5484d}
.vp-card.lv-medium{border-left-color:#f5a623}
.vp-card.lv-low{border-left-color:#9aa0a6}
.vp-head{display:flex;align-items:center;gap:8px;margin-bottom:6px}
.vp-head b{font-size:12.5px;color:var(--ink)}
.vp-lv{font-size:10px;font-weight:700;color:#fff;padding:1px 6px;border-radius:5px;flex:none}
.lv-high .vp-lv{background:#e5484d}
.lv-medium .vp-lv{background:#f5a623}
.lv-low .vp-lv{background:#9aa0a6}
.vp-card p{font-size:11.5px;color:var(--ink-2);line-height:1.55;margin:0 0 6px}
.vp-card small{font-size:11px;color:#2e7d32;display:block;line-height:1.5}
.viol-tabs{display:flex;gap:8px;margin-bottom:14px;border-bottom:1px solid var(--line);padding-bottom:10px}
.viol-tabs .chip{cursor:pointer}
.viol-tabs .chip b{font-size:10px;opacity:.7;margin-left:4px}
.viol-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(330px,1fr));gap:14px}
.viol-card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:14px 15px;display:flex;flex-direction:column;gap:9px}
.viol-card.acct{background:linear-gradient(180deg,rgba(229,72,77,.04),transparent)}
.viol-top{display:flex;flex-direction:column;gap:5px}
.viol-cat{font-size:11px;font-weight:700;color:#c62828;background:rgba(229,72,77,.1);align-self:flex-start;padding:2px 9px;border-radius:20px}
.viol-meta{font-size:11px;color:var(--ink-3)}
.viol-risk{font-size:12px;color:var(--ink-2);line-height:1.6;background:rgba(245,166,35,.08);border-radius:8px;padding:7px 10px}
.viol-risk b{color:#b26a00}
.viol-risk.soft{background:rgba(127,127,127,.07)}
.viol-risk.soft b{color:var(--ink-3)}
.viol-imgs{display:flex;gap:6px;flex-wrap:wrap}
.viol-imgs img{width:62px;height:62px;object-fit:cover;border-radius:7px;border:1px solid var(--line);background:var(--bg-soft);cursor:zoom-in}
.viol-body{border-top:1px dashed var(--line);padding-top:9px}
.viol-body-label{font-size:11px;font-weight:700;color:var(--ink-3);margin-bottom:5px}
.viol-text{font-size:11.5px;line-height:1.65;color:var(--ink-2);white-space:pre-wrap;max-height:230px;overflow:auto;background:var(--bg-soft);border-radius:8px;padding:9px 11px}
.viol-certs{font-size:11px;color:var(--ink-3);margin-top:7px}
.viol-more{align-self:flex-start;font-size:11px;color:#7a5cc4;background:none;border:0;cursor:pointer;padding:0;font-weight:600}
.viol-more:hover{text-decoration:underline}
@media (max-width:760px){.viol-grid{grid-template-columns:1fr}.viol-toolbar .search-box{min-width:0;width:100%}}

/* ================= 爆文范文库 ================= */
.ref-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:14px}
.ref-card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:14px 15px;display:flex;flex-direction:column;gap:8px}
.ref-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.ref-prod{font-size:11px;font-weight:700;color:#7a5cc4;background:rgba(122,92,196,.1);padding:2px 10px;border-radius:20px}
.ref-risk{font-size:10.5px;font-weight:700;padding:2px 9px;border-radius:20px;white-space:nowrap}
.ref-risk.lv-high{background:rgba(229,72,77,.13);color:#c62828}
.ref-risk.lv-medium{background:rgba(245,166,35,.15);color:#b26a00}
.ref-risk.lv-clean{background:rgba(76,175,80,.14);color:#2e7d32}
.ref-card h3{font-size:14px;color:var(--ink);margin:0;line-height:1.5}
.ref-hit{font-size:11px;color:#c62828;background:rgba(229,72,77,.07);border-radius:7px;padding:6px 9px;line-height:1.55}
.ref-imgs{display:flex;gap:5px;flex-wrap:wrap}
.ref-imgs img{width:66px;height:88px;object-fit:cover;border-radius:6px;border:1px solid var(--line);cursor:zoom-in}
.ref-body{border-top:1px dashed var(--line);padding-top:9px}
.ref-tags{display:flex;flex-wrap:wrap;gap:4px;margin-top:8px}
.ref-tags span{font-size:10px;color:var(--ink-3);background:var(--bg-soft);border-radius:5px;padding:2px 6px}
.ref-imglarge{display:flex;justify-content:center;padding:10px}
.ref-imglarge img{max-width:100%;max-height:78vh;object-fit:contain;border-radius:10px}
@media (max-width:760px){.ref-grid{grid-template-columns:1fr}}

/* 范文库：封面制作备注 / 审核排期 */
.ref-note{font-size:11px;line-height:1.6;color:#5a4a8a;background:linear-gradient(90deg,rgba(122,92,196,.09),rgba(122,92,196,.03));border-left:2px solid #7a5cc4;border-radius:0 7px 7px 0;padding:6px 10px;display:flex;flex-direction:column;gap:2px}
.ref-note div{white-space:pre-wrap;word-break:break-all}

/* ================= 范本库：案例库学习闭环 ================= */
.learn-bar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;font-size:12.5px;padding:10px 14px;border-radius:10px;margin-bottom:16px;line-height:1.5}
.learn-bar.dirty{background:linear-gradient(90deg,rgba(245,166,35,.14),rgba(245,166,35,.05));border:1px solid rgba(245,166,35,.3);color:#8a5a00}
.learn-bar.ok{background:rgba(76,175,80,.09);border:1px solid rgba(76,175,80,.22);color:#2e7d32}
.learn-bar.busy{background:linear-gradient(90deg,rgba(122,92,196,.13),rgba(224,65,127,.08));border:1px solid rgba(122,92,196,.25);color:#6a4fb0}
.learn-bar.err{background:rgba(229,72,77,.09);border:1px solid rgba(229,72,77,.25);color:#c62828}
.learn-bar .chip{margin-left:auto}
.learn-history{display:flex;flex-direction:column;gap:6px}
.learn-h-item{display:flex;gap:14px;align-items:center;font-size:11.5px;color:var(--ink-3);background:var(--card);border:1px solid var(--line);border-radius:8px;padding:7px 11px}
.learn-h-item .add{margin-left:auto;color:#7a5cc4;font-weight:600}

/* 批量导入：Excel / txt 模式切换 */
.bi-mode-tabs{display:flex;gap:8px;margin-bottom:12px}
.bi-mode-tabs .chip{cursor:pointer;transition:.18s}
.bi-mode-tabs .chip.on{background:linear-gradient(135deg,#7a5cc4,#e0417f);color:#fff;border-color:transparent}
.bi-drop.on{border-color:#7a5cc4!important;background:rgba(122,92,196,.07)!important}

/* ================= 手机窄屏：对比区防竖排/防截断 ================= */
@media (max-width: 760px) {
  /* 五组对比：两列改上下堆叠，每组之间加分隔 */
  .cmp-row{grid-template-columns:1fr;gap:8px;padding:10px 0;border-bottom:1px solid var(--line)}
  .cmp-row:last-child{border-bottom:none}
  .cmp-row.cmp-media-row{border-bottom:1px solid var(--line)}
  /* 左右格子上加「原文 / 新方案」角标，堆叠后仍能分清 */
  .cmp-row .cmp-cell{position:relative;padding-top:22px}
  .cmp-row .cmp-cell:first-child::before{content:"原文";position:absolute;left:10px;top:5px;font-size:10px;font-weight:700;color:#7a5cc4;background:rgba(122,92,196,.1);padding:1px 7px;border-radius:5px}
  .cmp-row .cmp-cell:nth-child(2)::before{content:"新方案";position:absolute;left:10px;top:5px;font-size:10px;font-weight:700;color:var(--pink-strong,#e0417f);background:rgba(224,65,127,.09);padding:1px 7px;border-radius:5px}
  /* 中文正常换行，禁止逐字竖排 */
  .cmp-text,.ov-text{word-break:break-word;overflow-wrap:anywhere;white-space:pre-wrap}
  /* 叠字编辑行：徽标单独一行，输入框占满宽度，防止值被挤没 */
  .ov-line{flex-wrap:wrap;gap:4px;padding:7px 0}
  .ov-line .ov-badge{flex:0 0 auto}
  .ov-line .ov-edit{flex:1 1 100%;width:100%;min-width:0;font-size:13px;padding:7px 10px}
  /* 列头箭头：堆叠后改为上下指向 */
  .cmp-cols-head{grid-template-columns:1fr;gap:3px;justify-items:center;text-align:center;margin-bottom:14px}
  .cmp-cols-head .cols-l,.cmp-cols-head .cols-r{justify-content:center}
  .cmp-cols-head .cols-arrow{transform:rotate(90deg);width:28px;height:28px;font-size:16px}
  /* 图片与占位框在窄屏居中且不超宽 */
  .cmp-media .cmp-src-wrap,.cmp-media .adapt-out-slot{max-width:100%;margin:0 auto}
  .cmp-out-ph{width:100%;max-width:280px}
}

/* ================= 产品档案：合规档案 / 副图规范库 切换 ================= */
.pf-tabs{display:flex;gap:8px;margin-bottom:14px}
.pf-tabs .chip{cursor:pointer;transition:.18s}
.pf-tabs .chip.on{background:linear-gradient(135deg,#7a5cc4,#e0417f);color:#fff;border-color:transparent}
.vp-toolbar{display:flex;gap:10px;margin-bottom:14px}
.vp-toolbar .ce-f{max-width:420px}
.sub-card .cat{color:#7a5cc4}
.sub-card h3{font-size:15px;line-height:1.4;margin:6px 0}
.sub-imgs{display:flex;gap:6px;margin:8px 0;flex-wrap:wrap}
.sub-imgs img{width:64px;height:64px;object-fit:cover;border-radius:8px;border:1px solid var(--line)}
.sub-eff,.sub-feat{font-size:12px;color:var(--muted);line-height:1.5;margin:6px 0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.sub-eff b,.sub-feat b{color:var(--text)}
.sub-vimgs{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0}
.sub-vimgs .sub-vi{width:140px;height:180px;object-fit:cover;border-radius:10px;border:1px solid var(--line)}

/* ================= 统一产品档案：合并视图 ================= */
.pf-filters{display:flex;gap:6px;flex-wrap:wrap}
.pf-filters .chip{cursor:pointer;font-size:12px;padding:6px 12px}
.pf-filters .chip.on{background:linear-gradient(135deg,#7a5cc4,#e0417f);color:#fff;border-color:transparent}
.pf-badges{display:flex;gap:5px;flex-wrap:wrap;margin-bottom:6px}
.pf-badges .badge-ok{background:rgba(39,174,96,.12);color:#1e8449;padding:2px 8px;border-radius:20px;font-size:11px}
.pf-badges .badge-info{background:rgba(122,92,196,.12);color:#7a5cc4;padding:2px 8px;border-radius:20px;font-size:11px}
.pf-badges .badge-img{background:rgba(224,65,127,.12);color:#e0417f;padding:2px 8px;border-radius:20px;font-size:11px}
.prod-admin-info .tag{font-size:11px}

/* ================= 统一产品档案 · Excel 式表格 ================= */
.pf-table-wrap{overflow-x:auto;overflow-y:hidden;border:1px solid var(--line);border-radius:12px;background:var(--card,#fff);max-width:100%}
.pf-table{border-collapse:separate;border-spacing:0;width:max-content;min-width:100%;font-size:12.5px}
.pf-table th,.pf-table td{border-bottom:1px solid var(--line);border-right:1px solid var(--line);padding:12px 14px;vertical-align:top;text-align:left;min-width:150px;max-width:340px}
.pf-table th{position:sticky;top:0;background:var(--bg-soft,#f7f6fb);font-weight:700;color:var(--muted);white-space:nowrap;z-index:2;min-width:150px}
.pf-table td.b {font-weight:600}
.pf-table tbody tr:hover td,.pf-table tbody tr:hover .sticky-col,.pf-table tbody tr:hover .sticky-act{background:rgba(122,92,196,.05)}
.pf-table .sticky-col{position:sticky;left:0;z-index:3;background:var(--card,#fff);min-width:200px;max-width:260px;box-shadow:2px 0 6px rgba(0,0,0,.04)}
.pf-table th.sticky-col{z-index:5;background:var(--bg-soft,#f7f6fb)}
.pf-table .sticky-act{position:sticky;right:0;z-index:3;background:var(--card,#fff);min-width:110px;white-space:nowrap;box-shadow:-2px 0 6px rgba(0,0,0,.04)}
.pf-table th.sticky-act{z-index:5;background:var(--bg-soft,#f7f6fb)}
.pf-table .pf-sub{color:var(--muted);font-size:11px;margin-top:4px}
.pf-table .pf-multiline{white-space:pre-wrap;word-break:break-word;line-height:1.6;max-width:320px}
.pf-table .pf-mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px;color:var(--muted);white-space:normal;word-break:break-all;min-width:170px}
.pf-table .sub-imgs{gap:4px;margin:0}
.pf-table .sub-imgs img{width:44px;height:44px}
.pf-table .chip.mini{padding:4px 8px;font-size:11px;margin:2px 0}
/* 编辑器 tab */
.ue-tabs{display:flex;gap:6px;margin:14px 0 16px;flex-wrap:wrap}
.ue-tabs .chip{cursor:pointer}
.ue-tabs .chip.on{background:linear-gradient(135deg,#7a5cc4,#e0417f);color:#fff;border-color:transparent}
.ue-pane .pf-form{display:grid;gap:12px}
@media(max-width:760px){.pf-table th,.pf-table td{padding:9px 10px;min-width:130px}.pf-table .sticky-col{min-width:150px}}

/* ================= 局部修改（框选编辑） ================= */
.wd-op-edit{background:#fff}
.wd-op-edit:hover{background:var(--pink,#ff4d6d);color:#fff;border-color:var(--pink,#ff4d6d)}
.wd-op-edit[disabled]{opacity:.5;cursor:not-allowed}
@media(max-width:760px){.wd-img-ops button.wd-op-edit span{display:none}}
.le-layout{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:22px;align-items:start}
.le-left{min-width:0}
/* 关键：img 盒子必须与画面内容完全重合（不能 max-height + object-fit:contain 产生留白），否则框选坐标会偏移 */
.le-stage{position:relative;width:min(100%,440px);border-radius:14px;overflow:hidden;border:1px solid var(--line);background:#1c1a20;line-height:0;touch-action:none;cursor:crosshair;user-select:none}
.le-stage img{display:block;width:100%;height:auto;pointer-events:none}
.le-layer{position:absolute;inset:0;pointer-events:none}
.le-box{position:absolute;box-sizing:border-box;border:2px solid #ffd23f;border-radius:4px;background:rgba(255,210,63,.16);box-shadow:0 0 0 1px rgba(0,0,0,.35),0 0 10px rgba(255,210,63,.5)}
.le-box-n{position:absolute;left:-2px;top:-2px;min-width:18px;height:18px;padding:0 4px;border-radius:4px 0 4px 0;background:#ffd23f;color:#1c1a20;font-size:11px;font-weight:800;line-height:18px;text-align:center}
.le-box-del{position:absolute;right:-2px;top:-2px;width:18px;height:18px;border:none;border-radius:0 4px 0 4px;background:#e0417f;color:#fff;font-size:11px;line-height:18px;text-align:center;cursor:pointer;pointer-events:auto}
.le-box-del:hover{background:#b62f66}
.le-hint{font-size:12px;color:var(--muted);line-height:1.6;margin:10px 2px 0}
.le-right{min-width:0;display:flex;flex-direction:column;gap:14px}
.le-presets{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.le-presets-t{font-size:12px;color:var(--muted);font-weight:600;margin-right:2px}
.le-presets .chip{cursor:pointer}
.le-boxlist{display:flex;flex-wrap:wrap;align-items:center;gap:6px;min-height:30px;padding:8px 10px;border:1px dashed var(--line);border-radius:10px;background:rgba(127,127,127,.04)}
.le-boxlist-t{font-size:12px;color:var(--muted);font-weight:600}
.le-boxlist-empty{font-size:12px;color:var(--muted);opacity:.8}
.le-box-item{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;background:rgba(255,210,63,.18);color:#7a5c00;border-radius:20px;padding:3px 6px 3px 10px}
.le-box-item button{border:none;background:rgba(0,0,0,.08);border-radius:50%;width:16px;height:16px;line-height:14px;font-size:10px;cursor:pointer;color:#7a5c00}
@media(max-width:820px){.le-layout{grid-template-columns:1fr}.le-stage{width:min(100%,420px)}}

/* ================= 普通模式·上传图片创作 ================= */
.upload-strip{margin:14px 0 4px;padding:14px;border:1px solid var(--line);border-radius:14px;background:rgba(127,127,127,.04)}
.us-head{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:13px;color:var(--ink);margin-bottom:10px}
.us-head b{color:var(--pink-strong,#e0417f);font-size:15px}
.us-thumbs{display:flex;flex-wrap:wrap;gap:10px}
.us-thumb{position:relative;width:82px;height:110px;border-radius:9px;overflow:hidden;border:1px solid var(--line);background:#eee;flex:none}
.us-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.us-thumb>span{position:absolute;left:4px;top:4px;min-width:18px;height:18px;padding:0 4px;border-radius:5px;background:rgba(0,0,0,.6);color:#fff;font-size:11px;font-weight:700;line-height:18px;text-align:center}
.us-del{position:absolute;right:3px;top:3px;width:18px;height:18px;border:none;border-radius:50%;background:rgba(224,65,127,.92);color:#fff;font-size:10px;line-height:18px;text-align:center;cursor:pointer}
.us-del:hover{background:#b62f66}
.us-tip{font-size:12px;color:var(--muted);line-height:1.6;margin-top:10px}
@media(max-width:760px){.us-thumb{width:68px;height:92px}}

/* ================= 点击图片进入编辑 ================= */
.wd-img-ph[data-wd-open]{cursor:pointer}
.wd-img-ph[data-wd-open]:hover img{filter:brightness(.82);transition:filter .18s}
.wd-edit-hint{position:absolute;left:50%;bottom:12px;transform:translateX(-50%);white-space:nowrap;background:rgba(0,0,0,.62);color:#fff;font-size:12px;font-weight:600;padding:6px 14px;border-radius:20px;opacity:0;transition:opacity .18s;pointer-events:none;z-index:2}
.wd-img-ph[data-wd-open]:hover .wd-edit-hint{opacity:1}
@media(hover:none){.wd-edit-hint{opacity:.85;bottom:8px;font-size:11px}}

/* ================= 资质库 ================= */
.cert-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(360px,1fr));gap:16px}
.cert-card{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:16px;box-shadow:0 3px 12px rgba(40,20,70,.04)}
.cert-head{display:flex;gap:14px;align-items:flex-start}
.cert-thumb{flex:none;width:88px;height:118px;border-radius:8px;overflow:hidden;border:1px solid var(--line);background:#f4f2f8;cursor:zoom-in}
.cert-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.cert-meta{min-width:0;flex:1}
.cert-type{display:inline-block;font-size:11px;color:var(--pink-strong,#e0417f);background:rgba(224,65,127,.1);padding:2px 8px;border-radius:12px;font-weight:700;margin-bottom:6px}
.cert-meta h3{font-size:15px;margin:0 0 6px;line-height:1.4;word-break:break-all}
.cert-meta p{font-size:12px;color:var(--muted);margin:3px 0;line-height:1.5}
.cert-crops{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0;padding-top:12px;border-top:1px dashed var(--line)}
.cert-crop{position:relative;background:#fff;border:1px solid var(--line);border-radius:8px;overflow:hidden;max-width:100%}
.cert-crop img{display:block;max-width:100%;height:auto;max-height:80px;object-fit:contain}
.cert-crop span{display:block;font-size:10px;color:var(--muted);text-align:center;padding:3px 5px;background:rgba(127,127,127,.06);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cert-nocrop{font-size:12px;color:var(--muted);margin:12px 0;padding:10px;background:rgba(127,127,127,.05);border-radius:8px}
.cert-foot{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.cert-upload-preview{margin-top:10px;max-width:100%}
.cert-upload-preview img{width:100%;max-width:240px;border-radius:8px;border:1px solid var(--line)}
.cert-batch-tip{margin-top:8px;font-size:12px;color:var(--muted)}
.cert-batch-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:10px;max-height:280px;overflow:auto}
.cert-batch-item{position:relative;border:1px solid var(--line);border-radius:10px;padding:6px;background:var(--panel-2,transparent)}
.cert-batch-item img{width:100%;height:90px;object-fit:contain;background:#fff;border-radius:6px}
.cert-batch-item .ce-f{margin-top:6px;width:100%;font-size:12px;padding:5px 7px}
.cert-batch-item .chip{margin-top:5px;font-size:11px;padding:3px 8px}
@media(max-width:760px){.cert-grid{grid-template-columns:1fr}}

/* ================= 产品档案内嵌资质证书 ================= */
.page-head.sub-head{align-items:flex-end;border-top:1px solid var(--line);padding-top:20px}
.page-head.sub-head h2{font-size:20px}
.pf-cert-groups{display:flex;flex-direction:column;gap:22px}
.pf-cert-group{background:rgba(255,255,255,.72);border:1px solid var(--line);border-radius:16px;padding:16px}
.pf-cert-group-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px;padding-bottom:10px;border-bottom:1px dashed var(--line)}
.pf-cert-group-head b{font-size:15px}
.pf-cert-count{display:inline-block;font-size:12px;color:var(--muted);margin-left:10px}

/* ================= 新增叠图：来源选择 + 拖框裁剪 ================= */
.ov-tabs{display:flex;gap:8px;margin:14px 0 12px}
.ov-pane{background:rgba(255,255,255,.72);border:1px solid var(--line);border-radius:12px;padding:12px 14px}
.ov-cert-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:10px;margin-top:8px;max-height:260px;overflow:auto}
.ov-cert-item{display:flex;flex-direction:column;gap:5px;text-align:left;background:#fff;border:1px solid var(--line);border-radius:10px;padding:8px;cursor:pointer;transition:.16s}
.ov-cert-item:hover{border-color:var(--pink);transform:translateY(-1px)}
.ov-cert-item.on{border-color:var(--pink);box-shadow:0 0 0 2px rgba(232,36,80,.14)}
.ov-cert-item img{width:100%;height:92px;object-fit:contain;background:#f7f7f9;border-radius:6px}
.ov-cert-name{font-size:12px;font-weight:700;line-height:1.4;word-break:break-all}
.ov-cert-item small{font-size:11px;color:var(--muted)}
.ov-empty{grid-column:1/-1;padding:18px;text-align:center;color:var(--muted);font-size:12px;background:rgba(127,127,127,.05);border-radius:8px}
.ov-stage{min-height:320px;background:#f7f7fa}
.ov-stage img{display:block;max-width:100%;max-height:520px;margin:0 auto}
.ov-save{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--muted);margin-top:10px;line-height:1.5}
.ov-save input{accent-color:var(--pink)}
@media(max-width:760px){.ov-cert-list{grid-template-columns:1fr 1fr}.ov-stage{min-height:240px}}

/* ================= 产品列表行内资质证书 ================= */
.pf-cert-th,.pf-cert-cell{min-width:190px}
.pf-cert-thumbs{display:flex;gap:5px;margin-bottom:4px}
.pf-cert-thumbs img{width:42px;height:56px;object-fit:cover;border:1px solid var(--line);border-radius:5px;background:#f7f7f9}
.pf-cert-count{font-size:12px;color:var(--muted);margin-bottom:5px}
.pf-cert-none{font-size:12px;color:var(--muted);margin-bottom:5px}

/* ================= 页面底部：说明 / 功能与规则手册 ================= */
.app-footer{display:flex;justify-content:center;align-items:center;margin:48px 0 8px;padding-top:22px;border-top:1px solid var(--line)}
.app-footer a{display:inline-flex;align-items:center;gap:7px;font-size:13px;color:var(--muted);text-decoration:none;padding:8px 16px;border:1px solid var(--line);border-radius:20px;background:var(--card);transition:.15s}
.app-footer a::before{content:'?';display:inline-grid;place-items:center;width:16px;height:16px;border-radius:50%;background:var(--pink-soft);color:var(--pink);font-size:11px;font-weight:800}
.app-footer a:hover{color:var(--pink);border-color:var(--pink-line);background:var(--pink-soft)}

/* ================= 创作规则：写作范本 / 违规案例 tab ================= */
.rule-tabs{margin:4px 0 18px}
.rule-pane[hidden]{display:none}
