/* PS Agent — 首页插件布局（对齐竞品侧栏比例，非 UXP） */
:root {
  --bg: #1b1d22;
  --panel: #23262d;
  --card: #2c3038;
  --card-hover: #353a44;
  --border: #3c424e;
  --text: #eef1f6;
  --muted: #8b93a3;
  --blue: #2f7cf6;
  --blue-hi: #4d9fff;
  --cta-a: #1ec8e8;
  --cta-b: #3b82f6;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --rail: #12141a;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
/* CEP 宿主：去掉浏览器居中大边距，让面板贴满 PS 面板壳 */
body.cep-host {
  display: block;
  place-items: unset;
  padding: 0;
  min-height: 100%;
  overflow: hidden;
  background: #12141a;
}
body.cep-host .plugin {
  width: 100% !important;
  height: 100% !important;
  max-width: none;
  max-height: none;
  border-radius: 0;
  box-shadow: none;
  resize: none; /* 宿主外框由 CEP resizeContent 控制 */
}

body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 70% 10%, #1a2740 0%, transparent 55%),
    #0b0c0f;
  color: var(--text);
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 16px;
}

/* ===== 插件窗体：可拖拽缩放 + 有预览时自适应变宽 ===== */
.plugin {
  --plugin-w: 430px;
  --plugin-h: 950px;
  width: min(var(--plugin-w), calc(100vw - 16px));
  height: min(var(--plugin-h), calc(100vh - 16px));
  min-width: 360px;
  min-height: 480px;
  max-width: calc(100vw - 8px);
  max-height: calc(100vh - 8px);
  display: grid;
  /* 默认：rail + 主面板 */
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  background: var(--bg);
  border: 1px solid #2a2f3a;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  resize: both; /* 浏览器可拖角缩放；CEP 内再补自定义把手 */
  box-shadow:
    0 0 0 1px rgba(255,255,255,.03) inset,
    0 24px 64px rgba(0,0,0,.55);
}
/* 有预览默认：rail | 预览(左) | 主面板(右) —— 这是初始化出现位置 */
body.has-preview:not(.preview-below) .plugin {
  --plugin-w: 960px;
  grid-template-columns: 48px minmax(240px, 1.05fr) minmax(300px, 1fr);
}
/* 仅当用户手动拖窄后（body.preview-below）：预览到 AI 生图下方 */
body.has-preview.preview-below .plugin {
  --plugin-w: 460px;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}
.plugin-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  z-index: 50;
  background:
    linear-gradient(135deg, transparent 50%, rgba(255,255,255,.18) 50%, rgba(255,255,255,.18) 58%, transparent 58%),
    linear-gradient(135deg, transparent 68%, rgba(255,255,255,.28) 68%, rgba(255,255,255,.28) 76%, transparent 76%);
  opacity: .85;
}
.plugin-resize-handle:hover { opacity: 1; }

