:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #e6e8ee;
  --border-strong: #d5d8e0;
  --text: #1f2329;
  --text-dim: #5b616e;
  --text-faint: #8a919e;
  --accent: #2f6fed;
  --accent-soft: #eaf1fe;
  --danger: #d93a3a;
  --danger-soft: #fdf1f1;
  --warn: #a15c07;
  --warn-soft: #fdf3e3;
  --radius: 12px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.wrap { max-width: 1360px; margin: 0 auto; padding: 24px 20px 80px; }

header.top {
  display: flex; align-items: baseline; gap: 12px;
  flex-wrap: wrap; margin-bottom: 6px;
}
header.top h1 { font-size: 19px; font-weight: 600; margin: 0; }
header.top .sub { color: var(--text-dim); font-size: 13px; }

.toolbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; margin: 16px 0;
}
.toolbar .grow { flex: 1; }

.btn {
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); border-radius: 8px; padding: 7px 14px;
  font-size: 13px; cursor: pointer; font-family: inherit;
}
.btn:hover { background: #fafaf8; }
.btn.primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.btn.primary:hover { background: #0a6cb7; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: #e8c9c9; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn-icon {
  border: none; background: transparent; color: var(--text-faint);
  cursor: pointer; font-size: 17px; line-height: 1; padding: 2px 6px; border-radius: 5px;
}
.btn-icon:hover { background: var(--danger-soft); color: var(--danger); }

input[type="text"], select, textarea {
  font: inherit; font-size: 13px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 7px; padding: 6px 9px; width: 100%;
}
input[type="text"]:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft);
}

/* 系列卡片 */
.campaign {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 16px;
}
.camp-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.camp-no { font-weight: 600; font-size: 14px; }

.grid {
  display: grid; gap: 10px 14px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin-bottom: 14px;
}
.field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.field-label { font-size: 12px; color: var(--text-dim); font-weight: 500; }
.field-hint { font-size: 11px; color: var(--text-faint); }

/* 广告组 */
.adgroup {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 14px; margin-bottom: 12px; background: #fcfcfb;
}
.ag-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.ag-title { font-size: 13px; font-weight: 600; color: var(--accent); }

.sub-block { margin-top: 14px; }
.sub-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 13px; font-weight: 600; margin-bottom: 8px;
}
.muted { color: var(--text-faint); font-weight: 400; font-size: 12px; }

/* 关键词表 */
.kw-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.kw-table th {
  text-align: left; font-size: 11px; color: var(--text-dim);
  font-weight: 500; padding: 5px 6px; border-bottom: 1px solid var(--border);
}
.kw-table td { padding: 3px 6px 3px 0; }

.paste-box {
  margin-top: 8px; min-height: 46px; font-size: 12px;
  font-family: var(--mono); resize: vertical;
}

/* RSA */
.rsa-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.rsa-col-title {
  font-size: 12px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px;
}
.rsa-row {
  display: flex; align-items: center; gap: 7px; margin-bottom: 5px;
}
.rsa-idx {
  width: 20px; flex: none; text-align: right;
  font-size: 11px; color: var(--text-faint); font-family: var(--mono);
}
.rsa-row textarea { resize: vertical; font-size: 12px; }

.counter {
  flex: none; width: 46px; text-align: right;
  font-size: 11px; color: var(--text-faint); font-family: var(--mono);
}
.counter.warn { color: var(--warn); }
.counter.over { color: var(--danger); font-weight: 600; }

/* 校验 */
.validate { border-radius: var(--radius); padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.validate.ok { background: var(--accent-soft); color: var(--accent); }
.validate.bad { background: var(--danger-soft); color: var(--danger); }
.validate.warnbox { background: var(--warn-soft); color: var(--warn); }
.v-group ul { margin: 4px 0 0; padding-left: 18px; }
.v-group li { font-size: 12px; }

/* 预览 */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-bottom: 16px;
}
.panel h2 {
  font-size: 14px; font-weight: 600; margin: 0 0 10px;
  display: flex; align-items: center; gap: 8px;
}
.preview-meta { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; }
.unver-legend { color: var(--warn); }
.preview-scroll { overflow: auto; max-height: 340px; }
.preview-table { border-collapse: collapse; font-size: 11px; width: max-content; }
.preview-table th {
  background: #f2f1ed; padding: 5px 7px; text-align: left;
  white-space: nowrap; border: 1px solid var(--border);
  position: sticky; top: 0; font-weight: 500;
}
.preview-table th.unver { background: var(--warn-soft); color: var(--warn); }
.preview-table td {
  padding: 4px 7px; border: 1px solid var(--border);
  white-space: nowrap; max-width: 190px; overflow: hidden; text-overflow: ellipsis;
}

/* 设置 */
.set-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px; flex-wrap: wrap;
}
.set-row label { font-size: 13px; color: var(--text-dim); flex: none; }
.set-row input { max-width: 380px; }
.token {
  font-family: var(--mono); font-size: 12px; background: #f2f1ed;
  padding: 4px 9px; border-radius: 6px; color: var(--text-dim);
}
.note {
  font-size: 12px; color: var(--text-dim); background: #f2f1ed;
  border-left: 3px solid var(--border-strong);
  padding: 8px 12px; border-radius: 0 6px 6px 0; margin-top: 10px;
}

/* ===================== 视图切换 ===================== */
.view { display: block; }
.hidden { display: none !important; }
.grow { flex: 1; }

