/* ═══════════ 加吉设计 · 样式 ═══════════ */
:root {
  --bg: #0b0b0f;
  --panel: #14141b;
  --ink: #e8e9f0;
  --sub: #9aa0ae;
  --line: #262634;
  --b1: #ff4d4f;
  --b2: #e7eaef;
  --b3: #cfd4dc;
  --grad: linear-gradient(135deg, #f2f4f8 0%, #d6dbe3 60%, #b9bfc9 120%);
  --grad-soft: linear-gradient(135deg, #1b1e24 0%, #191c22 100%);
  --ok: #16a34a;
  --err: #e5484d;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --radius: 18px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
/* ★ V4.16.0：html 也要给底色 —— 嵌入模式里 body 是 transparent，内容不满一屏时
   会露出浏览器默认的白色画布（截图上一眼看得到「下面一截是白的」）。 */
html { background: #0b0b0f; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(1200px 500px at 85% -10%, rgba(255, 197, 61, 0.10), transparent 60%),
    radial-gradient(900px 420px at -10% 0%, rgba(255, 77, 79, 0.08), transparent 55%),
    var(--bg);
  color: var(--ink);
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
textarea, input { font-family: inherit; outline: none; }
::selection { background: rgba(255, 255, 255, 0.4); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #3a3a48; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #14161c; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ═══════════ 顶栏 ═══════════ */
.topbar {
  height: 66px;
  background: rgba(20, 20, 27, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px;
  position: relative; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 13px; }
.logo { width: 44px; height: 44px; filter: drop-shadow(0 4px 10px rgba(255, 77, 79, 0.35)); }
.brand-text h1 {
  font-size: 19px; letter-spacing: 1px; font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-text p { font-size: 10.5px; color: var(--sub); letter-spacing: 2.5px; margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.model-chip {
  font-size: 12px; color: #a9aebc;
  background: #171720; border: 1px solid var(--line);
  padding: 6px 11px; border-radius: 999px; white-space: nowrap;
}
.model-chip b { color: #d3d7e0; font-weight: 600; }
.api-status {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: #14141b;
  transition: all 0.2s;
}
.api-status:hover { border-color: #322011; box-shadow: var(--shadow-sm); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #9aa3b2; flex: none; }
.api-status.testing .dot { background: var(--b3); animation: pulse 1s infinite; }
.api-status.ok .dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18); }
.api-status.ok { color: #5ad48f; border-color: #12301d; background: #11321b; }
.api-status.fail .dot { background: var(--err); box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.16); }
.api-status.fail { color: #ff8a8a; border-color: #321111; background: #2a1618; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ═══════════ 布局 ═══════════ */
.layout { display: flex; height: calc(100% - 66px); }
.sidebar {
  width: 178px; flex: none;
  background: rgba(20, 20, 27, 0.78);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--line);
  padding: 16px 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 12px;
  font-size: 14px; font-weight: 600; color: #c6cad6;
  transition: all 0.18s; position: relative;
}
.nav-item:hover { background: #171720; color: var(--ink); }
.nav-item.active {
  background: var(--grad-soft); color: #ff6b6b;
  box-shadow: inset 0 0 0 1px #321711;
}
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 26%;
  width: 4px; height: 48%; border-radius: 4px; background: var(--grad);
}
.nav-ico { font-size: 17px; }
.nav-badge {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: #262634; color: #a9aebc;
  min-width: 20px; height: 20px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 6px;
}
.sidebar-foot { margin-top: auto; text-align: center; }
.foot-line { height: 1px; background: var(--line); margin: 10px 8px 12px; }
.sidebar-foot p { font-size: 10.5px; color: #a2a9bb; line-height: 1.7; }

.content { flex: 1; overflow-y: auto; padding: 20px 22px; }
.tab-panel { display: none; height: 100%; }
.tab-panel.active { display: block; }
/* V3.6.9 布局防溢出：工作区最小高度 0，避免嵌套 flex/grid 内容撑破父级导致顶部被裁切 */
.work-grid, .tab-panel, .content { min-height: 0; }

/* ═══════════ 面板通用 ═══════════ */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.work-grid {
  display: grid; grid-template-columns: 400px 1fr; gap: 18px;
  height: 100%; align-items: start;
}
.control-panel { padding: 22px; max-height: calc(100vh - 126px); overflow-y: auto; }
/* V3.12.6 右栏最小高度不得超出可用高度（窗口较矮时 560px 会撑破容器 → 内容被裁且无法滚动） */
.result-panel { padding: 22px; display: flex; flex-direction: column; min-height: min(560px, calc(100vh - 126px)); max-height: calc(100vh - 126px); }
.panel-title { font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.panel-sub { font-size: 12.5px; color: var(--sub); margin: 6px 0 18px; line-height: 1.6; }
.result-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.result-head h3 { font-size: 16px; font-weight: 700; }
.result-meta { font-size: 12px; color: var(--sub); }

.field-label { display: block; font-size: 13px; font-weight: 700; color: #d3d7e0; margin: 16px 0 8px; }
.field-label:first-of-type { margin-top: 0; }
.opt-tag {
  margin-left: 8px; font-size: 11px; font-weight: 600; color: #ffa06b;
  background: #322011; border: 1px solid #321f11; padding: 2px 8px; border-radius: 999px;
}

/* V3.12.4 画面描述标题行：右侧「复制 / 清空」工具按钮
   （注意 .btn-ghost.small 默认是 textarea 内的绝对定位右下角，这里必须复位为行内，否则按钮会飞出输入框） */
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0 8px; }
.field-head:first-of-type { margin-top: 0; }
.field-head .field-label { margin: 0; }
.field-tools { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.field-tools .btn-ghost.small { position: static; right: auto; bottom: auto; padding: 5px 10px; }

.prompt-wrap { position: relative; }
textarea {
  width: 100%; border: 1.5px solid #151922; border-radius: 12px;
  padding: 12px 14px 38px; font-size: 13.5px; line-height: 1.7;
  resize: vertical; min-height: 96px; transition: border 0.15s, box-shadow 0.15s;
  background: #101015;
}
textarea:focus { border-color: var(--b2); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.13); background: #14141b; }
.btn-ghost {
  font-size: 12.5px; font-weight: 600; color: #a9aebc;
  background: #171720; border: 1px solid var(--line);
  padding: 7px 13px; border-radius: 10px; transition: all 0.15s;
}
.btn-ghost:hover { color: #ff6b6b; border-color: #322011; background: #322111; }
.btn-ghost.small { position: absolute; right: 10px; bottom: 10px; font-size: 11.5px; padding: 5px 10px; }
.btn-ghost:disabled { opacity: 0.5; cursor: not-allowed; }

/* 比例网格 */
.ratio-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ratio-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 4px 8px; border-radius: 12px;
  border: 1.5px solid #161923; background: #101015;
  transition: all 0.15s;
}
.ratio-item:hover { border-color: #321e11; background: #322111; }
.ratio-item.on {
  border-color: var(--b2);
  background: linear-gradient(135deg, #2a1c14, #322511);
  box-shadow: 0 3px 12px rgba(255, 255, 255, 0.18);
}
.ratio-shape-wrap { width: 40px; height: 30px; display: flex; align-items: center; justify-content: center; }
.ratio-shape { background: #3a3a48; border-radius: 3px; }
.ratio-item.on .ratio-shape { background: var(--grad); }
.ratio-name { font-size: 11.5px; font-weight: 700; color: #c6cad6; }
.ratio-item.on .ratio-name { color: #ff6b6b; }

/* 分辨率分段 */
.tier-seg {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  background: #171720; border-radius: 13px; padding: 5px;
}
.tier-seg button {
  padding: 9px 6px 8px; border-radius: 10px; font-size: 14px; font-weight: 800;
  color: #a9aebc; display: flex; flex-direction: column; align-items: center; gap: 1px;
  transition: all 0.15s;
}
.tier-seg button i { font-style: normal; font-size: 10px; font-weight: 500; color: #9aa3b2; }
.tier-seg button.on { background: #14141b; color: #ff6b6b; box-shadow: 0 2px 8px rgba(31, 35, 41, 0.10); }
.tier-seg button.on i { color: #b2a37e; }
/* V3.12.0 变清晰档位按钮第三行（输出长边说明） */
.tier-seg button em { font-style: normal; font-size: 10px; font-weight: 500; color: #b9c0cc; }
.tier-seg button.on em { color: #cbb98e; }
.size-hint {
  margin-top: 10px; font-size: 12px; color: #c9a86a;
  background: #2a2414; border: 1px dashed #322911;
  padding: 8px 12px; border-radius: 10px; line-height: 1.5;
}

.adv { margin-top: 16px; }
.adv summary { font-size: 12.5px; font-weight: 600; color: var(--sub); cursor: pointer; }
.adv input {
  width: 100%; border: 1.5px solid #151922; border-radius: 10px;
  padding: 9px 12px; font-size: 13px; margin-top: 8px; background: #101015;
}
.adv input:focus { border-color: var(--b2); }

.btn-primary {
  background: var(--grad); color: #15181d;
  font-weight: 700; border-radius: 13px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: all 0.18s; letter-spacing: 1px;
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 9px 24px rgba(0, 0, 0, 0.45); }
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary.big { width: 100%; margin-top: 20px; padding: 14px; font-size: 15.5px; }

/* ═══════════ 结果区 ═══════════ */
/* V3.6.9 结果面板：头部（标题 + 工具栏）固定不滚动，主体 #layerResult 独立滚动
   —— 修复「拆分结果上边显示不全」：内容超出时不再把标题压出可视区 */
/* V3.12.6 整栏可纵向滚动（原来 overflow:hidden 会把超出部分直接裁掉、完全够不着）：
   参考图修改页的「表单 + 开始修改按钮」就在右栏里，表单变长后按钮被裁在可视区外且无法滚动
   （用户 2026-10-03 反馈「滑动不下去、点不到确定/生成」）。
   头部与表单一律 flex:none 保持完整高度，由整栏滚动；结果区 .result-body 内部仍各自独立滚动。 */
.result-panel { overflow-x: hidden; overflow-y: auto; }
.result-panel > .result-head { flex: none; }
.result-panel > .ref-form { flex: none; }
.layer-panel .result-head { flex: none; }
.layer-panel .result-body { display: block; flex: 1 1 auto; min-height: 0; }
.layer-panel .result-body .empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 300px;
}
/* V3.6.9 图层工具栏（批量下载 + 自定义保存位置） */
.layer-tools {
  flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 9px 12px; margin-bottom: 12px;
  background: #151b2e; border: 1px solid #161d2c; border-radius: 12px;
}
.layer-tools-gap { flex: 1 1 auto; }
.layer-pick-info { font-size: 12px; color: #9aa0ae; }
.layer-dir {
  font-size: 11.5px; color: #a9aebc; background: #14141b;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px;
  max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 图层多选态 */
.layer-card { position: relative; transition: border-color .15s, box-shadow .15s; }
.layer-card.pickable { cursor: pointer; }
.layer-card.pickable:hover { border-color: #121b30; }
.layer-card.picked { border-color: #3b6fe0; box-shadow: 0 0 0 2px rgba(59,111,224,.18); }
.layer-card.picked::after {
  content: "✓"; position: absolute; top: 6px; right: 6px;
  width: 20px; height: 20px; border-radius: 50%; background: #3b6fe0; color: #fff;
  font-size: 12px; font-weight: 700; line-height: 20px; text-align: center;
  box-shadow: 0 2px 6px rgba(59,111,224,.4);
}
.result-body {
  flex: 1; border-radius: 14px; position: relative;
  background: radial-gradient(500px 260px at 50% 0%, rgba(255, 255, 255, 0.05), transparent),
    #101015;
  border: 1.5px dashed #151922;
  display: flex; align-items: center; justify-content: center;
  min-height: 340px; overflow: auto;
}
.empty-state { text-align: center; padding: 40px 20px; }
.empty-art { font-size: 52px; filter: grayscale(0.15); }
.empty-t { margin-top: 14px; font-size: 15px; font-weight: 700; color: #c6cad6; }
.empty-d { margin-top: 6px; font-size: 12.5px; color: var(--sub); }

.gen-loading { text-align: center; padding: 30px; }
.spinner {
  width: 52px; height: 52px; margin: 0 auto;
  border-radius: 50%;
  border: 4px solid #321e11; border-top-color: var(--b2);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.gen-loading .t { margin-top: 16px; font-size: 14.5px; font-weight: 700; color: #d3d7e0; }
.gen-loading .d { margin-top: 6px; font-size: 12px; color: var(--sub); line-height: 1.7; }

.img-card { max-width: 100%; display: flex; flex-direction: column; align-items: center; padding: 16px; }
.img-card img {
  max-width: 100%; max-height: calc(100vh - 320px);
  border-radius: 12px; box-shadow: 0 10px 34px rgba(31, 35, 41, 0.16);
  cursor: zoom-in;
}
.img-tools { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; justify-content: center; }
.img-tools .btn-ghost { font-size: 12.5px; }

/* 错误卡 */
.error-card {
  max-width: 480px; margin: 20px; padding: 18px 20px;
  background: #2a1618; border: 1.5px solid #321111; border-radius: 14px;
}
.error-card .t { font-weight: 800; color: #ff8a8a; font-size: 14px; }
.error-card .d { margin-top: 8px; font-size: 12.5px; color: #ff9b9b; line-height: 1.8; word-break: break-all; }

/* ═══════════ V2.9 变高清上限提示卡 ═══════════ */
.limit-card {
  max-width: 520px; margin: 20px; padding: 22px 24px;
  background: #1e2e15; border: 1.5px solid #1e2d15; border-radius: 14px;
}
.limit-card .t { font-weight: 800; color: #3d7a1f; font-size: 14.5px; }
.limit-card .d { margin-top: 8px; font-size: 12.5px; color: #a6d98c; line-height: 1.8; }

/* ═══════════ 参考图 ═══════════ */
.dropzone {
  border: 2px dashed #151922; border-radius: 14px;
  padding: 26px 16px; text-align: center; cursor: pointer;
  transition: all 0.18s; background: #101015;
}
.dropzone:hover, .dropzone.drag { border-color: var(--b2); background: #322111; }
.dz-ico { font-size: 34px; }
.dz-t { margin-top: 8px; font-size: 13.5px; font-weight: 700; color: #d3d7e0; }
.dz-d { margin-top: 4px; font-size: 11.5px; color: var(--sub); }

.thumb-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.thumb {
  position: relative; width: 62px; height: 62px; border-radius: 10px; overflow: hidden;
  border: 2px solid transparent; cursor: pointer; flex: none;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.on { border-color: var(--b2); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2); }
.thumb .tag {
  position: absolute; left: 0; top: 0; font-size: 9.5px; font-weight: 700;
  background: rgba(255, 77, 79, 0.92); color: #fff; padding: 1px 5px; border-radius: 0 0 6px 0;
}
.thumb .del {
  position: absolute; right: 2px; top: 2px; width: 17px; height: 17px;
  background: rgba(0, 0, 0, 0.55); color: #fff; border-radius: 50%;
  font-size: 10px; line-height: 17px; text-align: center; display: none;
}
.thumb:hover .del { display: block; }

.main-img-wrap { margin-top: 16px; }
.mi-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mi-tools { display: flex; gap: 6px; }
.mi-tools .btn-ghost { position: static; }
.mi-tools .btn-ghost.on { color: #ff6b6b; border-color: var(--b2); background: #2a1c14; }

.img-canvas {
  position: relative; border-radius: 12px; overflow: hidden;
  border: 1.5px solid #151922; background: #171720;
  user-select: none;
}
.img-canvas img { display: block; width: 100%; max-height: 380px; object-fit: contain; }
.img-hint {
  position: absolute; inset: auto 0 0 0;
  font-size: 11.5px; text-align: center; color: #c9a86a;
  background: rgba(253, 248, 236, 0.94); padding: 6px;
}
.img-hint.hidden { display: none; }
.select-rect {
  position: absolute; border: 2px dashed #ff2d2d;
  background: rgba(255, 45, 45, 0.12);
  pointer-events: none; z-index: 5;
}
.select-rect::after {
  content: "修改区域"; position: absolute; left: 0; top: -22px;
  font-size: 10.5px; font-weight: 700; color: #fff;
  background: #ff2d2d; padding: 2px 7px; border-radius: 4px; white-space: nowrap;
}
.img-canvas.boxing { cursor: crosshair; }

.ref-form { margin-bottom: 14px; }

/* ═══════════ AI 对话 ═══════════ */
.chat-wrap {
  height: calc(100% - 0px); max-height: calc(100vh - 126px);
  display: flex; flex-direction: column; overflow: hidden;
}
.chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 14px; border-bottom: 1px solid var(--line);
}
.chat-head h3 { font-size: 16px; font-weight: 800; }
.chat-head p { font-size: 12px; color: var(--sub); margin-top: 3px; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; }
.msg { display: flex; gap: 10px; max-width: 88%; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.avatar {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
  background: var(--grad-soft); border: 1px solid #2a2f38;
}
.msg.user .avatar { background: #111832; border-color: #111832; }
.bubble {
  padding: 11px 15px; border-radius: 14px; font-size: 13.5px; line-height: 1.75;
  background: #171720; border: 1px solid var(--line);
  word-break: break-word; white-space: pre-wrap; position: relative;
}
.msg.user .bubble { background: var(--grad-soft); border-color: #2a2f38; }
.msg .cite-btn {
  position: absolute; right: 8px; bottom: -24px; font-size: 11px; color: #9aa3b2;
  padding: 2px 8px; border-radius: 8px;
}
.msg .cite-btn:hover { color: #ff6b6b; background: #2a1c14; }
.msg .chat-img { max-width: 220px; max-height: 200px; border-radius: 10px; margin-top: 8px; display: block; cursor: zoom-in; }
.cursor-blink::after { content: "▍"; color: var(--b2); animation: pulse 0.8s infinite; }

.quote-bar {
  margin: 0 22px; display: flex; align-items: center; gap: 10px;
  background: #2a2414; border: 1px solid #322911; border-radius: 10px;
  padding: 8px 12px; font-size: 12.5px;
}
.q-label { font-weight: 800; color: #c9a86a; flex: none; }
.q-text { color: #e2c48a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-close { margin-left: auto; color: #a08c5e; font-size: 13px; flex: none; }
.q-close:hover { color: #ff6b6b; }

.chat-input-bar { border-top: 1px solid var(--line); padding: 12px 22px 16px; }
.pending-imgs { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.pending-imgs .p-img { position: relative; width: 52px; height: 52px; border-radius: 9px; overflow: hidden; border: 1.5px solid #151922; }
.pending-imgs .p-img img { width: 100%; height: 100%; object-fit: cover; }
.pending-imgs .p-img .del {
  position: absolute; right: 1px; top: 1px; width: 16px; height: 16px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff; font-size: 9.5px; line-height: 16px; text-align: center;
}
.input-row { display: flex; align-items: flex-end; gap: 10px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; font-size: 17px; flex: none;
  background: #171720; border: 1px solid var(--line); transition: all 0.15s;
}
.icon-btn:hover { background: #2a1c14; border-color: #322011; }
#chatInput {
  flex: 1; border: 1.5px solid #151922; border-radius: 12px;
  padding: 11px 14px; font-size: 13.5px; line-height: 1.6;
  resize: none; max-height: 130px; background: #101015;
}
#chatInput:focus { border-color: var(--b2); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.13); background: #14141b; }
.send-btn { padding: 0 22px; height: 42px; font-size: 14px; flex: none; }

/* ═══════════ 历史 ═══════════ */
.history-panel { padding: 22px; min-height: 400px; max-height: calc(100vh - 126px); overflow-y: auto; }
.hist-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 14px; margin-top: 14px;
}
.hist-card {
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: #14141b; transition: all 0.18s;
}
.hist-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.hist-card .h-img {
  width: 100%; aspect-ratio: 1; object-fit: cover; background: #171720;
  cursor: zoom-in; display: block;
}
.hist-card .h-img.broken { display: flex; align-items: center; justify-content: center; font-size: 12px; color: #ff8a8a; }
.hist-card .h-body { padding: 10px 12px 12px; }
.hist-card .h-prompt { font-size: 12px; color: #d3d7e0; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 37px; }
.hist-card .h-meta { margin-top: 7px; font-size: 10.5px; color: #9aa3b2; display: flex; gap: 8px; flex-wrap: wrap; }
.hist-card .h-tools { display: flex; gap: 6px; margin-top: 9px; }
.hist-card .h-tools .btn-ghost { font-size: 11px; padding: 4px 9px; border-radius: 8px; }
.hist-empty { text-align: center; padding: 60px 0; color: var(--sub); font-size: 13px; }

/* V3.6.5 历史作品批量下载：选择模式 */
.hist-card { position: relative; }
.hist-card.picking { cursor: pointer; }
.hist-card.picked { outline: 3px solid #2563eb; outline-offset: -3px; }
.hist-card .pick-mark {
  position: absolute; top: 8px; left: 8px; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(37, 99, 235, .92); color: #fff; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25); pointer-events: none;
}
.hist-card.no-full .pick-mark { background: rgba(100, 116, 139, .85); }

/* ═══════════ Lightbox / Toast ═══════════ */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 17, 23, 0.82); backdrop-filter: blur(6px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 30px;
}
.lightbox img { max-width: 92vw; max-height: 82vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.lb-bar { display: flex; gap: 10px; }
.lb-bar .btn-ghost { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.25); color: #fff; font-size: 13px; padding: 9px 18px; }
.lb-bar .btn-ghost:hover { background: rgba(255, 255, 255, 0.22); color: #fff; }

.toast {
  position: fixed; left: 50%; top: 78px; transform: translateX(-50%);
  z-index: 120; padding: 11px 20px; border-radius: 12px;
  font-size: 13.5px; font-weight: 600; color: #fff;
  background: rgba(31, 35, 41, 0.92); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  max-width: 70vw; text-align: center;
}
.toast.err { background: rgba(190, 32, 38, 0.95); }
.toast.ok { background: rgba(18, 138, 76, 0.95); }

/* 响应式 */
@media (max-width: 1080px) {
  .work-grid { grid-template-columns: 1fr; height: auto; }
  .result-panel { min-height: 480px; }
  .tab-panel { height: auto; }
  .content { overflow-y: visible; }
  .model-chip { display: none; }
}


/* ===== V2.2 对话改图 / 下载保存 ===== */
.edit-base-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin-bottom: 8px; background: #322011; border: 1px solid #322011; border-radius: 12px; }
.edit-base-bar[hidden] { display: none !important; }
.edit-base-bar img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid #322011; flex: none; }
.edit-base-bar .eb-info { display: flex; flex-direction: column; gap: 1px; flex: 1; font-size: 12px; color: #e0b183; min-width: 0; }
.edit-base-bar .eb-info b { font-size: 12.5px; color: #e7eaef; }
.edit-base-bar .q-close { border: none; background: transparent; color: #e7eaef; font-size: 15px; cursor: pointer; padding: 4px 6px; }
#btnEditMode.on { background: linear-gradient(135deg, #ff4d4f, #e7eaef); color: #fff; border-color: transparent; }
.bubble .chat-img { max-width: 300px; max-height: 300px; border-radius: 10px; cursor: zoom-in; display: block; margin-top: 6px; }


/* ===== V2.4 全局文字可选中可复制 ===== */
* { -webkit-user-select: text !important; user-select: text !important; }
/* 例外：框选画布必须禁选（拖框标注交互必需），特异性高于上方通配规则 */
.img-canvas, .img-canvas * { -webkit-user-select: none !important; user-select: none !important; }

/* ===== V2.5 文生图批次生成（1/2/4 张并发） ===== */
.batch-grid { display: grid; gap: 14px; }
.batch-grid.n2, .batch-grid.n3, .batch-grid.n4 { grid-template-columns: 1fr 1fr; }
.batch-grid .batch-item { margin: 0; }
.batch-tag { margin: 8px 0 0; font-size: 12px; color: #9aa0ae; text-align: center; }
.batch-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 56px 0; color: #9aa0ae; font-size: 13px; }
.batch-loading .spin { width: 26px; height: 26px; border: 3px solid #161c28; border-top-color: #4f6ef7; border-radius: 50%; animation: jjspin 0.9s linear infinite; }
@keyframes jjspin { to { transform: rotate(360deg); } }

/* ===== V2.6 参考图比例选择 ===== */
.ratio-shape.auto-shape { background: repeating-linear-gradient(45deg, #34343f 0 4px, #131a2f 4px 8px) !important; border: 1px dashed #151922 !important; box-sizing: border-box; }

/* ═══════════ V3.0 会员体系样式 ═══════════ */
.balance-chip {
  padding: 6px 14px; border-radius: 20px; border: 1.5px solid #151a23;
  background: #14141b; color: #c6cad6; font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: all .16s; margin-right: 10px; white-space: nowrap;
}
.balance-chip:hover { border-color: #3b6fe0; color: #7aa2ff; }
.balance-chip.has-balance { background: #111a32; border-color: #111b32; color: #7aa2ff; }

.modal-mask {
  position: fixed; inset: 0; background: rgba(24, 28, 38, .55); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(2px);
}
.modal-card {
  background: #14141b; border-radius: 18px; padding: 30px 32px; width: 100%;
  max-height: 88vh; overflow-y: auto; position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
.auth-card { max-width: 380px; }
.member-card { max-width: 560px; }
.modal-x {
  position: absolute; right: 16px; top: 14px; border: 0; background: transparent;
  font-size: 16px; color: #9aa1b3; cursor: pointer; padding: 6px 8px; border-radius: 8px;
}
.modal-x:hover { background: #161c28; color: #c6cad6; }

/* 登录 */
.auth-logo { font-size: 19px; font-weight: 800; color: #7aa2ff; text-align: center; }
.auth-sub { text-align: center; color: #a9aebc; font-size: 13px; margin: 6px 0 20px; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 18px; background: #0b0b0f; padding: 4px; border-radius: 10px; }
.auth-tab {
  flex: 1; padding: 9px; border: 0; background: transparent; border-radius: 8px;
  font-size: 13.5px; font-weight: 600; color: #a9aebc; cursor: pointer; transition: all .15s;
}
.auth-tab.on { background: #14141b; color: #7aa2ff; box-shadow: 0 2px 8px rgba(59, 111, 224, .13); }
.auth-card input {
  width: 100%; padding: 11px 14px; margin-bottom: 12px; border: 1.5px solid #151823;
  border-radius: 10px; font-size: 14px; outline: none; transition: border-color .15s;
}
.auth-card input:focus { border-color: #3b6fe0; }
/* V3.13.0 注册短信核验：验证码输入 + 「获取验证码」按钮并排；倒计时中置灰并显示剩余秒数 */
.sms-row { display: flex; gap: 8px; align-items: stretch; margin-bottom: 12px; }
.sms-row input { flex: 1 1 auto; min-width: 0; margin-bottom: 0 !important; }
.btn-sms {
  flex: 0 0 auto; padding: 0 14px; border: 1.5px solid #3b6fe0; border-radius: 10px;
  background: #14141b; color: #7aa2ff; font-size: 13px; font-weight: 700; cursor: pointer;
  white-space: nowrap; transition: background .15s, color .15s, border-color .15s;
}
.btn-sms:hover:not(:disabled) { background: #111b32; }
.btn-sms.counting, .btn-sms:disabled { border-color: #161b27; color: #9aa1b3; background: #13192f; cursor: not-allowed; }
.sms-note { color: #8a90a2; font-size: 12px; margin: -4px 0 12px; line-height: 1.5; }
.btn-main {
  width: 100%; padding: 12px; border: 0; border-radius: 10px; background: #3b6fe0;
  color: #fff; font-size: 14.5px; font-weight: 700; cursor: pointer; transition: background .15s;
}
.btn-main:hover { background: #2c56b8; }
.btn-main:disabled { opacity: .55; cursor: not-allowed; }
.btn-ghost.block { width: 100%; }
.auth-err { color: #ff7a7a; font-size: 12.5px; min-height: 18px; margin: 12px 0 0; text-align: center; }
.auth-foot { color: #9aa1b3; font-size: 12px; text-align: center; margin: 12px 0 0; }
.auth-hint { color: #a9aebc; font-size: 12px; text-align: center; margin: 4px 0 0; }

/* 会员中心 */
.member-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 18px; border-bottom: 1px solid #262634; margin-bottom: 6px;
}
.member-title { font-size: 17px; font-weight: 800; }
.member-phone { color: #a9aebc; font-size: 12.5px; margin-top: 3px; }
.member-balance-box { text-align: right; }
.mb-label { color: #a9aebc; font-size: 12px; }
.mb-value { font-size: 26px; font-weight: 800; color: #7aa2ff; line-height: 1.2; }
.mb-value small { font-size: 13px; font-weight: 600; color: #a9aebc; }
.member-tabs { display: flex; gap: 4px; margin: 16px 0 18px; border-bottom: 1px solid #262634; }
.mtab {
  padding: 9px 14px; border: 0; background: transparent; font-size: 13.5px; font-weight: 600;
  color: #a9aebc; cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -1px;
}
.mtab.on { color: #7aa2ff; border-bottom-color: #3b6fe0; }
.mpane { display: none; }
.mpane.on { display: block; }
/* ═══ V4.9.0 会员周期切换条 + 五档卡片 + 温馨提示 ═══ */
.plan-terms { display: flex; gap: 8px; justify-content: center; margin: 12px 0 4px; }
.plan-terms .ptab {
  border: 1px solid var(--line, #131418); background: #14141b; color: #c6cad6;
  font-size: 13px; font-weight: 700; padding: 7px 16px; border-radius: 999px;
}
.plan-terms .ptab.on { background: linear-gradient(135deg, #ff4d4f, #e7eaef); border-color: transparent; color: #fff; }
.plan-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 10px; }
.plan .plan-badge {
  margin-left: 6px; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 6px;
  background: rgba(255, 255, 255, 0.14); color: #ff8f5e; font-style: normal;
}
.plan .plan-price b { font-size: 22px; }
.plan .plan-price small { font-size: 12px; color: #8c8c8c; margin-left: 2px; }
.plan .plan-price.unset b { font-size: 15px; color: #9aa0ab; }
.plan .plan-off {
  margin-left: 6px; font-size: 10.5px; font-weight: 700; color: #ff8f5e;
  background: rgba(255, 77, 79, 0.12); padding: 1px 6px; border-radius: 6px; font-style: normal;
}
.plan .plan-renew { font-size: 11px; color: #8c8c8c; margin-top: 3px; }
.plan .plan-credits.plan-unset { font-size: 12.5px; color: #9aa0ab; }
.pay-tip {
  margin: 12px 0 2px; padding: 10px 12px; border-radius: 12px;
  background: #322711; border: 1px solid #322711; color: #e8c476;
  font-size: 12px; line-height: 1.65;
}
.pay-tip b { color: #f5c76a; }
.member-tip { color: #a9aebc; font-size: 12.5px; line-height: 1.7; margin: 12px 0 0; text-align: center; }
.notice-bar {
  background: #322811; border: 1px solid #322711; color: #e8c476; font-size: 12.5px;
  padding: 10px 14px; border-radius: 9px; margin-bottom: 14px; line-height: 1.7;
}

/* 档位 */
.tier-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; }
.tier {
  border: 1.5px solid #151823; border-radius: 12px; padding: 13px 12px; text-align: center;
  cursor: pointer; transition: all .15s; background: #14141b;
}
.tier:hover { border-color: #111b32; }
.tier.on { border-color: #3b6fe0; background: #161c28; box-shadow: 0 3px 12px rgba(59, 111, 224, .13); }
.tier-label { color: #a9aebc; font-size: 12px; margin-bottom: 6px; }
.tier-credits { font-size: 21px; font-weight: 800; color: #e2e4ec; line-height: 1.2; }
.tier-credits small { font-size: 12px; font-weight: 600; color: #a9aebc; }
.tier-price { color: #ff7a7a; font-weight: 700; font-size: 14px; margin-top: 5px; }
.tier-unit { color: #9aa1b3; font-size: 11px; margin-top: 2px; }

/* 支付通道 */
.pay-channels { display: flex; gap: 10px; margin: 16px 0 4px; }
.pay-ch {
  flex: 1; padding: 11px; border: 1.5px solid #151823; border-radius: 10px; text-align: center;
  font-size: 13.5px; font-weight: 600; color: #c6cad6; cursor: pointer; transition: all .15s;
}
.pay-ch.on { border-color: #3b6fe0; background: #161c28; color: #7aa2ff; }
#btnCreateOrder { margin-top: 16px; }
.qr-box { margin-top: 18px; text-align: center; padding: 18px; background: #101015; border-radius: 12px; }
.qr-title { font-size: 13px; color: #c6cad6; margin-bottom: 12px; font-weight: 600; }
.qr-box img { width: 220px; height: 220px; border-radius: 10px; background: #14141b; }
.qr-status { font-size: 13px; color: #7aa2ff; margin-top: 12px; font-weight: 600; }
/* V3.6 支付成功视图 */
.pay-ok { text-align: center; padding: 22px 10px 8px; }
.pay-ok-circle { width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 50%; background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; font-size: 44px; line-height: 76px; font-weight: 700; box-shadow: 0 10px 26px rgba(34, 197, 94, .35); }
.pay-ok-title { font-size: 20px; font-weight: 700; color: #5ad48f; margin-bottom: 8px; }
.pay-ok-credits { font-size: 34px; font-weight: 800; color: #e8a33d; margin-bottom: 6px; }
.pay-ok-credits small { font-size: 15px; font-weight: 600; color: #b98a2f; }
.pay-ok-balance { font-size: 13px; color: #a9aebc; margin-bottom: 16px; }

/* 记录 */
.rec-sum { display: flex; gap: 26px; padding: 14px 16px; background: #101015; border-radius: 11px; margin-bottom: 14px; }
.rec-sum > div { font-size: 13px; color: #a9aebc; }
.rec-sum b { color: #e2e4ec; font-size: 16px; margin: 0 3px; }
.usage-list { max-height: 300px; overflow-y: auto; }
.usage-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 4px;
  border-bottom: 1px solid #161c28; font-size: 12.5px;
}
.usage-row .u-type { font-weight: 600; color: #c6cad6; min-width: 74px; }
.usage-row .u-note { flex: 1; color: #9aa1b3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usage-row .u-credit { color: #ff7a7a; font-weight: 700; }
/* V3.12.1 积分记录（增减双向）：增加=绿色（充值/会员/返利/赠礼到账），减少=红色（生成消费扣减） */
.usage-row .u-credit.plus { color: #4fd1a5; }
.usage-row .u-credit.minus { color: #ff7a7a; }
.usage-row .u-time { color: #9aa1b3; font-size: 11.5px; }
.empty-tip { text-align: center; color: #9aa1b3; padding: 24px; font-size: 13px; }

/* 账号 */
.acct-row { display: flex; justify-content: space-between; padding: 9px 0; font-size: 13px; border-bottom: 1px solid #161c28; }
.acct-row span { color: #a9aebc; }
#m-account input {
  width: 100%; padding: 10px 13px; margin-bottom: 10px; border: 1.5px solid #151823;
  border-radius: 9px; font-size: 13.5px; outline: none;
}
/* V3.10.0 卡密兑换面板已下线，其输入框样式一并移除 */

/* ═══════════ V3.0 协议勾选 ═══════════ */
.agree-row {
  display: flex; align-items: flex-start; gap: 8px; margin: 4px 0 14px;
  font-size: 12.5px; color: #a9aebc; line-height: 1.6; cursor: pointer;
}
.agree-row input[type="checkbox"] {
  width: auto; margin: 2px 0 0; flex-shrink: 0; cursor: pointer;
}
.agree-row a { color: #7aa2ff; text-decoration: none; }
.agree-row a:hover { text-decoration: underline; }

/* ═══════════ V3.6.8 底部声明栏（AI 生成声明 + 免责声明/测试协议/隐私政策） ═══════════ */
.app-footer {
  margin: 26px 24px 0;
  padding: 14px 16px 18px;
  border-top: 1px solid #161a25;
  text-align: center;
  font-size: 12px;
  color: #9aa1b4;
  line-height: 1.8;
}
.app-footer .af-text { margin-right: 12px; }
.app-footer a { color: #8fa3c8; text-decoration: none; margin: 0 7px; }
.app-footer a:hover { color: #7aa2ff; text-decoration: underline; }

/* ═══════════ V3.6.8 图层结果卡元信息（尺寸 + bbox）与创意描述标签 ═══════════ */
.layer-desc { text-align: left; }
.layer-desc i {
  display: inline-block;
  font-style: normal;
  font-size: 10.5px;
  color: #7aa2ff;
  background: #111c32;
  border-radius: 4px;
  padding: 0 5px;
  margin-right: 6px;
  vertical-align: 1px;
}
.layer-meta {
  font-size: 11px;
  color: #9aa1b4;
  text-align: left;
  margin-top: 2px;
  word-break: break-all;
}

/* ═══════════ V3.7.0 AI 去水印 / AI 消除 · 标注编辑器 ═══════════ */
.erase-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.erase-tool {
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: #a9aebc;
  background: #0b0b0f;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all .16s ease;
}
.erase-tool:hover { background: #262634; }
.erase-tool.on {
  color: #ff6b6b;
  background: #14141b;
  border-color: #321411;
  box-shadow: 0 2px 8px rgba(217, 44, 46, .12);
}
.erase-gap { flex: 1 1 auto; }
.erase-count { font-size: 11.5px; color: #9aa1b4; white-space: nowrap; }
.erase-brush-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.erase-brush-row input[type="range"] { flex: 1 1 auto; accent-color: #ff4d4f; max-width: 220px; }

.erase-stage {
  position: relative;
  width: 100%;
  max-width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #14161e repeating-conic-gradient(#2c2c38 0% 25%, #161c2b 0% 50%) 50% / 18px 18px;
  border: 1px solid var(--line);
  line-height: 0;
  touch-action: none;
  user-select: none;
}
.erase-stage img { display: block; width: 100%; height: auto; pointer-events: none; }
.erase-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}
#erasePreview { pointer-events: none; }
.erase-stage.busy { opacity: .55; pointer-events: none; }

.erase-text-input {
  width: 100%;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  background: #14141b;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
}
.erase-text-input:focus { border-color: #321511; box-shadow: 0 0 0 3px rgba(255, 255, 255, .12); }


/* ═══════════ V3.8.0 AI 证件照 ═══════════ */
.id-color-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 6px; }
.id-color {
  display: flex; align-items: center; gap: 8px;
  border: 2px solid var(--line); border-radius: 12px;
  background: #14141b; padding: 8px 14px; cursor: pointer; font: inherit; font-size: 13px;
  transition: border-color .15s, box-shadow .15s;
}
.id-color .sw { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }
.id-color:hover { border-color: #321511; }
.id-color.on { border-color: #e7eaef; box-shadow: 0 0 0 3px rgba(255, 255, 255, .15); font-weight: 600; }
.id-preview-wrap { text-align: center; }
#idPreviewImg {
  max-width: 100%; max-height: 420px; border-radius: 10px;
  box-shadow: 0 2px 14px rgba(0,0,0,.12); image-rendering: auto;
}
.id-sheet-wrap { margin-top: 14px; }
#idSheetImg { max-width: 100%; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.10); }

/* ═══════════ V3.9.0 会员套餐 ═══════════ */
.bonus-tag {
  font-style: normal; font-size: 10.5px; color: #e8b25c; background: #332e1c;
  border-radius: 6px; padding: 1px 5px; margin-left: 4px; font-weight: 700; vertical-align: 2px;
}
.plan-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 14px; }
.plan {
  position: relative; border: 1.5px solid #151823; border-radius: 14px; padding: 16px 15px;
  background: linear-gradient(180deg, #322a11 0%, #14141b 55%); cursor: pointer; transition: all .15s;
}
.plan:hover { border-color: #322511; }
.plan.on { border-color: #e8a33d; background: #322711; box-shadow: 0 4px 16px rgba(232, 163, 61, .18); }
/* ★ 2026-10-20 后台未上架档位：照常显示但置灰不可选（运营方要求"未上架的显示不可用"）。
   用 opacity + grayscale 而不是 display:none —— 目的是让用户看出"这个档位存在但暂不开放"，
   而不是"档位凭空少了一个"（后者会被当成系统故障来投诉）。 */
.plan.off { opacity: .45; cursor: not-allowed; filter: grayscale(1); }
.plan.off:hover { border-color: #151823; }
.plan-name { font-weight: 800; font-size: 15px; color: #f0c674; }
.plan-credits { font-size: 26px; font-weight: 800; color: #e2e4ec; line-height: 1.25; margin-top: 4px; }
.plan-credits small { font-size: 12.5px; font-weight: 600; color: #a9aebc; }
.plan-valid { color: #a9aebc; font-size: 12px; margin-top: 3px; }
.plan-price { color: #ff7a7a; font-weight: 800; font-size: 19px; margin-top: 7px; }
.plan-price del { color: #b3b9c8; font-size: 12.5px; font-weight: 600; margin-left: 6px; }
.plan-promo { color: #e8b25c; background: #332e1c; border-radius: 8px; font-size: 11.5px; padding: 4px 8px; margin-top: 8px; line-height: 1.5; }
.plan-promo.off { color: #9aa0ae; background: #161c2b; }
.plan-perks { margin-top: 9px; display: grid; gap: 4px; }
.plan-perk { color: #c6cad6; font-size: 12px; }
#btnBuyPlan { margin-top: 16px; }
.mstatus {
  background: linear-gradient(135deg, #322611, #2c1132 65%); border: 1px solid #322711;
  border-radius: 13px; padding: 13px 16px; margin-bottom: 6px;
}
.mstatus-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; padding: 3px 0; }
.mstatus-row b { color: #e2e4ec; }
.mstatus-label { color: #8a7a5c; font-size: 12px; min-width: 60px; }
.mstatus-lots { margin-top: 8px; border-top: 1px dashed #322611; padding-top: 8px; }
.lot-row { display: flex; justify-content: space-between; font-size: 12.5px; color: #c6cad6; padding: 2px 0; }
.lot-row span:last-child { color: #9aa0ae; font-size: 11.5px; }
.prio-tag {
  font-style: normal; font-size: 10.5px; color: #7aa2ff; background: #1b2333;
  border-radius: 6px; padding: 1px 6px; font-weight: 700; margin-left: auto;
}
.plan-total { color: #a9aebc; font-size: 12px; font-weight: 700; margin-top: 2px; }

/* ═══════════ V3.9.2 会员收款弹窗（高端金黑风） ═══════════ */
.ppm-mask {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  background: rgba(8, 10, 18, .62); backdrop-filter: blur(6px); animation: ppmFade .18s ease;
}
@keyframes ppmFade { from { opacity: 0; } to { opacity: 1; } }
.ppm-card {
  position: relative; width: 320px; max-height: 92vh; overflow: auto; border-radius: 18px; padding: 22px 22px 16px;
  background: linear-gradient(168deg, #161b28 0%, #1d2434 52%, #171c29 100%);
  border: 1px solid rgba(232, 196, 118, .38);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(232, 196, 118, .16);
  animation: ppmPop .22s cubic-bezier(.2, .9, .3, 1.2); text-align: center;
}
@keyframes ppmPop { from { transform: translateY(14px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.ppm-close {
  position: absolute; top: 10px; right: 12px; width: 28px; height: 28px; border: none; cursor: pointer;
  border-radius: 50%; background: rgba(255, 255, 255, .07); color: #b9c0d4; font-size: 13px; line-height: 1;
}
.ppm-close:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.ppm-crown { font-size: 26px; line-height: 1; filter: drop-shadow(0 0 10px rgba(232, 196, 118, .55)); }
.ppm-title {
  margin-top: 5px; font-size: 17px; font-weight: 800; letter-spacing: 2px;
  background: linear-gradient(92deg, #322811, #322711 45%, #c99a45); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ppm-sub { margin-top: 2px; font-size: 9.5px; letter-spacing: 3.5px; color: #9aa0ae; }
.ppm-order { margin: 14px 0 4px; padding: 11px 12px; border-radius: 12px; background: rgba(232, 196, 118, .07); border: 1px solid rgba(232, 196, 118, .18); }
.ppm-plan-name { font-size: 13.5px; font-weight: 800; color: #f0e6cf; letter-spacing: 1px; }
.ppm-price { margin-top: 3px; color: #ffd98a; font-size: 26px; font-weight: 800; }
.ppm-price del { color: #7d8598; font-size: 12.5px; font-weight: 600; margin-left: 7px; }
.ppm-credits { margin-top: 3px; color: #9aa0ae; font-size: 11.5px; }
.ppm-qr-zone { margin-top: 12px; }
.ppm-qr-frame {
  position: relative; display: inline-block; padding: 9px; border-radius: 12px; background: #14141b;
  box-shadow: 0 0 0 1px rgba(232, 196, 118, .35), 0 0 26px rgba(232, 196, 118, .28);
  animation: ppmGlow 2.4s ease-in-out infinite;
}
@keyframes ppmGlow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(232, 196, 118, .35), 0 0 22px rgba(232, 196, 118, .22); }
  50% { box-shadow: 0 0 0 1px rgba(232, 196, 118, .55), 0 0 34px rgba(232, 196, 118, .4); }
}
.ppm-qr-frame img { display: block; width: 168px; height: 168px; }
.ppm-corner { position: absolute; width: 16px; height: 16px; border-color: #322711; border-style: solid; border-width: 0; }
.ppm-corner.tl { top: -5px; left: -5px; border-top-width: 2.5px; border-left-width: 2.5px; border-top-left-radius: 7px; }
.ppm-corner.tr { top: -5px; right: -5px; border-top-width: 2.5px; border-right-width: 2.5px; border-top-right-radius: 7px; }
.ppm-corner.bl { bottom: -5px; left: -5px; border-bottom-width: 2.5px; border-left-width: 2.5px; border-bottom-left-radius: 7px; }
.ppm-corner.br { bottom: -5px; right: -5px; border-bottom-width: 2.5px; border-right-width: 2.5px; border-bottom-right-radius: 7px; }
.ppm-scan { margin-top: 10px; color: #c9cfdf; font-size: 12.5px; }
.ppm-scan b { color: #ffd98a; }

/* ═══ ★ V4.16.3 支付弹窗改两栏（运营方参考图）：左=商品信息 + 订单明细，右=二维码 + 失效倒计时 ═══ */
.ppm-card { width: min(880px, 94vw); padding: 20px 24px 14px; }
.ppm-head2 { text-align: center; margin-bottom: 12px; }
.ppm-title2 { font-size: 17px; font-weight: 800; color: #f2e3bd; letter-spacing: .3px; }
.ppm-sub2 { font-size: 10.5px; letter-spacing: 2px; color: #9a8a6a; margin-top: 3px; }
.ppm-body { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; align-items: start; }
.ppm-left { min-width: 0; }
.ppm-sec { font-size: 12px; font-weight: 700; color: var(--sub); margin: 12px 0 7px; }
.ppm-sec:first-child { margin-top: 0; }
.ppm-goods {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 12px;
  border: 1px solid rgba(232, 196, 118, .35); background: rgba(232, 196, 118, .06);
}
.ppm-goods-name { font-size: 13.5px; font-weight: 800; color: #f4e6c4; word-break: break-all; }
.ppm-goods-per { font-size: 11.5px; color: var(--sub); margin-top: 3px; }
.ppm-goods-r { text-align: right; flex: 0 0 auto; }
.ppm-goods-price { font-size: 21px; font-weight: 900; color: #ffd98a; }
.ppm-goods-orig { display: block; font-size: 12px; color: #7d8598; }
.ppm-goods-tag {
  display: inline-block; margin-top: 3px; font-size: 10.5px; padding: 1px 7px; border-radius: 20px;
  background: rgba(232, 196, 118, .16); color: #ffd98a;
}
.ppm-rows {
  border-radius: 12px; background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line); padding: 2px 14px;
}
.ppm-row {
  display: flex; justify-content: space-between; gap: 12px; padding: 9px 0;
  font-size: 12.5px; color: var(--sub); border-bottom: 1px dashed var(--line);
}
.ppm-row:last-child { border-bottom: 0; }
.ppm-row b { color: var(--ink); font-weight: 700; text-align: right; }
.ppm-row b.ppm-cut { color: #ff9a76; }
.ppm-total { display: flex; justify-content: space-between; align-items: baseline; padding: 11px 14px 0; font-size: 12.5px; color: var(--sub); }
.ppm-total b { font-size: 21px; font-weight: 900; color: #ffd98a; }
.ppm-right { text-align: center; border-left: 1px solid var(--line); padding-left: 18px; }
.ppm-scan-t { font-size: 12.5px; color: var(--ink); margin-bottom: 10px; }
.ppm-alipay {
  display: inline-flex; width: 16px; height: 16px; border-radius: 4px; background: #1677ff;
  color: #fff; font-size: 11px; align-items: center; justify-content: center;
  font-style: normal; margin-right: 5px; vertical-align: -3px;
}
.ppm-expire { margin-top: 10px; font-size: 12px; color: var(--sub); font-variant-numeric: tabular-nums; }
.ppm-expire.out { color: var(--err); }
.ppm-paid {
  margin-top: 10px; width: 100%; padding: 9px 0; border-radius: 9px; cursor: pointer;
  border: 1px solid rgba(232, 196, 118, .4); background: rgba(232, 196, 118, .1);
  color: #ffd98a; font-size: 12.5px; font-weight: 700;
}
.ppm-paid:hover { background: rgba(232, 196, 118, .2); }
.ppm-paid:disabled { opacity: .6; cursor: default; }
.ppm-note { margin-top: 8px; font-size: 11px; color: #7d8598; line-height: 1.5; }
/* ★ V4.16.3 会员协议（开通即代表同意）+ 支付弹窗里的同一句 */
.member-agree { text-align: center; font-size: 11.5px; color: var(--sub); margin: 9px 0 0; }
.member-agree a { color: #ffd98a; text-decoration: none; border-bottom: 1px dashed rgba(232, 196, 118, .45); }
.ppm-agree { text-align: center; font-size: 11px; color: #7d8598; margin-top: 8px; }
.ppm-agree a { color: #ffd98a; text-decoration: none; }
.agree-card { max-width: 660px; }
.agree-body {
  white-space: pre-wrap; font-family: inherit; font-size: 13px; line-height: 1.85;
  color: var(--ink); max-height: 58vh; overflow: auto; padding: 2px 2px 14px;
}
/* ★ V4.16.3 不能降级购买：低等级卡片锁灰 */
.plan.locked { opacity: .48; filter: grayscale(.45); }
.plan.locked .plan-pick { background: rgba(255, 255, 255, .06); color: var(--sub); }
@media (max-width: 720px) {
  .ppm-body { grid-template-columns: 1fr; }
  .ppm-right { border-left: 0; padding-left: 0; margin-top: 14px; }
}
.ppm-status { margin-top: 6px; color: #9aa0ae; font-size: 11.5px; min-height: 16px; }
.ppm-foot { margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(232, 196, 118, .22); color: #9aa0ae; font-size: 10.5px; }
/* 开通成功视图 */
.ppm-ok { padding: 10px 0 6px; }
.ppm-ok-circle {
  width: 58px; height: 58px; margin: 0 auto; border-radius: 50%; line-height: 56px; font-size: 28px; color: #dfe2ec;
  background: linear-gradient(140deg, #322811, #322711 55%, #c99a45);
  box-shadow: 0 0 30px rgba(232, 196, 118, .5);
}
.ppm-ok-title { margin-top: 10px; font-size: 17px; font-weight: 800; letter-spacing: 3px; color: #f0e6cf; }
.ppm-ok-credits { margin-top: 6px; color: #ffd98a; font-size: 24px; font-weight: 800; }
.ppm-ok-credits small { font-size: 12px; color: #9aa0ae; font-weight: 600; margin-left: 3px; }
.ppm-ok-note { margin-top: 5px; color: #9aa0ae; font-size: 11.5px; }
.ppm-ok-btn {
  margin-top: 14px; min-width: 168px; padding: 9px 0; border: none; border-radius: 999px; cursor: pointer;
  font-size: 13.5px; font-weight: 800; letter-spacing: 5px; color: #dfe2ec;
  background: linear-gradient(92deg, #322811, #322711 55%, #c99a45);
  box-shadow: 0 6px 18px rgba(232, 196, 118, .35);
}
.ppm-ok-btn:hover { filter: brightness(1.06); }

/* ═══════════ V3.11.0 推广返利（专属ID / 邀请统计 / 返利记录） ═══════════ */
.promo-hero {
  border-radius: 14px; padding: 16px 18px; margin-bottom: 14px;
  background: linear-gradient(160deg, #1b2130 0%, #232b3d 60%, #1a2030 100%);
  border: 1px solid rgba(232, 196, 118, .35);
  box-shadow: 0 10px 26px rgba(23, 28, 41, .18);
}
.promo-hero-title { color: #e8c476; font-size: 12.5px; font-weight: 800; letter-spacing: .5px; margin-bottom: 8px; }
.promo-code-row { display: flex; align-items: center; gap: 10px; }
.promo-code { flex: 1; font-size: 23px; font-weight: 800; letter-spacing: 3px; color: #fff; font-family: Consolas, "Courier New", monospace; }
.promo-hero-tip { color: #b9c2d6; font-size: 12px; margin-top: 9px; line-height: 1.6; }
.promo-hero .btn-ghost.small { color: #e8c476; border-color: rgba(232, 196, 118, .5); background: rgba(232, 196, 118, .08); }
.promo-stats { display: flex; gap: 12px; margin-bottom: 10px; }
.promo-stat { flex: 1; border: 1px solid #262634; border-radius: 12px; padding: 12px 14px; background: #111732; }
.promo-stat .ps-k { font-size: 12px; color: #78809a; }
.promo-stat .ps-v { font-size: 19px; font-weight: 800; color: #dbe2f5; margin-top: 4px; }
.promo-sub-title { font-size: 12.5px; font-weight: 800; color: #c3cbe0; margin: 14px 0 8px; }
.promo-list { max-height: 190px; overflow: auto; }
.promo-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border: 1px solid #161b28; border-radius: 10px; margin-bottom: 7px;
  font-size: 12.5px; color: #cfd5e6; background: #14141b;
}
.promo-row .promo-dim { color: #8a92a8; font-size: 12px; }
.promo-row .promo-gain { color: #ff8f7a; font-weight: 800; }
.promo-row:nth-child(even) { background: #111932; }

/* ═══════════ V3.14.0 无限画布 · 卡片嵌入模式 ═══════════
   同一份页面既作整页工作台，也作画布上的一张卡片（index.html?embed=<功能>）。
   嵌入时隐藏顶栏与侧栏，只保留目标功能面板；其余页面结构原样保留，
   保证 app.js 里既有的元素引用（导航、页签）不失效。 */
html[data-embed] .topbar,
html[data-embed] .sidebar { display: none !important; }
html[data-embed] .layout { height: 100% !important; }
html[data-embed] .content { padding: 14px !important; }
html[data-embed] .tab-panel { display: none !important; }
html[data-embed] .tab-panel.active { display: block !important; }
html[data-embed] body { background: transparent; }
/* ═══ V4.3.2 「会员中心 / 登录注册」卡片：它们是**弹窗**，不是页签 ═══
   这两个功能在整页里没有 .tab-panel（只有 #memberModal / #authModal 两个浮层），
   所以 iframe 底下默认激活的永远是 #tab-t2i（文生图）。一旦弹窗被关掉
   （✕ / 点遮罩 / 登录成功 / 退出登录 / 登录态过期），就会露出底下的文生图 ——
   用户看到的现象就是「把会员中心关掉，结果蹦出一个文生图窗口」。
   这里把这两个卡片底下的内容区与页脚整个藏掉：弹窗开着时看不到后面，弹窗关掉时也不会露出别的功能。 */
html[data-embed="member"] .layout,
html[data-embed="auth"] .layout,
html[data-embed="member"] .app-footer,
html[data-embed="auth"] .app-footer { display: none !important; }
/* 兜底出口：万一画布没收到「已关闭」回执（老画布 / 卡片被手动摘掉），本卡片不至于留一片空白 */
#jjClosedHint { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 10px; font-size: 13px; color: #9aa0ae; cursor: pointer; background: #14141b; }
#jjClosedHint b { font-size: 13.5px; font-weight: 600; color: #e6e8f0; text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════════
   V4.12.0 全屏会员中心（?embed=member&full=1）
   用户要求：点「会员中心」直接铺满整屏，只在右上角留一个 X。
   容器由画布的 #cvMemberModal 提供；这里把原来的"弹窗外壳"拆掉，让内容自己铺满。
   ⚠️ 必须显式写 [hidden] 规则 —— 下面的 display:block !important 会把默认的 hidden 覆盖掉。
   ═══════════════════════════════════════════════════════════════ */
html[data-full="1"] body { background: #08080c !important; }
html[data-full="1"] .topbar,
html[data-full="1"] .sidebar,
html[data-full="1"] .app-footer,
html[data-full="1"] .layout { display: none !important; }
html[data-full="1"] #memberModal.modal-mask {
  position: static !important; inset: auto !important;
  background: transparent !important; padding: 0 !important;
  display: block !important; z-index: 1 !important;
}
html[data-full="1"] #memberModal[hidden] { display: none !important; }
html[data-full="1"] #memberModal .modal-card.member-card {
  position: static !important;
  width: 100% !important; max-width: none !important;
  height: 100vh !important; max-height: none !important;
  padding: 20px 34px 52px !important; box-sizing: border-box;
  margin: 0 !important; border-radius: 0 !important; box-shadow: none !important;
  overflow-y: auto; overscroll-behavior: contain;
}
/* 大屏上限宽居中，避免 5 列卡片被拉得过散 */
html[data-full="1"] #memberModal .member-head,
html[data-full="1"] #memberModal .member-tabs { max-width: 1560px; margin-left: auto !important; margin-right: auto !important; }
html[data-full="1"] #memberModal .mpane.on { max-width: 1560px; margin: 0 auto; }
/* 关闭按钮交给画布浮层右上角那一个，避免两个 ✕ 打架 */
html[data-full="1"] #memberModal .modal-x { display: none !important; }

/* ═══════════════════════════════════════════════════════════════
   V4.12.0 会员套餐卡片重做（按运营方参考图：简约 · 酷炫 · 深色 · 五档并列）
   用 #planList 提权覆盖上面那套旧浅色样式（旧样式保留给老页面兜底）。
   ═══════════════════════════════════════════════════════════════ */
#planList.plan-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
@media (max-width: 1500px) { #planList.plan-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 960px) { #planList.plan-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

#planList .plan {
  position: relative; display: flex; flex-direction: column;
  padding: 18px 16px 16px; border-radius: 16px;
  background: #14141b; border: 1px solid rgba(255, 255, 255, 0.09);
  color: #e9e9f0; cursor: pointer;
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
#planList .plan:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, 0.22); }
#planList .plan.on { border-color: #e7eaef; box-shadow: 0 0 0 1px #e7eaef, 0 12px 32px rgba(255, 255, 255, .18); }

#planList .plan-name { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: #ffffff; }
#planList .plan-badge {
  font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  background: linear-gradient(90deg, #b02a10, #e7eaef); color: #ffffff;
}
#planList .plan-price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin: 12px 0 2px; }
#planList .plan-price b { font-size: 30px; font-weight: 800; letter-spacing: -.5px; color: #ffffff; }
#planList .plan-price small { font-size: 12px; color: #9a9aa8; }
#planList .plan-price del { font-size: 13px; color: #8b8b9a; }
#planList .plan-price.unset b { font-size: 20px; color: #9a9aa8; }
#planList .plan-renew { font-size: 11.5px; color: #9a9aa8; margin-bottom: 10px; }

#planList .plan-credits { font-size: 22px; font-weight: 800; line-height: 1.25; color: #ffd166; }
#planList .plan-credits small { font-size: 12px; font-weight: 500; color: #9a9aa8; }
#planList .plan-credits.plan-unset { font-size: 13px; font-weight: 500; color: #9a9aa8; }

#planList .plan-own {
  margin: 10px 0; padding: 5px 9px; border-radius: 8px;
  font-size: 11.5px; color: #9a9aa8; background: rgba(255, 255, 255, 0.05);
}
#planList .plan-own b { color: #ffffff; }
#planList .plan-pick {
  text-align: center; padding: 9px 0; margin-bottom: 10px; border-radius: 10px;
  font-size: 13px; font-weight: 700; color: #d8d8e4; background: rgba(255, 255, 255, 0.08);
  transition: background .15s;
}
#planList .plan.on .plan-pick { background: linear-gradient(90deg, #b02a10, #e7eaef); color: #ffffff; }

#planList .plan-valid { font-size: 11.5px; color: #9a9aa8; padding-bottom: 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
#planList .plan-perks { margin-top: 10px; }
#planList .pk-title { font-size: 11.5px; color: #9a9aa8; margin-bottom: 6px; }
#planList .plan-perk { font-size: 12px; line-height: 1.9; color: #c9c9d6; }

/* 档位递进：1-3 冷灰、4 青绿、5 橙红 —— 一眼看出档次高低 */
#planList .plan.p4 { background: linear-gradient(180deg, rgba(45, 212, 191, .10), #14141b 42%); border-color: rgba(45, 212, 191, .30); }
#planList .plan.p4 .plan-credits { color: #2dd4bf; }
#planList .plan.p4 .plan-pick { background: rgba(45, 212, 191, .16); color: #7ff0e0; }
#planList .plan.p5 { background: linear-gradient(180deg, rgba(255, 255, 255, .14), #14141b 42%); border-color: rgba(255, 255, 255, .38); }
#planList .plan.p5 .plan-name { color: #ffd6b0; }
#planList .plan.p5 .plan-credits { color: #ff9a5c; }
#planList .plan.p5 .plan-pick { background: linear-gradient(90deg, #b02a10, #e7eaef); color: #ffffff; }

/* 顶部横幅（全屏会员页的氛围条） */
.mm-banner {
  margin-top: 14px; padding: 16px 22px; border-radius: 14px;
  background: linear-gradient(110deg, rgba(255, 255, 255, .20), rgba(120, 90, 255, .16) 55%, rgba(45, 212, 191, .14));
  border: 1px solid rgba(255, 255, 255, .10);
}
.mm-banner b { display: block; font-size: 17px; font-weight: 800; color: #ffffff; letter-spacing: .2px; }
.mm-banner span { display: block; margin-top: 4px; font-size: 12.5px; color: #b9b9c8; }

/* ═══════════════════════════════════════════════════════════════
   V4.13.4 会员中心全屏浮层 → 纯黑底图（运营方要求「改成纯黑色底图」）
   ⚠️ 两个关键点，只改一处都会翻车：
      ① .modal-card 自带**白底**，把 body 的深色盖住了 → 必须同时把它也改黑；
      ② 标题 / 手机号 / 页签 / 说明 / 账号设置行这些**没自带背景**的文字原本是深色，
         纯黑底上会直接看不见 → 必须配套转浅色。
      自带浅底的块（充值档位卡 .tier、积分汇总 .rec-sum、提示条 .pay-tip、氛围条 .mm-banner）
      保持原样 —— 它们在自己的浅底上依然可读，不用动。
   ═══════════════════════════════════════════════════════════════ */
html[data-full="1"] body { background: #000000 !important; }
html[data-full="1"] #memberModal .modal-card.member-card {
  background: #000000 !important;
  color: #e8e8ef;
  border: 0 !important;
}
/* ① 头部：标题与余额数字用纯白，标签用灰 */
html[data-full="1"] #memberModal .member-title { color: #ffffff !important; }
html[data-full="1"] #memberModal .member-phone,
html[data-full="1"] #memberModal .mb-label { color: #9a9aa8 !important; }
html[data-full="1"] #memberModal .mb-value { color: #ffffff !important; }
html[data-full="1"] #memberModal .mb-value small { color: #9a9aa8 !important; }
/* ② 页签（当前项仍用品牌橙，别的转灰） */
html[data-full="1"] #memberModal .member-tabs { border-bottom-color: rgba(255, 255, 255, 0.12) !important; }
html[data-full="1"] #memberModal .mtab { color: #9a9aa8 !important; }
html[data-full="1"] #memberModal .mtab.on { color: #e7eaef !important; border-bottom-color: #e7eaef !important; }
/* ③ 说明文字 */
html[data-full="1"] #memberModal .member-tip { color: #9a9aa8 !important; }
/* ④ 账号设置的行（无背景 + 浅色下边框，纯黑上会整行消失）
      ⚠️ 排除表单控件：输入框是白底，文字被改浅就成「白底白字」了 */
html[data-full="1"] #memberModal .acct-row {
  color: #d8d8e2 !important;
  border-bottom-color: rgba(255, 255, 255, 0.10) !important;
}
html[data-full="1"] #memberModal .acct-row > *:not(input):not(select):not(textarea) { color: #d8d8e2 !important; }
/* ⑤ 积分批次行（无背景裸文本） */
html[data-full="1"] #memberModal .lot-row { color: #d8d8e2 !important; }
/* ⑥ 推广页小标题 */
html[data-full="1"] #memberModal .promo-sub-title { color: #9a9aa8 !important; }

/* ═══════════════════════════════════════════════════════════════
   V4.15.0 通用积分卡（按运营方给的参考版式重做充值页）
   卡片自带深底浅字，所以在浅色外壳（独立页弹窗）与纯黑外壳（画布全屏浮层）下都成立。
   ═══════════════════════════════════════════════════════════════ */
.rch-hero { text-align: center; margin: 6px 0 16px; }
.rch-title { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: 1px; color: inherit; }
.rch-sub { margin: 6px 0 0; font-size: 12.5px; color: #9a9aa8; }
/* 纯黑外壳下标题必须是白的（否则黑底黑字，看不见） */
html[data-full="1"] .rch-title { color: #ffffff !important; }
html[data-full="1"] .rch-sub { color: #9a9aa8 !important; }

.pack-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1180px) { .pack-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .pack-grid { grid-template-columns: 1fr; } }

.pack {
  position: relative; display: flex; flex-direction: column;
  padding: 16px 14px 12px; border-radius: 14px;
  background: #14141b; border: 1px solid rgba(255, 255, 255, 0.10);
  color: #e9e9f0; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.pack:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.22); }
.pack.on { border-color: #22d3ee; box-shadow: 0 0 0 1px #22d3ee, 0 10px 28px rgba(34, 211, 238, .16); }
.pack.locked { opacity: 0.62; }
.pack-name { font-size: 14px; font-weight: 600; color: #ffffff; }
.pack-badge {
  position: absolute; top: 10px; right: 10px;
  font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  color: #22d3ee; border: 1px solid rgba(34, 211, 238, 0.55); background: rgba(34, 211, 238, 0.10);
  white-space: nowrap;
}
.pack-badge.hot { color: #06212a; background: #22d3ee; border-color: #22d3ee; }
.pack-credits { margin: 14px 0 2px; font-size: 28px; font-weight: 800; letter-spacing: -.5px; color: #ffffff; }
.pack-credits .pk-bolt { font-style: normal; font-size: 18px; margin-right: 4px; color: #22d3ee; }
.pack-split { font-size: 12px; color: #9a9aa8; }
.pack-save { font-size: 11.5px; color: #7a7a8c; margin: 10px 0 12px; min-height: 16px; }
.pack-buy {
  width: 100%; height: 34px; border: 0; border-radius: 8px;
  font-size: 13px; font-weight: 700; color: #06212a; cursor: pointer;
  background: linear-gradient(135deg, #38d9f0, #22b8e6);
  transition: filter .15s;
}
.pack-buy:hover:not(:disabled) { filter: brightness(1.08); }
.pack-buy:disabled { background: rgba(255, 255, 255, 0.12); color: #9a9aa8; cursor: not-allowed; }
.pack-gate { margin-top: 8px; text-align: center; font-size: 11px; color: #9a9aa8; }
.pack-gate.warn { color: #f0a35e; }

/* 自定义充值：整行一张宽卡（参考图里它比固定档更宽） */
.pack-custom { grid-column: 1 / -1; cursor: default; }
.pack-custom:hover { transform: none; }
.pack-custom .pack-credits { font-size: 34px; }
.cust-range { width: 100%; margin: 10px 0 4px; -webkit-appearance: none; appearance: none; height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); outline: none; }
.cust-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: #22d3ee; border: 3px solid #0b0b10; cursor: pointer;
}
.cust-range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #22d3ee; border: 3px solid #0b0b10; cursor: pointer; }
.pack-custom.locked .cust-range { pointer-events: none; }
.cust-scale { display: flex; justify-content: space-between; font-size: 11.5px; color: #9a9aa8; }
.cust-row { display: flex; align-items: flex-end; gap: 12px; margin-top: 14px; }
.cust-input { display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; color: #9a9aa8; }
.cust-yuan { display: inline-flex; align-items: center; gap: 4px; padding: 0 10px; height: 34px; border-radius: 8px; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.14); }
.cust-yuan b { font-size: 13px; color: #e9e9f0; }
.cust-yuan input { width: 110px; border: 0; background: transparent; outline: none; font-size: 15px; font-weight: 700; color: #ffffff; }
.cust-row .pack-buy { width: auto; flex: 1 1 auto; min-width: 140px; }
/* V4.15.0 自定义充值行：金额输入框在左、购买按钮在右（参考图版式），不要让按钮铺满整行 */
.cust-row { align-items: flex-end; }
.cust-row .web-only-hide { display: none; }
.cust-row .pack-buy { flex: 0 0 190px; min-width: 190px; max-width: 190px; margin-left: auto; }

/* ═══════════════════════════════════════════════════════════════
   ★ V4.16.0 历史作品：满屏浮层 + 批量管理条
   运营方原话：「点击下边历史作品，弹出来的弹窗太小了，参考会员中心的满屏式弹窗。
   历史作品的 X 关闭窗口按键也放到右上角。新增批量选择功能，选中后可以进行批量下载、批量删除。」
   · 满屏外壳由画布的 #cvHistoryModal 提供（X 在右上角），这里只负责「里面那一页」铺满；
   · 批量管理条：全选 / 批量下载 / 批量删除 / 取消，点删除原地切成「确认 / 再想想」。 */
.hist-head-acts { display: flex; align-items: center; gap: 8px; }
/* ⚠️ V4.16.0 实锤（与 V3.12.4 同一个坑）：
   `.btn-ghost.small` 是**给输入框里的「AI 润色」按钮用的绝对定位**（position:absolute; right:10px; bottom:10px）。
   把它放到标题栏里，按钮会飞到「最近的定位祖先」右下角 —— 表现就是「批量下载 / 清空记录 跑到整页右下角」。
   历史作品页的按钮全在这个容器里，所以在这里统一复位。 */
.hist-head-acts .btn-ghost.small,
.hist-bar .btn-ghost.small { position: static !important; right: auto !important; bottom: auto !important; white-space: nowrap; }
/* 卡片底部 4 个操作按钮（下载 / 再修改 / 存资产 / 删除）：允许换行，按钮文字不要被挤成两行 */
.hist-card .h-tools { flex-wrap: wrap; }
.hist-card .h-tools .btn-ghost { white-space: nowrap; padding: 4px 8px; }
.hist-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 12px 22px 0; padding: 10px 14px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line);
}
.hist-bar-btns { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hist-info { font-size: 12.5px; color: var(--sub); font-weight: 600; }
.hist-danger-tip { font-size: 12.5px; color: #ff8a8a; font-weight: 700; }
.btn-ghost.danger { color: #ff8a8a; border-color: rgba(255, 138, 138, 0.45); }
.btn-ghost.danger:hover { background: rgba(255, 77, 79, 0.14); border-color: rgba(255, 138, 138, 0.7); }

/* ★ V4.16.0 表单控件统一深色底
   原先很多 input / select 根本没写 background（`.auth-card input`、`#m-account input`…），
   靠浏览器默认的白底 + 边框成型；卡片改成黑底之后这些白框非常跳，placeholder 也看不清。 */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
textarea, select { background: #171720; color: var(--ink); border-color: #2c2c38; }
input::placeholder, textarea::placeholder { color: #7f8595; }
select option { background: #171720; color: var(--ink); }

/* ★ V4.16.0 个人中心的「云端存储空间」卡片 */
.stor-card {
  margin: 0 0 18px; padding: 14px 16px; border-radius: 14px;
  background: #171720; border: 1px solid var(--line);
}
.stor-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stor-title { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.stor-badge {
  font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  color: #9aa0ae; border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}
.stor-badge.ok { color: #22d3ee; border-color: rgba(34, 211, 238, 0.5); background: rgba(34, 211, 238, 0.10); }
.stor-badge.warn { color: #e7eaef; border-color: rgba(255, 155, 99, 0.5); background: rgba(255, 155, 99, 0.12); }
.stor-badge.off { color: #a9aebc; }
.stor-bar {
  height: 6px; border-radius: 999px; margin: 12px 0 8px;
  background: rgba(255, 255, 255, 0.10); overflow: hidden;
}
.stor-bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #22b8e6, #22d3ee); transition: width .25s; }
.stor-bar i.warn { background: linear-gradient(90deg, #e7eaef, #ff4d4f); }
.stor-nums { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: #c6cad6; }
.stor-tip { margin-top: 8px; font-size: 11.5px; line-height: 1.75; color: #9aa0ae; }
.stor-tip b { color: #ffd9a8; }
.stor-buy {
  margin-top: 10px; width: 100%; height: 32px; border: 0; border-radius: 9px;
  font-size: 12.5px; font-weight: 700; color: #06212a; cursor: pointer;
  background: linear-gradient(135deg, #38d9f0, #22b8e6);
}
.stor-buy:hover { filter: brightness(1.08); }

/* 满屏模式：隐藏外壳，只让历史作品这一页铺满（与会员中心的 html[data-full="1"] 同一套思路，
   但会员中心是「浮层在 .layout 外面」，历史作品是「.layout 里的一页」→ 不能整块隐藏 .layout） */
html[data-full="1"][data-embed="history"] .topbar,
html[data-full="1"][data-embed="history"] .sidebar,
html[data-full="1"][data-embed="history"] .app-footer { display: none !important; }
/* ★ V4.16.5 修「历史作品翻不到下边、滚不动」：
   原来这里写死 height:100vh（等于把高度锁在一屏），而下面又把 .content 的滚动改成 visible，
   于是内容超出后被直接裁掉、页面也没有滚动条 —— 客户看不到下边的作品。
   改成让内容自然撑开（height:auto + min-height:100vh），滚动交给文档本身。 */
html[data-full="1"][data-embed="history"] .layout {
  display: block !important; height: auto !important; min-height: 100vh !important;
}
html[data-full="1"][data-embed="history"] .content { padding: 0 !important; overflow: visible !important; }
html[data-full="1"][data-embed="history"] #tab-history { display: block !important; height: auto !important; }
html[data-full="1"][data-embed="history"] .history-panel {
  max-height: none !important; min-height: 100vh; padding: 26px 32px 56px;
  max-width: 1560px; margin: 0 auto; border: 0 !important; border-radius: 0 !important;
  background: transparent !important;
}
html[data-full="1"][data-embed="history"] .hist-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
/* 给右上角那个浮层关闭 X 腾位置：否则「清空记录 / 批量管理」会被它压住（真机截图实测过） */
html[data-full="1"][data-embed="history"] .result-head { padding-right: 64px; }

/* ══════════════════════════════════════════════════════════════
   ★ V4.16.3 白底模式（html[data-theme="light"]）
   运营方要求：「以后所有页面统一黑底，也可以模式切换统一切换为白底；
   黑底模式就是全黑底，白底模式就是全白底」——所以这里是一整套反向映射。
   规则生成方式：把深色主题里的深色背景与灰阶文字逐个换成浅色版本，
   **品牌色与纯白（彩色按钮上的白字）保持不动**，避免按钮文字被弄黑。
   ══════════════════════════════════════════════════════════════ */
html[data-theme="light"] {
  --bg: #f4f5f9; --panel: #ffffff; --ink: #1a1c22; --sub: #5b6270; --line: #e4e7f0;
  --shadow: 0 8px 28px rgba(20, 25, 40, 0.10); --shadow-sm: 0 2px 10px rgba(20, 25, 40, 0.07);
  --grad-soft: linear-gradient(135deg, #fff5f2 0%, #fffaf0 100%);
  color-scheme: light;
}
html[data-theme="light"] body { background: #f4f5f9; color: #1a1c22; }
html[data-theme="light"] html { background: #f4f5f9; }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: #dfe3ee; }
html[data-theme="light"] .model-chip { color: #4b5364; background: #f8f9fc; }
html[data-theme="light"] .model-chip b { color: #2b3038; }
html[data-theme="light"] .api-status { background: #ffffff; }
html[data-theme="light"] .api-status.fail { color: #c62828; background: #fdf1ec; }
html[data-theme="light"] .nav-item { color: #2b3038; }
html[data-theme="light"] .nav-item:hover { background: #f8f9fc; }
html[data-theme="light"] .nav-item.active { color: #c62828; }
html[data-theme="light"] .nav-badge { background: #e4e7f0; color: #4b5364; }
html[data-theme="light"] .field-label { color: #2b3038; }
html[data-theme="light"] .opt-tag { background: #fdf6e6; }
html[data-theme="light"] textarea { background: #ffffff; }
html[data-theme="light"] textarea:focus { background: #ffffff; }
html[data-theme="light"] .btn-ghost { color: #4b5364; background: #f8f9fc; }
html[data-theme="light"] .btn-ghost:hover { color: #c62828; background: #fdf6e6; }
html[data-theme="light"] .ratio-item { background: #ffffff; }
html[data-theme="light"] .ratio-item:hover { background: #fdf6e6; }
html[data-theme="light"] .ratio-item.on { background: linear-gradient(135deg, #fdf1ec, #322511); }
html[data-theme="light"] .ratio-shape { background: #dfe3ee; }
html[data-theme="light"] .ratio-name { color: #2b3038; }
html[data-theme="light"] .ratio-item.on .ratio-name { color: #c62828; }
html[data-theme="light"] .tier-seg { background: #f8f9fc; }
html[data-theme="light"] .tier-seg button { color: #4b5364; }
html[data-theme="light"] .tier-seg button i { color: #5b6270; }
html[data-theme="light"] .tier-seg button.on { background: #ffffff; color: #c62828; }
html[data-theme="light"] .size-hint { color: #8a6b1f; background: #fbf4e4; }
html[data-theme="light"] .adv input { background: #ffffff; }
html[data-theme="light"] .layer-pick-info { color: #5b6270; }
html[data-theme="light"] .layer-dir { color: #4b5364; background: #ffffff; }
html[data-theme="light"] .result-body { background: radial-gradient(500px 260px at 50% 0%, rgba(255, 255, 255, 0.05), transparent),
    #ffffff; }
html[data-theme="light"] .empty-t { color: #2b3038; }
html[data-theme="light"] .gen-loading .t { color: #2b3038; }
html[data-theme="light"] .error-card { background: #fdf1ec; }
html[data-theme="light"] .error-card .t { color: #c62828; }
html[data-theme="light"] .dropzone { background: #ffffff; }
html[data-theme="light"] .dropzone:hover, .dropzone.drag { background: #fdf6e6; }
html[data-theme="light"] .dz-t { color: #2b3038; }
html[data-theme="light"] .mi-tools .btn-ghost.on { color: #c62828; background: #fdf1ec; }
html[data-theme="light"] .img-canvas { background: #f8f9fc; }
html[data-theme="light"] .img-hint { color: #8a6b1f; }
html[data-theme="light"] .bubble { background: #f8f9fc; }
html[data-theme="light"] .msg .cite-btn { color: #5b6270; }
html[data-theme="light"] .msg .cite-btn:hover { color: #c62828; background: #fdf1ec; }
html[data-theme="light"] .quote-bar { background: #fbf4e4; }
html[data-theme="light"] .q-label { color: #8a6b1f; }
html[data-theme="light"] .q-close:hover { color: #c62828; }
html[data-theme="light"] .icon-btn { background: #f8f9fc; }
html[data-theme="light"] .icon-btn:hover { background: #fdf1ec; }
html[data-theme="light"] #chatInput { background: #ffffff; }
html[data-theme="light"] #chatInput:focus { background: #ffffff; }
html[data-theme="light"] .hist-card { background: #ffffff; }
html[data-theme="light"] .hist-card .h-img { background: #f8f9fc; }
html[data-theme="light"] .hist-card .h-img.broken { color: #c62828; }
html[data-theme="light"] .hist-card .h-prompt { color: #2b3038; }
html[data-theme="light"] .hist-card .h-meta { color: #5b6270; }
html[data-theme="light"] .edit-base-bar { background: #fdf6e6; }
html[data-theme="light"] .edit-base-bar .eb-info b { color: #c2410c; }
html[data-theme="light"] .edit-base-bar .q-close { color: #c2410c; }
html[data-theme="light"] .batch-tag { color: #5b6270; }
html[data-theme="light"] .batch-loading { color: #5b6270; }
html[data-theme="light"] .balance-chip { background: #ffffff; color: #2b3038; }
html[data-theme="light"] .modal-card { background: #ffffff; }
html[data-theme="light"] .modal-x { color: #5b6270; }
html[data-theme="light"] .modal-x:hover { background: #f8f9fc; color: #2b3038; }
html[data-theme="light"] .auth-sub { color: #4b5364; }
html[data-theme="light"] .auth-tabs { background: #f4f5f9; }
html[data-theme="light"] .auth-tab { color: #4b5364; }
html[data-theme="light"] .auth-tab.on { background: #ffffff; }
html[data-theme="light"] .btn-sms { background: #ffffff; }
html[data-theme="light"] .btn-sms:hover:not(:disabled) { background: #f2f5fb; }
html[data-theme="light"] .btn-sms.counting, .btn-sms:disabled { color: #5b6270; }
html[data-theme="light"] .auth-err { color: #c62828; }
html[data-theme="light"] .auth-foot { color: #5b6270; }
html[data-theme="light"] .auth-hint { color: #4b5364; }
html[data-theme="light"] .member-phone { color: #4b5364; }
html[data-theme="light"] .mb-label { color: #4b5364; }
html[data-theme="light"] .mb-value small { color: #4b5364; }
html[data-theme="light"] .mtab { color: #4b5364; }
html[data-theme="light"] .plan-terms .ptab { background: #ffffff; color: #2b3038; }
html[data-theme="light"] .pay-tip { background: #fdf6e6; color: #a97a12; }
html[data-theme="light"] .member-tip { color: #4b5364; }
html[data-theme="light"] .notice-bar { background: #fdf6e6; color: #a97a12; }
html[data-theme="light"] .tier { background: #ffffff; }
html[data-theme="light"] .tier.on { background: #f8f9fc; }
html[data-theme="light"] .tier-label { color: #4b5364; }
html[data-theme="light"] .tier-credits { color: #242832; }
html[data-theme="light"] .tier-credits small { color: #4b5364; }
html[data-theme="light"] .tier-price { color: #c62828; }
html[data-theme="light"] .tier-unit { color: #5b6270; }
html[data-theme="light"] .pay-ch { color: #2b3038; }
html[data-theme="light"] .pay-ch.on { background: #f8f9fc; }
html[data-theme="light"] .qr-box { background: #ffffff; }
html[data-theme="light"] .qr-title { color: #2b3038; }
html[data-theme="light"] .qr-box img { background: #ffffff; }
html[data-theme="light"] .pay-ok-balance { color: #4b5364; }
html[data-theme="light"] .rec-sum { background: #ffffff; }
html[data-theme="light"] .rec-sum > div { color: #4b5364; }
html[data-theme="light"] .rec-sum b { color: #242832; }
html[data-theme="light"] .usage-row .u-type { color: #2b3038; }
html[data-theme="light"] .usage-row .u-note { color: #5b6270; }
html[data-theme="light"] .usage-row .u-credit { color: #c62828; }
html[data-theme="light"] .usage-row .u-credit.minus { color: #c62828; }
html[data-theme="light"] .usage-row .u-time { color: #5b6270; }
html[data-theme="light"] .empty-tip { color: #5b6270; }
html[data-theme="light"] .acct-row span { color: #4b5364; }
html[data-theme="light"] .agree-row { color: #4b5364; }
html[data-theme="light"] .app-footer { color: #5b6270; }
html[data-theme="light"] .layer-meta { color: #5b6270; }
html[data-theme="light"] .erase-tool { color: #4b5364; background: #f4f5f9; }
html[data-theme="light"] .erase-tool:hover { background: #e4e7f0; }
html[data-theme="light"] .erase-tool.on { color: #c62828; background: #ffffff; }
html[data-theme="light"] .erase-count { color: #5b6270; }
html[data-theme="light"] .erase-text-input { background: #ffffff; }
html[data-theme="light"] .id-color { background: #ffffff; }
html[data-theme="light"] .plan { background: linear-gradient(180deg, #322a11 0%, #ffffff 55%); }
html[data-theme="light"] .plan.on { background: #fdf6e6; }
html[data-theme="light"] .plan-credits { color: #242832; }
html[data-theme="light"] .plan-credits small { color: #4b5364; }
html[data-theme="light"] .plan-valid { color: #4b5364; }
html[data-theme="light"] .plan-price { color: #c62828; }
html[data-theme="light"] .plan-promo.off { color: #5b6270; }
html[data-theme="light"] .plan-perk { color: #2b3038; }
html[data-theme="light"] .mstatus-row b { color: #242832; }
html[data-theme="light"] .lot-row { color: #2b3038; }
html[data-theme="light"] .lot-row span:last-child { color: #5b6270; }
html[data-theme="light"] .plan-total { color: #4b5364; }
html[data-theme="light"] .ppm-title { background: linear-gradient(92deg, #fdf6e6, #fdf6e6 45%, #c99a45); }
html[data-theme="light"] .ppm-sub { color: #5b6270; }
html[data-theme="light"] .ppm-price { color: #a97a12; }
html[data-theme="light"] .ppm-price del { color: #6b7280; }
html[data-theme="light"] .ppm-credits { color: #5b6270; }
html[data-theme="light"] .ppm-qr-frame { background: #ffffff; }
html[data-theme="light"] .ppm-scan b { color: #a97a12; }
html[data-theme="light"] .ppm-goods-price { color: #a97a12; }
html[data-theme="light"] .ppm-goods-orig { color: #6b7280; }
html[data-theme="light"] .ppm-goods-tag { color: #a97a12; }
html[data-theme="light"] .ppm-total b { color: #a97a12; }
html[data-theme="light"] .ppm-paid { color: #a97a12; }
html[data-theme="light"] .ppm-note { color: #6b7280; }
html[data-theme="light"] .member-agree a { color: #a97a12; }
html[data-theme="light"] .ppm-agree { color: #6b7280; }
html[data-theme="light"] .ppm-agree a { color: #a97a12; }
html[data-theme="light"] .ppm-status { color: #5b6270; }
html[data-theme="light"] .ppm-foot { color: #5b6270; }
html[data-theme="light"] .ppm-ok-circle { background: linear-gradient(140deg, #fdf6e6, #fdf6e6 55%, #c99a45); }
html[data-theme="light"] .ppm-ok-credits { color: #a97a12; }
html[data-theme="light"] .ppm-ok-credits small { color: #5b6270; }
html[data-theme="light"] .ppm-ok-note { color: #5b6270; }
html[data-theme="light"] .ppm-ok-btn { background: linear-gradient(92deg, #fdf6e6, #fdf6e6 55%, #c99a45); }
html[data-theme="light"] .promo-hero-title { color: #a97a12; }
html[data-theme="light"] .promo-hero .btn-ghost.small { color: #a97a12; }
html[data-theme="light"] .promo-row { background: #ffffff; }
html[data-theme="light"] #jjClosedHint { color: #5b6270; background: #ffffff; }
html[data-theme="light"] #planList .plan { background: #ffffff; color: #242832; }
html[data-theme="light"] #planList .plan-price small { color: #5a6172; }
html[data-theme="light"] #planList .plan-price.unset b { color: #5a6172; }
html[data-theme="light"] #planList .plan-renew { color: #5a6172; }
html[data-theme="light"] #planList .plan-credits small { color: #5a6172; }
html[data-theme="light"] #planList .plan-credits.plan-unset { color: #5a6172; }
html[data-theme="light"] #planList .plan-own { color: #5a6172; }
html[data-theme="light"] #planList .plan-valid { color: #5a6172; }
html[data-theme="light"] #planList .pk-title { color: #5a6172; }
html[data-theme="light"] #planList .plan.p4 { background: linear-gradient(180deg, rgba(45, 212, 191, .10), #ffffff 42%); }
html[data-theme="light"] #planList .plan.p5 { background: linear-gradient(180deg, rgba(255, 255, 255, .14), #ffffff 42%); }
html[data-theme="light"] html[data-full="1"] #memberModal .mb-label { color: #5a6172 !important; }
html[data-theme="light"] html[data-full="1"] #memberModal .mb-value small { color: #5a6172 !important; }
html[data-theme="light"] html[data-full="1"] #memberModal .mtab { color: #5a6172 !important; }
html[data-theme="light"] html[data-full="1"] #memberModal .member-tip { color: #5a6172 !important; }
html[data-theme="light"] html[data-full="1"] #memberModal .promo-sub-title { color: #5a6172 !important; }
html[data-theme="light"] .rch-sub { color: #5a6172; }
html[data-theme="light"] html[data-full="1"] .rch-sub { color: #5a6172 !important; }
html[data-theme="light"] .pack { background: #ffffff; color: #242832; }
html[data-theme="light"] .pack-split { color: #5a6172; }
html[data-theme="light"] .pack-buy:disabled { color: #5a6172; }
html[data-theme="light"] .pack-gate { color: #5a6172; }
html[data-theme="light"] .cust-scale { color: #5a6172; }
html[data-theme="light"] .cust-input { color: #5a6172; }
html[data-theme="light"] .cust-yuan b { color: #242832; }
html[data-theme="light"] .hist-danger-tip { color: #c62828; }
html[data-theme="light"] .btn-ghost.danger { color: #c62828; }
html[data-theme="light"] textarea, select { background: #f8f9fc; }
html[data-theme="light"] select option { background: #f8f9fc; }
html[data-theme="light"] .stor-card { background: #f8f9fc; }
html[data-theme="light"] .stor-badge { color: #5b6270; }
html[data-theme="light"] .stor-badge.warn { color: #c2410c; }
html[data-theme="light"] .stor-badge.off { color: #4b5364; }
html[data-theme="light"] .stor-nums { color: #2b3038; }
html[data-theme="light"] .stor-tip { color: #5b6270; }

/* ══ ★ V4.16.3 浅色模式修正（第二轮）：页面底 + 白底上的浅色文字 + 彩色按钮白字回滚 ══ */
html[data-theme="light"][data-full="1"] body { background: #f4f5f9 !important; color: #1a1c22; }
html[data-theme="light"] #memberModal.modal-mask { background: #f4f5f9 !important; }
html[data-theme="light"] .btn-primary { color: #1a1c22; }
html[data-theme="light"] .layer-card.picked::after { color: #1a1c22; }
html[data-theme="light"] .thumb .tag { color: #1a1c22; }
html[data-theme="light"] .thumb .del { color: #1a1c22; }
html[data-theme="light"] .select-rect::after { color: #1a1c22; }
html[data-theme="light"] .pending-imgs .p-img .del { color: #1a1c22; }
html[data-theme="light"] .hist-card .pick-mark { color: #1a1c22; }
html[data-theme="light"] .lb-bar .btn-ghost { color: #1a1c22; }
html[data-theme="light"] .lb-bar .btn-ghost:hover { color: #1a1c22; }
html[data-theme="light"] .toast { color: #1a1c22; }
html[data-theme="light"] #btnEditMode.on { color: #1a1c22; }
html[data-theme="light"] .btn-main { color: #1a1c22; }
html[data-theme="light"] .plan-terms .ptab.on { color: #1a1c22; }
html[data-theme="light"] .pay-tip { color: #1a1c22; }
html[data-theme="light"] .notice-bar { color: #1a1c22; }
html[data-theme="light"] .pay-ok-circle { color: #1a1c22; }
html[data-theme="light"] .plan-name { color: #1a1c22; }
html[data-theme="light"] .ppm-close:hover { color: #1a1c22; }
html[data-theme="light"] .ppm-price { color: #1a1c22; }
html[data-theme="light"] .ppm-scan b { color: #1a1c22; }
html[data-theme="light"] .ppm-title2 { color: #1a1c22; }
html[data-theme="light"] .ppm-goods-name { color: #1a1c22; }
html[data-theme="light"] .ppm-goods-price { color: #1a1c22; }
html[data-theme="light"] .ppm-goods-tag { color: #1a1c22; }
html[data-theme="light"] .ppm-total b { color: #1a1c22; }
html[data-theme="light"] .ppm-alipay { color: #1a1c22; }
html[data-theme="light"] .ppm-paid { color: #1a1c22; }
html[data-theme="light"] .member-agree a { color: #1a1c22; }
html[data-theme="light"] .ppm-agree a { color: #1a1c22; }
html[data-theme="light"] .ppm-ok-credits { color: #1a1c22; }
html[data-theme="light"] .promo-hero-title { color: #1a1c22; }
html[data-theme="light"] .promo-code { color: #1a1c22; }
html[data-theme="light"] .promo-hero .btn-ghost.small { color: #1a1c22; }
html[data-theme="light"] #planList .plan-name { color: #1a1c22; }
html[data-theme="light"] #planList .plan-badge { color: #1a1c22; }
html[data-theme="light"] #planList .plan-price b { color: #1a1c22; }
html[data-theme="light"] #planList .plan-own b { color: #1a1c22; }
html[data-theme="light"] #planList .plan.on .plan-pick { color: #1a1c22; }
html[data-theme="light"] #planList .plan.p5 .plan-pick { color: #1a1c22; }
html[data-theme="light"] .mm-banner b { color: #1a1c22; }
html[data-theme="light"] html[data-full="1"] #memberModal .member-title { color: #1a1c22 !important; }
html[data-theme="light"] html[data-full="1"] #memberModal .mb-value { color: #1a1c22 !important; }
html[data-theme="light"] html[data-full="1"] .rch-title { color: #1a1c22 !important; }
html[data-theme="light"] .pack-name { color: #1a1c22; }
html[data-theme="light"] .pack-credits { color: #1a1c22; }
html[data-theme="light"] .cust-yuan input { color: #1a1c22; }
/* 上面把浅色文字统一改深；这几类是「彩色底」元素，文字必须回滚为白色（否则橙底/蓝底按钮看不清） */
html[data-theme="light"] .brand-text h1 { color: #fff !important; }
html[data-theme="light"] .nav-item.active::before { color: #fff !important; }
html[data-theme="light"] .ratio-item.on .ratio-shape { color: #fff !important; }
html[data-theme="light"] .btn-primary { color: #fff !important; }
html[data-theme="light"] .layer-card.picked::after { color: #fff !important; }
html[data-theme="light"] #btnEditMode.on { color: #fff !important; }
html[data-theme="light"] .btn-main { color: #fff !important; }
html[data-theme="light"] .plan-terms .ptab.on { color: #fff !important; }
html[data-theme="light"] .pay-ok-circle { color: #fff !important; }
html[data-theme="light"] .ppm-alipay { color: #fff !important; }
html[data-theme="light"] #planList .plan-badge { color: #fff !important; }
html[data-theme="light"] #planList .plan.on .plan-pick { color: #fff !important; }
html[data-theme="light"] #planList .plan.p5 .plan-pick { color: #fff !important; }
html[data-theme="light"] .pack-badge.hot { color: #fff !important; }
html[data-theme="light"] .cust-range::-webkit-slider-thumb { color: #fff !important; }
html[data-theme="light"] .cust-range::-moz-range-thumb { color: #fff !important; }
html[data-theme="light"] .stor-bar i { color: #fff !important; }
html[data-theme="light"] .stor-bar i.warn { color: #fff !important; }

/* ══ ★ V4.16.3 浅色模式修正（第三轮）：把强制纯黑的「容器底」翻成浅色 ══
   上面几处 `!important` 的黑底（html 自身 / full 模式的 body / 全屏会员卡）特异性更高，
   需要同等级 + 更高特异性的规则才能盖住，否则白底模式下页面底仍是黑的一块。 */
html[data-theme="light"] { background: #f4f5f9 !important; }
html[data-theme="light"][data-full="1"] body { background: #f4f5f9 !important; }
html[data-theme="light"][data-full="1"] #memberModal .modal-card.member-card {
  background: #f4f5f9 !important;
  color: #1a1c22;
}
html[data-theme="light"] .modal-mask { background: rgba(244, 245, 249, .82); }
html[data-theme="light"] .modal-card { background: #ffffff; color: #1a1c22; }

/* ═══════════════════════════════════════════════════════════════════════════════
   ★ V4.17.0 节点下控制面板（运营方要求）
   运营方原话：「文生图、参考图修改都是窗口，要求参考以下格式：节点下边是控制面板，
   控制面板左上角可以添加参考图，中间可以输入文字提示词，左下角可以选择模型，
   右下角箭头代表开始生成，箭头左边有积分消耗对应显示。」
   布局 = 结果（节点作品）在上、控制面板吸在下面；颜色全部走主题变量，黑底/白底都自动适配。
   ═══════════════════════════════════════════════════════════════════════════════ */
/* ⚠️ align-items 必须显式改成 stretch：.work-grid 原有 `align-items: start` 是给两列 grid 用的，
   在 flex 纵向布局里它会变成"水平方向不拉伸" → 控制面板缩成内容宽度（实测 277px，右边一大片空）。 */
.cp-grid { display: flex; flex-direction: column; gap: 12px; align-items: stretch; overflow: hidden;
  min-height: 0; height: calc(100vh - 106px); }
.cp-grid > .panel { width: 100%; }
/* 嵌入模式（画布卡片）没有顶栏、内容区 padding 只有 14px */
html[data-embed] .cp-grid { height: calc(100vh - 28px); }
.cp-grid .result-panel { flex: 1 1 0; min-height: 0; }
.cp-panel { flex: 0 0 auto; padding: 10px 12px; }

.cp { display: flex; flex-direction: column; gap: 10px; max-width: 1080px; }

/* ── 上半：参考图（左上角）＋ 提示词（中间） ── */
.cp-main { display: flex; gap: 10px; align-items: flex-start; }
.cp-refbox { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.cp-add {
  width: 62px; height: 62px; border-radius: 14px; flex: 0 0 auto;
  border: 1px dashed var(--line); background: rgba(255, 255, 255, 0.04);
  color: var(--sub); font-size: 24px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.cp-add:hover { border-color: #e7eaef; color: #ff9a6a; background: rgba(255, 255, 255, 0.10); }
.cp-thumbs { display: flex; gap: 6px; max-width: 208px; overflow-x: auto; padding-bottom: 2px; }
.cp-thumb { position: relative; width: 62px; height: 62px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); flex: 0 0 auto; }
.cp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cp-thumb i {
  position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.62); color: #fff; font-size: 11px; font-style: normal;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.cp-inputwrap { flex: 1 1 auto; min-width: 0; position: relative; }
.cp-inputwrap textarea {
  width: 100%; min-height: 62px; resize: none; padding: 9px 10px 30px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 14px;
  color: var(--ink); font-size: 13px; line-height: 1.6;
}
.cp-inputwrap textarea:focus { border-color: #e7eaef; background: rgba(255, 255, 255, 0.06); }
.cp-tools { position: absolute; right: 8px; bottom: 7px; display: flex; gap: 6px; }
.cp-tools .btn-ghost { padding: 2px 7px; font-size: 11px; border-radius: 8px; white-space: nowrap; flex: 0 0 auto; }

/* ── 下半：模型（左下角）／设置／积分＋箭头（右下角） ── */
.cp-bar { display: flex; align-items: center; gap: 8px; }
.cp-modwrap { position: relative; }
.cp-model {
  display: flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 11px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); color: var(--ink); font-size: 12.5px;
}
.cp-model:hover { border-color: #e7eaef; }
.cp-model b { font-weight: 700; }
.cp-caret { font-style: normal; color: var(--sub); font-size: 10px; }
.cp-menu {
  position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 30;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 8px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); min-width: 200px;
}
.cp-gear {
  width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05); color: var(--sub); font-size: 14px; flex: 0 0 auto;
}
.cp-gear:hover, .cp-gear.on { border-color: #e7eaef; color: #ff9a6a; }
.cp-spacer { flex: 1 1 auto; }
.cp-cost { font-size: 12.5px; color: #e7eaef; font-weight: 700; white-space: nowrap; }
.cp-go {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto;
  background: var(--grad); color: #1a1206; font-size: 19px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(255, 255, 255, 0.38);
}
.cp-go:hover { filter: brightness(1.08); }
.cp-go:disabled { opacity: 0.55; filter: grayscale(0.4); cursor: default; }

/* ── 更多设置（点 ⚙ 展开）──
   用 grid + minmax 而不是 flex-wrap：flex-wrap 下列宽 = 内容宽度，13 个比例按钮会竖成一长条（实测高 1125px）。 */
.cp-adv { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 20px; padding: 10px 2px 2px; border-top: 1px solid var(--line); }
.cp-adv-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cp-adv-col > label { font-size: 11.5px; color: var(--sub); }
.cp-adv .ratio-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
.cp-adv .size-hint { grid-column: 1 / -1; }
/* 参考图提示（加了图 = 参考图修改）*/
.cp-refnote { font-size: 11.5px; color: #7ee787; flex: 1 1 100%; }
/* 控制面板版式下结果区必须让位：它内部滚动，别把下边的控制面板（用户真正在操作的那条）挤出视口。 */
.cp-grid .result-panel { overflow-y: auto; }
.cp-grid .result-panel .empty-state { min-height: 140px; }
.cp-grid #dropzone { padding: 14px; }
.cp-grid #dropzone .dz-ico { font-size: 24px; margin-bottom: 4px; }
.cp-grid #dropzone .dz-d { display: none; }
/* 参考图修改页：上传区（dropzone）已经承担引导，「修改结果」里再放一份空态就是重复占地方（实测把控制面板挤出视口） */
.cp-grid #refResult .empty-state { display: none; }
/* ⚠️ 必须 !important：.result-panel 自带 min-height: min(560px, calc(100vh - 126px))，
   在「结果上 / 控制面板下」的纵向布局里会把结果区顶成 400+px，把控制面板挤出视口（真机实测）。 */
.cp-grid > .panel.result-panel { flex: 1 1 0 !important; min-height: 0 !important; max-height: none !important; overflow-y: auto !important; }
.cp-grid > .panel.cp-panel { flex: 0 0 auto !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   V4.27.4 移动端适配（纯追加块：以上桌面规则一行未动）
   375×812 实测：.topbar 里 .brand 被挤到 141px 宽 → 品牌名竖排并向上溢出
   （实测 .brand-text 高 131px / y = -33，肉眼只剩「计平台」三个字），
   「服务已连接」徽标同样竖排（高 96px）压在上面；.layout 是 375 的定宽 flex，
   侧栏 178px 吃掉一半宽度，.content 只剩 263px，输入框被压到 121px 宽，
   且 .layout 内容 min-content = 441px → 整页横向溢出（innerWidth 被撑到 441）。
   修法：顶栏严格单行 + 主标题省略号；侧栏改成顶部横向导航；内容区整宽 + 整页滚动。
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  html, body { height: auto; min-height: 100%; }
  body { overflow-x: hidden; overflow-y: auto; }

  /* ── 顶栏：品牌名不换行、不被徽标挤压 ── */
  .topbar { height: auto; min-height: 56px; padding: 8px 12px; gap: 8px; }
  .brand { flex: 1 1 auto; min-width: 0; gap: 8px; }
  .logo { width: 34px; height: 34px; flex: none; }
  .brand-text { min-width: 0; }
  /* 品牌名是身份标识：不换行、不省略号截断（截一半比不显示更难看） */
  .brand-text h1 { font-size: 15px; letter-spacing: 0; white-space: nowrap; }
  .brand-text p { display: none; }               /* 英文副标题手机上是纯噪声 */
  .topbar-right { flex: none; gap: 6px; }
  .balance-chip { margin-right: 0; padding: 6px 10px; font-size: 12px; }
  .api-status { flex: none; gap: 6px; padding: 6px 9px; font-size: 11.5px; white-space: nowrap; }

  /* ── 侧边栏 → 顶部横向导航（9 个入口横滑，不再独占半屏） ── */
  .layout { display: block; height: auto; }
  .sidebar {
    width: 100%; flex-direction: row; align-items: center; gap: 6px;
    padding: 8px 10px; overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  .nav-item { flex: 0 0 auto; min-height: 40px; padding: 9px 12px; font-size: 13px; white-space: nowrap; }
  .nav-item.active::before { display: none; }
  .sidebar-foot { display: none; }

  /* ── 内容区：整宽 + 整页滚动（原先 body 锁死 100% 高，窄屏下只能靠内层滚动） ── */
  .content { min-width: 0; padding: 12px; overflow: visible; }
  .tab-panel { height: auto; }
  .work-grid { height: auto; grid-template-columns: 1fr; }
  .control-panel { max-height: none; padding: 16px; }
  .result-panel { min-height: 300px; max-height: none; padding: 16px; }
  /* .result-body 自带 min-height: 340px（桌面给"创作结果"留的画布位）——
     手机上它比整个结果面板还高，空态被挤到面板外面只剩半个 🎨 */
  .result-body { min-height: 200px; }
  /* 覆盖上方那条 !important 版 min-height:0（同特异性 + 位置更靠后 → 生效）。
     flex-basis:0 在 auto 高度的父级里算出来是 0，不显式给高度结果区就整块塌掉。 */
  .cp-grid > .panel.result-panel { min-height: 268px !important; }
  .cp-grid { height: auto; overflow: visible; }
  .app-footer { padding: 10px 12px; }
}

@media (max-width: 480px) {
  .brand-text h1 { font-size: 14.5px; }
  .balance-chip { display: inline-flex; align-items: center; min-height: 40px; margin-right: 0; padding: 0 9px; font-size: 11.5px; }

  /* ── 连接徽标：健康时沉默（只留圆点），出问题时说话 ──
     文字走「sr-only」而不是 display:none：读屏仍能念出「服务器已连接 · Nms」，
     写死 aria-label 反而分不出 已连接 / 检测中 / 未连接 三态。 */
  .api-status { position: relative; min-height: 40px; min-width: 40px; justify-content: center; padding: 8px; }
  .api-status #apiText {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
  }
  .api-status.fail #apiText, .api-status.testing #apiText {
    position: static; width: auto; height: auto; margin: 0; overflow: visible; clip-path: none;
  }
  .api-status .dot { width: 10px; height: 10px; }
  /* 连上时连底色也去掉：只剩 10px 绿点（40×40 仍是可点区域），别在手机顶栏上顶一个绿盘子 */
  .api-status.ok { background: transparent; border-color: transparent; }

  /* 提示词输入区：参考图按钮缩小，输入框吃满剩余宽度 */
  .cp-main { gap: 8px; }
  .cp-add { width: 52px; height: 52px; border-radius: 12px; font-size: 20px; }
  .cp-inputwrap textarea { min-height: 64px; }
  .cp-bar { flex-wrap: wrap; row-gap: 8px; }
  .cp-panel { padding: 8px 10px; }
  /* 结果区空态（🎨 + 两行文案）在手机上收一档，保证整块都露出来 */
  .empty-state { padding: 22px 12px; }
  .empty-art { font-size: 40px; }

  /* 弹层：375 下 30px 内边距太奢侈，套餐卡改单列（原来 2 列会把价格挤换行） */
  .modal-card { padding: 20px 16px; max-height: 90vh; }
  #planList.plan-list { grid-template-columns: 1fr; }
}
