/* 明亮多彩科技风 · PbootCMS 批量发文工具 UI
 * 主色：蓝(primary) + 白(背景) + 黄(高亮/警示) + 绿(成功) + 红(危险)
 * 目标：亲切、鲜活、清晰，不过度暗沉。
 */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #eef3fb;
  --bg-soft: #f6f9fd;
  --card: #ffffff;
  --card-hover: #ffffff;
  --line: #e3e9f2;
  --line-soft: #eef2f8;
  --text: #1f2d3d;
  --text-muted: #6b7a90;
  --primary: #2f6bff;
  --primary-d: #1d4ed8;
  --primary-glow: rgba(47, 107, 255, 0.28);
  --gold: #f5b50a;
  --ok: #16a34a;
  --warn: #f59e0b;
  --no: #ef4444;
  --shadow: 0 6px 22px rgba(31, 45, 61, 0.10);
  --radius: 14px;
}

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 0%, rgba(47, 107, 255, 0.10), transparent 38%),
    radial-gradient(circle at 88% 8%, rgba(16, 185, 129, 0.10), transparent 40%),
    linear-gradient(180deg, #eef3fb 0%, #f6f9fd 60%, #eef3fb 100%);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* 顶部彩色科技标题栏 */
.topbar {
  background: linear-gradient(120deg, #1d4ed8 0%, #2f6bff 45%, #22b8cf 100%);
  color: #fff;
  padding: 18px 28px;
  display: flex;
  align-items: baseline;
  gap: 16px;
  box-shadow: 0 6px 24px rgba(31, 77, 216, 0.28);
  position: relative;
  overflow: hidden;
}
.topbar::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -50px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 70%);
  pointer-events: none;
}
.brand {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.15);
}
.brand-sub { color: #eaf2ff; font-size: 13px; font-weight: 500; letter-spacing: 0.3px; }
.admin-link {
  margin-left: auto;
  color: #fff;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.35);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  align-self: center;
}
.admin-link:hover { background: rgba(255,255,255,0.28); }

/* Tab 导航 */
.tabs {
  display: flex;
  gap: 6px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  box-shadow: 0 2px 10px rgba(31, 45, 61, 0.05);
}
.tab {
  background: none;
  border: none;
  padding: 14px 20px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
}
.tab:hover { color: var(--primary); }
.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 700;
}

.container { max-width: 1100px; margin: 28px auto; padding: 0 22px 80px; }
.panel { display: none; animation: fadeIn 0.35s ease; }
.panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
h2 { font-size: 19px; font-weight: 700; color: var(--text); }
h3 { font-size: 15px; margin: 26px 0 12px; color: var(--primary-d); font-weight: 700; }
h3:first-of-type { margin-top: 0; }
.hint { color: var(--text-muted); margin-bottom: 16px; font-size: 13px; line-height: 1.7; }