/* 左栏 */
.rail {
  background: var(--rail);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0 8px;
  gap: 4px;
  border-right: 1px solid #0a0b0e;
}
.rail-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #6b7384;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: .12s ease;
}
.rail-btn:hover { color: #c9d0dc; background: #1c2028; }
.rail-btn.active {
  color: #fff;
  background: #2a3344;
  box-shadow: inset 0 0 0 1px #3d4f6d;
}
.rail-foot {
  margin-top: auto;
  font-size: 9px;
  color: #4b5362;
  text-align: center;
  line-height: 1.25;
  letter-spacing: .02em;
}

.panel {
  background: var(--panel);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.module {
  display: none;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.module.active { display: flex; }

/* UID 顶栏 */
.uid-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid #2a2f38;
  background: linear-gradient(180deg, #252930, #1f2228);
  flex-shrink: 0;
  flex-wrap: wrap;
  overflow: visible;
}
.uid-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.uid-avatar {
  width: 20px; height: 20px; border-radius: 50%;
  background: #3a4150; color: #c5cddb;
  display: grid; place-items: center; flex-shrink: 0;
}
.uid-text {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.uid-status {
  width: 7px; height: 7px; border-radius: 50%;
  background: #5c6575;
  flex-shrink: 0;
}
.uid-status.ok { background: var(--ok); box-shadow: 0 0 6px rgba(52,211,153,.5); }
.uid-status.warn { background: var(--warn); }
.uid-status.err { background: var(--err); }
.btn-uid-refresh {
  min-width: 72px;
  height: 34px;
  padding: 0 18px;
  border: 1px solid #3a4656;
  border-radius: 9px;
  background: linear-gradient(180deg, #303947 0%, #29313d 100%);
  color: #f1f5ff;
  font: 600 13px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: .04em;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .06),
    0 1px 2px rgba(0, 0, 0, .35);
  /* no transform: avoid CEP IME coordinate bugs */
}
.btn-uid-refresh:hover {
  border-color: #4a5a6e;
  background: linear-gradient(180deg, #3a4658 0%, #313b4a 100%);
  color: #fff;
}
.btn-uid-refresh:active {
  border-color: #354152;
  background: #252e3b;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .35);
}
.btn-uid-refresh:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}
.btn-uid-refresh.is-busy {
  opacity: 0.75;
  pointer-events: none;
}

/* 本机桥状态条 */
.local-bridge-bar {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid #2a2f38;
  background: #1a1d23;
  flex-shrink: 0;
  font-size: 12px;
  min-height: 40px;
}
.local-bridge-bar .lb-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5c6575;
  flex-shrink: 0;
}
.local-bridge-bar.ok .lb-dot {
  background: #34d399;
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.55);
}
.local-bridge-bar.bad .lb-dot {
  background: #f87171;
  box-shadow: 0 0 6px rgba(248, 113, 113, 0.45);
}
.local-bridge-bar .lb-text {
  flex: 0 0 auto;
  min-width: 0;
  color: #c5cddb;
  line-height: 1.35;
  white-space: nowrap;
  overflow: visible;
}
.local-bridge-bar .btn-sm {
  flex: 0 0 auto;
  min-height: 28px;
  margin-top: 0;
  padding: 2px 7px;
  font-size: 11px;
}

.icon-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  font: inherit;
  line-height: 1;
}
.icon-btn:hover { color: var(--text); background: #2e333d; }
.icon-btn.sq {
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  background: #1c1f26;
  display: grid; place-items: center;
  flex-shrink: 0;
}

/* AI生图 头 */
.ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 8px;
  flex-shrink: 0;
}
.ai-title { display: flex; align-items: center; gap: 6px; }
.ai-title h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .02em;
}
.info-dot {
  width: 15px; height: 15px; border-radius: 50%;
  border: 1px solid #6b7384;
  background: transparent;
  color: #8b93a3;
  font-size: 10px;
  font-family: Georgia, serif;
  font-style: italic;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.link-tutorial {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.link-tutorial:hover { color: var(--blue-hi); }


.tool-body {
  flex: 0 1 auto;
  overflow: auto;
  padding: 0 12px 12px;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: #3a4150 transparent;
}
.tool-body.collapsed,
.tool-body[hidden] {
  display: none !important;
  height: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  flex: 0 !important;
  min-height: 0 !important;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr 34px;
  gap: 8px;
  margin-bottom: 12px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel);
  padding-top: 2px;
  padding-bottom: 2px;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1a1d24;
  border: 1px solid #2f3540;
  border-radius: 8px;
  padding: 0 10px;
  color: #6b7384;
  min-height: 34px;
}
.search-box input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 8px 0;
  font: inherit;
  font-size: 12.5px;
  outline: none;
  min-width: 0;
}
.search-box input::placeholder { color: #5c6575; }

.section-label {
  font-size: 12px;
  color: var(--muted);
  margin: 2px 0 10px;
  font-weight: 500;
}

/* 4 列网格 — 首页主视觉 */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding-bottom: 4px;
}
.tool-card {
  aspect-ratio: 1;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--card);
  color: #d7dce6;
  cursor: pointer;
  padding: 6px 3px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font: inherit;
  min-height: 0;
  transition: background .12s, border-color .12s, transform .12s, box-shadow .12s;
  user-select: none;
}
.tool-card:hover {
  background: var(--card-hover);
  border-color: #4a5568;
}
.tool-card.selected {
  background: linear-gradient(160deg, #3b8cff 0%, #2a6fe0 100%);
  border-color: #6eb0ff;
  color: #fff;
  box-shadow: 0 6px 16px rgba(47, 124, 246, 0.35);
  transform: translateY(-1px);
}
.tool-card .ti {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  font-size: 17px;
  line-height: 1;
  opacity: .95;
}
.tool-card .tn {
  font-size: 10.5px;
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  font-weight: 500;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.tool-card .tv {
  font-size: 9px;
  opacity: 0.7;
  margin-top: -2px;
}
.tool-card.selected .tv { opacity: .9; }

/* 生图页：与工具墙互斥，占满中间区域，不叠层 */
.gen-form {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 8px 12px 12px;
  border-top: 0;
  background: var(--panel);
}
.gen-form.open {
  display: block;
}
.gen-form[hidden] {
  display: none !important;
  height: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  flex: 0 !important;
}
.form-back-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.form-back-row[hidden] { display: none !important; }
.btn-back {
  border: 1px solid #2f3540;
  background: #1a1d24;
  color: var(--text);
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  min-height: 32px;
}
.btn-back:hover { border-color: #4a5568; }
.form-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.field-label {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin: 6px 0 5px;
}
.prompt-panel {
  margin-top: 4px;
}
.prompt-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 6px 0 8px;
}
.prompt-tab {
  border: 1px solid #2f3540;
  background: #171a20;
  color: var(--muted);
  border-radius: 8px;
  padding: 7px 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.prompt-tab.active {
  color: var(--text);
  border-color: #3d6df0;
  background: linear-gradient(180deg, #24304a 0%, #1a2233 100%);
  box-shadow: inset 0 0 0 1px rgba(61, 109, 240, 0.25);
}
.prompt-pane[hidden] {
  display: none !important;
}
.prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 2px 0 4px;
}
.prompt-head .field-label {
  margin: 0;
  min-width: 0;
}
.prompt-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.prompt-action {
  border: 0;
  background: transparent;
  color: #24d3ef;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  padding: 2px 0;
  cursor: pointer;
  opacity: 0.92;
}
.prompt-action:hover {
  opacity: 1;
  text-shadow: 0 0 8px rgba(36, 211, 239, 0.35);
}
.prompt-action:active {
  transform: translateY(0.5px);
}
.prompt-action.is-done {
  color: #7dffa8;
}
.req-mark {
  color: #7aa2ff;
  font-size: 10.5px;
  font-weight: 600;
  margin-left: 4px;
}
.opt-mark {
  color: #7d8796;
  font-size: 10.5px;
  font-weight: 500;
  margin-left: 4px;
}
.ref-row { display: flex; flex-wrap: wrap; gap: 6px; }
.ref-add, .ref-thumb {
  width: 52px; height: 52px;
  border-radius: 8px;
  border: 1px dashed #3c424e;
  display: grid; place-items: center;
  background: #1a1d24;
  color: var(--muted);
  cursor: pointer;
  overflow: hidden;
}
.ref-thumb img { width: 100%; height: 100%; object-fit: cover; }
textarea, select, input[type="text"], input[type="password"] {
  width: 100%;
  background: #1a1d24;
  border: 1px solid #2f3540;
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 12.5px;
}
textarea { resize: vertical; min-height: 76px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.field { display: block; margin-top: 6px; }
.field span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.result { margin-top: 8px; font-size: 12px; }
.result img { max-width: 100%; border-radius: 8px; border: 1px solid #2f3540; }
.result.err { color: var(--err); }

/* 底栏 CTA 固定 */
.cta-wrap {
  padding: 10px 12px 12px;
  margin-top: auto;
  border-top: 1px solid #2a2f38;
  background: #1c1f26;
  flex-shrink: 0;
}
.cta {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 13px 16px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: .04em;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(90deg, var(--cta-a) 0%, var(--cta-b) 100%);
  box-shadow: 0 8px 20px rgba(30, 200, 232, 0.18);
  min-height: 46px;
}
.cta:hover { filter: brightness(1.06); }
.cta:active { transform: translateY(1px); }
.cta:disabled { opacity: 0.55; cursor: not-allowed; filter: none; transform: none; }

/* 其它模块 */
.mod-placeholder {
  padding: 14px;
  overflow: auto;
  height: 100%;
}
.mod-placeholder h2 { margin: 0 0 8px; font-size: 15px; }
.mod-placeholder h3 {
  margin: 16px 0 8px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  text-transform: none;
}
.muted { color: var(--muted); font-size: 12px; }
.mono { font-family: var(--mono); font-size: 11.5px; word-break: break-all; }
.btn-sm {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  margin-top: 6px;
  min-height: 40px;
}
.btn-sm.primary {
  background: var(--blue);
  border-color: var(--blue-hi);
  color: #fff;
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.provider-list { margin-top: 8px; }
.provider-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px;
  border: 1px solid #2f3540;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #1a1d24;
  font-size: 12px;
}
.provider-item.active { border-color: #3d6eb5; }
.pi-main { flex: 1; min-width: 0; }
.pi-sub { color: var(--muted); margin-top: 4px; word-break: break-all; }
.pi-actions { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.pi-actions .btn-sm { min-height: 32px; padding: 4px 8px; margin-top: 0; font-size: 11px; }
.chat-log {
  min-height: 200px;
  max-height: 340px;
  overflow: auto;
  background: #1a1d24;
  border: 1px solid #2f3540;
  border-radius: 8px;
  padding: 10px;
  margin: 12px 0;
}
.msg { margin: 0 0 8px; padding: 8px; border-radius: 8px; font-size: 12.5px; }
.msg.user { background: #1e3a5f; margin-left: 16%; }
.msg.bot { background: var(--card); margin-right: 8%; }
.chat-input-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.hist-list { list-style: none; padding: 0; margin: 12px 0; }
.hist-list li {
  padding: 10px;
  border: 1px solid #2f3540;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  background: var(--card);
}

/* 首页布局完成标记条（仅开发可见可去掉） */
.home-layout-note {
  display: none;
}

@media (max-width: 480px) {
  body { padding: 0; }
  .plugin {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
  .tool-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tool-card { padding-left: 2px; padding-right: 2px; }
  .tool-card .tn { font-size: 10px; }
}


/* 置入 PS */
.place-bar {
  margin-top: 10px;
  padding: 10px 0 4px;
  border-top: 1px solid #2f3540;
}
.btn-place {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
}
.btn-place:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.2);
}
.btn-place:not(:disabled):hover {
  filter: brightness(1.05);
}
.place-hint {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.4;
}

/* 教程弹层 */
.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 10, 14, 0.72);
  backdrop-filter: blur(2px);
}
.tutorial-overlay[hidden] {
  display: none !important;
}
.tutorial-modal {
  width: min(720px, 100%);
  max-height: min(86vh, 900px);
  display: flex;
  flex-direction: column;
  background: #1b1f27;
  border: 1px solid #343b48;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.tutorial-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid #2f3540;
  background: linear-gradient(180deg, #252b36, #1d222b);
  flex-shrink: 0;
}
.tutorial-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}
.tutorial-sub {
  margin: 4px 0 0;
  font-size: 11.5px;
  color: var(--muted);
}
.tutorial-close {
  border: 0;
  background: #2a303c;
  color: #d7deea;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.tutorial-close:hover {
  background: #353c4a;
}
.tutorial-body {
  overflow: auto;
  padding: 12px 16px 18px;
  scrollbar-width: thin;
}
.tutorial-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #2a2f38;
}
.tutorial-toc a {
  color: #9eb6ff;
  text-decoration: none;
  font-size: 11.5px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #232a38;
  border: 1px solid #33405a;
}
.tutorial-toc a:hover {
  color: #fff;
  border-color: #4a6ad8;
}
.tutorial-article h3 {
  margin: 16px 0 8px;
  font-size: 14.5px;
  color: #f2f5fb;
}
.tutorial-article h4 {
  margin: 12px 0 6px;
  font-size: 13px;
  color: #dce5f5;
}
.tutorial-article p {
  margin: 0 0 8px;
  font-size: 12.5px;
  line-height: 1.65;
  color: #c5cddb;
}
.tut-lead {
  color: #8ec8ff !important;
  font-weight: 600;
}
.tut-list {
  margin: 0 0 10px;
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.65;
  color: #c5cddb;
}
.tut-list li {
  margin-bottom: 4px;
}
.tut-callout {
  padding: 8px 10px;
  border-left: 3px solid #3d6df0;
  background: #202636;
  border-radius: 0 8px 8px 0;
  color: #d7e3ff !important;
}
.tut-step {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #2f3540;
  border-radius: 10px;
  background: #171b22;
}
.tut-compare {
  display: grid;
  gap: 8px;
  margin: 8px 0;
}
.tut-compare code {
  display: block;
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #11151c;
  border: 1px solid #2a3140;
  color: #e8eef8;
  font-size: 11.5px;
  white-space: pre-wrap;
  word-break: break-word;
}
.tut-compare .bad,
.tut-compare .good {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
}
.tut-compare .bad {
  color: #ffb4b4;
  background: rgba(239, 68, 68, 0.15);
}
.tut-compare .good {
  color: #9dffc4;
  background: rgba(34, 197, 94, 0.15);
}
.tut-tip {
  color: #9bb0d0 !important;
  font-size: 12px !important;
}
.tut-code {
  margin: 6px 0 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #11151c;
  border: 1px solid #2a3140;
  color: #e8eef8;
  font-size: 11.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
}
.tut-card {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #2f3540;
  border-radius: 10px;
  background: #171b22;
}
.tut-label {
  margin: 8px 0 2px !important;
  font-size: 11px !important;
  color: #8b96a8 !important;
  font-weight: 600;
}
.tut-faq {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #171b22;
  border: 1px solid #2a3140;
}
.tut-faq h4 {
  margin: 0 0 4px;
}
.tut-footer {
  margin-top: 12px !important;
  padding-top: 10px;
  border-top: 1px solid #2a2f38;
  color: #aeb8c8 !important;
}

/* 生图 / 置入 进度弹窗 */
.progress-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(6, 8, 12, 0.72);
  backdrop-filter: blur(2px);
}
.progress-overlay[hidden],
.progress-overlay:not(.open) {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}
.progress-overlay.open:not([hidden]) {
  pointer-events: auto !important;
  visibility: visible !important;
}
.progress-modal {
  width: min(320px, 100%);
  padding: 22px 18px 16px;
  border-radius: 14px;
  border: 1px solid #3a4354;
  background: linear-gradient(180deg, #242b36 0%, #1a1f28 100%);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  text-align: center;
}
.progress-spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: 3px solid rgba(126, 160, 255, 0.2);
  border-top-color: #6ea0ff;
  animation: progress-spin 0.85s linear infinite;
}
@keyframes progress-spin {
  to { transform: rotate(360deg); }
}
.progress-modal h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: #f2f6ff;
}
.progress-stage {
  margin: 0 0 14px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #aeb8c8;
  min-height: 1.45em;
}
.progress-track {
  height: 8px;
  border-radius: 999px;
  background: #11161f;
  border: 1px solid #2f3644;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3b82f6, #22d3ee);
  transition: width 0.28s ease;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  font-size: 11.5px;
  color: #8b96a8;
}
.progress-meta #progressPercent {
  color: #d7e6ff;
  font-weight: 700;
}


/* ===== 独立预览面板（rail 右侧，主面板左侧） ===== */
#mod-home {
  overflow: hidden;
}
.gen-workspace {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.preview-pane {
  display: none;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  border-right: 1px solid #2a2f38;
  background: #15181e;
  overflow: hidden;
}
/* 默认有图布局：预览在主功能面板最左侧（rail 右侧） */
body.has-preview:not(.preview-below) .preview-pane:not([hidden]) {
  display: flex !important;
  grid-column: 2 !important;
  grid-row: 1 !important;
  width: auto !important;
  height: 100% !important;
  min-height: 0 !important;
  border-top: 0 !important;
  border-right: 1px solid #2a2f38 !important;
}
body.has-preview:not(.preview-below) .panel {
  grid-column: 3 !important;
  grid-row: 1 !important;
}
body.has-preview:not(.preview-below) .rail {
  grid-column: 1 !important;
  grid-row: 1 !important;
}
/* 窄布局：预览落到主面板内部 AI 生图下方（由 JS 把节点移进 panel） */
body.has-preview.preview-below .preview-pane:not([hidden]) {
  display: flex;
  width: 100%;
  height: min(42vh, 360px);
  min-height: 220px;
  border-right: 0;
  border-top: 1px solid #2a2f38;
  flex-shrink: 0;
}
body.has-preview.preview-below .panel {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
}
body.has-preview.preview-below .rail {
  grid-column: 1;
  grid-row: 1;
}
body.has-preview.preview-below #mod-home {
  flex: 1 1 auto;
  min-height: 0;
}
.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid #2a2f38;
  flex-shrink: 0;
}
.preview-title {
  font-size: 12px;
  font-weight: 600;
  color: #d7dde8;
}
.preview-zoom-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.zoom-label {
  min-width: 42px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.preview-stage {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: grab;
  touch-action: none;
  user-select: none;
  background:
    linear-gradient(45deg, #1b1f27 25%, transparent 25%),
    linear-gradient(-45deg, #1b1f27 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #1b1f27 75%),
    linear-gradient(-45deg, transparent 75%, #1b1f27 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-color: #12151b;
}
.preview-empty {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  line-height: 1.5;
  padding: 16px;
}
.preview-stage.is-panning { cursor: grabbing; }
.preview-stage .preview-image {
  position: relative;
  will-change: transform;
  cursor: grab;
}
.preview-image {
  max-width: none;
  transform-origin: center center;
  border-radius: 6px;
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
  user-select: none;
  -webkit-user-drag: none;
}
 .preview-actions {
   display: grid;
   grid-template-columns: .85fr 1.35fr;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #2a2f38;
  flex-shrink: 0;
}
.preview-actions #btnDownloadImage {
  grid-column: 1 / -1;
}
.preview-actions #btnRetryPlace {
  grid-column: 1 / -1;
}
.preview-actions #btnRetryPlace:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.preview-actions .btn-place,
.preview-actions .btn-import {
  width: 100%;
  margin: 0;
}
.preview-actions #btnDownloadImage:disabled,
.preview-actions .btn-import:disabled,
.preview-actions .btn-place:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.preview-pane .place-hint {
  margin: 0 10px 10px;
  font-size: 11px;
}
.gen-form-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: var(--panel);
  flex: 1;
}
/* 工具列表区不要被空白撑高成“大黑洞” */
.gen-form-pane .tool-body {
  flex: 0 1 auto;
  max-height: none;
}
.gen-form-pane .cta-wrap {
  margin-top: auto;
}
/* 旧 result 区隐藏 */
#mod-home #genResult {
  display: none !important;
}


