/* [v2.0 完全合并 / P3] 智能海报 Studio 原生页样式 —— 移植自 adpilot static/style.css 的
   智能海报(studio)部分，全部收敛到 .ads-poster 作用域，自带 CSS 变量(adpilot 浅色主题)，
   与宿主 vvdig 深色主题隔离，零全局污染。动画 @keyframes 统一加 ads-poster- 前缀防撞。 */

.ads-poster {
  --brand: #5b4bdb; --brand2: #8b7cf5;
  --txt: #1f2533; --muted: #8a93a5; --line: #e6e9f0;
  --panel: #ffffff; --panel2: #f3f5f9; --bg: #f7f8fb;
  --warn: #c98a00; --ok: #1aa564; --accent: #ef5b34; --danger: #e5484d;
  --radius: 14px; --shadow: 0 4px 18px rgba(30, 40, 80, .10);
  color: var(--txt); font-size: 14px; line-height: 1.55;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, "Segoe UI", Roboto, sans-serif;
}
.ads-poster *, .ads-poster *::before, .ads-poster *::after { box-sizing: border-box; }

/* ===== 基础控件(局部化，避免触碰宿主全局) ===== */
.ads-poster label { display: block; font-size: 13.5px; color: #46505f; margin: 10px 0 4px; }
.ads-poster input, .ads-poster select, .ads-poster textarea {
  width: 100%; background: #fff; border: 1px solid var(--line); color: var(--txt);
  border-radius: 10px; padding: 10px 12px; font-size: 15px; font-family: inherit; outline: none;
}
.ads-poster input:focus, .ads-poster select:focus, .ads-poster textarea:focus { border-color: var(--brand); }
.ads-poster input::placeholder, .ads-poster textarea::placeholder { color: #9aa3b2; }
.ads-poster textarea { resize: vertical; min-height: 54px; }
.ads-poster .row { display: flex; gap: 10px; flex-wrap: wrap; }
.ads-poster .row > * { flex: 1; }
.ads-poster .muted { color: var(--muted); }
.ads-poster .ok { color: var(--ok); } .ads-poster .warn { color: var(--warn); } .ads-poster .danger { color: var(--danger); }
.ads-poster .pl { font-size: 12px; font-weight: 600; color: #555; margin: 8px 0 3px; }

.ads-poster button.btn {
  background: linear-gradient(135deg, var(--brand), var(--brand2)); color: #fff; border: none;
  padding: 10px 18px; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 600;
}
.ads-poster button.btn:hover { filter: brightness(1.08); }
.ads-poster button.btn:disabled { opacity: .5; cursor: not-allowed; }
.ads-poster button.ghost { background: var(--panel2); color: var(--txt); border: 1px solid var(--line); }
.ads-poster button.mini { padding: 5px 10px; font-size: 12px; border-radius: 8px; }

.ads-poster .scantext-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 14px; margin-bottom: 10px; background: #fff;
  border: 1px solid var(--line); border-left: 4px solid #12a67a; border-radius: 10px;
  box-shadow: 0 3px 12px rgba(31, 37, 51, .06);
}
.ads-poster .scantext-copy { display: flex; flex-direction: column; gap: 2px; min-width: 220px; }
.ads-poster .scantext-copy b { font-size: 15px; color: var(--txt); }
.ads-poster .scantext-copy span { font-size: 12.5px; color: #687285; }
.ads-poster .scantext-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ads-poster .scantext-actions button.btn { padding: 8px 14px; border-radius: 8px; }

/* 分段按钮(比例/备选用) */
.ads-poster .seg { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ads-poster .seg button {
  background: #fff; border: 1px solid var(--line); color: var(--muted); padding: 7px 14px;
  border-radius: 9px; cursor: pointer; font-size: 13px;
}
.ads-poster .seg button.on { background: linear-gradient(135deg, var(--brand), var(--brand2)); color: #fff; border-color: transparent; }
.ads-poster .seg button:hover { color: var(--brand); }
.ads-poster .seg.seg-off { opacity: .4; pointer-events: none; filter: grayscale(.6); }

/* 拖拽上传区 */
.ads-poster .dropzone {
  border: 2px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; color: #5a6473;
  cursor: pointer; transition: .2s; background: #fafbfd;
}
.ads-poster .dropzone:hover, .ads-poster .dropzone.drag { border-color: var(--brand); background: rgba(91, 75, 219, .07); color: var(--brand); }
.ads-poster .dropzone .big { font-size: 26px; margin-bottom: 6px; }
.ads-poster .dropzone img { max-height: 120px; border-radius: 8px; margin-top: 8px; }

/* 子标签 / 子页(studio 内复用) */
.ads-poster .subtabs { display: flex; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.ads-poster .subtabs button { background: none; border: none; color: #5a6473; padding: 10px 16px; cursor: pointer; font-size: 14px; border-bottom: 2px solid transparent; }
.ads-poster .subtabs button.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 700; }
.ads-poster .subpage { display: none; }
.ads-poster .subpage.on { display: block; }

/* ===== 智能海报 · 底图来源 + Fabric 文字层编辑器 ===== */
.ads-poster .sm-srcbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ads-poster .sm-edit { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-top: 6px; }
.ads-poster .sm-stage { background: #0d0f14; border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: inline-block; flex: 0 0 auto; }
.ads-poster .sm-stage .canvas-container { border-radius: 8px; overflow: hidden; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.ads-poster .sm-side { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 8px; }
.ads-poster .sm-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.ads-poster .sm-tools button { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; background: var(--panel2); color: var(--txt); border: 1px solid var(--line); cursor: pointer; }
.ads-poster .sm-tools button:hover { border-color: var(--brand); }
.ads-poster .sm-tools button.warn { color: #e74c3c; }
.ads-poster .sm-props { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 64px; }
.ads-poster .sm-props .pl { font-size: 11.5px; color: var(--muted); display: block; margin: 8px 0 3px; }
.ads-poster .sm-props .pl:first-child { margin-top: 0; }
.ads-poster .sm-props textarea { width: 100%; min-height: 46px; resize: vertical; }
.ads-poster .sm-props input[type=range] { width: 100%; accent-color: var(--brand); }
.ads-poster .sm-props input[type=color] { width: 100%; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer; }
.ads-poster .sm-props .ckrow { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.ads-poster .sm-props .ck { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--txt); cursor: pointer; }

/* 素材库图片选择器弹窗 */
.ads-poster .modal-mask { position: fixed; inset: 0; z-index: 9998; background: rgba(20, 22, 30, .6); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 20px; }
.ads-poster .modal-box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; width: min(880px, 94vw); max-height: 84vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
.ads-poster .modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--txt); }
.ads-poster .modal-head .x { background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1; }
.ads-poster .modal-head .x:hover { color: var(--txt); }
.ads-poster .modal-body { padding: 16px 18px; overflow: auto; }
.ads-poster #assetpick_grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.ads-poster .apick { position: relative; cursor: pointer; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel2); transition: .15s; }
.ads-poster .apick:hover { border-color: var(--brand); transform: translateY(-2px); }
.ads-poster .apick img { width: 100%; height: 130px; object-fit: cover; display: block; }
.ads-poster .apick .cap { font-size: 11px; color: var(--muted); padding: 5px 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ads-poster .apick-x { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0, 0, 0, .62); color: #fff; font-size: 12px; line-height: 22px; text-align: center; cursor: pointer; opacity: 0; transition: .15s; }
.ads-poster .apick:hover .apick-x { opacity: 1; }
.ads-poster .apick-x:hover { background: #e74c3c; }
.ads-poster .sm-layoutbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 2px; }
.ads-poster .sm-layoutbar .pl { margin: 0; white-space: nowrap; }
.ads-poster .sm-layoutbar select { flex: 1; min-width: 150px; padding: 6px 8px; border-radius: 8px; background: var(--panel2); color: var(--txt); border: 1px solid var(--line); }
.ads-poster .sm-topbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.ads-poster #pdraft_grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }

/* 构图 + 色系 选择器 */
.ads-poster .sm-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 5px; margin-top: 4px; }
.ads-poster .wbtn { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 3px 3px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); }
.ads-poster .wbtn.on { border-color: var(--brand); color: var(--txt); box-shadow: 0 0 0 1px var(--brand); }
.ads-poster .wbtn em { font-size: 10.5px; font-style: normal; }
.ads-poster .wire { position: relative; width: 36px; height: 58px; background: #cfd6e0; border-radius: 4px; overflow: hidden; display: block; }
.ads-poster .wz { position: absolute; display: block; }
.ads-poster .wz.subj { background: rgba(70, 82, 104, .55); border-radius: 3px; }
.ads-poster .wz.tx { border-radius: 2px; opacity: .92; }
.ads-poster .sm-pal { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.ads-poster .palbtn { display: flex; align-items: center; gap: 4px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px 3px 5px; cursor: pointer; color: var(--muted); font-size: 11.5px; }
.ads-poster .palbtn.on { border-color: var(--brand); color: var(--txt); }
.ads-poster .palbtn .sw { width: 13px; height: 13px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0, 0, 0, .15); }
.ads-poster .palbtn em { font-style: normal; }

/* ===== 智能海报 · 三栏作图布局 ===== */
.ads-poster .poster-app { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--panel); }
.ads-poster .pa-top { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--panel2); flex-wrap: wrap; }
.ads-poster .pa-title { font-size: 15px; }
.ads-poster .pa-ratiowrap { display: flex; align-items: center; gap: 6px; }
.ads-poster .pa-ratiowrap .pl { margin: 0; }
.ads-poster .pa-ratiowrap .seg { transform: scale(.92); transform-origin: left center; }
.ads-poster .pa-spacer { flex: 1; }
.ads-poster .pa-body { display: flex; align-items: stretch; min-height: 560px; }
.ads-poster .pa-left { flex: 0 0 360px; width: 360px; border-right: 1px solid var(--line); display: flex; flex-direction: column; max-height: 80vh; }
.ads-poster .pa-tabs { display: flex; border-bottom: 1px solid var(--line); }
.ads-poster .pa-tabs button { flex: 1; padding: 9px 0; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; border-bottom: 2px solid transparent; }
.ads-poster .pa-tabs button.on { color: var(--txt); border-bottom-color: var(--brand); }
.ads-poster .pa-tabc { display: none; padding: 10px 12px; overflow: auto; }
.ads-poster .pa-tabc.on { display: block; }
.ads-poster #pt-gen.pa-tabc { padding: 10px 12px; }
.ads-poster .pa-sec { font-size: 12px; color: var(--muted); margin: 9px 0 5px; padding-top: 7px; border-top: 1px dashed var(--line); font-weight: 600; }
.ads-poster .pa-left input, .ads-poster .pa-left textarea, .ads-poster .pa-left select { font-size: 12.5px; }
.ads-poster .pa-left .seg { flex-wrap: wrap; }
.ads-poster .pa-canvas { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px; background: #0d0f14; min-width: 0; }
.ads-poster .pa-canvas .sm-stage { padding: 0; border: none; background: none; display: flex; }
.ads-poster .pa-canvas .canvas-container { box-shadow: 0 8px 30px rgba(0, 0, 0, .45); border-radius: 8px; overflow: hidden; }
.ads-poster .pa-hint { font-size: 12px; }
.ads-poster .pa-right { flex: 0 0 250px; width: 250px; border-left: 1px solid var(--line); padding: 12px; overflow: auto; max-height: 80vh; }
.ads-poster .pa-rt { font-size: 13px; font-weight: 600; color: var(--txt); margin-bottom: 8px; }
.ads-poster .sm-dz { padding: 10px; min-height: auto; font-size: 12px; }
.ads-poster .sm-dz .big { font-size: 20px; }
.ads-poster .sm-refbox { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ads-poster .refthumb { position: relative; width: 46px; height: 46px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.ads-poster .refthumb img { width: 100%; height: 100%; object-fit: cover; }
.ads-poster .refthumb i { position: absolute; top: 1px; right: 1px; width: 15px; height: 15px; line-height: 15px; text-align: center; font-size: 10px; background: rgba(0, 0, 0, .6); color: #fff; border-radius: 50%; cursor: pointer; font-style: normal; }
.ads-poster .sm-alts { margin-top: 8px; }
.ads-poster .sm-altsload { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.ads-poster .sm-altt { font-size: 11px; margin-bottom: 4px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ads-poster .sm-altsgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.ads-poster .alt { position: relative; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: #0d0f14; }
.ads-poster .alt img { width: 100%; display: block; height: auto; }
.ads-poster .alt span { position: absolute; left: 0; bottom: 0; right: 0; font-size: 10px; color: #fff; background: rgba(0, 0, 0, .5); padding: 1px 4px; }
.ads-poster .alt.on, .ads-poster .alt:hover { border-color: var(--brand); }
.ads-poster .sm-clr { cursor: pointer; color: var(--brand); font-size: 11px; flex: 0 0 auto; }
.ads-poster .sm-clr:hover { text-decoration: underline; }
.ads-poster .sm-layerlist { display: flex; flex-direction: column; gap: 4px; }
.ads-poster .sm-quota { font-size: 12px; color: var(--muted); background: var(--panel2); border: 1px solid var(--line); border-radius: 20px; padding: 3px 10px; white-space: nowrap; }
.ads-poster .sm-quota.low { color: #e67e22; border-color: #e67e22; }
.ads-poster #sm_textform { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.ads-poster #sm_textform input { margin-bottom: 4px; }
.ads-poster .sm-hires { position: absolute; right: 4px; top: 4px; font-size: 10px; background: rgba(108, 92, 231, .94); color: #fff; padding: 2px 6px; border-radius: 10px; cursor: pointer; font-weight: 700; font-style: normal; }
.ads-poster .sm-hires:hover { background: #5b4bd6; }
.ads-poster .sm-dragover { outline: 3px dashed var(--brand); outline-offset: -6px; background: rgba(108, 92, 231, .06); }
.ads-poster .sm-elemgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 4px; }
.ads-poster .sm-elem { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; cursor: pointer; background: #f4f4f6; aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center; }
.ads-poster .sm-elem:hover { border-color: var(--brand); }
.ads-poster .sm-elem img { width: 100%; height: 100%; object-fit: contain; }

/* 素材库选择器 · 文件管理器树(左树 + 折叠) */
.ads-poster .fm { display: flex; gap: 14px; align-items: flex-start; }
.ads-poster .fm-tree { flex: 0 0 232px; width: 232px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 6px; background: #fafafb; max-height: 640px; overflow: auto; user-select: none; }
.ads-poster .fm-main { flex: 1; min-width: 0; }
.ads-poster .fm-crumb { font-size: 12.5px; color: #888; margin-bottom: 8px; min-height: 16px; }
.ads-poster .fm-crumb b { color: #444; }
.ads-poster .fm-row { display: flex; align-items: center; gap: 5px; padding: 5px 6px; border-radius: 6px; cursor: pointer; font-size: 13px; white-space: nowrap; line-height: 1.4; }
.ads-poster .fm-row:hover { background: #efeefb; }
.ads-poster .fm-row.on { background: #eae6ff; color: #5a4bd1; font-weight: 600; }
.ads-poster .fm-row .fm-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ads-poster .fm-row .fm-cnt { font-size: 11px; color: #aaa; flex-shrink: 0; }
.ads-poster .fm-row .fm-acts { display: none; gap: 1px; flex-shrink: 0; }
.ads-poster .fm-row:hover .fm-acts, .ads-poster .fm-row.on .fm-acts { display: inline-flex; }
.ads-poster .fm-row .fm-acts span { padding: 0 4px; font-size: 12px; border-radius: 4px; color: #888; }
.ads-poster .fm-row .fm-acts span:hover { background: #d8d4f5; color: #5a4bd1; }
.ads-poster .fm-new { margin-top: 8px; padding: 6px; font-size: 12.5px; color: #5a4bd1; cursor: pointer; border: 1px dashed var(--line); border-radius: 7px; text-align: center; }
.ads-poster .fm-new:hover { background: #efeefb; border-color: #6c5ce7; }
.ads-poster #pick_tree .fm-row { display: flex; align-items: center; gap: 2px; }
.ads-poster .fm-tri { display: inline-block; width: 14px; text-align: center; cursor: pointer; color: #999; user-select: none; flex: 0 0 auto; }
.ads-poster .fm-tri:hover { color: var(--brand); }
.ads-poster .pick-fm { align-items: stretch; }
.ads-poster .pick-fm .fm-tree { max-height: 62vh; }
.ads-poster .pick-fm .fm-main { max-height: 62vh; overflow: auto; }

/* 模板墙 */
.ads-poster .sm-tplfilter { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.ads-poster .sm-chip { font-size: 11.5px; padding: 3px 9px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel2); color: var(--txt); cursor: pointer; }
.ads-poster .sm-chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.ads-poster .sm-chip:hover { border-color: var(--brand); }
.ads-poster .sm-tplgrid { display: flex; flex-direction: column; gap: 6px; }
.ads-poster .sm-tplgroup { font-size: 12px; color: var(--muted); font-weight: 600; margin: 8px 0 2px; }
.ads-poster .sm-tplrow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ads-poster .sm-tplcard { position: relative; cursor: pointer; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel2); transition: .15s; }
.ads-poster .sm-tplcard:hover { border-color: var(--brand); box-shadow: 0 2px 12px rgba(108, 92, 231, .22); transform: translateY(-1px); }
/* 固定缩略图尺寸: 不随原图长宽拉伸(长图也只在固定框内裁切显示) */
.ads-poster .sm-tplcard img { width: 100%; height: 150px; object-fit: cover; object-position: top; display: block; background: #f4f4f6; }
.ads-poster .sm-tplname { font-size: 11px; padding: 4px 6px; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 管理员删除角标(hover显现) */
.ads-poster .sm-tpldel { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 50%; background: rgba(220, 40, 40, .85); color: #fff; font-size: 13px; cursor: pointer; opacity: 0; transition: .15s; z-index: 2; }
.ads-poster .sm-tplcard:hover .sm-tpldel { opacity: 1; }
.ads-poster .sm-tpldel:hover { background: #c0392b; transform: scale(1.12); }

/* 模板大图预览弹窗 */
.ads-poster .modal-box.tplprev { width: min(680px, 94vw); }
.ads-poster .tplprev-body { display: flex; align-items: center; gap: 8px; padding: 12px 10px; height: 64vh; }
/* 固定预览框: 长图也只在框内等比缩放(contain), 不把预览拉长 */
.ads-poster .tplprev-imgwrap { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; justify-content: center; }
.ads-poster .tplprev-imgwrap img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; border: 1px solid var(--line); background: #f4f4f6; transition: opacity .15s; }
.ads-poster .tplprev-nav { flex: 0 0 38px; height: 72px; border: 1px solid var(--line); background: var(--panel2); color: var(--txt); border-radius: 10px; font-size: 24px; cursor: pointer; }
.ads-poster .tplprev-nav:hover { border-color: var(--brand); color: var(--brand); }
.ads-poster .tplprev-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }

/* 画布右键菜单 */
.ads-poster .sm-ctxmenu { position: fixed; z-index: 10001; min-width: 190px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 5px; box-shadow: 0 10px 36px rgba(0, 0, 0, .35); font-size: 12.5px; }
.ads-poster .sm-ctxmenu .it { padding: 7px 10px; border-radius: 7px; cursor: pointer; color: var(--txt); white-space: nowrap; }
.ads-poster .sm-ctxmenu .it:hover { background: var(--panel2); color: var(--brand); }
.ads-poster .sm-ctxmenu .it.danger:hover { color: #ff6b6b; }
.ads-poster .sm-ctxmenu .sep { height: 1px; background: var(--line); margin: 4px 6px; }

/* 图层项 */
.ads-poster .laylitem { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: var(--panel2); }
.ads-poster .laylitem.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.ads-poster .laylitem b { font-size: 12px; font-weight: 600; flex: 0 0 auto; }
.ads-poster .laylitem span { font-size: 11.5px; color: var(--muted); flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ads-poster .laylitem i { font-style: normal; cursor: pointer; opacity: .6; }
.ads-poster .laylitem i:hover { opacity: 1; }

/* 左栏可折叠分区 */
.ads-poster .pa-fold { border-top: 1px dashed var(--line); margin-top: 9px; padding-top: 3px; }
.ads-poster .pa-fold > summary { font-size: 12px; color: var(--muted); font-weight: 600; cursor: pointer; padding: 5px 0; list-style: revert; user-select: none; }
.ads-poster .pa-fold > summary:hover { color: var(--txt); }
.ads-poster .pa-fold[open] > summary { color: var(--txt); }

/* 候选放大 + lightbox(模板/元素预览) */
.ads-poster .zoom-btn { position: absolute; right: 4px; top: 4px; z-index: 3; background: rgba(0, 0, 0, .55); color: #fff; font-style: normal; border-radius: 6px; padding: 1px 6px; font-size: 12px; cursor: zoom-in; }
.ads-poster .zoom-btn:hover { background: rgba(0, 0, 0, .8); }
.ads-poster .imgzoom-mask { position: fixed; inset: 0; z-index: 10050; background: rgba(10, 12, 18, .9); display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: zoom-out; gap: 12px; }
.ads-poster .imgzoom-mask img { max-width: 96vw; max-height: 90vh; border-radius: 8px; box-shadow: 0 10px 50px rgba(0, 0, 0, .6); }
.ads-poster .imgzoom-x { color: #cfd6e4; font-size: 13px; }

/* ===== 窄屏适配:三栏堆叠 ===== */
@media (max-width: 1100px) {
  .ads-poster .pa-body { flex-direction: column; }
  .ads-poster .pa-left, .ads-poster .pa-right { flex: 1 1 auto; width: auto; max-height: none; border-right: none; border-left: none; border-bottom: 1px solid var(--line); }
  .ads-poster .pa-canvas { min-height: 440px; }
}

/* ===== 动画(加 ads-poster- 前缀防撞) ===== */
.ads-poster .spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--brand2); border-top-color: transparent; border-radius: 50%; animation: ads-poster-spin .7s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes ads-poster-spin { to { transform: rotate(360deg); } }
