/* ============================================================
   AIGX · 应用外壳
   ★ 排版 1:1 照参考站（swivai.com/generate 与 /assets）：
     通知条 32px → 品牌栏 56px → 左侧竖排图标（垂直居中）
     → 内容区（右上角搜索/筛选）→ 底部 840px 输入条 → 页脚
   ★ 只把「配色 / 按钮 / 圆角 / 动效」换成我们自己的
   ============================================================ */

/* ── 通知条（参考站顶部黄条的位置） ─────────────────── */
.notice {
  height: 32px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px;
  background: var(--tint);
  border-bottom: 1px solid rgba(168, 58, 103, .12);
  font-size: 12.5px; color: var(--accent-deep);
}
.notice__pill {
  display: inline-flex; align-items: center;
  height: 20px; padding: 0 8px;
  border-radius: var(--pill);
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0;
}
.notice__t { color: var(--ink); font-weight: 500; }
.notice__date { margin-left: auto; color: var(--muted); font-size: 12px; }

/* ── 品牌栏 ─────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 60;
  height: 56px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  background: rgba(245, 245, 247, .88);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}

.top__brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 19px; font-weight: 700; letter-spacing: -.02em;
}
.top__brand img { width: 22px; height: 22px; border-radius: 6px; }

.top__spacer { flex: 1; }
.top__right { display: flex; align-items: center; gap: 8px; }

.credit {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 6px 0 12px;
  border-radius: var(--pill);
  background: var(--fill-1);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 14px; font-weight: 600;
}
.credit__n { color: var(--ink); }
.credit__l { color: var(--muted); font-weight: 500; }
.credit .icon-btn { width: 26px; height: 26px; }
.credit .icon-btn svg { width: 14px; height: 14px; }

.avatar {
  width: 34px; height: 34px; border-radius: 999px;
  background: linear-gradient(135deg, #efa663, #a83a67);
  display: grid; place-items: center;
  color: #fff; font-size: 13px; font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
}

/* ── 左侧竖排图标（垂直居中，照参考站位置） ─────────── */
.rail {
  position: fixed; left: 0; top: 88px; z-index: 50;
  width: 78px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start;
  padding-top: 8px;
  gap: 12px;
  background: transparent;
  pointer-events: none;
}
.rail > * { pointer-events: auto; }

.rail__item {
  display: grid; place-items: center; gap: 5px;
  width: 58px; padding: 9px 0;
  border-radius: var(--r-sm);
  color: #8b8b93;
  font-size: 11px; font-weight: 500;
  transition: background .22s var(--ease), color .22s var(--ease), transform .22s var(--ease);
}
.rail__item svg { width: 21px; height: 21px; }
.rail__item:hover { color: var(--ink); background: rgba(0, 0, 0, .04); }
.rail__item[aria-current="page"] {
  background: var(--fill-1);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}
.rail__item[aria-current="page"] svg { color: var(--accent); }

/* ── 内容区 ─────────────────────────────────────────── */
.shell {
  margin-left: 78px;
  min-height: calc(100vh - 56px);
  display: flex; flex-direction: column;
}

.main {
  flex: 1;
  display: flex; flex-direction: column;
  padding: 20px 24px 56px;
}
/* 生成页要给底部输入条让位 */
.main--gen { padding-bottom: 260px; }

/* 右上角：搜索 + 筛选（照参考站位置） */
.controls {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px;
  padding: 14px 0 10px;
}
.controls__search {
  display: inline-grid; place-items: center;
  width: 36px; height: 32px;
  border-radius: var(--pill);
  color: var(--muted);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.controls__search:hover { background: var(--fill-2); color: var(--ink); }
.controls__search svg { width: 16px; height: 16px; }

.controls__field {
  display: inline-flex; align-items: center;
  height: 32px; padding: 0 10px;
  border-radius: var(--pill);
  background: var(--fill-1);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px; color: var(--muted);
}
.controls__field input,
.controls__field select {
  border: 0; background: transparent; font-size: 13px; color: var(--ink);
  max-width: 150px;
}
.controls__field input:focus, .controls__field select:focus { outline: 0; }
.controls__field select { appearance: none; padding-right: 4px; cursor: pointer; }

/* 空状态（居中，照参考站） */
.blank {
  flex: 1;
  display: grid; place-content: center; justify-items: center;
  gap: 8px;
  text-align: center;
  padding: 40px 20px 60px;
}
.blank__ico { color: #b6b6bd; margin-bottom: 8px; }
.blank__ico svg { width: 62px; height: 62px; }
.blank__t { font-size: 17px; font-weight: 600; color: var(--ink); }
.blank__s { font-size: 14px; color: var(--muted); }

/* ── 生成记录（有内容时） ───────────────────────────── */
.feed {
  display: flex;
  flex-direction: column;     /* 对话式：一条一条竖着排，不再并成网格 */
  gap: 0;
  align-items: center;
  padding-bottom: 8px;
}

.job {
  width: 100%; max-width: 820px; margin: 0 0 22px;
  background: var(--fill-1);
  border-radius: var(--r-md);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
  animation: jobIn .4s var(--ease) both;
}
@keyframes jobIn { from { opacity: 0; transform: translateY(8px); } }

.job__head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 10px; }
.job__dot {
  width: 7px; height: 7px; border-radius: 999px;
  background: var(--accent); animation: pulse 1.2s infinite;
}
@keyframes pulse { 50% { opacity: .25; } }
.job__model { font-size: 13px; font-weight: 600; }
.job__meta { font-size: 12px; color: var(--muted); margin-left: auto; }

.job__prompt {
  padding: 0 14px 12px;
  font-size: 13px; color: var(--muted); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.job__canvas { position: relative; background: var(--fill-2); aspect-ratio: 1 / 1; }

.job__pct {
  position: absolute; inset: auto 0 0 0;
  padding: 10px 14px 12px;
  font-size: 12px; color: var(--muted);
  display: flex; align-items: center; gap: 10px;
}
.job__pct .bar-progress { flex: 1; }

.job__grid { display: grid; gap: 2px; width: 100%; height: 100%; }
.job__grid.n1 { grid-template-columns: 1fr; }
.job__grid.n2 { grid-template-columns: 1fr 1fr; }
.job__grid.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }

.job__cell { position: relative; overflow: hidden; background: var(--fill-2); }
.job__cell img { width: 100%; height: 100%; object-fit: cover; }
.job__cell::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, .28));
  opacity: 0; transition: opacity .25s var(--ease);
  /* 关键：opacity:0 不等于点不到，它仍然会吃掉整个格子的点击，
     导致生成中的卡片里点图片没反应（要等整批完成才恢复）。 */
  pointer-events: none;
}
.job__cell:hover::after { opacity: 1; }

.job__acts {
  position: absolute; right: 8px; bottom: 8px; z-index: 2;
  display: flex; gap: 6px;
  opacity: 1;                      /* 常驻显示：以前只在 hover 才出现，手机和触屏根本点不到 */
  transform: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.job__cell:hover .job__acts { opacity: 1; transform: none; }

.act {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .16);
  transition: transform .18s var(--ease), background .18s var(--ease);
}
.act:hover { transform: scale(1.08); background: #fff; }
.act svg { width: 15px; height: 15px; }

/* ── 底部输入条（参考站：居中 840px） ────────────────── */
.composer-wrap {
  position: fixed; left: 78px; right: 0; bottom: 42px; z-index: 55;
  display: grid; justify-items: center;
  padding: 0 24px 14px;
  background: linear-gradient(180deg, rgba(245, 245, 247, 0), rgba(245, 245, 247, .9) 40%, var(--bg) 76%);
  pointer-events: none;
}
.composer-wrap > * { pointer-events: auto; }

/* 图片 / 视频 切换（参考站位置：输入条上方居中） */
.mode-switch {
  display: inline-flex; gap: 2px;
  padding: 3px;
  margin-bottom: 8px;
  border-radius: var(--pill);
  background: var(--fill-1);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1);
}
.mode-switch button {
  height: 28px; padding: 0 15px;
  border-radius: var(--pill);
  font-size: 13px; font-weight: 600; color: var(--muted);
  transition: background .22s var(--ease), color .22s var(--ease);
}
.mode-switch button[aria-selected="true"] { background: var(--ink); color: #fff; }
.mode-switch button[disabled] { opacity: .38; cursor: not-allowed; }

.composer {
  position: relative;
  width: min(840px, 100%);
  background: var(--fill-1);
  border-radius: var(--r-lg);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-2);
  padding: 14px;
  transition: box-shadow .25s var(--ease);
}
.composer:focus-within {
  box-shadow: inset 0 0 0 1.5px rgba(168, 58, 103, .5), var(--shadow-2);
}

/* 计费说明：浮在输入条左上角（照参考站） */
.composer__cost {
  position: absolute; left: 14px; top: -13px;
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px;
  border-radius: var(--pill);
  background: var(--tint); color: var(--accent-deep);
  box-shadow: inset 0 0 0 1px rgba(168, 58, 103, .16);
  font-size: 11.5px; font-weight: 600;
}

.composer__top { display: flex; gap: 12px; }

.refbox {
  position: relative;
  flex: 0 0 88px; width: 88px; height: 88px;
  border-radius: var(--r-sm);
  border: 1.5px dashed #cfcfd6;
  background: #fbfbfc;
  display: grid; place-items: center;
  color: #9a9aa0;
  overflow: hidden;
  transition: border-color .2s var(--ease), background .2s var(--ease), color .2s var(--ease);
}
.refbox:hover { border-color: var(--accent); background: var(--tint); color: var(--accent); }
.refbox svg { width: 22px; height: 22px; }
.refbox img { width: 100%; height: 100%; object-fit: cover; }
.refbox__x {
  position: absolute; top: 4px; right: 4px;
  width: 20px; height: 20px; border-radius: 999px;
  background: rgba(0, 0, 0, .55); color: #fff;
  display: grid; place-items: center;
}
.refbox__x svg { width: 11px; height: 11px; }