/* ===== IME-safe prompts (CEP 中文候选窗贴输入框) ===== */
#promptPositive,
#promptNegative,
textarea,
input[type="text"],
input[type="search"],
input[type="password"] {
  /* 关键：不要让输入控件自身带 transform/filter */
  transform: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  will-change: auto !important;
  position: relative;
  z-index: 5;
  pointer-events: auto !important;
  user-select: text !important;
  -webkit-user-select: text !important;
  caret-color: #4d9fff;
  cursor: text;
  transition: border-color .12s ease, box-shadow .12s ease, background-color .12s ease;
}

/* 明确选中/输入态：用户反馈“经常点了没反应”优先是焦点环太弱 */
#promptPositive:hover,
#promptNegative:hover,
#imeExpandTextarea:hover {
  border-color: #465266;
  background: #1c212b;
}
#promptPositive:focus,
#promptNegative:focus,
#promptPositive:focus-visible,
#promptNegative:focus-visible,
#imeExpandTextarea:focus,
#imeExpandTextarea:focus-visible {
  outline: none !important;
  border-color: #4d9fff !important;
  background: #141a24 !important;
  box-shadow: 0 0 0 2px rgba(77, 159, 255, 0.35), inset 0 0 0 1px rgba(77, 159, 255, 0.25);
}
#promptPositive.is-focused,
#promptNegative.is-focused,
#imeExpandTextarea.is-focused {
  outline: none !important;
  border-color: #4d9fff !important;
  background: #141a24 !important;
  box-shadow: 0 0 0 2px rgba(77, 159, 255, 0.35), inset 0 0 0 1px rgba(77, 159, 255, 0.25);
}