/* ===================== 登录 / 注册（简洁白底风格） ===================== */
#view-auth {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 32px 20px; background: #fff;
}
.auth-card { width: 100%; max-width: 400px; padding: 0; }
.auth-brand {
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 14px;
}
.auth-hello { font-size: 24px; line-height: 1.3; font-weight: 700; color: #1f2329; margin: 0 0 8px; }
.auth-slogan { font-size: 14px; color: #8a919e; margin: 0 0 26px; line-height: 1.6; }
.auth-card h1 { font-size: 19px; margin: 0 0 6px; font-weight: 600; }
.auth-sub { font-size: 13px; color: var(--text-dim); margin: 0 0 18px; line-height: 1.6; }

.auth-tabs { display: flex; align-items: center; gap: 14px; margin: 0 0 22px; }
.auth-tab {
  border: none; background: transparent; padding: 2px 0;
  font: inherit; font-size: 15px; color: #8a919e; cursor: pointer;
  border-bottom: 2px solid transparent;
}
.auth-tab.active { color: #1f2329; font-weight: 700; border-bottom-color: #2f6fed; }
.auth-tab-sep { width: 1px; height: 12px; background: #e3e5ec; }

.auth-form { display: flex; flex-direction: column; }
.f-label { font-size: 13px; color: #3a3f4b; margin: 16px 0 7px; display: block; }
.f-label + .f-input { margin-top: 0; }
.f-opt { color: #a5abb7; font-size: 12px; margin-left: 6px; }

/* 显式覆盖全局 input 规则（全局是 input[type=text]{width:100%;padding;border}，
   这里用 .auth-form .f-input 提高优先级并统一 text/password 两种框） */
.auth-form .f-input,
.modal .f-input {
  display: block; width: 100%; box-sizing: border-box;
  height: 46px; padding: 0 14px; margin: 0;
  font: inherit; font-size: 14px; color: #2b2f36;
  background: #fff; border: 1px solid #dcdee8; border-radius: 10px;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.auth-form .f-input::placeholder,
.modal .f-input::placeholder { color: #b3b9c4; }
.auth-form .f-input:focus,
.modal .f-input:focus {
  border-color: #2f6fed; box-shadow: 0 0 0 3px rgba(47,111,237,.12);
}

.f-pass { position: relative; }
.f-pass .f-input { padding-right: 46px; }
.eye {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: none; background: transparent;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; padding: 0;
}
.eye svg { width: 19px; height: 19px; fill: #b3b9c4; }
.eye:hover svg { fill: #2f6fed; }

.remember {
  display: flex; align-items: center; gap: 7px;
  margin: 14px 0 0; font-size: 13px; color: #5b616e;
  cursor: pointer; user-select: none;
}
.remember input { width: 15px; height: 15px; accent-color: #2f6fed; cursor: pointer; margin: 0; }

.login-btn {
  display: block; width: 100%; box-sizing: border-box;
  margin-top: 26px; height: 50px; border: none; border-radius: 999px; cursor: pointer;
  background: #2f6fed; color: #fff;
  font: inherit; font-size: 15px; font-weight: 600;
  transition: background .15s, transform .05s;
}
.login-btn:hover { background: #2761d4; }
.login-btn:active { transform: translateY(1px); }
.login-btn:disabled { opacity: .6; cursor: default; }

.btn.block { width: 100%; padding: 9px 0; margin-top: 4px; }

.auth-msg {
  display: none; margin-top: 16px; font-size: 13px; color: #e5484d;
  background: #fdf1f1; border: 1px solid #f6d5d5; border-radius: 10px; padding: 10px 14px;
}
.auth-msg.show { display: block; }
.auth-msg.err { color: #e5484d; }
.auth-card .note { margin-top: 16px; font-size: 13px; color: #6b7190; }

/* ===================== 页签 ===================== */
header.top .grow { flex: 1; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab {
  border: none; background: transparent; font: inherit; font-size: 13px;
  color: var(--text-dim); padding: 8px 16px; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.badge {
  display: inline-block; min-width: 17px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: 11px; line-height: 17px;
  text-align: center; margin-left: 3px;
}

/* ===================== 批次表 ===================== */
.batch-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.batch-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 13px; margin-top: 12px; }
.batch-table th {
  text-align: left; font-size: 11px; color: var(--text-dim); font-weight: 500;
  padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.batch-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.batch-table tr:last-child td { border-bottom: none; }
.b-name { font-weight: 500; }
.b-id { font-family: var(--mono); font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.b-scale { font-size: 12px; color: var(--text-dim); }
.b-time { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.b-detail { font-size: 11px; color: var(--text-dim); margin-top: 4px; max-width: 320px; line-height: 1.5; }
.b-ops { white-space: nowrap; }
.b-ops .btn { margin: 0 4px 4px 0; }

.st {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 500; white-space: nowrap;
}
.st-pending    { background: #e8eefc; color: #1e4ba8; }
.st-working    { background: var(--warn-soft); color: var(--warn); }
.st-previewed  { background: #d6f1ff; color: #10557e; border: 1px solid #b0ddf2; }
.st-done       { background: var(--accent-soft); color: var(--accent); }
.st-failed     { background: var(--danger-soft); color: var(--danger); }
.st-timeout    { background: #f6e2e2; color: #8c1d1d; border: 1px solid #e0aaaa; }
.st-cancelled  { background: #f0efeb; color: var(--text-faint); }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 5px;
  font-size: 11px; background: #f0efeb; color: var(--text-dim);
}
.tag-apply { background: var(--warn-soft); color: var(--warn); }

.warn-text { color: var(--warn); }
.ok-text   { color: var(--accent); }

/* ===================== 模式选择弹窗 ===================== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(28,27,24,.42);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 99;
}
.modal {
  position: relative;
  background: var(--surface); border-radius: 14px; padding: 22px 22px 16px;
  width: 100%; max-width: 480px; box-shadow: 0 18px 50px rgba(0,0,0,.22);
}
.modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 30px; height: 30px; padding: 0; border: none; background: transparent;
  border-radius: 8px; cursor: pointer; font-size: 22px; line-height: 1;
  color: var(--text-dim); display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: #f0f1f4; color: var(--text); }
.modal h3 { margin: 0 0 6px; font-size: 16px; }
.modal-sum { font-size: 12px; color: var(--text-dim); margin-bottom: 14px; }
.modal-opts { display: flex; flex-direction: column; gap: 9px; }
.modal-opt {
  text-align: left; border: 1px solid var(--border-strong); background: var(--surface);
  border-radius: 10px; padding: 11px 14px; cursor: pointer; font: inherit;
  display: flex; flex-direction: column; gap: 3px;
}
.modal-opt:hover { border-color: var(--accent); background: #f5f9fe; }
.modal-opt strong { font-size: 13px; }
.modal-opt span { font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.modal-opt.danger:hover { border-color: var(--danger); background: #fdf6f6; }
.modal-foot { margin-top: 14px; text-align: right; }

code {
  font-family: var(--mono); font-size: 12px; background: #f0efeb;
  padding: 1px 5px; border-radius: 4px;
}
a.btn { text-decoration: none; display: inline-block; }

/* ===================== 主应用顶部 ===================== */
header.top {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 24px 12px; background: var(--surface);
  border-bottom: 1px solid var(--border); margin-bottom: 0;
}
header.top .brand {
  font-family: var(--mono); font-size: 13px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent); font-weight: 600;
}
header.top .me { font-size: 13px; color: var(--text-dim); display: flex; align-items: center; gap: 6px; }
header.top .me #me-name { color: var(--text); font-weight: 500; }
header.top .me .role {
  font-size: 11px; padding: 2px 7px; border-radius: 4px;
  background: var(--accent-soft); color: var(--accent); font-weight: 500;
}
header.top .me .role.admin { background: #fff1d0; color: #8a5a00; }
header.top #btn-logout { padding: 5px 12px; font-size: 12px; }

main.container { padding: 18px 24px 80px; }

/* ===================== 面板 ===================== */
.pane { display: block; }
.pane.hidden { display: none; }
.pane h3 { font-size: 14px; font-weight: 600; margin: 18px 0 8px; }

.row-actions {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-bottom: 14px;
}
.row-actions .muted { font-size: 12px; color: var(--text-dim); }

/* 未开通功能提示横幅 */
.restricted-banner { margin:14px 0 0; padding:12px 16px; border-radius:10px; background:#fdf3e3; border:1px solid #f0d9b0; color:#a15c07; font-size:13px; line-height:1.6; }
.restricted-banner b { color:#7a4405; }
.f-input.inline { width:auto; min-width:150px; display:inline-block; }

.msg { display: none; margin: 8px 0; padding: 8px 12px; border-radius: 6px; font-size: 13px; }
.msg.show { display: block; }
.msg.err { background: var(--danger-soft); color: var(--danger); }
.msg:not(.err) { background: var(--accent-soft); color: var(--accent); }

.empty {
  padding: 28px 16px; text-align: center; color: var(--text-faint);
  font-size: 13px; background: var(--surface); border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}
#accounts-list .empty, #published-list .empty, #scripts-list .empty { min-height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; }

.prev-ag-body { display: flex; gap: 16px; flex-wrap: wrap; margin: 8px 0 12px; }
.prev-col { flex: 1; min-width: 180px; }
.prev-sub { font-size: 12px; color: var(--text-dim); margin-bottom: 4px; font-weight: 500; }
.prev-kws, .prev-rsa { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-main); }
.prev-kws li, .prev-rsa li { margin: 3px 0; line-height: 1.5; }
.prev-url { font-size: 12px; color: var(--text-dim); word-break: break-all; margin-top: 4px; }
/* ===================== 账号表格 ===================== */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tbl th {
  text-align: left; font-size: 11px; color: var(--text-dim); font-weight: 500;
  padding: 8px 10px; background: #faf9f5; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.tbl td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl tr:last-child td { border-bottom: none; }
.tbl .ops { white-space: nowrap; }
.tbl .ops .btn { margin: 0 3px 3px 0; }

/* 表格内行内 tag 状态 */
.tag.ok   { background: var(--accent-soft); color: var(--accent); }
.tag.warn { background: var(--warn-soft);    color: var(--warn); }
.tag.err  { background: var(--danger-soft);  color: var(--danger); }

code.tok {
  font-family: var(--mono); font-size: 11px; background: #f2f1ed;
  padding: 2px 6px; border-radius: 4px; color: var(--text);
  cursor: pointer; user-select: all;
}
code.tok:hover { background: var(--accent-soft); color: var(--accent); }

/* ===================== 代码块 / 复制 ===================== */
pre.copycode {
  background: #1f1e1b; color: #e6e5e0; border-radius: 8px;
  padding: 12px 14px; font-family: var(--mono); font-size: 11px; line-height: 1.5;
  max-height: 280px; overflow: auto; white-space: pre; margin: 8px 0;
}

.instr {
  background: #f2f1ed; border-radius: 6px; padding: 10px 14px;
  font-size: 12px; color: var(--text-dim); line-height: 1.7; white-space: pre-line;
  margin: 10px 0 0;
}

/* ===================== 上传脚本对话框（slot-0 + slot-30） ===================== */
.up-script {
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
  margin: 10px 0; background: #fbfbfa;
}
.up-script-head { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.up-script pre.copycode { max-height: 240px; margin: 6px 0; }

/* 分步引导：一次只显示 1 份脚本，顶部步骤指示 */
.up-steps { display: flex; align-items: center; margin: 6px 0 14px; }
.up-step {
  width: 26px; height: 26px; border-radius: 999px; flex: 0 0 26px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; background: #f5f6f8; color: #8a919e;
  border: 1px solid var(--border);
}
.up-step.on  { background: var(--primary); color: #fff; border-color: var(--primary); }
.up-step.done { background: #e8f6ec; color: #1a7a3c; border-color: #bfe6cb; }
.up-step-sep { flex: 0 0 30px; height: 2px; background: var(--border); margin: 0 5px; }
.up-nav { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

/* ===================== 批次日志 ===================== */
.logs {
  background: #fcfcfb; border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 12px; max-height: 200px; overflow: auto; font-size: 12px;
}
.log { padding: 3px 0; border-bottom: 1px dashed var(--border); }
.log:last-child { border-bottom: none; }
.log .lt { font-family: var(--mono); font-size: 11px; color: var(--text-faint); margin-right: 8px; }
.log.err { color: var(--danger); }
.log.err .lt { color: var(--danger); }

/* ===================== 弹窗扩展 ===================== */
.modal pre { background: #1f1e1b; color: #e6e5e0; border-radius: 6px; padding: 10px 12px; font-size: 11px; max-height: 220px; overflow: auto; white-space: pre-wrap; }
.modal h4 { font-size: 13px; font-weight: 600; margin: 14px 0 6px; color: var(--text-dim); }

/* 二级按钮 */
.btn.secondary { background: transparent; color: var(--text-dim); border-color: var(--border); }
.btn.secondary:hover { background: #faf9f5; color: var(--text); }

/* ===================== 新建批次 · ads 搜索表格 ===================== */
.btabs { display: flex; gap: 6px; margin: 14px 0 10px; border-bottom: 1px solid var(--border); }
.btab { background: transparent; border: none; padding: 8px 14px; font-size: 13px; color: var(--text-dim); cursor: pointer; border-bottom: 2px solid transparent; }
.btab:hover { color: var(--text); }
.btab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.btabpane { margin-top: 10px; }
.form-campaign { background: #fafaf8; border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.row2 { display: flex; gap: 12px; }
.row2 > label { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-dim); margin-bottom: 8px; }
.row2 > label input, .row2 > label select { width: 100%; }
.ag-card { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 12px; background: #fff; }
.ag-head { font-weight: 600; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; color: var(--text); }
.ag-del, .kw-del, .g-del { background: transparent; border: 1px solid var(--border); color: var(--text-faint); border-radius: 4px; width: 24px; height: 24px; cursor: pointer; line-height: 1; flex: none; }
.ag-del:hover, .kw-del:hover, .g-del:hover { color: #c0392b; border-color: #c0392b; }
.sub { font-size: 12px; color: var(--text-dim); margin: 10px 0 6px; font-weight: 600; }
.add-ctrl { display: inline-flex; gap: 6px; align-items: center; margin-left: 6px; }
.add-ctrl select { padding: 4px 8px; border: 1px solid var(--border-strong); border-radius: 8px; font-size: 13px; background: var(--surface); color: var(--text); }
.ag-add-kw { padding: 4px 12px; border: 1px solid var(--accent); color: var(--accent); background: #fff; border-radius: 8px; font-size: 13px; cursor: pointer; margin-left: 2px; }
.ag-add-kw:hover { background: var(--accent-soft); }
.kw-tbl, .grid-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.kw-tbl th, .grid-tbl th { text-align: left; color: var(--text-dim); font-weight: 600; padding: 4px 6px; border-bottom: 1px solid var(--border); }
.kw-tbl td, .grid-tbl td { padding: 3px 4px; border-bottom: 1px solid #f0efea; }
.kw-tbl input, .grid-tbl input, .kw-tbl select, .grid-tbl select { width: 100%; padding: 5px 6px; border: 1px solid #767676; border-radius: 3px; font-size: 12px; }
.rsa-heads, .rsa-descs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.rsa-field { display: flex; flex-direction: column; gap: 2px; }
.ext-fold { margin-top: 10px; border: 1px solid #e6e8ee; border-radius: 10px; background: #f5f6f8; overflow: hidden; }
.ext-fold > summary { cursor: pointer; padding: 10px 14px; font-size: 13px; font-weight: 600; color: #1f2329; user-select: none; list-style: none; }
.ext-fold > summary::-webkit-details-marker { display: none; }
.ext-fold > summary::before { content: "▸ "; color: #8a919e; }
.ext-fold[open] > summary::before { content: "▾ "; }
.ext-fold > summary:hover { background: #eef0f4; }
.ext-block { padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.ext-block .sub { margin-top: 4px; }
.ext-block textarea, .ext-block select { width: 100%; box-sizing: border-box; font-family: inherit; }
.ext-block textarea { resize: vertical; font-size: 13px; padding: 8px 10px; border: 1px solid #e6e8ee; border-radius: 8px; line-height: 1.5; }
.ext-block select { height: 40px; border: 1px solid #e6e8ee; border-radius: 8px; padding: 0 10px; background: #fff; }
.rsa-label { font-size: 11px; color: var(--text-faint); }
.rsa-input { padding: 6px 8px; border: 1px solid #767676; border-radius: 3px; font-size: 13px; }
.rsa-count { font-size: 10px; color: var(--text-faint); text-align: right; }
.grid-tbl { display: block; overflow-x: auto; white-space: nowrap; }

/* ===================== 新建批次 · 地区/语言 下拉选择框 ===================== */
.tg-block { display: flex; gap: 14px; margin: 12px 0; }
.tg-col { flex: 1; min-width: 0; }
.tg-head { font-size: 12px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }
.tg-combo { position: relative; }
.tg-field {
  display: flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 7px 12px; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: 9px;
  background: var(--surface); font-size: 13px; color: var(--text);
  transition: border-color .12s, box-shadow .12s;
}
.tg-field:hover { border-color: var(--accent); }
.tg-field.open { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tg-val { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-val.ph { color: var(--text-faint); }
.tg-caret { color: var(--text-faint); font-size: 11px; transition: transform .15s; flex: none; }
.tg-field.open .tg-caret { transform: rotate(180deg); }
.tg-pop {
  position: absolute; top: calc(100% + 5px); left: 0; right: 0; z-index: 60;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 11px; padding: 8px;
  box-shadow: 0 10px 30px rgba(16,24,40,.16);
}
.tg-pop[hidden] { display: none; }
.tg-filter { width: 100%; }
.tg-list { max-height: 210px; overflow: auto; margin-top: 6px; }
.tg-item { display: flex; align-items: center; gap: 7px; padding: 6px 8px; border-radius: 6px; font-size: 12px; color: var(--text); cursor: pointer; }
.tg-item:hover { background: #f0f3f8; }
.tg-item.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tg-item.hide { display: none; }
.tg-check { width: 14px; flex: none; color: var(--accent); font-weight: 700; }
.tg-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-block { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 6px 0 4px; padding: 8px 10px; background: #f5f9fe; border: 1px solid #d9e6f5; border-radius: 8px; }
.pm-label { font-size: 13px; font-weight: 600; color: var(--text); }
.pm-opt { font-size: 13px; color: var(--text-dim); display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.net-note { display: flex; flex-direction: column; justify-content: center; font-size: 11px; color: var(--text-faint); line-height: 1.5; }

/* ===================== 已发布广告管理面板 ===================== */
.pub-acct-label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-dim); }
.pub-acct-label select { max-width: 280px; }
.pub-camp { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; background: var(--surface); }
.pub-camp:last-child { margin-bottom: 0; }
.pub-camp-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pub-camp-head > b { font-size: 14px; }
.pub-meta { font-size: 12px; color: var(--text-dim); }
.pub-actions { margin-left: auto; display: flex; gap: 6px; }
.pub-ag { margin-top: 10px; }
.pub-ag th { background: #faf9f5; }

/* ===================== 后台界面美化 v2（对齐登录页风格） ===================== */

/* 顶栏 */
header.top {
  align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 0 0 18px; padding: 14px 18px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
header.top .brand {
  font-size: 16px; font-weight: 700; color: #1f2329;
  display: flex; align-items: center; gap: 10px;
}
header.top .brand::before {
  content: ''; width: 8px; height: 18px; border-radius: 3px;
  background: linear-gradient(180deg, #5b8bfa, #2f6fed);
}
header.top .me { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #5b616e; }
.role {
  padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: #eef1f6; color: #5b616e;
}
.role.admin { background: var(--accent-soft); color: var(--accent); }
.me-trial { font-size: 12px; padding: 2px 9px; border-radius: 999px; font-weight: 600; }
.me-trial.member-ok { color: #1a7a3c; background: #e8f6ec; }
.me-trial.member-exp { color: #d93a3a; background: #fdf1f1; }
.me-trial.member-life { color: #2761d4; background: #eaf1fe; }

/* ===== MCC 多账户配置 ===== */
.mcc-card {
  border: 1px solid var(--border); border-radius: 12px; background: #fff;
  padding: 14px 16px; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .04);
}
.mcc-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mcc-card-head b { font-size: 14px; color: var(--text); }
.mcc-cid { color: var(--text-dim, #5b616e); font-size: 13px; }
.mcc-tag-default {
  background: var(--accent-soft, #eaf1fe); color: var(--accent, #2f6fed);
  font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 10px;
}
.mcc-card .ops { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

/* 页签 */
.tabs { gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab {
  font-size: 14px; color: #8a919e; padding: 10px 16px;
  border-radius: 8px 8px 0 0; transition: color .15s, background .15s;
}
.tab:hover { color: #3a3f4b; background: #f3f4f7; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; background: transparent; }

/* 容器与面板 */
.container { max-width: 1180px; }
.pane h3 { font-size: 15px; font-weight: 600; color: #1f2329; margin: 22px 0 8px; }
.panel {
  border-radius: 12px; padding: 18px; margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(16,24,40,.04);
}
.panel h2 { font-size: 14px; margin: 0 0 12px; }
.row-actions {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap; margin-bottom: 14px;
}

/* 按钮 */
.btn {
  border-radius: 9px; padding: 8px 16px; font-size: 13px; font-weight: 500;
  color: #3a3f4b; transition: background .15s, border-color .15s;
}
.btn:hover { background: #f6f7fa; border-color: #c3c8d4; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #2761d4; border-color: #2761d4; }
.btn.danger { color: var(--danger); border-color: #f0cfcf; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.small { padding: 4px 11px; font-size: 12px; border-radius: 7px; }
.btn.small.danger { color: var(--danger); border-color: #f0cfcf; background: #fff; }
.btn.small.danger:hover { background: var(--danger-soft); border-color: var(--danger); }

/* 直接投放（立即跑）——醒目的暖色，提示会立即消耗预算 */
.btn.warn-run { background: #e8830c; border-color: #e8830c; color: #fff; }
.btn.warn-run:hover { background: #cf730a; border-color: #cf730a; }
.pm-actions { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }

/* 广告结构预览 */
.prev-camp { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-top: 8px; background: #fcfcfd; }
.prev-camp-h { font-weight: 600; color: #1f2329; font-size: 13px; }
.prev-ags { margin: 6px 0 0; padding-left: 18px; }
.prev-ags li { font-size: 12.5px; color: #5b616e; margin: 2px 0; }
.prev-status { margin-top: 12px; }
.prev-json { max-height: 220px; overflow: auto; background: #1f2329; color: #e6e8ee; border-radius: 8px; padding: 10px; font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.muted { color: #8a919e; }

/* 核对配置：广告结构树（更清晰的可视化预览） */
.struct-tree { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.stg-camp { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: #fff; box-shadow: 0 1px 3px rgba(16,24,40,.04); }
.stg-camp-h { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.stg-camp-name { font-weight: 600; color: var(--text); font-size: 14px; margin-right: 4px; }
.stg-tag { font-size: 11px; color: var(--text-dim); background: #f2f4f8; border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }
.stg-status { font-size: 11px; border-radius: 999px; padding: 1px 8px; font-weight: 600; }
.stg-status.pause { color: var(--warn); background: var(--warn-soft); }
.stg-status.run { color: var(--danger); background: var(--danger-soft); }
.stg-ags { display: flex; flex-direction: column; gap: 8px; padding-left: 12px; border-left: 2px solid var(--border); }
.stg-ag { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: #fcfcfd; }
.stg-ag-h { font-weight: 600; color: var(--text); font-size: 13px; margin-bottom: 8px; }
.stg-ag-cols { display: flex; gap: 10px; flex-wrap: wrap; }
.stg-col { flex: 1; min-width: 170px; }
.stg-col-h { font-size: 12px; color: var(--text-dim); font-weight: 600; margin-bottom: 5px; }
.stg-list { display: flex; flex-direction: column; gap: 3px; max-height: 230px; overflow: auto; }
.stg-item { font-size: 12.5px; color: var(--text-main); line-height: 1.5; padding: 2px 6px; background: #fff; border: 1px solid var(--border); border-radius: 6px; word-break: break-word; }
.stg-kw { color: var(--text); }
.stg-cpc { font-size: 11px; color: var(--text-dim); }
.stg-url { font-size: 12px; color: var(--text-dim); word-break: break-all; margin-top: 8px; background: #f2f4f8; border-radius: 6px; padding: 4px 8px; }
.stg-ags-ext { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; padding-top: 8px; border-top: 1px dashed #e6e8ee; }

/* 表格 */
.batch-table { font-size: 13px; margin-top: 0; min-width: 760px; }
.batch-table th {
  font-size: 12px; font-weight: 600; color: #5b616e;
  padding: 11px 12px; background: #f7f8fa; border-bottom: 1px solid var(--border);
}
.batch-table td { padding: 12px; border-bottom: 1px solid #f0f1f4; }
.batch-table tbody tr:hover { background: #fafbfc; }
.batch-table tr:last-child td { border-bottom: none; }

/* 状态标签 */
.st {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; line-height: 18px; white-space: nowrap; border: none;
}
.st-pending    { background: #eef1f6; color: #5b616e; }
.st-working    { background: var(--warn-soft); color: var(--warn); }
.st-previewed  { background: #e3f2fd; color: #1668c1; }
.st-done       { background: #e8f6ec; color: #1a7a3c; }
.st-failed     { background: var(--danger-soft); color: var(--danger); }
.st-timeout    { background: #fdeeee; color: #b02525; }
.st-cancelled  { background: #f0f1f4; color: #8a919e; }

/* 提示文字与消息 */
.muted { color: #8a919e; font-size: 12.5px; line-height: 1.7; }
.msg { border-radius: 10px; padding: 10px 14px; font-size: 13px; }
.msg.err { background: var(--danger-soft); color: var(--danger); border: 1px solid #f6d5d5; }
.msg.show { background: var(--accent-soft); color: var(--accent); border: 1px solid #cfe0fd; }

/* 代码块（API 地址等） */
.copycode {
  background: #f7f8fa; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; font-family: var(--mono); font-size: 12.5px;
  color: #3a3f4b; overflow-x: auto; margin: 0; white-space: pre-wrap; word-break: break-all;
}

/* ===================== 弹窗界面美化 v2 ===================== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(17, 24, 39, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 100;
}
.modal {
  background: #fff; border-radius: 16px; padding: 24px 26px;
  width: 100%; max-width: 520px; max-height: 90vh; overflow: auto;
  box-shadow: 0 24px 60px rgba(16, 24, 40, .22);
}
.modal h3 { font-size: 17px; font-weight: 700; color: #1f2329; margin: 0 0 6px; }
.modal h4 { font-size: 13px; font-weight: 600; color: #3a3f4b; margin: 18px 0 8px; }
.modal-sum { font-size: 13px; color: #8a919e; margin: 0 0 18px; line-height: 1.6; }
.modal-actions {
  display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px;
}
.modal .f-label { margin: 16px 0 7px; }
.modal .f-input { margin: 0; }

/* slot 选项卡片 */
.slot-opts { display: flex; flex-direction: column; gap: 10px; }
.slot-opt {
  display: flex; align-items: flex-start; gap: 10px;
  border: 1px solid #e6e8ee; border-radius: 10px; padding: 12px 14px;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.slot-opt:hover { border-color: #c3c8d4; background: #fafbfc; }
.slot-opt input { margin-top: 2px; accent-color: #2f6fed; flex: none; }
.slot-opt b { display: block; font-size: 13px; font-weight: 600; color: #1f2329; }
.slot-opt em { display: block; font-size: 12px; font-style: normal; color: #8a919e; margin-top: 2px; }
.slot-opt.on { border-color: #2f6fed; background: #f5f8ff; }

/* ===================== API 根地址块（按钮式） ===================== */
.api-base-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 10px 10px 14px;
}
.api-base-code {
  flex: 1; min-width: 180px;
  font-family: var(--mono); font-size: 12.5px; color: #3a3f4b;
  word-break: break-all; line-height: 1.6;
}

/* ===================== API 地址自检状态 ===================== */
.api-status {
  margin-top: 10px; font-size: 12.5px; line-height: 1.7;
  border-radius: 8px; padding: 9px 13px;
}
.api-status.ok  { background: #e8f6ec; color: #1a7a3c; }
.api-status.bad { background: #fdf1f1; color: #d93a3a; border: 1px solid #f6d5d5; }

/* ===================== 生成脚本后的 HTTPS 异常告警 ===================== */
.up-warn {
  background: var(--danger-soft); border: 1px solid #f6d5d5;
  border-radius: 10px; padding: 12px 14px; margin-bottom: 14px;
}
.up-warn-title { font-size: 14px; font-weight: 700; color: var(--danger); margin-bottom: 6px; }
.up-warn-body { font-size: 12.5px; line-height: 1.7; color: #b02525; }
.up-warn-body code { background: #fde2e2; color: #8c1d1d; }

/* 脚本状态面板 */
.script-status-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.script-status-card {
  padding: 18px 20px;
}
.script-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.script-status-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.status-pill.success { background: #e8f6ec; color: #1a7a3c; }
.status-pill.warning { background: #fdf3e3; color: #a15c07; }
.status-pill.danger  { background: #fdf1f1; color: #d93a3a; }
.status-pill.neutral { background: #f2f3f5; color: #5b616e; }
.status-pill.working { background: var(--accent-soft); color: var(--accent); }
.status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  padding: 10px 0;
  border-bottom: 1px solid #e6e8ee;
}
.status-row:last-of-type { border-bottom: none; }
.status-label {
  min-width: 80px;
  color: #5b616e;
  font-size: 13px;
}
.status-value {
  font-weight: 600;
  font-size: 14px;
}
.status-value.success { color: #1a7a3c; }
.status-value.warning { color: #a15c07; }
.status-value.danger  { color: #d93a3a; }
.status-value.neutral { color: #5b616e; }
.status-detail {
  width: 100%;
  margin: 2px 0 0;
  font-size: 12px;
}
.coverage-warning {
  margin: 12px 0;
  padding: 12px 14px;
  background: #fdf3e3;
  border: 1px solid #f5d9a8;
  border-radius: 9px;
  color: #a15c07;
  font-size: 13px;
}
.coverage-warning strong {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}
.coverage-warning p { margin: 0; line-height: 1.5; }
.script-execution-plan {
  margin-top: 14px;
  padding: 14px;
  background: #f8f9fa;
  border: 1px solid #e6e8ee;
  border-radius: 9px;
}
.script-execution-plan h4 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
}
.script-execution-plan ol {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: #5b616e;
  line-height: 1.7;
}
.script-status-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.script-status-actions .btn {
  padding: 8px 16px;
  border-radius: 9px;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
}
.script-status-actions .btn-primary {
  background: #2f6fed;
  color: #fff;
  border-color: #2f6fed;
}
.script-status-actions .btn-primary:hover { background: #2761d4; }
.script-status-actions .btn-secondary {
  background: #fff;
  color: #1f2329;
  border-color: #e6e8ee;
}
.script-status-actions .btn-secondary:hover { border-color: #c3c8d4; }
.script-status-logs {
  margin-top: 14px;
  padding: 14px;
  background: #fafbfc;
  border: 1px solid #e6e8ee;
  border-radius: 9px;
}
.script-status-result {
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13px;
  line-height: 1.5;
  background: #f5f6f8;
  border: 1px solid #e6e8ee;
  color: #5b616e;
}
.script-status-result.success { background: #e8f6ec; border-color: #bfe3c9; color: #1a7a3c; }
.script-status-result.warning { background: #fdf3e3; border-color: #f0d9a8; color: #a15c07; }
.script-status-result.danger { background: #fdf1f1; border-color: #f3c2c2; color: #d93a3a; }
.script-status-actions .btn[disabled] { opacity: .6; cursor: default; }
.script-status-logs h4 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
}
.log-list { font-size: 12px; }
.log-batch-title {
  font-weight: 600;
  margin: 8px 0 4px;
  color: #1f2329;
}
.log-line {
  padding: 3px 0;
  color: #5b616e;
  line-height: 1.4;
}
.log-time {
  display: inline-block;
  min-width: 120px;
  color: #8a919e;
}
.log-line.err { color: var(--danger); }
.log-line.err .log-time { color: var(--danger); }
.log-hint { margin: 6px 0 10px; padding: 8px 10px; border-radius: 8px; font-size: 12px; line-height: 1.5; }
.log-hint.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid #f3d9a8; }

/* ===== 新建广告 4 步向导 ===== */
.wiz-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 18px;
}
.wiz-step {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-faint);
  font-size: 13px;
  white-space: nowrap;
}
.wiz-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
  background: var(--surface);
  flex: none;
}
.wiz-step.active { color: var(--accent); font-weight: 600; }
.wiz-step.active .wiz-num { border-color: var(--accent); color: #fff; background: var(--accent); }
.wiz-step.done { color: #1a7a3c; }
.wiz-step.done .wiz-num { border-color: #1a7a3c; color: #1a7a3c; }
.wiz-line { flex: 1; height: 1.5px; background: var(--border); }
.wiz-pane.hidden { display: none; }

.wiz-acc-list { display: flex; flex-direction: column; gap: 8px; }
.wiz-acc {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  cursor: pointer;
  background: var(--surface);
  transition: border-color .12s, box-shadow .12s;
}
.wiz-acc:hover { border-color: var(--accent); }
.wiz-acc input { accent-color: var(--accent); width: 16px; height: 16px; }
.wiz-acc:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.wiz-acc-name { font-weight: 600; color: var(--text); font-size: 14px; }
.wiz-acc-sub { margin-left: auto; font-size: 12px; color: var(--text-faint); }

/* W4 选账号表格：搜索 + 胶囊状态，替代下拉框 */
.acc-search { margin: 4px 0 10px; }
.acc-search input {
  width: 100%; height: 42px; border: 1px solid var(--border-strong); border-radius: 9px;
  padding: 0 14px; font-size: 14px; background: var(--surface); color: var(--text);
  transition: border-color .12s, box-shadow .12s; box-sizing: border-box;
}
.acc-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.acc-table-wrap { max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.acc-sel-tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.acc-sel-tbl thead th {
  position: sticky; top: 0; background: var(--bg); text-align: left; padding: 10px 12px;
  font-size: 12px; color: var(--text-dim); font-weight: 600; border-bottom: 1px solid var(--border);
}
.acc-sel-tbl th.col-radio, .acc-sel-tbl td.col-radio { width: 36px; text-align: center; }
.acc-sel-tbl tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.acc-sel-tbl tbody tr:last-child td { border-bottom: none; }
.acc-row { cursor: pointer; transition: background .12s; }
.acc-row:hover { background: var(--bg); }
.acc-row.sel { background: var(--accent-soft); }
.acc-row.sel td { border-bottom-color: transparent; }
.acc-row input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; }
.acc-name { font-weight: 600; color: var(--text); font-size: 14px; }
.acc-cid { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.acc-empty { text-align: center; color: var(--text-faint); padding: 22px 12px !important; }

.wiz-alert {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 12px;
  line-height: 1.6;
}
.wiz-alert.err { background: var(--danger-soft); color: var(--danger); }
.wiz-alert.warn { background: var(--warn-soft); color: var(--warn); }

.wiz-final-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 16px;
  margin-bottom: 12px;
  background: var(--surface);
}
.wiz-final-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.wiz-final-row:last-child { border-bottom: none; }
.wiz-final-row span { color: var(--text-dim); }
.wiz-final-row b { color: var(--text); font-weight: 600; }

/* 发布后状态单选卡（向导第 3 步） */
.pm-block { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 14px; }
.pm-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.pm-card { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; cursor: pointer; background: #fff; margin-bottom: 8px; }
.pm-card:hover { border-color: var(--accent); }
.pm-card input { accent-color: var(--accent); width: 16px; height: 16px; margin-top: 2px; }
.pm-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pm-card.warn.selected { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.pm-card-main { display: flex; flex-direction: column; gap: 2px; }
.pm-card-name { font-weight: 600; color: var(--text); font-size: 14px; }
.pm-card-desc { font-size: 12px; color: var(--text-dim); }
.pm-card-warn { color: var(--danger); font-weight: 600; }

/* ===== W3 创意评分卡 ===== */
.cs-title { margin: 16px 0 8px; font-size: 14px; color: var(--text); }
.cs-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: #fff; }
.cs-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.cs-gauge { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.cs-num { font-size: 30px; font-weight: 700; }
.cs-lab { font-size: 11px; color: var(--text-dim); margin-top: 3px; }
.cs-strength { font-size: 13px; font-weight: 700; padding: 4px 14px; border-radius: 999px; }
.cs-strength.excellent { background: #e8f6ec; color: #1a7a3c; }
.cs-strength.good { background: #e9f0fe; color: #2f6fed; }
.cs-strength.fair { background: #fdf3e3; color: #a15c07; }
.cs-strength.weak { background: #fdf1f1; color: #d93a3a; }
.cs-bars { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.cs-bar-row { display: flex; align-items: center; gap: 10px; }
.cs-bar-lab { width: 32px; font-size: 12px; color: var(--text-dim); }
.cs-bar { flex: 1; height: 8px; background: #eef0f4; border-radius: 999px; overflow: hidden; }
.cs-bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.cs-bar-val { width: 52px; text-align: right; font-size: 12px; color: var(--text); font-variant-numeric: tabular-nums; }
.cs-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cs-list li { font-size: 12.5px; display: flex; align-items: flex-start; gap: 6px; }
.cs-list li.ok { color: #1a7a3c; }
.cs-list li.bad { color: #d93a3a; }
.cs-ic { font-weight: 700; }

/* ===== W3 发布结果可视化 ===== */
.res-card { border-radius: 12px; padding: 14px 16px; margin-top: 4px; }
.res-card.ok { background: #e8f6ec; border: 1px solid #bfe6cb; }
.res-card.err { background: #fdf1f1; border: 1px solid #f3c4c4; }
.res-card.warn { background: #fdf3e3; border: 1px solid #f0d9a8; }
.res-head { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.res-head.err { color: #d93a3a; }
.res-head.warn { color: #a15c07; }
.res-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.res-list li { font-size: 13px; color: #1f2329; }
.res-note { font-size: 12px; color: #5b616e; background: rgba(255,255,255,.6); border-radius: 8px; padding: 6px 10px; }
.res-err-msg { font-size: 13px; color: #d93a3a; font-weight: 600; line-height: 1.5; margin-bottom: 10px; white-space: pre-wrap; word-break: break-word; }
.res-raw { margin-top: 10px; }
.res-raw summary { font-size: 12px; color: #5b616e; cursor: pointer; }
.res-raw pre { margin: 6px 0 0; font-size: 11px; background: #fff; border: 1px solid #f0d2d2; border-radius: 8px; padding: 8px; max-height: 180px; overflow: auto; white-space: pre-wrap; word-break: break-word; }

/* 表格网格：文案纵向展开行（主行下方全宽双列，替代横向 19 列） */
.g-copy-chip { display: inline-block; background: var(--accent-soft); color: var(--accent); border-radius: 999px; font-size: 11px; font-weight: 600; padding: 2px 8px; white-space: nowrap; }
.grid-copy-row td { background: #fafbfd; padding: 10px 12px 14px; border-bottom: 1px solid var(--border); }
.grid-copy-sec { max-width: 860px; }
.grid-copy-t { font-size: 12px; color: var(--text-dim); font-weight: 600; margin: 8px 0 6px; }
.grid-copy-t:first-child { margin-top: 0; }
.grid-copy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid-copy-grid input { width: 100%; padding: 6px 8px; border: 1px solid #767676; border-radius: 3px; font-size: 12px; }

/* ============ v3.9.41 已发布广告：Google 真实快照表格 ============ */
.pub-sync { font-size: 12px; color: #5b616e; background: #f5f6f8; border: 1px solid #e6e8ee; border-radius: 8px; padding: 6px 12px; margin-bottom: 10px; }
.pub-sync.warn { color: #a15c07; background: #fdf3e3; border-color: #f0dfc0; }
.pub-live { width: 100%; border-collapse: collapse; background: #fff; }
.pub-live th { text-align: left; font-size: 12px; color: #5b616e; font-weight: 600; padding: 8px 10px; border-bottom: 1px solid #e6e8ee; white-space: nowrap; }
.pub-live td { padding: 10px; border-bottom: 1px solid #eef0f4; vertical-align: top; font-size: 13px; }
.pub-live tr:last-child td { border-bottom: none; }
.pub-ags { font-size: 12px; color: #8a919e; margin-top: 3px; max-width: 260px; }
.pub-live-actions { white-space: nowrap; }
.pub-live-actions .btn { margin: 2px 4px 2px 0; }
.pub-missing { font-size: 12px; color: #8a919e; background: #f5f6f8; border-radius: 8px; padding: 8px 12px; margin-top: 10px; }
.st-pill-warn { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 600; color: #a15c07; background: #fdf3e3; padding: 2px 7px; border-radius: 999px; cursor: help; }