/* 按钮 */
.btn {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 9px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}
.btn:hover { border-color: #b9cef2; box-shadow: 0 2px 10px rgba(47, 107, 255, 0.12); transform: translateY(-1px); }
.btn.primary {
  background: linear-gradient(135deg, #2f6bff, #1d4ed8);
  border-color: transparent;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(47, 107, 255, 0.30);
}
.btn.primary:hover { background: linear-gradient(135deg, #3f7bff, #2456e0); box-shadow: 0 6px 22px rgba(47, 107, 255, 0.42); }
.btn.success {
  background: linear-gradient(135deg, #1fb866, #13924e);
  border-color: transparent;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(16, 163, 74, 0.28);
}
.btn.info {
  background: linear-gradient(135deg, #f0a93a, #c08a2d);
  border-color: transparent;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(192, 138, 45, 0.30);
}
.btn.info:hover { filter: brightness(1.06); box-shadow: 0 6px 22px rgba(192, 138, 45, 0.42); }
.btn.danger { color: var(--no); border-color: #f3c0c0; }
.btn.danger:hover { background: #fdeaea; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.actions { display: flex; align-items: center; gap: 14px; margin: 12px 0 18px; flex-wrap: wrap; }
.status-text { color: var(--text-muted); font-size: 13px; }
.progress-wrap {
  display: flex; align-items: center; gap: 10px;
  margin: -8px 0 18px;
}
.progress-bar {
  flex: 1; height: 10px; background: var(--line-soft); border-radius: 5px;
  overflow: hidden; position: relative; transition: width 0.3s ease;
}
.progress-bar::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 100%;
  background: linear-gradient(90deg, var(--primary), #22b8cf);
  border-radius: 5px;
}
.progress-text { font-size: 13px; color: var(--text-muted); min-width: 42px; text-align: right; }
.progress-bar-image::after { background: linear-gradient(90deg, #8b5cf6, #ec4899); }

/* 表单 */
.field { margin: 12px 0; }
.field > label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
input, textarea, select {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: all 0.2s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.14);
}
input::placeholder, textarea::placeholder { color: #aab4c4; }
textarea { resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.model-combo { display: flex; gap: 8px; align-items: center; }
.model-combo input { flex: 1; min-width: 0; }
.model-combo select { width: auto; min-width: 120px; max-width: 160px; padding-right: 28px; }
.field.inline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.field.inline > label { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 0; font-size: 14px; color: var(--text); cursor: pointer; line-height: 1.5; }
.field.inline input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}
.field.inline label small {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}

/* 卡片 */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(31, 45, 61, 0.14);
  border-color: #c5d8fb;
}
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-meta { font-size: 13px; color: var(--text-muted); line-height: 2; word-break: break-all; }
.card-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.badge { font-size: 12px; padding: 3px 10px; border-radius: 20px; font-weight: 700; }
.badge.ok { background: #e7f7ee; color: #13924e; border: 1px solid #bce9cd; }
.badge.warn { background: #fff6e0; color: #b4790a; border: 1px solid #ffe2a0; }
.badge.no { background: #fdecec; color: #d33a3a; border: 1px solid #f6c4c4; }

/* 站点选择 chip（带自定义勾选图标 + 状态徽标） */
.chip-row { display: flex; flex-wrap: wrap; gap: 12px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  background: #fff;
  color: var(--text-muted);
  transition: all 0.18s ease;
  user-select: none;
  position: relative;
}
.chip:hover { border-color: #b9cef2; color: var(--text); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(31,45,61,0.08); }
.chip input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }
/* 自定义勾选框 */
.chip-check {
  width: 18px; height: 18px; border-radius: 6px; border: 2px solid var(--line);
  background: #fff; flex: 0 0 auto; position: relative; transition: all 0.18s ease;
}
.chip-check::after {
  content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform 0.18s ease;
}
.chip.on .chip-check { background: var(--primary); border-color: var(--primary); }
.chip.on .chip-check::after { transform: rotate(45deg) scale(1); }
.chip-name { font-weight: 600; color: var(--text); }
.chip-badge { font-size: 11px; padding: 2px 8px; border-radius: 20px; }
.chip-badge.ok { color: var(--ok); background: rgba(22,163,74,0.12); }
.chip-badge.off { color: var(--text-muted); background: var(--bg-soft); }
.chip.on { border-color: var(--primary); background: #f2f7ff; color: var(--primary-d); box-shadow: 0 0 12px rgba(47,107,255,0.12); }
.chip[title] { opacity: .9; }

/* 结果列表 */
.result-list { display: flex; flex-direction: column; gap: 12px; }
.result {
  display: flex;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  transition: box-shadow 0.2s ease;
}
.result:hover { box-shadow: 0 4px 18px rgba(31, 45, 61, 0.10); }
.result .chk { padding-top: 3px; }
.result-body { flex: 1; min-width: 0; }
.result-title { font-weight: 700; color: var(--text); }
.result-meta { font-size: 12px; color: var(--text-muted); margin: 4px 0; }
.result.ok { border-left: 3px solid var(--ok); }
.result.bad { border-left: 3px solid var(--no); }
.edit-row { margin: 8px 0; }
.edit-row label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.edit-title, .edit-desc {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 7px 11px;
}
.edit-title { font-size: 14px; font-weight: 700; }
.edit-desc { font-size: 13px; }
.edit-actions { margin: 10px 0; display: flex; gap: 10px; flex-wrap: wrap; }
.article-editor { margin: 10px 0 14px; }
.edit-content {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #2b3543;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  padding: 12px;
  resize: vertical;
}
.pub-summary {
  font-size: 14px;
  padding: 11px 15px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 14px;
  color: var(--text-muted);
}

/* 栏目选择 */
.sort-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.sort-header label { margin-bottom: 0; font-weight: 600; color: var(--text); }
.sort-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.sort-pick { background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; padding: 14px; transition: border-color 0.18s ease, box-shadow 0.18s ease; }
.sort-pick:hover { border-color: #b9cef2; box-shadow: 0 4px 16px rgba(31,45,61,0.08); }
.sort-pick label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.sort-pick select { background: #fff; width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; color: var(--text); }
.sort-pick select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,107,255,0.15); }
.sort-error { color: var(--no); font-size: 12px; margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.sort-error a { color: var(--primary); text-decoration: underline; cursor: pointer; }

/* 重新生成整篇弹窗表单 */
.regen-form { display: flex; flex-direction: column; gap: 12px; }
.regen-form .edit-row { display: flex; flex-direction: column; gap: 5px; }
.regen-form .edit-row.inline { flex-direction: row; align-items: center; gap: 18px; flex-wrap: wrap; }
.regen-form label { font-size: 12px; color: var(--text-muted); }
.regen-form input[type="text"], .regen-form textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font-size: 13px; color: var(--text); font-family: inherit;
}
.regen-form textarea { resize: vertical; }
.regen-form input[type="text"]:focus, .regen-form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,107,255,0.15); }
.regen-form .qty { flex-direction: row; align-items: center; gap: 6px; color: var(--text); }
.regen-form .qty input[type="number"] { border: 1px solid var(--line); border-radius: 6px; padding: 5px 7px; font-size: 13px; }
.regen-hint { font-size: 12px; color: var(--text-muted); background: var(--bg-soft); border-radius: 8px; padding: 8px 10px; margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
#publishSortList.loading { opacity: .6; pointer-events: none; }
.pub-actions { margin-top: 16px; }
.md { font-size: 13px; color: #3a4654; white-space: pre-wrap; margin-top: 6px; }
.err { color: #d33a3a; font-size: 13px; white-space: pre-wrap; word-break: break-word; line-height: 1.6; margin-top: 8px; }
.relogin-banner {
  margin: 16px 0;
  padding: 13px 16px;
  background: #fff6e0;
  border: 1px solid #ffe2a0;
  border-radius: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  color: #b4790a;
}
details summary { cursor: pointer; color: var(--primary); font-size: 13px; font-weight: 600; }

/* 工具栏 */
.result-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 12px; flex-wrap: wrap; }
.result-toolbar h3 { margin: 0; }
.toolbar-actions { display: flex; align-items: center; gap: 10px; }

/* 文章预览 */
.article-preview {
  margin-top: 10px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  max-height: 380px;
  overflow: auto;
  color: #2b3543;
  line-height: 1.85;
}
.article-preview h1, .article-preview h2, .article-preview h3, .article-preview h4 { margin: 16px 0 10px; line-height: 1.4; color: #1f2d3d; }
.article-preview h2 { font-size: 17px; }
.article-preview h3 { font-size: 15px; color: #2f6bff; }
.article-preview p { margin: 10px 0; }
.article-preview ul, .article-preview ol { margin: 10px 0 10px 24px; }
.article-preview li { margin: 5px 0; }
.article-preview img { max-width: 100%; border-radius: 8px; }
.article-preview a { color: #1d4ed8; }
.article-preview code { background: #eef2f8; padding: 2px 7px; border-radius: 5px; font-size: 12.5px; }
.article-preview blockquote { border-left: 3px solid var(--gold); margin: 10px 0; padding-left: 14px; color: #7a6a44; }

/* 日志 */
.log {
  background: #1b2430;
  color: #d7e2ee;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  height: 300px;
  overflow: auto;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.8;
}
.log-line { white-space: pre-wrap; word-break: break-all; }
.empty { color: var(--text-muted); padding: 16px 0; }

/* 表格 */
.tbl {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
/* 发布记录等表格统一加横向滚动容器，避免小屏列宽总和溢出（边框/圆角由 .tbl 自身负责，避免双重边框） */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl th, .tbl td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; box-sizing: border-box; }
.tbl th { background: #f2f6fd; color: #4a5b73; font-weight: 700; }
.tbl tr:last-child td { border-bottom: none; }
.tbl .badge { white-space: nowrap; }
/* 普通表格：单行截断防溢出（不应用于发布记录表，那里有专属规则） */
.tbl:not(#tab-report .tbl) th,
.tbl:not(#tab-report .tbl) td {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px;
}
/* 发布记录表：自动列宽、不截断、填满容器；列加总 ≈ 1100px，恰好与 .container max-width 对齐，
   不会出现横向滚动条；筛选文字与记录文字都能正常显示 */
#tab-report .tbl { table-layout: auto; width: 100%; }
#tab-report .tbl th, #tab-report .tbl td {
  white-space: normal; word-break: break-word; overflow-wrap: anywhere;
  overflow: visible; text-overflow: clip; max-width: none;
  padding: 10px 10px;
}
#tab-report .tbl th:nth-child(1), #tab-report .tbl td:nth-child(1) { min-width: 120px; }            /* 时间 */
#tab-report .tbl th:nth-child(2), #tab-report .tbl td:nth-child(2) { min-width: 90px; }             /* 站点 */
#tab-report .tbl th:nth-child(3), #tab-report .tbl td:nth-child(3) { min-width: 60px; text-align: center; }    /* 分站 */
#tab-report .tbl th:nth-child(4), #tab-report .tbl td:nth-child(4) { min-width: 120px; max-width: 200px; } /* 关键词 */
#tab-report .tbl th:nth-child(5), #tab-report .tbl td:nth-child(5) { min-width: 160px; max-width: 320px; } /* 标题 */
#tab-report .tbl th:nth-child(6), #tab-report .tbl td:nth-child(6) { min-width: 110px; }           /* 目标栏目 */
#tab-report .tbl th:nth-child(7), #tab-report .tbl td:nth-child(7) { min-width: 70px; text-align: center; }     /* 状态 */
#tab-report .tbl th:nth-child(8), #tab-report .tbl td:nth-child(8) { min-width: 150px; max-width: 280px; } /* 信息 */
#tab-report .tbl th:nth-child(9), #tab-report .tbl td:nth-child(9) { min-width: 120px; text-align: center; padding: 8px 6px; } /* 操作 */
/* 操作列要完整显示按钮，内部按钮允许换行/压缩（对所有表通用） */
.tbl td:nth-child(9) .btn.small { padding: 5px 9px; font-size: 12px; }
/* 表头筛选行：与上方表头做出区分（独立底色 + 顶部分隔线），内部控件统一样式 */
.report-filter-row th { background: #eaf1fb; border-top: 2px solid var(--line); padding: 6px 8px; }
.report-filter-row input,
.report-filter-row select {
  width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box;
  height: 30px; padding: 4px 8px; font-size: 12px; line-height: 1.2;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.report-filter-row input:focus,
.report-filter-row select:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(47, 107, 255, .12); }
.report-filter-row input::placeholder { color: #aab4c4; }
/* 筛选行内控件不继承表格的 ellipsis 截断，保证选项文本完整可读 */
.report-filter-row th { overflow: visible; text-overflow: clip; white-space: normal; }
.stats { display: flex; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 7px 14px; font-size: 13px; color: var(--text-muted); }
.stat.success { border-color: #bce9cd; color: #13924e; }
.stat.failed { border-color: #f6c4c4; color: #d33a3a; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(20, 33, 51, 0.45); display: flex; align-items: center; justify-content: center; z-index: 50; backdrop-filter: blur(3px); }
.modal {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  width: 580px;
  max-width: 94vw;
  max-height: 92vh;
  overflow: auto;
  box-shadow: 0 18px 50px rgba(31, 45, 61, 0.28);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; color: var(--text); }
.modal-head .x { border: none; background: none; font-size: 24px; cursor: pointer; color: var(--text-muted); }
.modal-head .x:hover { color: var(--text); }
.modal-body { padding: 20px 22px; }
.modal-body.center { text-align: center; }
.modal-foot { display: flex; justify-content: flex-end; gap: 12px; padding: 16px 22px; border-top: 1px solid var(--line); }
.modal-foot.center { justify-content: center; }
.captcha { max-width: 200px; border: 1px solid var(--line); border-radius: 8px; margin: 12px auto; display: block; }
#captchaInputWrap { max-width: 240px; margin: 14px auto 0; text-align: left; }

/* 通用模态框（查看发布内容等） */
.modal-overlay { position: fixed; inset: 0; background: rgba(20, 33, 51, 0.45); display: flex; align-items: center; justify-content: center; z-index: 60; backdrop-filter: blur(3px); }
.modal-overlay .modal { background: #fff; border: 1px solid var(--line); border-radius: 16px; width: 900px; max-width: 94vw; max-height: 92vh; overflow: auto; box-shadow: 0 18px 50px rgba(31, 45, 61, 0.28); }
.modal-overlay .modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.modal-overlay .modal-title { font-size: 16px; font-weight: 700; color: var(--text); }
.modal-overlay .modal-close { border: none; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--text-muted); }
.modal-overlay .modal-close:hover { color: var(--text); }
.modal-overlay .modal-body { padding: 18px 22px; }
.pub-content-head { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 18px; margin-bottom: 10px; font-size: 13px; color: var(--text-muted); }
.pub-content-head b { color: var(--text); font-weight: 600; }
.pub-url-row { margin-bottom: 14px; font-size: 13px; line-height: 1.6; word-break: break-all; color: var(--text-muted); }
.pub-url-row b { color: var(--text); font-weight: 600; }
.pub-url-row a { color: var(--primary); text-decoration: underline; }
.pub-url-row a:hover { color: var(--primary-d); }
.pub-url-row .muted { color: #aab4c4; }
.pub-content-body { border: 1px solid var(--line); border-radius: 10px; padding: 16px; background: #fbfbfd; max-height: 56vh; overflow: auto; }
.pub-content-body h2, .pub-content-body h3, .pub-content-body h4 { margin: 14px 0 8px; color: var(--text); }
.pub-content-body p { margin: 8px 0; line-height: 1.7; color: var(--text); }
.pub-content-body ul, .pub-content-body li { margin: 4px 0; }

/* Toast */
.toast {
  position: fixed; bottom: 32px; left: 50%;
  transform: translateX(-50%) translateY(24px);
  background: #1f2d3d;
  color: #fff;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  opacity: 0;
  pointer-events: none;
  transition: all .25s ease;
  z-index: 100;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: linear-gradient(135deg, #1fb866, #13924e); }
.toast.error { background: linear-gradient(135deg, #ff5a5a, #e23a3a); }
.toast.warn { background: linear-gradient(135deg, #f5a623, #d98200); }

/* 图片素材上传 */
.asset-list { display: flex; flex-direction: column; gap: 12px; }
.asset-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
}
.asset-name { flex: 1; min-width: 0; font-size: 13px; word-break: break-all; color: var(--text); }
.asset-status { font-size: 12px; font-weight: 700; }
.asset-status.ok { color: var(--ok); }
.asset-status.no { color: var(--no); }
.asset-item .btn { flex-shrink: 0; }
.asset-item { cursor: pointer; transition: border-color .15s, background .15s; outline: none; }
.qty { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); font-weight: 600; }
.qty select { font-weight: 600; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); }
.qty select:disabled { opacity: .5; }
.asset-item:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(245, 181, 10, 0.18); }
.asset-item.dragover { background: #fff9e6; border-color: var(--gold); border-style: dashed; }

/* 配图预览网格 */
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-top: 10px; }
.asset-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.asset-card.unused { opacity: .5; filter: grayscale(.6); }
.asset-card.img-err { border-color: var(--no); }
.asset-thumb { height: 140px; background: #f1f5fb; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.asset-thumb img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; transition: transform .2s ease; }
.asset-thumb img:hover { transform: scale(1.03); }
.asset-thumb .thumb-broken { color: var(--text-muted); font-size: 13px; text-align: center; padding: 10px; }
.asset-info { padding: 8px 10px 4px; }
.asset-name { font-size: 13px; font-weight: 600; color: var(--text); word-break: break-all; }
.asset-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.asset-actions { display: flex; gap: 6px; padding: 8px 10px 10px; flex-wrap: wrap; }
.asset-actions .btn { flex: 1 1 auto; }
.asset-err { padding: 0 10px 10px; font-size: 12px; color: var(--no); word-break: break-all; }
.img-summary { margin-top: 8px; font-size: 13px; color: var(--primary-d); font-weight: 600; background: #eaf1ff; border: 1px solid #d3e0ff; border-radius: 8px; padding: 6px 10px; }
.asset-meta .status-ok { color: var(--ok); font-weight: 600; }
.asset-meta .status-pending { color: var(--warn); font-weight: 600; }
.asset-meta .status-error { color: var(--no); font-weight: 600; }

/* 本地上传图片覆盖标记 */
.badge-local {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 20px;
  background: #fff1e6;
  color: #c2560a;
  border: 1px solid #ffd2ad;
  margin-left: 6px;
  vertical-align: middle;
}
.asset-card.is-local { border-color: #ffb877; box-shadow: 0 6px 22px rgba(245, 140, 40, 0.16); }

/* 独立的「本地素材上传」区块：与 AI 预览卡区分开 */
#localUploadSection {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
}
#localUploadSection .result-toolbar { margin-bottom: 10px; }
#localUploadSection h3 { color: #c2560a; }

/* 配图点击查看大图 */
.lightbox-wrap { display: flex; align-items: center; justify-content: center; min-height: 200px; }
.lightbox-wrap img { max-width: 100%; max-height: 78vh; border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,0.18); cursor: zoom-out; }

/* 会员 / 授权管理 */
.license-card { padding: 18px; }
.license-card .muted { color: var(--text-muted); font-size: 13px; line-height: 1.8; }
.lic-saved-status { margin-top: 10px; font-size: 13px; line-height: 1.7; }
.lic-saved-status .badge { margin-right: 6px; vertical-align: middle; }
.lic-saved-status.is-empty { color: var(--text-muted); }
.lic-row { font-size: 13px; color: var(--text); line-height: 2; }
.lic-row b { color: var(--text); }
.lic-row code, #licListBody code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #eef2f8; padding: 1px 7px; border-radius: 6px; font-size: 12.5px;
  color: #2b3543; word-break: break-all;
}
.lic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.lic-metric {
  background: linear-gradient(135deg, #fff7ec, #fdeedd);
  border: 1px solid #f1dcb8; border-radius: 12px; padding: 12px 14px;
}
.lic-metric .lm-val { font-size: 22px; font-weight: 800; color: #b23a1d; line-height: 1.1; }
.lic-metric .lm-lbl { font-size: 12.5px; color: #6b5331; margin-top: 4px; }
.lic-metric .lm-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* 必填标记 */
.req { color: #b23a1d; font-weight: 700; }
.pager { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 14px 0; flex-wrap: wrap; }
.pager button { min-width: 30px; padding: 6px 10px; border: 1px solid var(--line); background: #fff; border-radius: 8px; color: var(--text); font-size: 13px; cursor: pointer; }
.pager button:hover { border-color: var(--primary); color: var(--primary); }
.pager button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pager button:disabled { opacity: .45; cursor: not-allowed; }
.pager .pager-info { font-size: 13px; color: var(--text-muted); margin: 0 6px; }

/* 滚动条、空状态、响应式 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #e6ecf5; }
::-webkit-scrollbar-thumb { background: #b9c7da; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #93a6bf; }

/* 登录弹窗：步骤指示 + 加载动画 + 错误框（桌面端优化，提升登录流程可读性） */
.spinner {
  width: 34px; height: 34px;
  border: 3px solid rgba(47, 107, 255, 0.18);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 14px auto;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.login-steps {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 0;
  margin: 0 0 6px;
  font-size: 12px;
}
.login-steps li {
  flex: 1 1 0;
  padding: 7px 4px;
  border-radius: 8px;
  background: #f1f5fb;
  color: var(--text-muted);
  border: 1px solid var(--line);
  transition: all .2s ease;
}
.login-steps li.active {
  background: #eaf1ff;
  color: var(--primary-d);
  border-color: var(--primary);
  font-weight: 700;
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.12);
}

.login-err {
  margin: 10px auto 0;
  max-width: 360px;
  background: #fdecec;
  border: 1px solid #f6c4c4;
  color: #d33a3a;
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 13px;
  line-height: 1.6;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
}

.login-nocap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 12px auto 0;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
}
.login-nocap input { width: auto; accent-color: var(--primary); }

.login-diag {
  margin: 12px auto 0;
  max-width: 420px;
  text-align: left;
  background: #fff8e6;
  border: 1px solid #ffe2a0;
  color: #8a6d1b;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 12.5px;
  line-height: 1.75;
  white-space: normal;
}
.login-diag b { color: #b4790a; }

.captcha { max-width: 220px; max-height: 80px; object-fit: contain; }
#captchaInputWrap { max-width: 260px; margin: 14px auto 0; text-align: left; }
#captchaInput { text-align: center; letter-spacing: 3px; font-size: 16px; }

/* 窄屏适配（仅桌面窗口收拢，不做手机端专门优化） */
@media (max-width: 720px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .tabs { overflow-x: auto; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 6px; }
}