/* 扩大命中：label 点空白也聚焦输入框 */
.prompt-pane .field-label,
.prompt-head {
  cursor: text;
}

/* 生图表单滚动容器：避免某些 CEF 对 overflow 容器 caret 误判 */
.gen-form,
.gen-form-pane,
.prompt-panels,
.prompt-pane {
  transform: none !important;
  filter: none !important;
  will-change: auto !important;
}

/* 展开编辑：顶层固定层，减少滚动/祖先坐标系干扰 */
.ime-expand-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  align-items: stretch;
  justify-content: stretch;
  background: rgba(8, 10, 14, 0.72);
  padding: 10px;
  pointer-events: none;
}
.ime-expand-overlay[hidden],
.ime-expand-overlay:not(.open) {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}
.ime-expand-overlay.open:not([hidden]) {
  display: flex !important;
  pointer-events: auto !important;
  visibility: visible !important;
}
body.ime-expand-open {
  overflow: hidden;
}
.ime-expand-actions .btn-sm,
.ime-expand-actions .btn-sm.primary {
  pointer-events: auto !important;
  cursor: pointer !important;
  z-index: 2;
  position: relative;
}
.ime-expand-card {
  flex: 1;
  min-height: 0;
  background: #1e222a;
  border: 1px solid #3a4250;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(0,0,0,.45);
}
.ime-expand-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #2f3540;
  flex-shrink: 0;
}
.ime-expand-title {
  font-size: 13px;
  font-weight: 700;
  color: #e8eef8;
}
.ime-expand-actions {
  display: flex;
  gap: 8px;
}
.ime-expand-actions .btn-sm {
  min-width: 64px;
}
.ime-expand-body {
  flex: 1;
  min-height: 0;
  padding: 10px 12px 12px;
  display: flex;
}
#imeExpandTextarea {
  flex: 1;
  width: 100%;
  min-height: 220px;
  resize: none;
  border: 1px solid #3a4250;
  border-radius: 8px;
  background: #12151b;
  color: #eef2f8;
  padding: 12px;
  font-size: 14px;
  line-height: 1.55;
  outline: none;
  transform: none !important;
  filter: none !important;
}
#imeExpandTextarea:focus {
  border-color: #4d9fff;
  box-shadow: 0 0 0 2px rgba(47,124,246,.25);
}
.prompt-head .prompt-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}


