:root {
  --bg: #f3f4f8;
  --panel: #ffffff;
  --ink: #1e2230;
  --muted: #7a8194;
  --line: #e5e7ef;
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --accent-weak: #eef0fe;
  --ok: #16a34a;
  --err: #dc2626;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(22, 26, 45, .05), 0 2px 8px rgba(22, 26, 45, .04);
  --shadow: 0 1px 3px rgba(22, 26, 45, .06), 0 8px 28px rgba(22, 26, 45, .06);
  --shadow-lg: 0 4px 12px rgba(22, 26, 45, .08), 0 20px 50px rgba(22, 26, 45, .12);
  --ring: 0 0 0 3px rgba(79, 70, 229, .16);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
/* 氛围背景：两团极淡的品牌色光斑 + 顶部提亮，固定不随滚动 */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(560px 380px at 12% -6%, rgba(99, 102, 241, .09), transparent 62%),
    radial-gradient(640px 420px at 94% -10%, rgba(168, 85, 247, .07), transparent 60%),
    linear-gradient(180deg, #f7f8fc 0%, var(--bg) 320px);
}

::selection { background: rgba(99, 102, 241, .22); }

/* 细滚动条（WebKit） */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #cdd2e0; border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #aeb5c9; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* 键盘导航焦点环（鼠标点击不显示） */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:focus:not(:focus-visible), input:focus:not(:focus-visible) { outline: none; }

/* ── 顶栏 ── */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 20px;
  background: rgba(255, 255, 255, .84);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid rgba(226, 229, 238, .8);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 4px 18px rgba(24, 28, 45, .04);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand-logo {
  width: 33px; height: 33px; flex: none;
  display: grid; place-items: center; font-size: 17px; border-radius: 10px;
  background: linear-gradient(140deg, #6d6bf5, var(--accent) 55%, #6d28d9);
  box-shadow: 0 3px 10px rgba(79, 70, 229, .32), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; font-weight: 800; font-size: 15px; letter-spacing: .2px; }
.brand-sub { font-weight: 500; font-style: normal; font-size: 11px; color: var(--muted); letter-spacing: .5px; }

.tabs { display: flex; gap: 3px; flex: 1; flex-wrap: wrap; }
.tab {
  position: relative;
  border: none; background: transparent; color: var(--muted);
  padding: 8px 13px; border-radius: 9px; cursor: pointer; font-size: 14px; font-weight: 500;
  transition: color .16s ease, background-color .16s ease, transform .16s ease;
}
.tab:hover { background: rgba(79, 70, 229, .07); color: var(--ink); }
.tab:active { transform: scale(.96); }
.tab.active {
  background: linear-gradient(180deg, #eef0fe, #e8ebfd);
  color: var(--accent); font-weight: 650;
  box-shadow: inset 0 0 0 1px rgba(79, 70, 229, .16), 0 1px 4px rgba(79, 70, 229, .10);
}

.icon-btn {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: 7px 12px; border-radius: 9px; cursor: pointer; font-size: 13px; white-space: nowrap; text-decoration: none;
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}
.icon-btn:hover { background: var(--bg); border-color: #d5d9e6; box-shadow: 0 1px 6px rgba(24, 28, 45, .06); }

/* 点数胶囊：tabular 数字 + 变动时轻弹（.bump 由 app.js 触发） */
.acct-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: #6a63c8; white-space: nowrap;
  background: linear-gradient(135deg, #eef0fe, #f4edfd);
  box-shadow: inset 0 0 0 1px rgba(79, 70, 229, .18);
  border-radius: 999px; padding: 6px 13px;
}
.acct-chip::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: linear-gradient(135deg, #818cf8, var(--accent));
  box-shadow: 0 0 6px rgba(99, 102, 241, .8);
}
.acct-chip b { color: var(--accent); font-size: 14.5px; font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.acct-chip i { font-style: normal; }
.acct-chip.bump { animation: chip-bump .4s ease; }
@keyframes chip-bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.09); box-shadow: inset 0 0 0 1px rgba(79, 70, 229, .4), 0 0 14px rgba(99, 102, 241, .35); }
  100% { transform: scale(1); }
}

/* 账户按钮：首字头像 + 名字 */
.acct-btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: 4px 13px 4px 4px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 550; white-space: nowrap;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.acct-btn:hover { border-color: rgba(79, 70, 229, .35); box-shadow: 0 1px 8px rgba(79, 70, 229, .12); }
.acct-avatar {
  width: 25px; height: 25px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #818cf8, var(--accent) 60%, #7c3aed);
  color: #fff; font-size: 12px; font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
}
.acc-line { padding: 4px 0; }

@media (max-width: 900px) {
  .brand-sub { display: none; }
  .topbar { gap: 10px; padding: 8px 12px; }
}

/* ── 布局 ── */
#main { padding: 18px; max-width: 1280px; margin: 0 auto; }
.tabpane { display: none; }
.tabpane.active { display: block; animation: pane-in .22s ease; }
@keyframes pane-in { from { opacity: 0; transform: translateY(5px); } }
.layout { display: grid; grid-template-columns: minmax(360px, 460px) 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }

.panel {
  background: var(--panel); border: 1px solid rgba(229, 231, 239, .9); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}

.field { margin-bottom: 14px; }
.field > label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px;
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

input[type=text], input[type=password], input[type=number], textarea, select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--ink); font-size: 14px; font-family: inherit; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:hover, textarea:hover, select:hover { border-color: #cfd4e4; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: var(--ring); }
textarea { resize: vertical; }
input[type=color] { padding: 4px; height: 38px; cursor: pointer; }
input[type=range] { padding: 0; accent-color: var(--accent); }
input::placeholder, textarea::placeholder { color: #a6adc0; }

/* ── 按钮 ── */
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 9px 16px; border-radius: 9px; cursor: pointer; font-size: 14px; font-weight: 500;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease, transform .12s ease;
}
.btn:hover { background: #fafbfe; border-color: #cfd4e4; box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(180deg, #5b52ee, var(--accent) 60%, #463dd8);
  border-color: transparent; color: #fff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, .32), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn.primary:hover { box-shadow: 0 4px 16px rgba(79, 70, 229, .42), inset 0 1px 0 rgba(255, 255, 255, .22); filter: brightness(1.04); }
.btn.big { width: 100%; padding: 12px; font-size: 15px; font-weight: 650; margin-top: 4px; letter-spacing: .5px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.link-btn {
  border: none; background: transparent; color: var(--accent); cursor: pointer;
  font-size: 12.5px; font-weight: 600; padding: 0;
}
.link-btn:hover { text-decoration: underline; }

.hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.checkline { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); margin-top: 10px; cursor: pointer; }
.checkline input { width: auto; }

/* ── 分段控件 ── */
.seg {
  display: inline-flex; background: #eceef5; border-radius: 10px; padding: 3px; margin-bottom: 14px; gap: 3px; flex-wrap: wrap;
  box-shadow: inset 0 1px 3px rgba(22, 26, 45, .07);
}
.seg-btn {
  border: none; background: transparent; color: var(--muted); padding: 7px 14px; border-radius: 8px;
  cursor: pointer; font-size: 13.5px; font-weight: 500;
  transition: color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.seg-btn:hover { color: var(--ink); }
.seg-btn.active { background: #fff; color: var(--accent); font-weight: 650; box-shadow: 0 1px 3px rgba(22, 26, 45, .12), 0 1px 0 rgba(255, 255, 255, .8) inset; }

/* ── chips ── */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 5px 11px; border-radius: 999px; cursor: pointer; font-size: 12.5px;
  transition: border-color .14s ease, color .14s ease, background-color .14s ease, transform .14s ease, box-shadow .14s ease;
}
.chip:hover {
  border-color: rgba(79, 70, 229, .45); color: var(--accent); background: var(--accent-weak);
  transform: translateY(-1px); box-shadow: 0 3px 8px rgba(79, 70, 229, .12);
}
.chip:active { transform: translateY(0); }

/* ── 上传区 ── */
.dropzone {
  border: 1.5px dashed #d3d7e5; border-radius: 10px; padding: 18px; text-align: center;
  color: var(--muted); cursor: pointer; font-size: 13px;
  transition: border-color .18s ease, background-color .18s ease, color .18s ease;
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--accent); color: var(--accent);
  background: linear-gradient(180deg, #f2f3ff, #eceffe);
}
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.thumb {
  position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); transition: transform .14s ease, box-shadow .14s ease;
}
.thumb:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-x {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border: none; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 12px; line-height: 1; padding: 0;
}

/* ── 结果区 ── */
.results { display: flex; flex-direction: column; gap: 14px; min-height: 200px; }
.results .empty, .result-body .empty {
  border: 1.5px dashed #d8dceb; border-radius: var(--radius); padding: 40px 16px;
  text-align: center; color: var(--muted);
  background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(248, 249, 253, .9));
}
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }

/* 生成批次分组（每次点击「生成」是一批，最新在最上） */
.results-bar { display: flex; justify-content: flex-end; }
.batch-group { border: 1px dashed #d8dceb; border-radius: var(--radius); padding: 10px; background: rgba(255, 255, 255, .5); animation: pane-in .25s ease; }
.batch-head { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); margin-bottom: 10px; flex-wrap: wrap; }
.batch-head b { color: var(--ink); font-weight: 600; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-status.ok { color: var(--ok); font-weight: 600; }
.batch-status.err { color: var(--err); }
.img-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
  transition: box-shadow .18s ease, transform .18s ease;
}
.img-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.img-card img { width: 100%; display: block; background: #f0f0f3; }
.img-card .img-actions { display: flex; gap: 6px; padding: 8px; flex-wrap: wrap; }
.img-card .img-actions .btn { padding: 6px 10px; font-size: 12.5px; }
.img-revised { padding: 8px 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.img-revised summary { cursor: pointer; user-select: none; }
.img-revised > div { margin-top: 6px; color: var(--ink); white-space: pre-wrap; word-break: break-word; line-height: 1.5; }

.result-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; animation: pane-in .25s ease; }
.result-head {
  display: flex; align-items: center; justify-content: space-between; padding: 10px 14px;
  border-bottom: 1px solid var(--line); font-weight: 600; font-size: 13px;
  background: linear-gradient(180deg, #fbfcff, #f7f8fd);
}
.result-body { padding: 14px; white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.result-body .blk { display: inline-block; font-weight: 700; color: var(--accent); margin-top: 6px; }

/* 分块结果（每节独立复制） */
.block-sec { border-top: 1px dashed var(--line); margin-top: 12px; padding-top: 10px; }
.block-sec:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.block-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.block-body { white-space: pre-wrap; word-break: break-word; }

.spinner {
  display: inline-block; width: 15px; height: 15px; border-radius: 50%; vertical-align: -2px;
  border: 2px solid rgba(79, 70, 229, .18); border-top-color: var(--accent); border-right-color: var(--accent-2);
  animation: spin .65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-row { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 18px; }
.loading-row > span:last-child { animation: breath 1.6s ease-in-out infinite; }
@keyframes breath { 50% { opacity: .55; } }

/* ── 违禁词 ── */
.banned-summary { margin-top: 12px; font-size: 13px; }
.banned-summary .tagrow { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.banned-tag { background: #fde8e8; color: var(--err); border: 1px solid #f7caca; padding: 3px 9px; border-radius: 999px; font-size: 12px; }
.banned-tag i { font-style: normal; opacity: .75; margin-left: 2px; font-size: 11px; }
.banned-ok { color: var(--ok); font-weight: 600; }
.bn-cat { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.bn-cat > b { white-space: nowrap; font-size: 12.5px; line-height: 22px; }
.bn-level { flex-shrink: 0; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; line-height: 1.4; }
.bn-level.hi { background: #fde8e8; color: var(--err); }
.bn-level.mid { background: #fff3d6; color: #92400e; }
mark { background: #ffe08a; color: #6b4e00; border-radius: 3px; padding: 0 1px; }

/* ── 链接结果 ── */
.search-list { display: flex; flex-direction: column; gap: 8px; }
.search-item { padding: 10px; border: 1px solid var(--line); border-radius: 9px; }
.search-item a { color: var(--accent); font-weight: 600; text-decoration: none; font-size: 13.5px; }
.search-item p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }

/* ── 营销主图编辑器 ── */
.poster-layout { display: grid; grid-template-columns: minmax(340px, 420px) 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .poster-layout { grid-template-columns: 1fr; } }
.poster-stage-wrap { display: flex; flex-direction: column; align-items: center; }
.poster-stage {
  position: relative; width: 480px; max-width: 100%; aspect-ratio: 1 / 1;
  background: #f5f3ee center center / cover no-repeat; border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); user-select: none; touch-action: none;
}
.po-layer { position: absolute; transform: translate(-50%, -50%); cursor: move; white-space: pre; line-height: 1.25; max-width: 96%; }
.po-layer.sel { outline: 2px dashed var(--accent); outline-offset: 3px; }
.po-layer.po-img { line-height: 0; max-width: none; }
.po-layer.po-img img { display: block; width: 100%; height: auto; pointer-events: none; user-select: none; }
.po-guide { position: absolute; background: var(--accent); opacity: .65; pointer-events: none; z-index: 5; }
.po-guide.v { top: 0; bottom: 0; width: 1px; left: 50%; }
.po-guide.h { left: 0; right: 0; height: 1px; top: 50%; }
.poster-props { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 4px 0 14px; background: #fafbff; }
.po-layer-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; margin-top: 6px; cursor: pointer; font-size: 13px; }
.po-layer-item:hover { border-color: var(--accent); }
.po-layer-item.sel { border-color: var(--accent); background: var(--accent-weak); color: var(--accent); font-weight: 600; }
.po-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.po-item-ops { display: flex; gap: 4px; flex-shrink: 0; }
.mini-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 6px; font-size: 11px; padding: 2px 6px;
  cursor: pointer; color: var(--muted); line-height: 1.4;
  transition: color .13s ease, border-color .13s ease, background-color .13s ease;
}
.mini-btn:hover { color: var(--accent); border-color: rgba(79, 70, 229, .5); background: var(--accent-weak); }

/* ── 作品库 ── */
.ga-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.ga-toolbar input[type=text] { max-width: 170px; }
.ga-toolbar .chips { margin: 0; }
.chip.on { border-color: var(--accent); color: var(--accent); background: var(--accent-weak); font-weight: 600; }
.ga-batchbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; font-size: 13px; }
.ga-meta { padding: 6px 10px 0; font-size: 12px; color: var(--muted); word-break: break-all; }
.img-grid > .empty { grid-column: 1 / -1; }
.img-card { position: relative; }
.img-card.ga-sel { outline: 3px solid var(--accent); }
.ga-check { position: absolute; top: 8px; left: 8px; width: 22px; height: 22px; border-radius: 6px; background: #fff; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 14px; color: #fff; box-shadow: var(--shadow); }
.ga-check.on { background: var(--accent); border-color: var(--accent); }

/* 灯箱大图预览 */
.lightbox {
  position: fixed; inset: 0; background: rgba(13, 16, 28, .86);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  z-index: 90; display: flex; align-items: center; justify-content: center; animation: mask-in .16s ease;
}
.lightbox img { max-width: 90vw; max-height: 82vh; border-radius: 10px; box-shadow: 0 24px 90px rgba(0, 0, 0, .55); background: #fff; animation: modal-in .2s ease; }
.lb-btn { position: fixed; border: none; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; border-radius: 50%; width: 44px; height: 44px; font-size: 20px; line-height: 1; }
.lb-btn:hover { background: rgba(255, 255, 255, .28); }
.lb-x { top: 18px; right: 18px; }
.lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
.lb-cap { position: fixed; bottom: 16px; left: 0; right: 0; text-align: center; color: #cbd2e0; font-size: 12.5px; }

/* ── 设置弹窗 ── */
.modal-mask {
  position: fixed; inset: 0; background: rgba(18, 21, 38, .42);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px;
  animation: mask-in .18s ease;
}
@keyframes mask-in { from { opacity: 0; } }
.modal {
  background: var(--panel); border-radius: 16px; width: 100%; max-width: 520px; max-height: 90vh;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, .55) inset;
  animation: modal-in .22s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes modal-in { from { opacity: 0; transform: scale(.96) translateY(8px); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { padding: 14px 18px; border-top: 1px solid var(--line); text-align: right; }
/* 结果卡片底部动作条 */
.result-foot { padding: 10px 14px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; }
.result-foot .btn { padding: 6px 12px; font-size: 12.5px; }

/* ── 生成历史弹窗 ── */
.hist-sub { font-size: 11.5px; font-weight: 500; color: var(--muted); margin-left: 8px; }
.hist-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.hist-card img { cursor: zoom-in; aspect-ratio: 1 / 1; object-fit: cover; }
.hist-card .ga-meta { padding-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-viewbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.hist-viewbar .btn { padding: 6px 12px; font-size: 12.5px; }
.hist-prompt { font-size: 12.5px; color: var(--muted); background: var(--bg); border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; word-break: break-all; }
.hist-bigimg { width: 100%; border-radius: 10px; box-shadow: var(--shadow); display: block; }

/* 违禁词警示条（文案结果卡片内） */
.warn-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 14px; font-size: 12.5px; background: #fff7e6; color: #92400e; border-bottom: 1px solid #fde4b8; }

/* AI 润色预览框 */
.enhance-preview { margin-top: 8px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 9px; background: #fafbff; overflow: hidden; }
.enhance-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.enhance-ops { display: flex; gap: 12px; }
.enhance-body { padding: 10px; font-size: 13px; white-space: pre-wrap; word-break: break-word; max-height: 180px; overflow-y: auto; }

/* 自定义模型下拉（datalist 在内置浏览器里弹不出，改用真实面板） */
.combo { position: relative; }
.combo input { padding-right: 30px; }
.combo-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; padding: 4px 7px; }
.combo-toggle:hover { color: var(--accent); }
.combo-menu { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 10px 30px rgba(20, 24, 40, .18); max-height: 220px; overflow-y: auto; z-index: 60; }
.combo-item { padding: 8px 10px; font-size: 13px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.combo-item:hover { background: var(--accent-weak); }
.combo-item.cur { color: var(--accent); font-weight: 600; }
.combo-item em { font-style: normal; color: var(--muted); font-size: 11.5px; flex-shrink: 0; }
.combo-empty { padding: 10px; color: var(--muted); font-size: 12.5px; }

.test-result { font-size: 13px; margin-left: 10px; }
.test-result.ok { color: var(--ok); }
.test-result.err { color: var(--err); }
.advanced { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.advanced summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; }
.advanced .field { margin-top: 12px; }

/* ── toast ── */
#toast-wrap { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  display: flex; align-items: center; gap: 8px;
  background: rgba(26, 29, 44, .92); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 13.5px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .1);
  animation: pop .22s cubic-bezier(.2, .9, .3, 1.2); max-width: 80vw;
}
.toast.ok { background: rgba(18, 88, 47, .93); }
.toast.ok::before { content: '✓'; font-weight: 800; }
.toast.err { background: rgba(140, 28, 28, .93); }
.toast.err::before { content: '✕'; font-weight: 800; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.96); } }

/* ── 底部状态条 ── */
.app-foot { text-align: center; color: var(--muted); font-size: 12px; padding: 18px 16px 26px; }
.app-foot b { color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; font-weight: 600; }

.hidden { display: none !important; }