.composer__input { flex: 1; min-height: 88px; display: flex; flex-direction: column; }
.composer__input textarea {
  flex: 1; width: 100%;
  border: 0; resize: none; background: transparent;
  font-size: 15px; line-height: 1.5; padding: 4px 2px;
}
.composer__input textarea:focus { outline: 0; }
.composer__input textarea::placeholder { color: #9a9aa0; }

.composer__expand { align-self: flex-start; color: var(--muted); }
.composer__expand svg { width: 15px; height: 15px; }

/* 底排：模板 | 模型 | 比例·分辨率 | 数量 ……… 运行 */
.composer__bottom {
  display: flex; align-items: center; gap: 4px;
  padding-top: 8px;
  margin-top: 2px;
  border-top: 1px solid var(--line);
}
.composer__spacer { flex: 1; }

.picker {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 10px;
  border-radius: var(--pill);
  color: var(--muted);
  font-size: 13.5px; font-weight: 500;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.picker:hover { background: var(--fill-2); color: var(--ink); }
.picker svg { width: 15px; height: 15px; }
.picker select {
  appearance: none; border: 0; background: transparent;
  font-size: 13.5px; font-weight: 500; color: inherit; cursor: pointer;
  padding-right: 2px;
}
.picker select:focus { outline: 0; }
.picker::after {
  content: "";
  width: 5px; height: 5px; margin-left: 2px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: .7;
}

.run {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 20px;
  border-radius: var(--pill);
  background: var(--accent); color: #fff;
  font-size: 14px; font-weight: 600;
  transition: background .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.run:hover { background: var(--accent-deep); box-shadow: 0 6px 18px rgba(168, 58, 103, .28); }
.run:active { transform: scale(.98); }
.run[disabled] { opacity: .45; pointer-events: none; box-shadow: none; }

/* ── 资产页（照参考站：顶部 tab + 次行筛选） ─────────── */
.tabs {
  display: flex; align-items: center; gap: 26px;
  border-bottom: 1px solid var(--line);
  padding-top: 10px;
}
.tabs button {
  position: relative;
  padding: 10px 0 12px;
  font-size: 15px; font-weight: 600;
  color: var(--muted);
  transition: color .2s var(--ease);
}
.tabs button[aria-selected="true"] { color: var(--ink); }
.tabs button[aria-selected="true"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; border-radius: 2px; background: var(--accent);
}
.tabs button[disabled] { opacity: .38; cursor: not-allowed; }

.subbar {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 0;
}
.subbar__seg { display: flex; align-items: center; gap: 18px; }
.subbar__seg button {
  font-size: 14px; font-weight: 600; color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px;
  transition: color .2s var(--ease);
}
.subbar__seg button[aria-selected="true"] { color: var(--ink); }
.subbar__seg svg { width: 14px; height: 14px; }

.viewtoggle {
  display: inline-flex; padding: 3px;
  border-radius: var(--pill);
  background: var(--fill-1);
  box-shadow: inset 0 0 0 1px var(--line);
}
.viewtoggle button {
  display: grid; place-items: center;
  width: 30px; height: 26px;
  border-radius: var(--pill);
  color: var(--muted);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.viewtoggle button[aria-pressed="true"] { background: var(--fill-2); color: var(--ink); }
.viewtoggle svg { width: 15px; height: 15px; }

.assets {
  display: grid; gap: 14px;
  grid-template-columns: repeat(4, 1fr);
}
.assets[data-cols="2"] { grid-template-columns: repeat(2, 1fr); }
.assets[data-cols="3"] { grid-template-columns: repeat(3, 1fr); }

.card {
  position: relative;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--fill-1);
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.card:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1); }
.card__img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--fill-2); }

.card__bar {
  position: absolute; inset: auto 0 0 0;
  display: flex; align-items: center; gap: 6px;
  padding: 10px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .45));
  opacity: 0; transition: opacity .22s var(--ease);
}
.card:hover .card__bar, .card.is-selected .card__bar { opacity: 1; }
.card__bar .act { width: 28px; height: 28px; }
.card__bar .act svg { width: 14px; height: 14px; }

.card__pick {
  position: absolute; top: 8px; left: 8px;
  width: 22px; height: 22px; border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .18);
  display: none; place-items: center;
  color: #fff;
}
.card__pick svg { width: 13px; height: 13px; }
.assets.is-selecting .card__pick { display: grid; }
.card.is-selected { box-shadow: inset 0 0 0 2.5px var(--accent); }
.card.is-selected .card__pick { background: var(--accent); box-shadow: none; }

.card__fav {
  position: absolute; top: 8px; right: 8px;
  width: 26px; height: 26px; border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  display: grid; place-items: center;
  color: var(--muted);
  opacity: 0; transition: opacity .2s var(--ease), color .2s var(--ease);
}
.card__fav svg { width: 14px; height: 14px; }
.card:hover .card__fav { opacity: 1; }
.card__fav[aria-pressed="true"] { opacity: 1; color: var(--accent); }

.batchbar {
  position: sticky; bottom: 16px;
  margin: 18px auto 0;
  display: none; align-items: center; gap: 12px;
  width: fit-content;
  padding: 10px 14px;
  border-radius: var(--pill);
  background: var(--ink); color: #fff;
  box-shadow: var(--shadow-2);
  font-size: 14px;
}
.batchbar.is-on { display: flex; }
.batchbar .btn { height: 32px; font-size: 13px; }
.batchbar__n { font-weight: 700; }

/* ── 详情抽屉 ───────────────────────────────────────── */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 90;
  width: min(460px, 100%);
  background: var(--fill-1);
  box-shadow: -20px 0 60px rgba(0, 0, 0, .14);
  transform: translateX(102%);
  transition: transform .34s var(--ease);
  display: flex; flex-direction: column;
}
.drawer.is-open { transform: none; }

.drawer__head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.drawer__title { font-size: 15px; font-weight: 600; }
.drawer__body { flex: 1; overflow: auto; padding: 18px; }
.drawer__img {
  width: 100%; border-radius: var(--r-sm);
  box-shadow: inset 0 0 0 1px var(--line);
  background: var(--fill-2);
}
.drawer__kv {
  display: grid; grid-template-columns: 84px 1fr;
  gap: 8px 12px; margin-top: 18px; font-size: 13px;
}
.drawer__kv dt { color: var(--muted); }
.drawer__kv dd { margin: 0; color: var(--ink); word-break: break-all; }
.drawer__foot {
  display: flex; gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}
.drawer__foot .btn { flex: 1; }

.scrim {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(20, 20, 22, .28);
  opacity: 0; pointer-events: none;
  transition: opacity .3s var(--ease);
}
.scrim.is-on { opacity: 1; pointer-events: auto; }

/* ── 页脚（照参考站：一行，左版权 / 中链接 / 右邮箱） ── */
.foot {
  position: sticky; bottom: 0; z-index: 56;
  height: 42px;
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  background: rgba(245, 245, 247, .92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted);
}
.foot__links { display: flex; gap: 18px; margin-inline: auto; }
.foot__mail { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.foot__mail svg { width: 14px; height: 14px; }
.foot a:hover { color: var(--ink); }

/* ── 提示条 ─────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 120;
  transform: translate(-50%, 14px);
  padding: 10px 16px;
  border-radius: var(--pill);
  background: var(--ink); color: #fff;
  font-size: 13.5px;
  opacity: 0; pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ── 响应式 ─────────────────────────────────────────── */
@media (max-width: 1080px) {
  .assets { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 860px) {
  .rail {
    left: 0; right: 0; top: auto; bottom: 0;
    width: auto; height: 60px;
    flex-direction: row; justify-content: center; gap: 14px;
    background: rgba(245, 245, 247, .94);
    border-top: 1px solid var(--line);
  }
  .rail__item { width: auto; padding: 6px 14px; }
  .shell { margin-left: 0; padding-bottom: 60px; }
  .main { padding: 0 16px; }
  .main--gen { padding-bottom: 250px; }
  .composer-wrap { left: 0; padding: 0 12px 74px; }
  .feed { grid-template-columns: 1fr; }
  .assets { grid-template-columns: repeat(2, 1fr); }
  .controls { flex-wrap: wrap; justify-content: flex-start; }
  .foot { flex-wrap: wrap; padding: 14px 16px; }
  .foot__links { margin-inline: 0; }
  .drawer { width: 100%; }
  .notice { font-size: 11.5px; }
  .notice__date { display: none; }
}

/* ── 登录弹窗 ───────────────────────────────────────── */
.modal {
  position: fixed; left: 50%; top: 50%; z-index: 100;
  width: min(420px, calc(100% - 32px));
  transform: translate(-50%, -46%) scale(.98);
  opacity: 0; pointer-events: none;
  background: var(--fill-1);
  border-radius: var(--r-lg);
  box-shadow: inset 0 0 0 1px var(--line), 0 30px 80px rgba(0, 0, 0, .22);
  transition: opacity .24s var(--ease), transform .24s var(--ease);
}
.modal.is-open {
  opacity: 1; pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.modal__head {
  display: flex; align-items: center;
  padding: 16px 16px 8px 20px;
}
.modal__title { font-size: 17px; font-weight: 600; }
.modal__head .icon-btn { margin-left: auto; }

.modal__body { padding: 4px 20px 20px; display: grid; gap: 12px; }

.fld { display: grid; gap: 6px; }
.fld__l { font-size: 12.5px; font-weight: 600; color: var(--muted); }

.code-row { display: flex; gap: 8px; }
.code-row .field { flex: 1; }
.code-row .btn { height: 44px; flex: 0 0 auto; }

.modal__hint {
  font-size: 11.5px; color: var(--muted); text-align: center;
  line-height: 1.5; margin-top: 2px;
}

/* 顶部登录按钮与头像的显隐 */
#loginBtn { height: 34px; }

/* ── 自绘下拉（替代原生 select，才能长得像我们） ─────── */
.dd { position: relative; display: inline-flex; }

.dd__btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 12px;
  border-radius: var(--pill);
  color: var(--muted);
  font-size: 13.5px; font-weight: 500;
  white-space: nowrap;
  transition: background .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
}
.dd__btn:hover { background: var(--fill-2); color: var(--ink); }
.dd.is-open .dd__btn {
  background: var(--fill-1); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1);
}
.dd__btn svg { width: 9px; height: 9px; opacity: .65; transition: transform .2s var(--ease); }
.dd.is-open .dd__btn svg { transform: rotate(180deg); }

.dd__menu {
  position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 70;
  min-width: 190px; padding: 6px;
  border-radius: 16px;
  background: var(--fill-1);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-2);
  display: none;
}
.dd.is-open .dd__menu { display: block; animation: ddIn .18s var(--ease) both; }
@keyframes ddIn { from { opacity: 0; transform: translateY(4px); } }

.dd--down .dd__menu { bottom: auto; top: calc(100% + 8px); }
.dd--right .dd__menu { left: auto; right: 0; }

.dd__opt {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 11px;
  border-radius: 10px;
  font-size: 13.5px; color: var(--ink); text-align: left;
  transition: background .16s var(--ease);
}
.dd__opt:hover { background: var(--fill-2); }
.dd__opt[aria-selected="true"] { font-weight: 600; }
.dd__opt[aria-selected="true"]::after {
  content: ""; margin-left: auto;
  width: 5px; height: 9px;
  border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(45deg) translateY(-1px);
}

/* 参数名（模型参数下拉的前缀，弱化显示） */
.dd__k { color: var(--muted); opacity: .72; font-size: 12.5px; }
.dd__k + .dd__val { margin-left: 2px; }