/* ===== 电商设计模块（R-021） ===== */
.ecom-form .form-title { color: #7dd3fc; }
.ecom-control-label {
  color: #aeb9ca;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.ecom-workflow-nav {
  margin: 6px 0 12px;
}
.ecom-prompt-module {
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid #303a4a;
  border-radius: 8px;
  background: #151a23;
}
.ecom-prompt-module .ecom-control-label { margin: 1px 2px 9px; }
.seg-group {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.seg {
  flex: 1;
  border: 1px solid #2f3540;
  background: #171a20;
  color: var(--muted);
  border-radius: 8px;
  padding: 7px 4px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .12s ease;
}
.seg:hover { border-color: #46536a; color: #cdd6e4; }
.seg.active {
  color: #fff;
  border-color: #3d6df0;
  background: linear-gradient(180deg, #24304a 0%, #1a2233 100%);
  box-shadow: inset 0 0 0 1px rgba(61,109,240,.3);
}

.ecom-workflow-nav .ecom-mode-seg {
  margin: 0;
  gap: 4px;
  padding: 3px;
  border-radius: 7px;
  background: #0f131a;
}
.ecom-workflow-nav .ecom-mode-seg .seg {
  min-height: 34px;
  border-color: transparent;
  border-radius: 5px;
  background: transparent;
}
.ecom-workflow-nav .ecom-mode-seg .seg.active {
  border-color: #3e77ec;
  background: #21365b;
  box-shadow: inset 0 0 0 1px rgba(111, 165, 255, .18);
}
.ecom-prompt-module .ecom-prompt-tabs {
  margin: 0;
  gap: 0;
  position: relative;
  z-index: 1;
}
.ecom-prompt-module .prompt-tab {
  border-radius: 6px 6px 0 0;
  border-color: #303a4a;
  background: #111720;
}
.ecom-prompt-module .prompt-tab + .prompt-tab { margin-left: 4px; }
.ecom-prompt-module .prompt-tab.active {
  border-color: #3d6df0;
  border-bottom-color: #1a2230;
  background: #1a2230;
  box-shadow: none;
}
.ecom-prompt-panels {
  border: 1px solid #3d6df0;
  border-radius: 0 0 7px 7px;
  background: #1a2230;
  padding: 9px;
}
.ecom-prompt-block .prompt-head {
  margin: 0 0 7px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.ecom-prompt-block .prompt-head .field-label {
  flex: 1 1 100%;
  line-height: 1.4;
}
.ecom-prompt-block .prompt-actions {
  width: 100%;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px 10px;
}
.ecom-prompt-block textarea {
  min-height: 82px;
  border-color: #354258;
  background: #10151e;
}
.ecom-prompt-block textarea:focus {
  border-color: #4d86ff;
  box-shadow: 0 0 0 2px rgba(77, 134, 255, .18);
}

.ecom-prompt-assistant {
  margin: 10px 0 12px;
  padding: 10px;
  border: 1px solid #303a4a;
  border-radius: 8px;
  background: #121821;
}
.ecom-prompt-assistant-head,
.ecom-prompt-suggestion-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ecom-prompt-assistant-head .muted,
.ecom-prompt-suggest-status { font-size: 10.5px; }
.ecom-prompt-suggest-status { margin-top: 7px; }
.ecom-prompt-suggest-status.error { color: #ff8f8f; }
.ecom-prompt-suggestions {
  display: grid;
  gap: 8px;
  margin-top: 9px;
}
.ecom-prompt-suggestions[hidden] { display: none !important; }
#ecomScreenCountRow[hidden],
#ecomCountRow[hidden] { display: none !important; }
.ecom-prompt-suggestion {
  padding: 9px;
  border: 1px solid #354258;
  border-radius: 7px;
  background: #0e141d;
}
.ecom-prompt-suggestion-head strong { font-size: 11px; color: #dce8fb; }
.ecom-prompt-suggestion-text {
  margin-top: 7px;
  color: #b9c6d8;
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ecom-progress { margin-top: 10px; }
.ecom-progress-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
}
.ecom-progress-bar {
  height: 6px;
  border-radius: 4px;
  background: #1a1d24;
  overflow: hidden;
  border: 1px solid #2a2f38;
}
.ecom-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #22d3ee, #3d6df0);
  transition: width .3s ease;
}

.ecom-previews { margin-top: 12px; }
.ecom-previews-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.ecom-thumb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ecom-thumb {
  width: 76px;
  height: 76px;
  border-radius: 8px;
  border: 2px solid #2f3540;
  overflow: hidden;
  cursor: pointer;
  background: #12151b;
  padding: 0;
  transition: border-color .12s ease;
}
.ecom-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ecom-thumb:hover { border-color: #46536a; }
.ecom-thumb.active {
  border-color: #4d9fff;
  box-shadow: 0 0 0 2px rgba(77,159,255,.35);
}


/* 浏览器输入（中文候选窗跟随）入口 */
.prompt-action.browser-ime {
  color: #7dd3fc;
  border-color: #2f5f8a;
  background: rgba(45, 90, 140, 0.18);
}
.prompt-action.browser-ime:hover {
  color: #fff;
  border-color: #4d9fff;
  background: rgba(61, 109, 240, 0.28);
}

/* ===== 电商设计 R-022 独立体系 ===== */
.ecom-mode-seg { margin: 6px 0 10px; }
.ecom-mode-seg .seg { flex: 1; }
.prompt-action.prompt-action-icon {
  font-size: 14px;
  line-height: 1;
  padding: 4px 8px;
  min-width: 30px;
}
.ecom-selection-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 2px 0 8px;
  padding: 6px 8px;
  border: 1px dashed #3a4358;
  border-radius: 8px;
  background: #1b2130;
}
.ecom-selection-row .muted { font-size: 11px; }
/* ============ 电商设计 · 详情页教程示例层 ============ */
.ecom-example-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(8, 10, 14, 0.72);
  padding: 12px;
  pointer-events: none;
}
.ecom-example-overlay[hidden],
.ecom-example-overlay:not(.open) {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}
.ecom-example-overlay.open:not([hidden]) {
  display: flex !important;
  pointer-events: auto !important;
  visibility: visible !important;
}
body.ecom-example-open {
  overflow: hidden;
}
.ecom-example-card {
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  background: #1e222a;
  border: 1px solid #3a4250;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .45);
}
.ecom-example-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #2f3540;
  flex-shrink: 0;
}
.ecom-example-title {
  font-size: 13px;
  font-weight: 700;
  color: #e8eef8;
}
.ecom-example-actions {
  display: flex;
  gap: 8px;
}
.ecom-example-actions .btn-sm {
  pointer-events: auto !important;
  cursor: pointer !important;
  z-index: 2;
  position: relative;
}
.ecom-example-card > .muted {
  flex-shrink: 0;
  padding: 0 12px;
  color: #9aa6b8;
}
.ecom-example-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ecom-example-item {
  border: 1px solid #2f3540;
  border-radius: 8px;
  background: #12151b;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ecom-example-item-title {
  font-size: 12px;
  font-weight: 700;
  color: #cfe0ff;
}
.ecom-example-item-prompt {
  font-size: 12px;
  line-height: 1.5;
  color: #d6deea;
  white-space: pre-wrap;
  word-break: break-word;
}
.ecom-example-item .btn-sm {
  align-self: flex-start;
}
/* ============ 电商设计 · 生成尺寸预设 ============ */
.ecom-size-row { margin-top: 4px; }
.ecom-size-select {
  width: 100%;
  border: 1px solid #2f3540;
  background: #171a20;
  color: #e8eef8;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 12px;
  outline: none;
  cursor: pointer;
}
.ecom-size-select:focus {
  border-color: #3d6df0;
  box-shadow: 0 0 0 2px rgba(61,109,240,.22);
}
.ecom-size-hint { color: #8b98a9; }
/* ============ 电商设计 · 详情页设置（逐屏整屏直出） ============ */
.ecom-detail-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}
.ecom-detail-hint { color: #8b98a9; }

/* 电商输入：CEP 内 IME 候选窗不可见时的组字预览 */
.ime-compose-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 6px 0 4px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #3a6ea5;
  background: linear-gradient(180deg, rgba(45, 110, 180, 0.22), rgba(20, 30, 44, 0.92));
  box-shadow: 0 0 0 1px rgba(77, 159, 255, 0.12);
}
.ime-compose-preview[hidden] { display: none !important; }
.ime-compose-label {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  color: #7dd3fc;
  letter-spacing: 0.02em;
}
.ime-compose-text {
  flex: 1 1 auto;
  min-width: 80px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  color: #fff;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid #4d9fff;
  border-radius: 6px;
  padding: 4px 8px;
  word-break: break-all;
}
.ime-compose-tip {
  flex: 1 1 100%;
  font-size: 11px;
  color: #b7c5d8;
}
#ecomPrompt.is-composing {
  border-color: #4d9fff !important;
  box-shadow: 0 0 0 3px rgba(77, 159, 255, 0.22);
}
.prompt-actions .prompt-action.browser-ime {
  font-weight: 700;
}

/* 本机桥在线但 PS COM 未附着 */
.local-bridge-bar.warn {
  border-color: #b08900;
  background: rgba(176, 137, 0, 0.12);
}
.local-bridge-bar.warn .lb-dot {
  background: #f0c000;
  box-shadow: 0 0 0 3px rgba(240, 192, 0, 0.18);
}

/* 详情页候选：未写入 PS 角标 */
.ecom-thumb { position: relative; }
.ecom-thumb-actions {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.ecom-use-style {
  pointer-events: auto;
  padding: 3px 6px;
  border-radius: 5px;
  background: rgba(13, 60, 145, 0.94);
  color: #fff;
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}
.ecom-use-style:hover { background: #174fa8; }

.ecom-thumb-badge {
  position: absolute; left: 4px; bottom: 4px;
  font-size: 10px; line-height: 1; padding: 2px 4px;
  border-radius: 3px; background: rgba(220, 38, 38, 0.92); color: #fff;
  pointer-events: none;
}

.uid-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.btn-uid-update[hidden] { display: none !important; }
.btn-uid-update {
  min-width: 72px;
  height: 34px;
  padding: 0 16px;
  border: 1px solid #3a5648;
  border-radius: 9px;
  background: linear-gradient(180deg, #2f463b 0%, #273a32 100%);
  color: #e8fff4;
  font: 600 13px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: .04em;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .06),
    0 1px 2px rgba(0, 0, 0, .35);
  position: relative;
}
.btn-uid-update:hover {
  border-color: #4d7a62;
  background: linear-gradient(180deg, #355445 0%, #2c4339 100%);
}
.btn-uid-update:active { filter: brightness(.96); }
.btn-uid-update:focus-visible { outline: 2px solid #5eead4; outline-offset: 2px; }
.btn-uid-update.is-busy { opacity: .72; cursor: wait; }
.btn-uid-update.has-update {
  border-color: #d4a017;
  background: linear-gradient(180deg, #5a4720 0%, #463714 100%);
  color: #fff7d6;
}
.btn-uid-update.has-update::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 6px rgba(251, 191, 36, .8);
}
.settings-danger-zone {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px dashed #5a3030;
}
.settings-danger-zone h3 {
  color: #f0a0a0;
  margin: 0 0 8px;
  font-size: 14px;
}
.btn-sm.danger {
  border-color: #7a3030;
  background: linear-gradient(180deg, #5a2424 0%, #471c1c 100%);
  color: #ffe4e4;
}
.btn-sm.danger:hover {
  border-color: #a04040;
  background: linear-gradient(180deg, #6b2c2c 0%, #552222 100%);
}