/* 参数行：允许换行，按钮不被挤压 */
.composer__params { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; min-width: 0; flex: 1 1 auto; }
.composer__bottom { flex-wrap: wrap; row-gap: 6px; }
.composer__bottom .run { flex: 0 0 auto; white-space: nowrap; margin-left: auto; }
.composer__spacer { display: none; }

/* ── 参数设置面板（仿上游：一个入口，面板内分组） ─── */
.dd--up .dd__menu { bottom: calc(100% + 10px); top: auto; }
.dd__btn--sum { color: var(--ink); background: var(--fill-2); font-weight: 500; }
.dd__btn--sum:hover { background: var(--fill-3); }
.setpanel { min-width: 340px; max-width: 380px; max-height: 76vh; overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 14px 14px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.setpanel::-webkit-scrollbar { width: 6px; }
.setpanel::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.setpanel::-webkit-scrollbar-track { background: transparent; }
.setpanel__grp { padding: 8px 4px; border-bottom: 1px solid var(--line); }
.setpanel__grp:last-child { border-bottom: 0; }
.setpanel__l { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.setpanel__hint { font-size: 11px; color: var(--muted); opacity: .7; margin-top: 5px; line-height: 1.45; }
.setpanel__hint:empty { display: none; }
.modeswitch { display: inline-flex; gap: 4px; padding: 4px; margin: 0 auto 10px; border-radius: 999px;
  background: var(--fill-2); border: 1px solid var(--line); }
.modeswitch__btn { height: 30px; padding: 0 18px; border-radius: 999px; font-size: 13px; color: var(--ink-2);
  background: transparent; transition: background .15s, color .15s; }
.modeswitch__btn[aria-selected="true"] { background: #fff; color: var(--ink); font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.setpanel__opts { display: flex; flex-wrap: wrap; gap: 6px; }
.setpanel__opt { height: 28px; padding: 0 11px; border-radius: 999px; font-size: 12.5px; color: var(--ink); background: var(--fill-2); }
.setpanel__opt:hover { background: var(--fill-3); }
.setpanel__inp { height: 28px; width: 100%; max-width: 220px; padding: 0 10px; border-radius: 8px;
  font-size: 12.5px; color: var(--ink); background: var(--fill-2); border: 1px solid var(--line); outline: none; }
.setpanel__inp:focus { border-color: var(--accent); }
.setpanel__opt[aria-selected="true"] { background: var(--accent); color: #fff; }

/* ── 参考素材条 ── */
.assets { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.assets__add { display: inline-flex; flex-direction: row; align-items: center; justify-content: center;
  gap: 4px; width: 62px; height: 52px; border-radius: 12px; border: 1px dashed var(--line);
  background: var(--fill-2); color: var(--ink-2); font-size: 11px; padding: 0 4px;
  white-space: nowrap; }
@media (max-width:640px){
  .assets__add { width: auto; height: 34px; padding: 0 12px; border-radius: 999px; font-size: 12px; flex: 0 0 auto; }
  .assets__add svg { width: 15px; height: 15px; }
}
.assets__add:hover { border-color: var(--accent); color: var(--accent); }
.assets__add svg { width: 18px; height: 18px; }
.assets__list { display: flex; gap: 8px; overflow-x: auto; max-width: 46vw; }
.asset { position: relative; width: 52px; height: 52px; border-radius: 12px; overflow: hidden;
  background: var(--fill-3); cursor: pointer; flex: 0 0 auto; }
.asset img { width: 100%; height: 100%; object-fit: cover; }
.asset__ico { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
  font-size: 18px; color: var(--ink-2); }
.asset__no { position: absolute; left: 3px; bottom: 3px; padding: 0 5px; border-radius: 6px;
  background: rgba(0,0,0,.62); color: #fff; font-size: 10px; line-height: 15px; }
.asset__x { position: absolute; right: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: rgba(0,0,0,.62); color: #fff; font-size: 12px; line-height: 16px; text-align: center; }

/* ── 滑块 ── */
.rng { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 300px; }
.rng input[type=range] { -webkit-appearance: none; appearance: none; flex: 1; height: 4px; border-radius: 2px;
  background: var(--fill-3); outline: none; }
.rng input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.rng__v { min-width: 42px; text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--ink); }

/* ── 开关 ── */
.tgl { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px 0 4px;
  border-radius: 999px; background: var(--fill-2); font-size: 12.5px; color: var(--ink-2); }
.tgl__dot { width: 20px; height: 20px; border-radius: 50%; background: #c9ccd2; transition: background .15s, transform .15s; }
.tgl[aria-pressed="true"] { background: rgba(168,58,103,.1); color: var(--accent); }
.tgl[aria-pressed="true"] .tgl__dot { background: var(--accent); }

/* ── 顶栏用户信息 ── */
.userbox{display:flex;flex-direction:column;align-items:flex-end;line-height:1.25;margin-right:6px}
.userbox__c{font-size:12.5px;color:#6e6e73}
.userbox__c b{color:#a83a67;font-size:13.5px;font-variant-numeric:tabular-nums}
.userbox__p{font-size:11px;color:#86868b}

/* ── 历史结果（刷新后仍在） ── */
.hist{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px;margin-bottom:18px}
.hist:empty{display:none}
.hist__item{margin:0;border:1px solid #e5e5ea;border-radius:10px;overflow:hidden;background:#fff}
.hist__item img,.hist__item video{width:100%;aspect-ratio:1;object-fit:cover;display:block;background:#f5f5f7}
.hist__item figcaption{font-size:11.5px;color:#86868b;padding:6px 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* ── 移动端补充（账户页 / 后台 / 顶栏） ── */
@media (max-width: 640px) {
  .userbox { display: none !important; }
  .top .btn--sm { padding: 0 10px; }
  .hist { grid-template-columns: repeat(2, 1fr); }
  .acct { padding: 16px 12px 90px; }
  .grid2 { grid-template-columns: 1fr; }
  .box__v { font-size: 22px; }
  .panel__b { padding: 14px; }
  .row input { min-width: 100% !important; }
  table { font-size: 12px; }
  th, td { padding: 7px 8px; }
}

/* ── 全屏提示词编辑 ── */
.expand{position:fixed;inset:0;background:rgba(0,0,0,.4);display:none;align-items:center;justify-content:center;z-index:200;padding:20px}
.expand.is-on{display:flex}
.expand__box{background:#fff;border-radius:16px;width:100%;max-width:760px;padding:20px;display:flex;flex-direction:column;gap:12px;max-height:86vh}
.expand__h{display:flex;justify-content:space-between;align-items:center;font-size:14px}
.expand__n{color:#86868b;font-size:12px}
#expandArea{width:100%;min-height:46vh;border:1px solid #e5e5ea;border-radius:12px;padding:14px;font-size:15px;line-height:1.7;resize:vertical;outline:none;font-family:inherit}
#expandArea:focus{border-color:#a83a67}
.expand__f{display:flex;justify-content:flex-end;gap:10px}
@media (max-width:640px){ .expand{padding:10px} .expand__box{padding:14px;max-height:92vh} #expandArea{min-height:40vh} }

/* ── 页面主标题 ── */
.page__title{font-size:22px;font-weight:600;margin:4px 0 16px;letter-spacing:-.2px}
@media (max-width:640px){ .page__title{font-size:18px;margin:0 0 12px} }

/* ══════════════════════════════════════════════════
   移动端 App 式布局（≤640px）
   ══════════════════════════════════════════════════ */
@media (max-width: 640px) {
  :root { --rail-h: 58px; }

  /* 顶栏：只留 Logo + 右侧动作 */
  .top { height: 50px; padding: 0 14px; gap: 8px; }
  .top__right { gap: 8px; }
  .btn--sm { height: 30px; padding: 0 12px; font-size: 13px; border-radius: 999px; }
  .foot { display: none; }

  /* 主区域：给底部输入条 + 底部导航留出空间 */
  .shell { padding: 0; }
  .main--gen {
    padding: 12px 12px calc(var(--rail-h) + env(safe-area-inset-bottom, 0px) + 168px) 12px;
    min-height: calc(100vh - 50px);
    display: flex; flex-direction: column;
  }

  /* 空态：在剩余空间里居中，不再顶在天上 */
  .blank {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 0 20px; text-align: center; min-height: 240px;
  }
  .blank__ico { width: 56px; height: 56px; margin-bottom: 14px; }
  .blank__ico svg { width: 100%; height: 100%; }
  .blank__title { font-size: 16px; margin-bottom: 6px; }
  .blank__desc { font-size: 13px; line-height: 1.6; color: #86868b; }

  /* 历史结果两列小图 */
  .hist { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 10px; }

  /* 输入条：吸底卡片 */
  .composer {
    position: fixed; left: 8px; right: 8px;
    bottom: calc(var(--rail-h) + env(safe-area-inset-bottom, 0px) + 18px);
    z-index: 60;
    border-radius: 18px; padding: 8px 12px 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,.08), 0 1px 0 rgba(0,0,0,.03);
    background: #fff;
    margin: 0;
  }

  /* 模式切换缩小 */
  .modeswitch { padding: 2px; margin-bottom: 6px; }
  .modeswitch__btn { padding: 5px 14px; font-size: 12.5px; }

  /* 第一行：素材 + 输入框，同一基线 */
  .composer__top { display: flex; align-items: flex-start; gap: 8px; }
  .assets { flex: 0 0 auto; }
  .assets__add {
    width: 34px; height: 34px; border-radius: 10px;
    padding: 0; gap: 0; font-size: 0;
  }
  .assets__add svg { width: 17px; height: 17px; }
  .assets__list { display: none; }        /* 已选素材用编号条，不占输入行 */
  .composer__input { flex: 1; min-width: 0; min-height: 0; }
  .composer__input textarea { flex: 0 0 auto; padding: 0; }
  #prompt {
    width: 100%; height: 44px; min-height: 44px; max-height: 112px;
    font-size: 15px; line-height: 1.45; padding: 10px 0 0;
    border: none; background: transparent; resize: none;
    overflow-y: auto;
  }
  #prompt:focus { outline: none; }
  .composer__expand { display: none; }

  /* 第二行：参数 + 生成，等宽两栏 */
  .composer__bottom {
    display: flex; align-items: center; gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px; padding-top: 8px;
    border-top: 1px solid #f0f0f2;
  }
  /* 模型占第一行剩余宽度 */
  .composer__params { flex: 1 1 auto; }
  .composer__params .dd { flex: 1 1 auto; width: 100%; }
  .composer__params .dd__btn { width: 100%; max-width: none; justify-content: space-between; }
  .composer__params .dd__val { max-width: none; flex: 1; text-align: left; }
  /* 参数按钮第一行右侧 */
  .dd__btn--sum { flex: 0 0 auto; max-width: none; }
  .dd__btn--sum .dd__val { max-width: none; }
  /* 生成整行第二行（要压过 .composer__bottom .run 的 flex:0 0 auto） */
  .composer__bottom .run {
    flex: 1 0 100%; order: 9; margin-left: 0;
    height: 42px; font-size: 15.5px; border-radius: 12px;
    justify-content: center;
  }
  .composer__spacer { display: none; }
  /* 模型选择保留，压缩成小药丸，与参数/生成同一行 */
  .composer__params { display: flex; align-items: center; gap: 6px; flex: 0 1 auto; min-width: 0; order: 0; }
  .composer__params .dd { flex: 0 1 auto; min-width: 0; }
  .composer__params .dd__btn {
    height: 36px; padding: 0 10px; border-radius: 10px;
    font-size: 12.5px; max-width: none;
  }
  .composer__params .dd__val {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .composer__params .dd__k { display: none; }   /* 手机上隐藏"模型"两字，省空间 */
  .dd--up { position: static; }
  .dd__btn--sum {
    height: 36px; padding: 0 12px; border-radius: 10px;
    font-size: 12.5px; flex: 0 0 auto;
  }
  .dd__btn--sum .dd__val { max-width: none; overflow: visible; }
  .free-hint { display: none; }
  .run {
    flex: 1 1 auto; min-width: 84px; height: 38px; border-radius: 12px;
    font-size: 14.5px; font-weight: 600;
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  }

  /* 参数弹层：底部抽屉 */
  #ddSettings .dd__menu {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    width: 100%; min-width: 0; max-width: none;
    max-height: 82vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 32px rgba(0,0,0,.16);
    padding: 0 18px calc(20px + env(safe-area-inset-bottom));
    z-index: 120;
    /* 这里千万不能写 display:block —— 那会让抽屉在手机上永远展开、关不掉。
       显隐交给 .dd.is-open 控制（见 .dd.is-open .dd__menu） */
  }
  #ddSettings .dd__menu::before {
    content: "参数设置"; display: block;
    position: sticky; top: 0; z-index: 2;
    background: #fff; border-bottom: 1px solid #f0f0f2;
    margin: 0 -18px 4px; padding: 16px 18px 12px;
    font-size: 15px; font-weight: 600; text-align: center;
  }
  #ddSettings .dd__menu::after {
    content: ""; display: block; position: absolute;
    left: 50%; transform: translateX(-50%); top: 7px;
    width: 36px; height: 4px; border-radius: 99px; background: #e0e0e4;
  }
  .setpanel { min-width: 0; max-width: none; width: 100%; max-height: none; overflow: visible; padding: 0 18px 18px; }
  .setpanel__done{position:sticky;bottom:0;margin:8px -18px 0;padding:12px 18px calc(12px + env(safe-area-inset-bottom,0px));
    background:linear-gradient(180deg,rgba(255,255,255,0),#fff 22%);}
  .setpanel__done button{height:44px;border-radius:12px;font-size:15px;}
  .setpanel__grp { padding: 12px 0; }
  .setpanel__l { font-size: 13px; margin-bottom: 9px; }
  .setpanel__opts { gap: 8px; }
  .setpanel__opts--ratio { gap: 9px; }
  .ratio { width: 64px; padding: 12px 0 10px; border-radius: 14px; }
  .ratio__t { font-size: 13px; }
  .setpanel__opt { height: 32px; padding: 0 13px; font-size: 13px; }
  .setpanel__inp { height: 34px; max-width: none; font-size: 14px; }
  .rng { gap: 10px; }
  .rng__v { font-size: 13px; min-width: 42px; text-align: right; }
  #ddSettings.is-open::before {
    content: ""; position: fixed; inset: 0;
    background: rgba(0,0,0,.35); z-index: 110;
  }

  /* 底部导航：全宽 tab bar */
  .rail {
    left: 0; right: 0; bottom: 0; top: auto;
    width: 100%;
    height: calc(var(--rail-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    flex-direction: row; justify-content: space-around;
    align-items: center; gap: 0; padding: 0;
    background: rgba(255,255,255,.96);
    backdrop-filter: saturate(180%) blur(16px);
    border-top: 1px solid #e5e5ea;
    z-index: 70;                 /* 高于输入条(60)，图标永不被盖 */
  }
  .rail__item {
    flex: 1; width: auto; height: 100%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 2px;
    border-radius: 0; font-size: 11px; color: #86868b;
  }
  .rail__item svg { width: 21px; height: 21px; }
  .rail__item[aria-current="page"] { color: #a83a67; background: transparent; }

  /* 资产页 */
  .main { padding: 14px 12px calc(var(--rail-h) + env(safe-area-inset-bottom, 0px) + 16px); }
  .page__title { font-size: 19px; margin: 0 0 10px; }
  .subbar { gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
  .subbar__seg { white-space: nowrap; flex: 0 0 auto; }
  .subbar__seg button { padding: 6px 13px; font-size: 13px; white-space: nowrap; flex: 0 0 auto; }
  .subbar__seg[style] { margin-left: 0 !important; }
  .viewtoggle { display: none; }
  .subbar .dd { flex: 0 0 auto; }
  .subbar .btn--sm { flex: 0 0 auto; }
  .top .icon-btn[aria-label="通知"], .top .icon-btn[data-toast] { display: none; }
  .assets { grid-template-columns: repeat(2, 1fr) !important; gap: 8px; }
  .empty-block { padding: 56px 16px; font-size: 13px; text-align: center; grid-column: 1 / -1; width: 100%; }

  /* 弹窗 */
  .modal {
    left: 12px; right: 12px; top: auto; bottom: 12px;
    width: auto; max-height: 88vh; border-radius: 20px;
  }
  .modal__body { padding: 16px; }
  .expand { padding: 0; align-items: flex-end; }
  .expand__box { border-radius: 20px 20px 0 0; max-height: 92vh; padding: 16px; }
}

/* ── 参数抽屉底部按钮 ── */
.setpanel__done{margin:10px 0 2px;padding:0;}
.setpanel__done button{width:100%;height:40px;border-radius:10px;border:none;background:var(--accent);color:#fff;
  font-size:14px;font-weight:600;cursor:pointer}
.setpanel__done button:hover{filter:brightness(.95)}
.setpanel__done button:active{opacity:.9}

/* ── 比例选择器：形状图标 + 数字 ── */
.setpanel__opts--ratio { gap: 8px; }
.ratio {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; width: 62px; min-height: 62px; padding: 11px 0 9px; border-radius: 13px;
  background: var(--fill-2); border: 1px solid transparent; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.ratio:hover { background: var(--fill-3); }
.ratio__ico {
  display: block; border: 1.8px solid currentColor; border-radius: 3px;
  color: var(--ink); opacity: .9; flex: 0 0 auto;
}
.ratio__t { font-size: 12px; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.ratio[aria-selected="true"] { background: var(--accent); border-color: var(--accent); }
.ratio[aria-selected="true"] .ratio__ico { color: #fff; opacity: 1; }
.ratio[aria-selected="true"] .ratio__t { color: #fff; }

/* 图裂了就整块收掉，绝不把 alt 文字铺成一大堵墙 */
.is-broken{display:none!important}
.hist__item img,.card__img,.job__cell img{max-width:100%;overflow:hidden}

/* 空状态推荐词：把大片空白变成可点的引导 */
.blank__chips{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:22px;max-width:620px}
.blank__chip{appearance:none;border:1px solid var(--line);background:#fff;border-radius:12px;padding:11px 12px;font-size:13px;color:var(--muted);cursor:pointer;transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease;line-height:1.35}
.blank__chip:hover{transform:translateY(-1px);border-color:var(--accent);color:var(--accent);box-shadow:0 6px 18px rgba(168,58,103,.10)}
@media (max-width:700px){.blank__chips{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.blank__chip{font-size:12px;padding:9px 10px}}

/* ── 对话式作品流（对齐 SWIV 那种一条条记录） ── */
.feed{gap:26px}
.msg{background:#fff;border:1px solid var(--line);border-radius:18px;padding:16px 18px 12px;width:100%;max-width:820px;margin:0 0 22px}
.msg__head{display:flex;align-items:center;gap:10px;font-size:12px;color:#8a8a90;margin-bottom:8px}
.msg__model{font-weight:600;color:var(--ink);background:var(--tint);border-radius:999px;padding:2px 9px}
.msg__time{margin-left:auto}
.msg__prompt{font-size:13.5px;line-height:1.7;color:#3a3a3f;margin:0 0 12px;white-space:pre-wrap;word-break:break-word}
.msg__media{display:flex;justify-content:flex-start;border-radius:12px;overflow:hidden;background:transparent}
/* 图片按原始比例显示，不拉满整行 —— 参考 SWIV：宽度自适应、高度封顶 460px */
.msg__img{display:block;width:auto;height:auto;max-width:100%;max-height:460px;object-fit:contain;border-radius:12px;background:#fafafa}
.msg__fail{padding:38px 16px;text-align:center;color:#b03030;font-size:13px;background:#fdf3f3}
.msg__acts{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px}
.msg__act{display:inline-flex;align-items:center;gap:5px;appearance:none;border:1px solid transparent;background:transparent;color:#6b6b72;font-size:12.5px;padding:6px 10px;border-radius:9px;cursor:pointer;transition:background .15s,color .15s}
.msg__act svg{width:15px;height:15px}
.msg__act:hover{background:var(--fill-2);color:var(--ink)}
.msg__act--del:hover{background:#fdf0f0;color:#c03030}
.msg__act:disabled{opacity:.45;cursor:default}
@media (max-width:760px){.msg{padding:12px 12px 8px;border-radius:14px;margin-bottom:16px}.msg__img{max-height:400px}}

/* 图裂占位：卡片保留，删除按钮必须还能点 */
.img--dead{display:none!important}
.ph--dead{display:grid;place-items:center;min-height:180px;padding:28px 16px;color:#8a8a90;font-size:13px;background:#fafafa;border-radius:12px;text-align:center}
.card .ph--dead{min-height:160px;border-radius:0}

/* ── 图片预览灯箱 ── */
.lightbox{position:fixed;inset:0;background:rgba(10,10,12,.88);display:none;align-items:center;justify-content:center;z-index:400;cursor:zoom-out;padding:24px}
.lightbox.is-on{display:flex}
.lightbox img{max-width:96vw;max-height:92vh;border-radius:12px;box-shadow:0 24px 70px rgba(0,0,0,.55);cursor:default;background:#111}
.lightbox__x{position:absolute;top:16px;right:20px;width:38px;height:38px;border-radius:999px;border:0;background:rgba(255,255,255,.14);color:#fff;font-size:22px;line-height:1;cursor:pointer}
.lightbox__x:hover{background:rgba(255,255,255,.26)}

/* ── 图片再小一点，比例更好看 ── */
.msg__img{max-height:380px!important;border-radius:10px}
.job__cell img{max-height:380px;object-fit:contain;background:#fafafa}

/* ── 批量任务：同一张卡里排成一行 ── */
.job__grid.n2{grid-template-columns:repeat(2,1fr)}
.job__grid.n4{grid-template-columns:repeat(4,1fr);grid-template-rows:1fr}
@media (max-width:760px){
  .job__grid.n4{grid-template-columns:repeat(2,1fr);grid-template-rows:1fr 1fr}
  .msg__img{max-height:300px!important}
}

/* 数量选择器按钮 */
.dd__btn--cnt{min-width:56px;justify-content:center;font-variant-numeric:tabular-nums}

/* 卡片上的本次参数摘要 */
.msg__params{font-size:12px;color:#8a8a90;margin:-6px 0 10px;line-height:1.6;word-break:break-word}

/* 批量卡：一排图 */
.msgb{display:flex;gap:8px;flex-wrap:nowrap;overflow-x:auto;padding-bottom:4px}
.msgb__cell{flex:1 1 0;min-width:0;border-radius:10px;overflow:hidden;background:#fafafa}
.msgb__cell .job__fail{min-height:150px;display:grid;place-items:center;color:#b03030;font-size:13px;background:#fdf3f3}
.msgb__img{display:block;width:100%;height:auto;max-height:300px;object-fit:contain;cursor:zoom-in}
.msgb--n1{max-width:420px}
@media (max-width:760px){.msgb{flex-wrap:nowrap}.msgb__img{max-height:200px}}
.msg__img{cursor:zoom-in}

/* ── 显示区比输入框宽：图片不用挤在窄列里（参考站的做法） ── */
.msg{max-width:1080px!important}
.msg__img{max-height:420px!important}
.job{max-width:1080px!important}

/* 批量卡：等宽单元格，按 1:1 排，不再撑出大片灰底 */
.msgb{display:grid;gap:8px;grid-auto-flow:column;grid-auto-columns:1fr;overflow:visible;padding-bottom:2px}
.msgb__cell{position:relative;display:grid;place-items:center;background:#f4f4f6;border-radius:10px;aspect-ratio:1/1;overflow:hidden}
.msgb__img{width:100%;height:100%;object-fit:cover;display:block;cursor:zoom-in;max-height:none}
.msgb__cell .job__fail{position:absolute;inset:0;display:grid;place-items:center;color:#b03030;font-size:12.5px;background:#fdf3f3}
.msgb--n1{grid-auto-columns:minmax(0,420px)}
@media (max-width:760px){
  .msgb{grid-auto-flow:row;grid-template-columns:1fr 1fr}
  .msg{max-width:100%!important}
}

/* 批量卡：flex 布局，少图不撑满、多图自动缩，最多 320px 一张 */
.msgb{display:flex!important;gap:8px;justify-content:flex-start;grid-auto-flow:unset!important}
.msgb__cell{flex:1 1 0;min-width:0;max-width:320px;aspect-ratio:1/1}
.msgb--n1 .msgb__cell{max-width:420px}
.msgb__dl{position:absolute;right:8px;bottom:8px;width:30px;height:30px;border-radius:999px;border:0;
  background:rgba(0,0,0,.52);color:#fff;display:grid;place-items:center;cursor:pointer;
  opacity:.92;transition:background .15s,transform .15s;z-index:3}
.msgb__dl svg{width:16px;height:16px}
.msgb__dl:hover{background:rgba(0,0,0,.78);transform:scale(1.06)}
@media (max-width:760px){.msgb{flex-wrap:wrap}.msgb__cell{max-width:none;flex:1 1 calc(50% - 8px)}}

/* ── 首屏防闪：/api/me 没回来之前，右上角先不显示「登录」 ── */
body.booting .top__right{visibility:hidden}

/* ── 账号小窗 ── */
.modal--acct{max-width:560px;padding:0;overflow:hidden;border-radius:18px}
.modal--acct .acctm{position:relative;background:#fff}
.acctm__x{position:absolute;top:12px;right:14px;width:32px;height:32px;border:0;border-radius:999px;background:transparent;font-size:22px;line-height:1;color:#8a8a90;cursor:pointer;z-index:2}
.acctm__x:hover{background:#f0f0f3;color:#1d1d1f}
.acctm__tabs{display:flex;gap:22px;padding:18px 24px 0;border-bottom:1px solid #ececf0}
.acctm__tab{appearance:none;border:0;background:transparent;padding:0 0 12px;font-size:14px;color:#8a8a90;cursor:pointer;position:relative}
.acctm__tab.is-on{color:#1d1d1f;font-weight:600}
.acctm__tab.is-on::after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:2px;background:#1d1d1f;border-radius:2px}
.acctm__body{padding:22px 24px 20px;max-height:62vh;overflow:auto}
.acctm__id{display:flex;gap:16px;align-items:flex-start;margin-bottom:20px}
.acctm__av{width:64px;height:64px;border-radius:999px;background:#b03a8f;color:#fff;display:grid;place-items:center;font-size:22px;font-weight:600;flex:0 0 auto}
.acctm__lbl{font-size:12.5px;color:#8a8a90;margin-bottom:3px}
.acctm__val{font-size:14px;color:#1d1d1f;font-weight:500}
.acctm__row{display:flex;justify-content:space-between;align-items:center;padding:12px 0;border-top:1px solid #f0f0f3;font-size:13.5px;color:#48484d}
.acctm__row b{color:#1d1d1f;font-weight:600}
.acctm__redeem{display:flex;gap:8px;margin-top:16px}
.acctm__redeem input{flex:1;padding:10px 12px;border:1px solid #e0e0e5;border-radius:10px;font-size:13px}
.acctm__foot{display:flex;justify-content:flex-end;margin-top:16px}
.acctm__hint{font-size:12.5px;color:#8a8a90;margin-bottom:10px}
.acctm__item{display:flex;justify-content:space-between;gap:12px;padding:10px 0;border-bottom:1px solid #f2f2f5;font-size:13px;color:#48484d}
.acctm__item b{color:#1d1d1f}
.acctm__item span{color:#8a8a90;font-variant-numeric:tabular-nums}
.hide{display:none!important}

/* ── 生成中：环形进度（真实百分比驱动）+ 呼吸光晕 ── */
.job__cell.sk{background:linear-gradient(180deg,#fafafc 0%,#f3f3f6 100%)}
.job__cell.sk::after{display:none}          /* 去掉原来那条压暗渐变 */
.genfx{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none}
.genfx__svg{width:84px;height:84px;transform:rotate(-90deg);overflow:visible}
.genfx__track{fill:none;stroke:rgba(168,58,103,.13);stroke-width:5}
.genfx__bar{fill:none;stroke:url(#none);stroke:#b03a76;stroke-width:5;stroke-linecap:round;
  stroke-dasharray:213.63;stroke-dashoffset:213.63;
  transition:stroke-dashoffset .32s cubic-bezier(.4,0,.2,1);
  filter:drop-shadow(0 0 6px rgba(176,58,118,.35))}
.genfx__pct{position:absolute;font-size:15px;font-weight:700;color:#b03a76;
  font-variant-numeric:tabular-nums;letter-spacing:.3px}
.genfx::before{content:"";position:absolute;width:84px;height:84px;border-radius:999px;
  background:radial-gradient(circle,rgba(176,58,118,.14) 0%,rgba(176,58,118,0) 68%);
  animation:genPulse 2.2s ease-in-out infinite}
@keyframes genPulse{0%,100%{transform:scale(1);opacity:.75}50%{transform:scale(1.22);opacity:.35}}

/* ── 提示词固定高度，超出省略 ── */
.msg__prompt{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;cursor:pointer}
.msg__prompt.is-open{-webkit-line-clamp:unset;display:block}

/* 回到底部悬浮按钮 */
.jumpbtn{position:fixed;right:24px;bottom:190px;width:42px;height:42px;border-radius:999px;border:1px solid var(--line);
  background:#fff;color:#48484d;display:grid;place-items:center;cursor:pointer;box-shadow:0 6px 20px rgba(0,0,0,.10);
  opacity:0;visibility:hidden;transform:translateY(8px);transition:.2s;z-index:120}
.jumpbtn.is-on{opacity:1;visibility:visible;transform:none}
.jumpbtn:hover{background:var(--accent);color:#fff;border-color:var(--accent)}
.jumpbtn svg{width:18px;height:18px}
@media (max-width:760px){.jumpbtn{right:14px;bottom:170px;width:38px;height:38px}}

/* 模型下拉里的积分价：艺术字高亮，别和模型名一个样 */
.dd__price{display:inline-flex;align-items:baseline;gap:2px;margin-left:8px;padding:2px 9px 3px;border-radius:999px;
  font-style:normal;font-size:12.5px;letter-spacing:.2px;color:#fff;
  background:linear-gradient(135deg,#c2347a 0%,#a83a67 45%,#7e2a55 100%);
  box-shadow:0 3px 10px rgba(168,58,103,.28), inset 0 1px 0 rgba(255,255,255,.25);
  text-shadow:0 1px 1px rgba(0,0,0,.18)}
.dd__price b{font-size:14px;font-weight:800;font-variant-numeric:tabular-nums;letter-spacing:.3px;
  background:linear-gradient(180deg,#fff 25%,#ffd9e8 100%);-webkit-background-clip:text;background-clip:text;color:transparent}

/* 账号小窗：覆盖基础 modal 的宽度限制 */
.modal.modal--acct{width:min(560px,calc(100% - 32px));padding:0}

/* 生成中卡片：媒体区原本是 flex，canvas 会被压成 0 宽，这里给死宽度 */
.msg--live .job__canvas{width:min(100%,420px);flex:0 0 auto;border-radius:12px;overflow:hidden}
.msg--live .job__grid{width:100%;height:100%}
.msg--live .msg__media{overflow:visible}

/* 失败卡：保留卡片 + 显示原因 */
.msg__fail{display:flex;align-items:center;justify-content:center;min-height:120px;padding:18px 20px;
  background:#fdf4f4;border:1px solid #f6dede;border-radius:12px;color:#a63a3a;font-size:13.5px;line-height:1.6;text-align:center;word-break:break-word}
.msgb__cell .job__fail{padding:10px;text-align:center;line-height:1.5;font-size:12px}
.job__fail{padding:10px;text-align:center;line-height:1.5}

/* 单格出图时的小高亮 */
.job__cell.is-pop{box-shadow:0 0 0 2px rgba(176,58,118,.45) inset;transition:box-shadow .3s}
.job__cell img{width:100%;height:100%;object-fit:cover;display:block}
.msg--batch .job__grid{width:100%}
.msg--batch .job__cell{aspect-ratio:1/1;background:#f4f4f6}

/* 灯箱：小图先柔、原图到了再清晰 */
.lightbox img.is-soft{filter:blur(1.2px);transform:scale(1.004)}
.lightbox img{transition:opacity .2s,filter .18s,transform .18s}

/* ══ 修：生成中 / 已完成 卡片里的多图布局 ══
   以前 canvas 用 aspect-ratio:1/1，4 张图只占左边一小条，右边一片空白，
   下面还拖出一个巨大的灰块。改成 flex 一行铺满，每格自身 1:1。 */
.msg--live .job__canvas,
.msg--batch .job__canvas{
  width:100%!important;max-width:none!important;
  height:auto!important;aspect-ratio:auto!important;
  background:transparent!important;overflow:visible!important;
  border-radius:0!important;
}
.msg--live .job__grid,
.msg--batch .job__grid,
.job__grid{
  display:flex!important;
  gap:8px;
  width:100%;
  height:auto!important;
  grid-template-columns:none!important;
  grid-template-rows:none!important;
}
.msg--live .job__cell,
.msg--batch .job__cell,
.job__cell{
  flex:1 1 0;
  min-width:0;
  max-width:340px;
  aspect-ratio:1/1;
  border-radius:10px;
  overflow:hidden;
  position:relative;
  background:#f4f4f6;
}
.job__cell img{width:100%!important;height:100%!important;object-fit:cover;display:block}
.job__cell.sk::after{display:none}
.job__cell .job__acts{position:absolute;inset:auto 0 0 0;display:flex;justify-content:flex-end;gap:6px;padding:8px}
.job__cell .act{width:30px;height:30px;border-radius:999px;border:0;background:rgba(0,0,0,.52);color:#fff;display:grid;place-items:center;cursor:pointer}
.job__cell .act svg{width:15px;height:15px}
@media (max-width:760px){
  .job__grid{flex-wrap:wrap}
  .job__cell{flex:1 1 calc(50% - 8px);max-width:none}
}

/* 进度环里的秒数 */
.genfx{display:grid;place-items:center}
.genfx__svg{position:absolute}
.genfx__pct{position:relative;font-size:15px;line-height:1;margin-top:-6px}
.genfx__sec{position:relative;font-size:11px;color:#9a9aa2;margin-top:3px;font-variant-numeric:tabular-nums}

/* 完成格的图片：aspect-ratio 容器里 height:100% 不生效，必须绝对定位，否则只露顶上一条 */
.job__cell img{position:absolute;inset:0;width:100%!important;height:100%!important;object-fit:cover;display:block}
.job__cell .job__acts{z-index:3}
.msgb__img{position:absolute;inset:0;width:100%!important;height:100%!important;object-fit:cover}
.msgb__cell{position:relative}

/* ── 问题反馈小窗口 ───────────────────────────────── */
.fbmodal{
  position:fixed; left:50%; top:50%; transform:translate(-50%,-48%);
  width:min(520px,calc(100vw - 32px));
  background:#fff; border-radius:16px; z-index:1200;
  box-shadow:0 24px 70px rgba(20,16,30,.28);
  padding:26px 26px 20px;
  opacity:0; visibility:hidden; pointer-events:none;
  transition:opacity .22s var(--ease), transform .22s var(--ease), visibility .22s;
}
.fbmodal.is-on{opacity:1; visibility:visible; pointer-events:auto; transform:translate(-50%,-50%)}
.fbmodal__t{font-size:17px; font-weight:700; margin:0 0 8px; color:#1b1b20}
.fbmodal__d{font-size:13px; color:#71717a; margin:0 0 14px; line-height:1.6}
.fbmodal__ta{
  width:100%; box-sizing:border-box; resize:vertical; min-height:130px;
  border:1px solid #e6e6ea; border-radius:10px; padding:12px 13px;
  font:inherit; font-size:14px; line-height:1.65; color:#1b1b20;
  outline:none; transition:border-color .18s, box-shadow .18s;
}
.fbmodal__ta:focus{border-color:#b03a76; box-shadow:0 0 0 3px rgba(176,58,118,.12)}
.fbmodal__foot{display:flex; align-items:center; justify-content:space-between; margin-top:12px; gap:12px}
.fbmodal__n{font-size:12px; color:#a1a1aa; font-variant-numeric:tabular-nums}
.fbscrim{position:fixed; inset:0; background:rgba(15,12,24,.42); z-index:1190;
  opacity:0; visibility:hidden; transition:opacity .22s, visibility .22s}
.fbscrim.is-on{opacity:1; visibility:visible}

/* ── 套餐/充值列表 ─────────────────────────────────── */
.acctm__buy{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px 16px}
.acctm__buyinfo{display:flex;flex-direction:column;gap:3px;min-width:0}
.acctm__buyinfo b{font-size:14px;color:#1b1b20}
.acctm__buyinfo span{font-size:12.5px;color:#8b8b93}
.acctm__buy .btn{flex:0 0 auto}

/* ── 站内付款码弹窗 ─────────────────────────────── */
.payqr{position:fixed;inset:0;z-index:1300;display:grid;place-items:center;
  background:rgba(15,12,24,.55);opacity:0;visibility:hidden;transition:opacity .2s,visibility .2s}
.payqr.is-on{opacity:1;visibility:visible}
.payqr__card{position:relative;width:min(360px,calc(100vw - 40px));background:#fff;border-radius:18px;
  padding:26px 24px 22px;text-align:center;box-shadow:0 28px 80px rgba(20,16,30,.3)}
.payqr__x{position:absolute;top:10px;right:12px;width:30px;height:30px;border:0;background:transparent;
  font-size:20px;line-height:1;color:#9a9aa2;cursor:pointer;border-radius:8px}
.payqr__x:hover{background:#f4f4f6;color:#41414a}
.payqr__t{font-size:15px;font-weight:700;color:#1b1b20;margin-bottom:16px}
.payqr__box{width:200px;height:200px;margin:0 auto;border:1px solid #eee;border-radius:12px;
  display:grid;place-items:center;background:#fafafa;overflow:hidden}
.payqr__img{width:100%;height:100%;object-fit:contain;display:block}
.payqr__meta{margin-top:14px;font-size:13px;color:#41414a;line-height:1.7}
.payqr__s{display:flex;align-items:center;justify-content:center;gap:7px;margin-top:12px;
  font-size:13px;color:#b03a76;font-weight:600}
.payqr__dot{width:8px;height:8px;border-radius:99px;background:#b03a76;animation:payDot 1.1s ease-in-out infinite}
@keyframes payDot{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.35;transform:scale(.8)}}
.payqr.is-ok .payqr__s{color:#2f9e44}
.payqr.is-ok .payqr__dot{background:#2f9e44;animation:none}
.payqr__tip{margin-top:12px;font-size:12px;color:#a1a1aa;line-height:1.6}

/* ── 充值独立弹窗 ───────────────────────────────── */
.paymodal{position:fixed;inset:0;z-index:1250;display:grid;place-items:center;
  background:rgba(15,12,24,.5);opacity:0;visibility:hidden;transition:opacity .2s,visibility .2s;
  padding:24px;overflow:auto}
.paymodal.is-on{opacity:1;visibility:visible}
.paymodal__card{position:relative;width:min(460px,calc(100vw - 32px));background:#fff;border-radius:18px;
  padding:26px 24px 22px;box-shadow:0 28px 80px rgba(20,16,30,.28)}
.paymodal__x{position:absolute;top:12px;right:14px;width:30px;height:30px;border:0;background:transparent;
  font-size:20px;line-height:1;color:#9a9aa2;cursor:pointer;border-radius:8px}
.paymodal__x:hover{background:#f4f4f6;color:#41414a}
.paymodal__t{font-size:17px;font-weight:700;color:#1b1b20}
.paymodal__tabs{display:flex;gap:6px;margin:14px 0 18px;border-bottom:1px solid #f0f0f3}
.paymodal__tab{border:0;background:transparent;padding:8px 4px 10px;margin-right:18px;font:inherit;
  font-size:14px;color:#8b8b93;cursor:pointer;position:relative}
.paymodal__tab.is-on{color:#1b1b20;font-weight:700}
.paymodal__tab.is-on::after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:2px;
  background:#b03a76;border-radius:2px}
.paymodal__body.hide{display:none}
.paymodal__hint{font-size:13px;color:#71717a;margin-bottom:12px;line-height:1.6}
.paymodal__sub{font-size:12.5px;color:#9a9aa2;margin:18px 0 8px}
.paymodal__redeem{display:flex;gap:8px}
.paymodal__redeem input{flex:1;min-width:0;padding:10px 12px;border:1px solid #e6e6ea;border-radius:10px;
  font:inherit;outline:none;letter-spacing:.5px}
.paymodal__redeem input:focus{border-color:#b03a76;box-shadow:0 0 0 3px rgba(176,58,118,.1)}
.paymodal__redeem .btn{flex:0 0 auto}
@media (max-width:520px){.paymodal__card{padding:22px 18px 18px}}

/* ── 会员套餐条目 ───────────────────────────────── */
.acctm__buy--plan{align-items:flex-start}
.acctm__intro{display:block;margin-top:5px;font-size:12px;color:#a1a1aa;font-style:normal;line-height:1.6}
.acctm__buyact{display:flex;flex-direction:column;align-items:flex-end;gap:8px;flex:0 0 auto}
.acctm__price{font-size:15px;font-weight:700;color:#b03a76;white-space:nowrap}

/* ── 顶部公告跑马灯 ─────────────────────────────── */
.anno{position:sticky;top:0;z-index:61;overflow:hidden;height:36px;display:flex;align-items:center;
  background:linear-gradient(90deg,#b03a76,#7c5cd6 55%,#b03a76);
  background-size:220% 100%;animation:annoFlow 9s linear infinite;color:#fff}
@keyframes annoFlow{0%{background-position:0% 0}100%{background-position:220% 0}}
.anno[hidden]{display:none}
.anno__track{display:flex;align-items:center;gap:64px;white-space:nowrap;
  padding-left:100%;animation:annoScroll 26s linear infinite;will-change:transform}
@keyframes annoScroll{0%{transform:translateX(0)}100%{transform:translateX(-100%)}}
.anno:hover .anno__track{animation-play-state:paused}
.anno__item{font-size:13px;font-weight:600;letter-spacing:.2px;flex:0 0 auto}
.anno__ico{display:inline-block;margin-right:7px;opacity:.9}
.anno__x{position:absolute;right:10px;top:50%;transform:translateY(-50%);z-index:3;
  width:24px;height:24px;border:0;border-radius:50%;background:rgba(255,255,255,.22);
  color:#fff;font-size:15px;line-height:1;cursor:pointer;display:grid;place-items:center;
  font-family:system-ui,sans-serif}
.anno__x:hover{background:rgba(255,255,255,.32)}
.anno::after{content:"";position:absolute;right:40px;top:0;bottom:0;width:56px;z-index:2;
  background:linear-gradient(90deg,rgba(176,58,118,0),rgba(140,72,168,.92));pointer-events:none}
@media (max-width:820px){.anno{height:32px}.anno__item{font-size:12px}}

/* 公告条固定在最上面时，把原来的吸顶头部往下推，别被盖住 */
body.has-anno .top{top:36px}
@media (max-width:820px){body.has-anno .top{top:32px}}

/* 不用 emoji（部分环境缺字体会显示成方块），改内联图标 */
.anno__ico{width:14px;height:14px;flex:0 0 auto;margin-right:8px;vertical-align:-2px;opacity:.95}
.anno__item{display:inline-flex;align-items:center}

/* ── 小屏：参数抽屉要盖过底部导航，弹窗要能真正居中 ───────────── */
.setpanel__close {
  position: absolute; right: 12px; top: 12px; z-index: 3;
  width: 30px; height: 30px; border: 0; border-radius: 999px;
  background: #f2f2f5; color: #6b6b73; font-size: 20px; line-height: 1;
  display: none; cursor: pointer;
}
.setpanel__close:hover { background: #e8e8ec; color: #1d1d1f; }

@media (max-width: 760px) {
  /* 抽屉挂在 .composer-wrap(z-index:55) 里，不抬起来会被底部导航(z-index:70)盖住 */
  body.setpanel-open .composer-wrap { z-index: 300; }
  body.setpanel-open #ddSettings .dd__menu { z-index: 310; }
  body.setpanel-open .rail { z-index: 60; }

  /* 注意：这里不能改 position（上面那条已经是 fixed 贴底），只调高度 */
  #ddSettings .dd__menu { max-height: 78vh; }
  .setpanel { position: relative; }
  .setpanel__close { display: grid; place-items: center; }

  /* 手机端弹窗：清掉桌面用的 translate(-50%,-50%)，否则会被推到屏幕左侧外 */
  .modal, .modal.is-open { transform: none; }
  .modal--acct { left: 10px; right: 10px; width: auto; max-width: none; }
  .acctm__body { max-height: 58vh; }
}

/* 抽屉底部「完成」：点它关闭（小屏唯一稳妥的关闭方式） */
@media (max-width: 760px) {
  .setpanel__done { cursor: pointer; }
}

/* ══════════════════════════════════════════════════════════
   深色模式按钮 + 写死浅色的面统一改成深色
   ══════════════════════════════════════════════════════════ */
.themebtn {
  width: 32px; height: 32px; flex: 0 0 auto; padding: 0;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--muted); cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.themebtn:hover { background: var(--fill-2); color: var(--ink); }
.themebtn svg { width: 17px; height: 17px; }
.themebtn__moon { display: none; }
[data-theme="dark"] .themebtn__sun { display: none; }
[data-theme="dark"] .themebtn__moon { display: block; }
@media (max-width: 760px) {
  .themebtn { width: 30px; height: 30px; }
  .themebtn svg { width: 16px; height: 16px; }
}

[data-theme="dark"] .top { background: rgba(14, 14, 18, .86); }
[data-theme="dark"] .rail { background: transparent; }
[data-theme="dark"] .composer-wrap {
  background: linear-gradient(180deg, rgba(14,14,18,0), rgba(14,14,18,.92) 40%, var(--bg) 76%);
}
[data-theme="dark"] .msg,
[data-theme="dark"] .blank__chip,
[data-theme="dark"] .hist__item,
[data-theme="dark"] .expand__box,
[data-theme="dark"] .modeswitch__btn[aria-selected="true"],
[data-theme="dark"] .act:hover { background: var(--fill-1); }
[data-theme="dark"] .modal--acct .acctm,
[data-theme="dark"] .payqr__card,
[data-theme="dark"] .paymodal__card,
[data-theme="dark"] .acctm__card { background: var(--fill-1); color: var(--ink); }
[data-theme="dark"] .acctm__tabs { border-bottom-color: var(--line); }
[data-theme="dark"] .acctm__row { border-bottom-color: var(--line); }
[data-theme="dark"] .acctm__tab.is-on { color: var(--ink); }
[data-theme="dark"] .acctm__tab.is-on::after { background: var(--accent); }
[data-theme="dark"] .acctm__x:hover { background: var(--fill-2); color: var(--ink); }
[data-theme="dark"] .acctm__buyinfo b { color: var(--ink); }
[data-theme="dark"] .paymodal__redeem input,
[data-theme="dark"] .acctm__redeem input { background: var(--fill-2); color: var(--ink); border-color: var(--line); }
[data-theme="dark"] .payqr__box { background: var(--fill-2); border-color: var(--line); }
[data-theme="dark"] .paymodal__tabs { border-bottom-color: var(--line); }
[data-theme="dark"] .paymodal__tab.is-on { color: var(--ink); }
[data-theme="dark"] .setpanel__close { background: var(--fill-2); color: var(--muted); }
[data-theme="dark"] .lightbox { background: rgba(0,0,0,.92); }
[data-theme="dark"] .modal {
  background: var(--fill-1);
  box-shadow: inset 0 0 0 1px var(--line), 0 30px 80px rgba(0, 0, 0, .6);
}
[data-theme="dark"] .modal__title { color: var(--ink); }
@media (max-width: 760px) {
  [data-theme="dark"] .rail { background: rgba(14,14,18,.96); border-top-color: var(--line); }
  [data-theme="dark"] #ddSettings .dd__menu::before { background: var(--fill-1); border-bottom-color: var(--line); }
  [data-theme="dark"] .setpanel__done { background: linear-gradient(180deg, rgba(14,14,18,0), var(--fill-1) 22%); }
}
[data-theme="dark"] .foot { background: rgba(14, 14, 18, .92); }
[data-theme="dark"] .notice { background: var(--tint); border-bottom-color: rgba(212, 87, 140, .18); }
[data-theme="dark"] .notice__t { color: var(--ink); }
[data-theme="dark"] .userbox__c b { color: var(--ink); }
[data-theme="dark"] .composer { background: var(--fill-1); border-color: var(--line); }
[data-theme="dark"] .run { color: #fff; }
[data-theme="dark"] .dd__menu { background: var(--fill-1); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-2); }
[data-theme="dark"] .dd__btn { color: var(--muted); }
[data-theme="dark"] .dd.is-open .dd__btn { background: var(--fill-2); color: var(--ink); }
[data-theme="dark"] .setpanel__grp { border-bottom-color: var(--line); }
[data-theme="dark"] .setpanel__opt { background: var(--fill-2); color: var(--ink); }
[data-theme="dark"] .setpanel__opt.is-on { background: var(--accent); color: #fff; }
[data-theme="dark"] .assets__add { background: var(--fill-2); border-color: var(--line); color: var(--muted); }
[data-theme="dark"] .blank__chip { color: var(--muted); }
[data-theme="dark"] .msg__prompt, [data-theme="dark"] .msg__params { color: var(--muted); }

/* ══════════════════════════════════════════════════════════
   素材：输入框内联卡片（B 方案）
   ══════════════════════════════════════════════════════════ */
.doccards { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.doccards:empty { display: none; }

.doccard {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 168px; padding: 3px 8px 3px 3px;
  border-radius: 9px; background: var(--fill-2);
  border: 1px solid var(--line);
  cursor: grab; user-select: none;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease);
}
.doccard:hover { background: var(--fill-3); }
.doccard.is-drag { opacity: .45; }
.doccard.is-over { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(168, 58, 103, .18); }
.doccard__img {
  width: 26px; height: 26px; border-radius: 6px; object-fit: cover;
  flex: 0 0 auto; background: var(--fill-3);
}
.doccard__n {
  flex: 0 0 auto; min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 5px; background: var(--accent); color: #fff;
  font-size: 9.5px; font-weight: 700; line-height: 15px; text-align: center;
}
.doccard__name {
  font-size: 11.5px; color: var(--ink); max-width: 78px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.doccard__x {
  flex: 0 0 auto; width: 16px; height: 16px; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); font-size: 13px; line-height: 1;
  cursor: pointer; display: grid; place-items: center;
}
.doccard__x:hover { background: rgba(0, 0, 0, .12); color: var(--ink); }
[data-theme="dark"] .doccard__x:hover { background: rgba(255, 255, 255, .16); }

/* 上传中：环形进度盖在缩略图上 */
.doccard.is-up .doccard__img { opacity: .35; }
.doccard__ring {
  position: absolute; left: 3px; top: 3px; width: 26px; height: 26px;
  display: grid; place-items: center; pointer-events: none;
}
.doccard { position: relative; }
.doccard__ring svg { width: 26px; height: 26px; transform: rotate(-90deg); }
.doccard__ring circle { fill: none; stroke-width: 3; }
.doccard__ring .t { stroke: rgba(255, 255, 255, .55); }
.doccard__ring .b { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .2s linear; }

/* “+N” 与 “+” 按钮 */
.doccards__more, .doccards__add {
  display: inline-flex; align-items: center; justify-content: center;
  height: 34px; min-width: 34px; padding: 0 9px;
  border-radius: 9px; border: 1px dashed var(--line);
  background: transparent; color: var(--muted);
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.doccards__add:hover, .doccards__more:hover { border-color: var(--accent); color: var(--accent); }
.doccards__add svg { width: 15px; height: 15px; }

/* 拖文件到输入框：整块高亮 */
.composer__input.is-drop { background: rgba(168, 58, 103, .07); box-shadow: inset 0 0 0 2px var(--accent); border-radius: 12px; }
.composer__input.is-drop::after {
  content: "松手即可上传素材"; position: absolute; inset: 0;
  display: grid; place-items: center; pointer-events: none;
  font-size: 13px; font-weight: 600; color: var(--accent);
  background: rgba(255, 255, 255, .72); border-radius: 12px;
}
[data-theme="dark"] .composer__input.is-drop::after { background: rgba(14, 14, 18, .78); }
.composer__input { position: relative; }

/* @ 引用菜单 */
.atmenu {
  position: fixed; z-index: 400; width: 268px; max-height: 246px; overflow-y: auto;
  background: var(--fill-1); border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-2);
  padding: 6px;
}
.atmenu[hidden] { display: none; }
.atmenu__it {
  display: flex; align-items: center; gap: 9px; padding: 6px;
  border-radius: 8px; cursor: pointer;
}
.atmenu__it.is-on { background: var(--fill-2); }
.atmenu__it img { width: 30px; height: 30px; border-radius: 7px; object-fit: cover; flex: 0 0 auto; }
.atmenu__it b { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.atmenu__it i { font-style: normal; font-size: 11px; color: var(--muted); }
.atmenu__k {
  margin-left: auto; font-size: 10.5px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 5px; padding: 0 5px;
}
.atmenu__empty { padding: 12px; font-size: 12.5px; color: var(--muted); text-align: center; }

/* ══════════════════════════════════════════════════════════
   提示词输入框：contenteditable + 内联素材 pill
   ══════════════════════════════════════════════════════════ */
.pt {
  min-height: 62px; max-height: 260px; overflow-y: auto;
  padding: 2px 0; font-size: 15px; line-height: 1.62;
  color: var(--ink); outline: none;
  white-space: pre-wrap; word-break: break-word;
  caret-color: var(--accent);
}
/* 输入框不显示占位文字（用户要求去掉） */

/* 内联素材 pill */
.ptag {
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px; margin: 0 3px; padding: 0 8px 0 3px;
  border-radius: 8px;
  background: var(--fill-2);
  border: 1px solid var(--line);
  vertical-align: -7px;
  user-select: none; cursor: default;
  max-width: 190px;
}
.ptag img {
  width: 20px; height: 20px; border-radius: 5px; object-fit: cover; flex: 0 0 auto;
  background: var(--fill-3);
}
.ptag span {
  font-size: 12.5px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ptag__x {
  width: 15px; height: 15px; border-radius: 50%; border: 0; padding: 0;
  background: transparent; color: var(--muted); font-size: 12px; line-height: 1;
  display: grid; place-items: center; cursor: pointer; flex: 0 0 auto;
}
.ptag__x:hover { background: rgba(0,0,0,.12); color: var(--ink); }
[data-theme="dark"] .ptag__x:hover { background: rgba(255,255,255,.18); }
[data-theme="dark"] .ptag { background: var(--fill-2); }

/* @ 菜单：贴在光标下方 */
.atmenu { width: 262px; }
.atmenu__it b { font-size: 12.5px; }

/* ── 深色模式：账号弹窗 / 充值与扫码弹窗的文字对比度 ────────── */
[data-theme="dark"] .acctm__lbl,
[data-theme="dark"] .acctm__hint,
[data-theme="dark"] .acctm__item span,
[data-theme="dark"] .acctm__buyinfo,
[data-theme="dark"] .paymodal__hint,
[data-theme="dark"] .paymodal__sub,
[data-theme="dark"] .payqr__tip,
[data-theme="dark"] .payqr__meta,
[data-theme="dark"] .paymodal__tab,
[data-theme="dark"] .acctm__intro { color: var(--muted); }

[data-theme="dark"] .acctm__val,
[data-theme="dark"] .acctm__row,
[data-theme="dark"] .acctm__row b,
[data-theme="dark"] .acctm__item,
[data-theme="dark"] .acctm__item b,
[data-theme="dark"] .acctm__name,
[data-theme="dark"] .payqr__t,
[data-theme="dark"] .paymodal__t,
[data-theme="dark"] .paymodal__l,
[data-theme="dark"] .acctm__buyinfo b { color: var(--ink); }

[data-theme="dark"] .acctm__row,
[data-theme="dark"] .acctm__item { border-color: var(--line); }
[data-theme="dark"] .acctm__tabs,
[data-theme="dark"] .paymodal__tabs { border-bottom-color: var(--line); }
[data-theme="dark"] .acctm__body,
[data-theme="dark"] .paymodal__body { background: var(--fill-1); }
[data-theme="dark"] .acctm__card,
[data-theme="dark"] .paymodal__card,
[data-theme="dark"] .payqr__card { background: var(--fill-1); }
[data-theme="dark"] .acctm__x,
[data-theme="dark"] .payqr__x,
[data-theme="dark"] .paymodal__x { color: var(--muted); }
[data-theme="dark"] .acctm__x:hover,
[data-theme="dark"] .payqr__x:hover,
[data-theme="dark"] .paymodal__x:hover { background: var(--fill-2); color: var(--ink); }
[data-theme="dark"] .acctm__buy,
[data-theme="dark"] .paymodal__buy,
[data-theme="dark"] .acctm__recharge { background: var(--fill-2); color: var(--ink); border-color: var(--line); }
[data-theme="dark"] .acctm__exit { background: var(--fill-2); color: var(--ink); border-color: var(--line); }
[data-theme="dark"] .payqr__box img { background: #fff; }
[data-theme="dark"] .paymodal__tabs .paymodal__tab.is-on { color: var(--ink); }

/* ── 素材入口按钮（没有素材时显示在底部栏，避免占掉输入框第一行）── */
.assetbtn {
  display: inline-flex; align-items: center; gap: 4px;
  height: 28px; padding: 0 10px 0 7px; flex: 0 0 auto;
  border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--muted);
  font-size: 12.5px; cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.assetbtn:hover { background: var(--fill-2); color: var(--accent); border-color: var(--accent); }
.assetbtn svg { width: 14px; height: 14px; }
.assetbtn[hidden] { display: none !important; }
@media (max-width: 760px) {
  .assetbtn span { display: none; }
  .assetbtn { padding: 0 8px; }
}

/* ── 提示条：深色模式下 --ink 是浅色，原先的「浅底白字」会看不见 ── */
[data-theme="dark"] .toast {
  background: #34343e;
  color: #f4f4f7;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .1), 0 10px 30px rgba(0, 0, 0, .5);
}

/* 展开态：+N 按钮显示为「收起」，样式区分一下 */
.doccards__more.is-on {
  border-style: solid;
  border-color: var(--accent);
  color: var(--accent);
}

/* ══════════════════════════════════════════════════════════
   会员 FREE 艺术字（替代"N积分"）
   ══════════════════════════════════════════════════════════ */
.dd__price { display: inline-flex; align-items: center; }

.freetag {
  position: relative;
  display: inline-block;
  padding: 1px 4px 2px 5px;
  font-style: italic;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: .16em;
  line-height: 1.4;
  /* 浅色背景：用深一点的调子才看得清 */
  background: linear-gradient(100deg,
      #7d2249 0%, #b3306a 22%, #d98b1f 40%, #b3306a 58%, #7d2249 80%, #b3306a 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: freeShine 4s linear infinite;
  transform: translateZ(0);
}
.freetag::after {
  content: "";
  position: absolute; left: 4px; right: 4px; bottom: 1px;
  height: 1.5px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(179, 48, 106, .55), transparent);
}
@keyframes freeShine {
  0%   { background-position: 0% 50%; }
  100% { background-position: 250% 50%; }
}
[data-theme="dark"] .freetag {
  background: linear-gradient(100deg,
      #ff6ea8 0%, #ffb3d1 20%, #ffd76e 40%, #fff5fb 52%, #ffd76e 64%, #ffb3d1 80%, #ff6ea8 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
[data-theme="dark"] .freetag::after {
  background: linear-gradient(90deg, transparent, rgba(255, 215, 110, .55), transparent);
}
@media (prefers-reduced-motion: reduce) {
  .freetag { animation: none; }
}

/* 会员 FREE：去掉原来那个粉色药丸底，让艺术字直接贴在页面上 */
.dd__price.is-free {
  background: none !important;
  box-shadow: none !important;
  padding: 0 2px !important;
  color: transparent;
}

/* ── 深色模式：参数选项的「选中态」必须盖回主色 ────────────────
   上面那条 [data-theme="dark"] .setpanel__opt 和
   .setpanel__opt[aria-selected="true"] 同权重，写在前面的会被吃掉，
   结果选中的档位在深色下变成普通灰底，用户看不出选了哪个。 */
[data-theme="dark"] .setpanel__opt[aria-selected="true"] {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px rgba(212, 87, 140, .38);
}
[data-theme="dark"] .setpanel__opt[aria-selected="true"]:hover {
  background: var(--accent);
  filter: brightness(1.08);
}
/* 未选中的才用灰底 */
[data-theme="dark"] .setpanel__opt[aria-selected="false"] {
  background: var(--fill-2);
  color: var(--ink);
}

/* ── 深色模式：所有「反色底 + 白字」的地方统一改深色 ──────────
   --ink 在深色下变成浅色，直接用会变成"浅底白字"看不见。 */
[data-theme="dark"] .mode-switch button[aria-selected="true"] {
  background: var(--accent);
  color: #fff;
}
[data-theme="dark"] .batchbar {
  background: #33333d;
  color: var(--ink);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .09), 0 18px 44px rgba(0, 0, 0, .55);
}
[data-theme="dark"] .batchbar .btn--fill { color: #fff; }

/* ══════════════════════════════════════════════════════════
   API Key 小窗
   ══════════════════════════════════════════════════════════ */
.modal--apikey { width: min(560px, calc(100% - 32px)); padding: 0; overflow: hidden; border-radius: 18px; }
.apikm { background: var(--fill-1); color: var(--ink); }
.apikm__head { display: flex; align-items: center; padding: 16px 18px 10px; }
.apikm__head b { font-size: 16px; font-weight: 700; }
.apikm__x {
  margin-left: auto; width: 32px; height: 32px; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); font-size: 21px; line-height: 1; cursor: pointer;
}
.apikm__x:hover { background: var(--fill-2); color: var(--ink); }
.apikm__hint {
  margin: 0 18px 12px; padding: 10px 12px; border-radius: 10px;
  background: var(--fill-2); color: var(--muted);
  font-size: 12.5px; line-height: 1.75;
}
.apikm__hint b { color: var(--ink); }
.apikm__list { max-height: 42vh; overflow-y: auto; padding: 0 18px; }
.apikm__empty { padding: 18px 0; color: var(--muted); font-size: 13px; text-align: center; }
.apikm__item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.apikm__item:last-child { border-bottom: 0; }
.apikm__meta { min-width: 0; flex: 1 1 auto; }
.apikm__name { font-size: 13.5px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.apikm__stat { font-size: 11.5px; color: var(--muted); }
.apikm__key {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; color: var(--ink);
  background: var(--fill-2); border: 1px solid var(--line);
  border-radius: 7px; padding: 4px 8px;
  max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  cursor: pointer;
}
.apikm__del {
  border: 0; background: transparent; color: var(--muted);
  font-size: 12px; cursor: pointer; padding: 4px 8px; border-radius: 7px; flex: 0 0 auto;
}
.apikm__del:hover { background: var(--fill-2); color: #d0455f; }
.apikm__new { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.apikm__new input {
  flex: 1 1 auto; min-width: 0; height: 34px; padding: 0 11px;
  border-radius: 9px; border: 1px solid var(--line);
  background: var(--fill-2); color: var(--ink); font-size: 13px; outline: none;
}
.apikm__new input:focus { border-color: var(--accent); }
.apikm__foot {
  display: flex; align-items: center; gap: 10px;
  padding: 0 18px 16px; font-size: 12.5px;
}
.apikm__doc { color: var(--accent); text-decoration: none; font-weight: 600; }
.apikm__doc:hover { text-decoration: underline; }
.apikm__tip { margin-left: auto; color: var(--muted); }
@media (max-width: 760px) {
  .apikm__key { max-width: 130px; }
  .apikm__hint { font-size: 12px; }
}

/* API Key 小窗：一行说明 */
.apikm__sub {
  margin: 0 18px 10px; font-size: 12.5px; color: var(--muted);
}
.apikm__sub b { color: var(--ink); }
/* 顶栏 API 按钮在手机上也不挤 */
@media (max-width: 760px) {
  #apiOpen { padding: 0 10px; }
}
