/* ============ 前台布局 ============ */
.app { display: flex; min-height: 100vh; position: relative; z-index: 1; }
.view:not([hidden]) { animation: fadeUp 0.3s var(--ease) both; }

/* ---------- 侧栏 ---------- */
.rail {
  position: sticky; top: 0;
  flex: 0 0 232px; width: 232px; height: 100vh;
  display: flex; flex-direction: column;
  padding: 14px 12px 12px;
  background: var(--sidebar);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  border-right: 1px solid var(--line);
  transition: width 0.3s var(--ease), flex-basis 0.3s var(--ease), padding 0.3s var(--ease);
  z-index: 20;
}
.rail.is-collapsed { flex-basis: 68px; width: 68px; padding-left: 10px; padding-right: 10px; }
.rail.is-collapsed .brand-name,
.rail.is-collapsed .nav-item span,
.rail.is-collapsed .rail-label,
.rail.is-collapsed .rail-model span:not(.dot),
.rail.is-collapsed .rail-model .pill { display: none; }
.rail.is-collapsed .rail-top { justify-content: center; padding-left: 0; padding-right: 0; }
.rail.is-collapsed .brand { display: none; }
.rail.is-collapsed #collapseBtn svg { transform: scaleX(-1); }
.rail.is-collapsed .rail-model { justify-content: center; }
.rail.is-collapsed .nav-item { justify-content: center; padding: 8px 0; }

.rail-top { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 16px; }
.brand { display: flex; align-items: center; gap: 9px; border-radius: 10px; }
.brand-mark {
  width: 26px; height: 26px; flex: none;
  display: grid; place-items: center;
  border-radius: 8px;
  background: linear-gradient(155deg, #232a3c 0%, #10121a 55%, #05060a 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    0 3px 10px rgba(12, 18, 38, 0.35),
    0 0 14px rgba(122, 110, 255, 0.16);
  transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}
.brand-mark svg { width: 15px; height: 15px; display: block; filter: drop-shadow(0 0 6px rgba(140, 170, 255, 0.45)); }
.brand:hover .brand-mark {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    0 5px 14px rgba(12, 18, 38, 0.4),
    0 0 18px rgba(140, 120, 255, 0.3);
}
.brand-name {
  display: inline-flex; align-items: baseline; gap: 3px;
  font-size: 15px; font-weight: 700; letter-spacing: -0.35px;
  white-space: nowrap;
  color: var(--text);
}
.brand-name em {
  font-style: normal;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em;
  background: linear-gradient(100deg, #6FB0FF 0%, #9A6BFF 52%, #FF8CC4 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  transform: translateY(-1px);
}
[data-theme="light"] .brand-name em {
  background-image: linear-gradient(100deg, #2F74FF 0%, #7A46FF 52%, #E8519F 100%);
}

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  height: 32px; padding: 0 9px;
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: 12.5px; font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.nav-item svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.is-on { background: var(--accent-soft); color: var(--accent); }

.rail-sep { height: 1px; background: var(--line-soft); margin: 12px 8px; }
.rail-label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.4px; color: var(--text-3); padding: 0 9px 6px; text-transform: uppercase; }

.rail-model {
  display: flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 9px; border-radius: var(--r-md);
  font-size: 12px; color: var(--text-2);
  white-space: nowrap; overflow: hidden;
}
.rail-model:hover { background: var(--hover); color: var(--text); }
.rail-model .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); }
.rail-model .pill { margin-left: auto; }

.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 1px; }

/* ---------- 主区 ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: flex-end; gap: 16px;
  height: 56px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--line-soft);
}
.top-right { display: flex; align-items: center; gap: 8px; }

.credits-chip {
  display: flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  font-size: 12px; font-weight: 500;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.15s, background 0.15s;
}
.credits-chip:hover { border-color: var(--accent); }
.credits-chip .zap { width: 13px; height: 13px; fill: #f5a623; stroke: none; }
.credits-chip .plus { width: 12px; height: 12px; stroke: var(--text-3); fill: none; stroke-width: 2; }
.credits-chip.is-low { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }

.offline-bar {
  margin: 12px 24px 0; padding: 7px 12px;
  border-radius: var(--r-md);
  font-size: 11.5px; text-align: center;
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 26%, transparent);
}

/* ---------- 视图 ---------- */
.view { display: flex; flex-direction: column; padding: 26px 28px 40px; max-width: 1200px; width: 100%; margin: 0 auto; }
#view-create { padding-bottom: 210px; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.view-head h1, .view-head h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.4px; }
.view-head p { margin: 6px 0 0; font-size: 12px; color: var(--text-2); }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 12px; }
.section-head h2 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -0.2px; }
.section-head .hint { font-size: 11.5px; color: var(--text-3); }
.section-tools { display: flex; align-items: center; gap: 10px; }
.retention-hint {
  font-size: 11px;
  color: #a8691a;
  background: rgba(217, 147, 43, 0.12);
  border: 1px solid rgba(217, 147, 43, 0.3);
  padding: 2px 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1.6;
}
[data-theme="dark"] .retention-hint { color: #f0b45f; }

/* ---------- Hero ---------- */
.hero { padding-top: 34px; }
.hero h1 { margin: 0; text-align: center; font-size: 27px; font-weight: 600; letter-spacing: -0.6px; }
.hero > p { margin: 8px 0 30px; text-align: center; font-size: 12.5px; color: var(--text-2); }

/* ---------- Hero 标题：macOS 那种「流光字」----------
 * 底层是跨字渐变的彩色，上层一条高光按节奏从左扫到右；
 * 进场时从模糊里浮出来，和 Apple 的开场标题一个味道。
 */
.hero h1 {
  --hero-1: #0071e3;
  --hero-2: #7a4dff;
  --hero-3: #d6336c;
  --hero-glint: rgba(255, 255, 255, 0.66);
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  font-size: 32px;
  letter-spacing: -1px;
  text-shadow: 0 12px 34px color-mix(in srgb, var(--hero-1) 12%, transparent);
  animation: heroIn 0.9s var(--ease) both;
}
[data-theme="dark"] .hero h1 {
  --hero-1: #6ea8ff;
  --hero-2: #b48cff;
  --hero-3: #ff7ab6;
  --hero-glint: rgba(255, 255, 255, 0.9);
  text-shadow: 0 0 34px color-mix(in srgb, var(--hero-2) 42%, transparent);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero h1 {
    background-image:
      linear-gradient(112deg, transparent 22%, var(--hero-glint) 50%, transparent 78%),
      linear-gradient(100deg,
        var(--text) 0%, var(--text) 16%,
        var(--hero-1) 32%, var(--hero-2) 50%, var(--hero-3) 68%,
        var(--text) 84%, var(--text) 100%);
    background-size: 55% 100%, 100% 100%;
    background-repeat: no-repeat, no-repeat;
    background-position: -50% 50%, 0 50%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: heroIn 0.9s var(--ease) both;
  }
}

/* 标题的流光是一次性淡入；不再无限扫光——那会让整块渐变文字每帧重绘 */
@keyframes heroIn {
  from { opacity: 0; transform: translateY(14px); }
  60%  { opacity: 1; }
  to   { opacity: 1; transform: none; }
}

.hero > p { animation: heroIn 0.8s var(--ease) 0.12s both; }

.templates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.templates .tpl { animation: fadeUp 0.36s var(--ease) both; }
.templates .tpl:nth-child(1) { animation-delay: 0ms; }
.templates .tpl:nth-child(2) { animation-delay: 45ms; }
.templates .tpl:nth-child(3) { animation-delay: 90ms; }
.templates .tpl:nth-child(4) { animation-delay: 135ms; }
.templates .tpl:nth-child(5) { animation-delay: 180ms; }
.templates .tpl:nth-child(6) { animation-delay: 225ms; }

.tiers .tier { animation: fadeUp 0.36s var(--ease) both; }
.tiers .tier:nth-child(2) { animation-delay: 60ms; }
.tiers .tier:nth-child(3) { animation-delay: 120ms; }

.packs .pack { animation: fadeUp 0.36s var(--ease) both; }
.packs .pack:nth-child(2) { animation-delay: 60ms; }
.packs .pack:nth-child(3) { animation-delay: 120ms; }
.tpl-ref {
  position: absolute; left: 10px; bottom: 10px; z-index: 3;
  font-size: 10px; padding: 2px 7px; border-radius: 999px;
  color: #fff; background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(6px);
}
.tpl {
  background: color-mix(in srgb, var(--surface-solid) 82%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  cursor: pointer;
  transition: transform 0.26s var(--ease), box-shadow 0.26s var(--ease), border-color 0.2s;
}
.tpl:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
}
.tpl-media { height: 148px; background: var(--surface-2); position: relative; overflow: hidden; }
/* 背景放同一张图的高斯模糊铺底，前景图片 contain 完整显示：竖图不会被裁，也不会有生硬的黑边 */
.tpl-media::before {
  content: ""; position: absolute; inset: -28px;
  background-image: var(--tpl-bg);
  background-size: cover;
  background-position: center;
  filter: blur(18px) saturate(1.2) brightness(0.82);
  opacity: 0.85;
  transform: scale(1.06);
}
.tpl-media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
  z-index: 1;
}
.tpl-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.28));
  opacity: 0.7;
  z-index: 2;
}
.tpl-body { padding: 11px 13px 12px; }
.tpl-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tpl-title { font-size: 13px; font-weight: 600; letter-spacing: -0.1px; }
.tpl-try {
  font-size: 11px; font-weight: 500; color: var(--accent);
  padding: 3px 9px; border-radius: 999px;
  background: var(--accent-soft);
}
.tpl-try:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.tpl-desc { margin: 6px 0 0; font-size: 11.5px; line-height: 1.6; color: var(--text-2); }

/* ---------- 网格作品 ---------- */
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tile {
  position: absolute; top: 0; left: 0;
  border-radius: 12px;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface-solid) 84%, transparent);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  cursor: pointer;
  transition: box-shadow 0.2s var(--ease);
  animation: fadeIn 0.32s var(--ease) both;
  animation-delay: var(--d, 0ms);
  /* 定位靠 transform，不要再挂 will-change：几十张卡各占一层会把显存吃光 */
  contain: layout paint;
}
.tile:hover { box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15); }

/* ---------- 生成中：流动极光 + 扫光 + 转圈 ---------- */
.tile.is-loading {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 18%, transparent);
}
.tile.is-loading .tile-hover { display: none; }
.tile.is-loading .tile-media { background: #0f1219; }
/* 生成中的极光：渐变是静态的，只让整层缓慢漂移（transform 走合成器，不重绘） */
.tile.is-loading .shimmer {
  position: absolute; inset: -12%;
  display: block;
  background:
    radial-gradient(46% 46% at 26% 26%, color-mix(in srgb, var(--accent) 92%, transparent), transparent 72%),
    radial-gradient(44% 44% at 76% 30%, rgba(178, 107, 255, 0.82), transparent 72%),
    radial-gradient(56% 56% at 50% 86%, rgba(52, 211, 255, 0.7), transparent 74%),
    linear-gradient(160deg, #1b2030, #0d1017);
  background-size: 120% 120%, 120% 120%, 120% 120%, 100% 100%;
  animation: genDrift 9s ease-in-out infinite alternate;
  animation-delay: var(--gen-delay, 0s);
}
.tile.is-loading .tile-media::before {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: 130px; height: 130px; margin: -65px 0 0 -65px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 68%);
  animation: genPulse 2.6s ease-in-out infinite;
}
.tile.is-loading .shimmer::after {
  content: "";
  position: absolute; inset: -30%;
  background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, 0.26) 50%, transparent 58%);
  animation: genSweep 2.8s linear infinite;
}
.tile.is-loading .tile-media::after {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: 42px; height: 42px; margin: -21px 0 0 -21px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-top-color: rgba(255, 255, 255, 0.95);
  animation: genSpin 0.95s linear infinite;
  box-shadow: 0 0 22px rgba(255, 255, 255, 0.14);
}
.tile.is-loading .tile-model {
  color: var(--accent);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.2px;
}
.tile.is-loading .tile-model::after {
  content: "";
  animation: genDots 1.4s steps(4, end) infinite;
}
.tile.is-loading .tile-meta { background: color-mix(in srgb, var(--accent) 7%, transparent); }

.gen-bar {
  position: absolute; left: 12%; right: 12%; bottom: 16px;
  height: 3px; border-radius: 99px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}
.gen-bar::after {
  content: "";
  display: block; width: 42%; height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent);
  animation: genBar 1.35s ease-in-out infinite;
}

/* 极光漂移：只有 transform，合成器搬运；不要用 background-position 或 filter 动画 */
@keyframes genDrift {
  0%   { transform: translate3d(-3%, -2%, 0) rotate(-2deg) scale(1.08); }
  50%  { transform: translate3d(3%, 2%, 0) rotate(2deg) scale(1.14); }
  100% { transform: translate3d(-2%, 3%, 0) rotate(-1deg) scale(1.1); }
}
@keyframes genSweep {
  0% { transform: translateX(-45%) rotate(0.001deg); }
  100% { transform: translateX(45%) rotate(0.001deg); }
}
@keyframes genSpin { to { transform: rotate(360deg); } }
@keyframes genBar {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(320%); }
}
@keyframes genPulse {
  0%, 100% { opacity: 0.35; transform: scale(0.92); }
  50% { opacity: 0.9; transform: scale(1.08); }
}
@keyframes genDots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75%, 100% { content: "..."; }
}

/* 卡片滚出屏幕 / 标签页切到后台：暂停生成中的装饰动画，别让它们白烧 GPU */
.tile.is-loading.is-paused .shimmer,
.tile.is-loading.is-paused .shimmer::after,
.tile.is-loading.is-paused .tile-media::before,
.tile.is-loading.is-paused .tile-media::after,
.tile.is-loading.is-paused .gen-bar::after,
.gen-media.is-loading.is-paused .shimmer,
.gen-media.is-loading.is-paused .shimmer::after,
.gen-media.is-loading.is-paused::before,
.gen-media.is-loading.is-paused::after,
html.is-page-hidden .tile.is-loading .shimmer,
html.is-page-hidden .tile.is-loading .shimmer::after,
html.is-page-hidden .tile.is-loading .tile-media::before,
html.is-page-hidden .tile.is-loading .tile-media::after,
html.is-page-hidden .tile.is-loading .gen-bar::after,
html.is-page-hidden .gen-media.is-loading .shimmer,
html.is-page-hidden .gen-media.is-loading .shimmer::after,
html.is-page-hidden .gen-media.is-loading::before,
html.is-page-hidden .gen-media.is-loading::after,
html.is-page-hidden .bg-orbs span,
html.is-page-hidden .sk-line { animation-play-state: paused; }

@media (prefers-reduced-motion: reduce) {
  .tile.is-loading .tile-media,
  .tile.is-loading .shimmer,
  .tile.is-loading .shimmer::after,
  .tile.is-loading .tile-media::before,
  .tile.is-loading .tile-media::after,
  .tile.is-loading .tile-model::after,
  .gen-bar::after,
  .send.is-busy::after { animation: none; }
}
.tile-media { position: relative; aspect-ratio: 4 / 5; background: var(--surface-2); overflow: hidden; }
.tile-media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.5s var(--ease);
}
.tile:hover .tile-media img { transform: scale(1.03); }
.tile-hover {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 8px;
  padding: 10px;
  background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, 0.72));
  opacity: 0; transition: opacity 0.2s var(--ease);
}
.tile:hover .tile-hover { opacity: 1; }
.tile-prompt {
  margin: 0; color: #fff; font-size: 11px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
.tile-actions { display: flex; gap: 6px; }
.tile-btn {
  width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  color: #fff;
}
.tile-btn:hover { background: rgba(255, 255, 255, 0.34); }
.tile-btn svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tile-meta { display: flex; align-items: center; justify-content: space-between; padding: 6px 9px; }
.tile-model { font-size: 10.5px; color: var(--text-2); }
.tile-time { font-size: 10px; color: var(--text-3); }

.gallery-wrap.is-empty { display: none; }

/* ---------- 最近生成：详细列表模式 ---------- */
.seg-mini { height: 26px; padding: 2px; }
.seg-mini .seg { height: 22px; padding: 0 10px; font-size: 11.5px; border-radius: 6px; }

.gen-list { display: flex; flex-direction: column; }
.gen-day {
  display: flex; align-items: baseline; gap: 8px;
  margin: 20px 2px 10px;
  font-size: 13px; font-weight: 600; letter-spacing: -0.1px;
}
.gen-day:first-child { margin-top: 4px; }
.gen-day span { font-size: 11px; font-weight: 500; color: var(--text-3); }

.gen-row {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  padding: 14px;
  margin-bottom: 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-solid) 78%, transparent);
  box-shadow: var(--shadow-1);
}
.gen-media {
  position: relative;
  aspect-ratio: 4 / 3;
  max-height: 220px;
  border-radius: 12px;
  overflow: hidden;
  background: #0a0a0d;
}
/* 绝对定死图片框，再用 contain 完整显示：竖图不会被裁掉上下，横图也不会溢出 */
.gen-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  cursor: zoom-in;
}
.gen-badge {
  position: absolute; left: 8px; top: 8px;
  padding: 2px 7px; border-radius: 99px;
  background: rgba(0, 0, 0, 0.55); color: #fff;
  font-size: 10px;
  backdrop-filter: blur(6px);
}
.gen-del {
  position: absolute; right: 8px; top: 8px;
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.45); color: #fff;
  font-size: 11px; line-height: 1;
  opacity: 0; transition: opacity 0.15s, background 0.15s;
}
.gen-media:hover .gen-del { opacity: 1; }
.gen-del:hover { background: var(--danger); }

.gen-body { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.gen-prompt {
  margin: 0;
  font-size: 12.5px; line-height: 1.85;
  color: var(--text);
  white-space: pre-wrap; word-break: break-word;
}
.gen-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11px; color: var(--text-3); }
.gen-thumbs, .gen-refs { display: flex; flex-wrap: wrap; gap: 6px; }
.gen-thumbs img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); cursor: zoom-in; }
.gen-refs img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); }
.gen-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 2px; }

.gen-row.is-pending { opacity: 1; }
.gen-row.is-pending .gen-media { background: var(--surface-2); }
.gen-pending-label { position: absolute; font-size: 12px; color: var(--text-2); }

/* 详细列表里的「生成中」：和瀑布流卡片同一套极光 / 扫光 / 转圈 / 进度条 */
.gen-media.is-loading {
  background: #0f1219;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 14%, transparent);
}
.gen-media.is-loading .shimmer {
  position: absolute; inset: -12%;
  display: block;
  background:
    radial-gradient(46% 46% at 26% 26%, color-mix(in srgb, var(--accent) 92%, transparent), transparent 72%),
    radial-gradient(44% 44% at 76% 30%, rgba(178, 107, 255, 0.82), transparent 72%),
    radial-gradient(56% 56% at 50% 86%, rgba(52, 211, 255, 0.7), transparent 74%),
    linear-gradient(160deg, #1b2030, #0d1017);
  background-size: 120% 120%, 120% 120%, 120% 120%, 100% 100%;
  animation: genDrift 9s ease-in-out infinite alternate;
}
.gen-media.is-loading::before {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: 130px; height: 130px; margin: -65px 0 0 -65px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 68%);
  animation: genPulse 2.6s ease-in-out infinite;
}
.gen-media.is-loading .shimmer::after {
  content: "";
  position: absolute; inset: -30%;
  background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, 0.26) 50%, transparent 58%);
  animation: genSweep 2.8s linear infinite;
}
.gen-media.is-loading::after {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: 42px; height: 42px; margin: -21px 0 0 -21px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-top-color: rgba(255, 255, 255, 0.95);
  animation: genSpin 0.95s linear infinite;
  box-shadow: 0 0 22px rgba(255, 255, 255, 0.14);
}
.gen-media.is-loading .gen-pending-label {
  left: 0; right: 0; bottom: 26px;
  z-index: 3;
  text-align: center;
  color: rgba(255, 255, 255, 0.92);
  font-size: 11.5px;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.65);
}
.gen-media.is-loading .gen-dots::after {
  display: inline-block;
  min-width: 1.1em;
  text-align: left;
  animation: genDots 1.4s steps(4, end) infinite;
}
.gen-meta .gen-live { color: var(--accent); font-weight: 500; }
.gen-meta .gen-live::after {
  display: inline-block;
  min-width: 1.1em;
  text-align: left;
  animation: genDots 1.4s steps(4, end) infinite;
}

/* ---------- 探索：瀑布流案例 ---------- */
.masonry { position: relative; width: 100%; }
.case {
  position: absolute; top: 0; left: 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: color-mix(in srgb, var(--surface-solid) 84%, transparent);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  cursor: pointer;
  /* 瀑布流靠 inline transform 定位：这里不要给 transform 加过渡，否则每次重排整屏卡片一起做动画 */
  transition: box-shadow 0.24s var(--ease), border-color 0.2s;
  animation: fadeIn 0.32s var(--ease) both;
  animation-delay: var(--d, 0ms);
  contain: layout paint;
}
.case:hover { box-shadow: 0 16px 38px rgba(0, 0, 0, 0.16); border-color: color-mix(in srgb, var(--accent) 26%, var(--line)); }
.case-media { overflow: hidden; background: var(--surface-2); }
.case-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s var(--ease); }
.case:hover .case-media img { transform: scale(1.03); }
.case figcaption { padding: 10px 12px 12px; }
.case-title { font-size: 12.5px; font-weight: 600; letter-spacing: -0.1px; }
.case-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.case-tag { font-size: 10px; color: var(--text-2); background: var(--surface-3); padding: 2px 7px; border-radius: 999px; }
.case-tag.is-ref { color: var(--accent); background: var(--accent-soft); }

/* ---------- 分段控件 ---------- */
.segmented {
  display: inline-flex; gap: 2px; padding: 2px;
  border-radius: var(--r-md);
  background: var(--surface-3);
  border: 1px solid var(--line-soft);
}
.seg {
  height: 26px; padding: 0 12px;
  border-radius: 7px;
  font-size: 12px; font-weight: 500;
  color: var(--text-2);
  transition: background 0.18s var(--ease), color 0.18s;
}
.seg.is-on { background: var(--surface-solid); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }

/* ---------- 参考图 ---------- */
.refs-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.ref-card { border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); aspect-ratio: 1; }
.ref-card img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- 资产：按日期分组 ---------- */
.asset-groups { display: grid; gap: 34px; margin-top: 6px; }
.asset-day h3 {
  display: flex; align-items: baseline; gap: 10px;
  margin: 0 0 12px;
  font-size: 15px; font-weight: 650; letter-spacing: -0.25px;
  color: var(--text);
}
.asset-day h3 span {
  font-size: 11px; font-weight: 400; color: var(--text-3);
  letter-spacing: 0;
}
.asset-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
}
.asset-thumb {
  position: relative;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
  aspect-ratio: 4 / 3;
  cursor: zoom-in;
  box-shadow: var(--shadow-1);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.15s;
}
.asset-thumb img {
  position: relative;
  z-index: 1;
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.45s var(--ease);
}
/* 模糊铺底：缩略图仍按 4:3 对齐，但图片本身完整显示，竖图不被裁 */
.asset-thumb::before {
  content: "";
  position: absolute; inset: -18px;
  background-image: var(--thumb);
  background-size: cover;
  background-position: center;
  filter: blur(14px) saturate(1.15) brightness(0.88);
  opacity: 0.9;
}
.asset-thumb.is-broken::before { display: none; }
.asset-thumb:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.14);
}
.asset-thumb:hover img { transform: scale(1.04); }
.asset-thumb.is-broken { cursor: default; }
.asset-thumb.is-broken img { opacity: 0; }
.asset-thumb.is-broken::after {
  content: "链接已过期";
  position: absolute; inset: 0;
  z-index: 2;
  display: grid; place-items: center;
  font-size: 10.5px; color: var(--text-3);
  background:
    repeating-linear-gradient(135deg, rgba(120, 130, 160, 0.07) 0 8px, transparent 8px 16px),
    var(--surface-2);
}

@media (max-width: 720px) {
  .asset-row { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
  .asset-groups { gap: 24px; }
}

.field-hint { display: block; margin-top: 6px; font-size: 10.5px; color: var(--text-3); }
.field-hint.is-warn { color: var(--danger); }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; }
.code-btn { height: 34px; padding: 0 12px; white-space: nowrap; font-size: 11.5px; }

/* ---------- 探索：搜索 / 分类 ---------- */
.explore-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 6px 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  box-shadow: var(--shadow-1);
  min-width: 300px; flex: 0 1 420px;
}
.search-box svg { width: 14px; height: 14px; stroke: var(--text-3); fill: none; stroke-width: 1.9; stroke-linecap: round; flex: none; }
.search-box input { flex: 1; border: 0; background: transparent; color: var(--text); font-size: 12.5px; outline: none; min-width: 0; }
.search-box input::placeholder { color: var(--text-3); }
.search-box .search-go {
  height: 26px; padding: 0 12px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 11.5px; font-weight: 500;
}
.search-box .search-go:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }

.tag-row { display: flex; gap: 6px; flex-wrap: wrap; }
.tag-chip {
  height: 28px; padding: 0 11px; border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  color: var(--text-2);
  font-size: 11.5px;
  display: inline-flex; align-items: center; gap: 5px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.tag-chip:hover { border-color: var(--accent); color: var(--accent); }
.tag-chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tag-chip em { font-style: normal; font-size: 10px; opacity: 0.6; }

/* ---------- 帮助 ---------- */
.help-list { display: grid; gap: 6px; margin-top: 12px; }
.help-list details {
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: var(--surface-2);
  padding: 9px 12px;
}
.help-list summary { cursor: pointer; font-size: 12.5px; color: var(--text); list-style: none; }
.help-list summary::-webkit-details-marker { display: none; }
.help-list summary::before { content: "▸ "; color: var(--text-3); }
.help-list details[open] summary::before { content: "▾ "; }
.help-list p { margin: 8px 0 0; font-size: 11.5px; line-height: 1.75; color: var(--text-2); }

/* ---------- 反推提示词 ---------- */
.chip-ai { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.chip-ai .chip-cost {
  margin-left: 4px; padding: 0 5px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  font-size: 10px; font-variant-numeric: tabular-nums;
}
.chip-ai .spark { width: 13px; height: 13px; fill: currentColor; stroke: none; }
.chip-ai:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); }
/* 用 .chip.chip-ai 提高优先级，盖掉 .chip:disabled 的 0.55 透明 */
.chip.chip-ai.is-busy {
  opacity: 1;
  pointer-events: none;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 24%, transparent);
}

/* 优化中：转圈 + 文案「优化中…」 */
.chip-ai .chip-spinner {
  width: 12px; height: 12px;
  flex: none;
  border-radius: 50%;
  border: 1.6px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-top-color: var(--accent);
  animation: genSpin 0.75s linear infinite;
}
.chip-ai.is-busy #optimizeLabel { letter-spacing: 0.3px; }
.chip-ai.is-busy #optimizeLabel::after {
  display: inline-block;
  min-width: 1.15em;
  text-align: left;
  animation: genDots 1.1s steps(4, end) infinite;
}

.reverse-grid { display: grid; grid-template-columns: minmax(300px, 0.85fr) 1.15fr; gap: 16px; align-items: start; }
.rev-panel {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-solid) 84%, transparent);
  box-shadow: var(--shadow-1);
  display: flex; flex-direction: column; gap: 12px;
}
.rev-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 220px; padding: 18px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12.5px;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.rev-drop svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rev-drop em { font-style: normal; font-size: 11px; color: var(--text-3); }
.rev-drop:hover, .rev-drop.is-over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
#revPreview {
  width: 100%; max-height: 340px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  display: block;
}
/* 动作行：目标模型 + 开始反推 + 换一张，都在同一行，反推时不会漏看 */
.rev-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rev-target {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 500; color: var(--text-2);
  flex: 0 1 auto; min-width: 0;
}
.rev-target span { white-space: nowrap; flex: none; }
.rev-target select {
  height: 30px; padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  max-width: 180px; min-width: 0;
  flex: 0 1 auto;
  text-overflow: ellipsis;
}
.rev-target select:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.rev-text-toggle {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 500; color: var(--text-2);
  white-space: nowrap; cursor: pointer; user-select: none;
}
.rev-text-toggle input { margin: 0; accent-color: var(--accent); cursor: pointer; }
.rev-hint { margin: 0; font-size: 11px; color: var(--text-3); line-height: 1.7; }

/* 反推进行中：右侧骨架 + 转圈 */
.rev-loading { display: flex; flex-direction: column; gap: 14px; }
.rev-loading-top {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.rev-orbit {
  width: 22px; height: 22px; flex: none;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-top-color: var(--accent);
  animation: genSpin 0.9s linear infinite;
}
.rev-loading-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.rev-loading-text b { font-size: 12.5px; font-weight: 600; color: var(--text); }
.rev-loading-text span { font-size: 11px; color: var(--text-3); }
.rev-elapsed { font-size: 11.5px; color: var(--accent); font-variant-numeric: tabular-nums; flex: none; }
.rev-skel { display: flex; flex-direction: column; gap: 10px; }
.rev-skel-card {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.sk-line {
  display: block;
  height: 10px;
  border-radius: 6px;
  margin: 9px 0;
  background: linear-gradient(
    90deg,
    var(--surface-3) 25%,
    color-mix(in srgb, var(--accent) 22%, var(--surface-3)) 50%,
    var(--surface-3) 75%
  );
  background-size: 220% 100%;
  animation: skPulse 1.6s ease-in-out infinite;
}
.sk-line:first-child { height: 12px; margin-top: 0; }
.sk-line:last-child { margin-bottom: 0; }
.rev-skel-card:nth-child(2) .sk-line { animation-delay: 0.16s; }
.rev-skel-card:nth-child(3) .sk-line { animation-delay: 0.32s; }
.rev-skel-card:nth-child(4) .sk-line { animation-delay: 0.48s; }
/* 骨架用透明度呼吸，不做背景位移（位移会让每根骨架线每帧重绘） */
@keyframes skPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
/* 失败态 */
.rev-loading.rev-error .rev-loading-top {
  border-color: color-mix(in srgb, var(--danger) 40%, var(--line));
  background: color-mix(in srgb, var(--danger) 8%, transparent);
}
.rev-err-icon {
  width: 22px; height: 22px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--danger); color: #fff;
  font-size: 13px; font-weight: 700;
}
.rev-result { min-height: 280px; }
.rev-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.rev-head-title h3 { margin: 0; font-size: 13.5px; font-weight: 600; }
.rev-head-sub { font-size: 10.5px; color: var(--text-3); }
.rev-head-actions { display: flex; gap: 6px; }

.rev-card {
  border: 1px solid var(--line-soft);
  background: var(--surface-2);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.rev-card.is-main { border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); background: color-mix(in srgb, var(--accent) 6%, var(--surface-2)); }
.rev-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
}
.rev-card-kind {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: var(--text-2);
  letter-spacing: 0.2px;
}
.rev-card-kind::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-3);
}
.rev-card.is-main .rev-card-kind { color: var(--accent); }
.rev-card.is-main .rev-card-kind::before { background: var(--accent); }
.rev-card.is-enhance .rev-card-kind { color: #b26bff; }
.rev-card.is-enhance .rev-card-kind::before { background: #b26bff; }
.rev-card-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
.rev-card:hover .rev-card-actions, .rev-card:focus-within .rev-card-actions { opacity: 1; }
.rev-card-actions button {
  font-size: 10.5px; padding: 2px 8px; border-radius: 999px;
  color: var(--text-2); background: var(--surface-solid); border: 1px solid var(--line);
}
.rev-card-actions button:hover { color: var(--accent); border-color: var(--accent); }
.rev-text { margin: 0; font-size: 12.5px; line-height: 1.85; color: var(--text); white-space: pre-wrap; }

.rev-variants { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.rev-variant {
  border: 1px solid var(--line-soft);
  background: var(--surface-2);
  border-radius: 12px;
  padding: 10px 11px;
  display: flex; flex-direction: column; gap: 6px;
}
.rev-variant-head { display: flex; align-items: center; justify-content: space-between; }
.rev-variant-tag {
  font-size: 10px; font-weight: 600; color: var(--text-3);
  letter-spacing: 0.3px; text-transform: uppercase;
}
/* 这版改了什么：模型给的中文标题，先看一眼标题再决定用不用 */
.rev-variant-label {
  align-self: flex-start;
  max-width: 100%;
  padding: 1px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.6;
  word-break: break-word;
}
.rev-variant p { margin: 0; font-size: 11.5px; line-height: 1.75; color: var(--text-2); flex: 1; }
.rev-variant .rev-copy { font-size: 10px; }

.rev-neg {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 9px 12px;
  background: transparent;
}
.rev-neg span { font-size: 10px; color: var(--text-3); letter-spacing: 0.3px; }
.rev-neg p { margin: 4px 0 0; font-size: 11.5px; line-height: 1.7; color: var(--text-2); }

/* 通用版（元提示词） */
.rev-generic {
  border: 1px dashed color-mix(in srgb, var(--accent) 38%, var(--line));
  border-radius: 12px;
  padding: 10px 12px 9px;
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.rev-generic-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.rev-generic-tag {
  font-size: 10.5px; font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.2px;
}
.rev-generic-type {
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}
.rev-generic-head .rev-card-actions { margin-left: auto; opacity: 1; }
.rev-generic p.rev-text { margin: 0; }
.rev-generic-hint { margin: 6px 0 0; font-size: 10.5px; color: var(--text-3); }

/* 历史记录 */
.rev-history { margin-top: 18px; }
.rev-history-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.rev-history-head h3 { margin: 0; font-size: 13.5px; font-weight: 600; }
.rev-history-head .rev-history-count { font-size: 11px; color: var(--text-3); margin-left: 8px; }
.rev-history-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; align-items: start; }

.rev-pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-bottom: 12px; font-size: 12px; color: var(--text-2); }
.rev-pager .btn:disabled { opacity: .45; }

.rev-hi {
  position: relative;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-solid) 82%, transparent);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), border-color 0.2s;
}
.rev-hi:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14); border-color: color-mix(in srgb, var(--accent) 26%, var(--line)); }

.rev-hi-open { display: block; width: 100%; padding: 0; cursor: pointer; background: none; border: 0; text-align: left; }
.rev-hi-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  overflow: hidden;
}
/* 缩略框仍按 4:3 对齐（网格不歪），但图片本身完整显示：竖图 / 长图不会被裁掉一段。
   --thumb 由 app.js 按 image_url 注入同一张图，铺成模糊底填满两侧空白，和「资产」页一个做法 */
.rev-hi-media::before {
  content: "";
  position: absolute; inset: -18px;
  background-image: var(--thumb, none);
  background-size: cover;
  background-position: center;
  filter: blur(14px) saturate(1.12) brightness(0.86);
  opacity: 0.88;
  pointer-events: none;
}
.rev-hi-media img {
  position: relative;
  z-index: 1;
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.4s var(--ease);
}
.rev-hi:hover .rev-hi-media img { transform: scale(1.04); }
.rev-hi.is-failed .rev-hi-media img { opacity: 0.45; filter: grayscale(0.6); }
.rev-hi.is-pending { border-color: color-mix(in srgb, var(--accent) 34%, var(--line)); }
.rev-hi.is-pending .rev-hi-media { background: color-mix(in srgb, var(--accent) 9%, var(--surface-2)); }

.rev-hi-badge {
  position: absolute; left: 8px; top: 8px; z-index: 2;
  font-size: 9.5px; padding: 2px 7px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.5); color: #fff;
  backdrop-filter: blur(6px);
}
.rev-hi-badge.is-ok { background: color-mix(in srgb, var(--ok) 82%, transparent); }
.rev-hi-badge.is-fail { background: color-mix(in srgb, var(--danger) 82%, transparent); }
.rev-hi-badge.is-pending { background: color-mix(in srgb, var(--accent) 82%, transparent); }

.rev-hi-foot { display: block; padding: 9px 11px 10px; }
.rev-hi-title {
  font-size: 11.5px; color: var(--text); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 34px;
}
.rev-hi-meta { margin-top: 6px; display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--text-3); }
.rev-hi-meta .dot-sep { opacity: 0.5; }

.rev-hi-del {
  position: absolute; right: 8px; top: 8px; z-index: 3; /* 压住 contain 图片（img z-index:1） */
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.45); color: #fff;
  font-size: 11px; line-height: 1;
  opacity: 0; transform: scale(0.9);
  transition: opacity 0.15s, transform 0.15s, background 0.15s;
  backdrop-filter: blur(6px);
}
.rev-hi:hover .rev-hi-del { opacity: 1; transform: scale(1); }
.rev-hi-del:hover { background: var(--danger); }

/* 作品卡片右上角删除 */
.tile-del {
  position: absolute; right: 8px; top: 8px; z-index: 2;
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.45); color: #fff;
  font-size: 11px; line-height: 1;
  opacity: 0; transform: scale(0.9);
  transition: opacity 0.15s, transform 0.15s, background 0.15s;
  backdrop-filter: blur(6px);
}
.tile:hover .tile-del { opacity: 1; transform: scale(1); }
.tile-del:hover { background: var(--danger); }
/* 还在生成的任务也能直接删掉（手机上没有 hover） */
.tile.is-loading .tile-del { opacity: 0.95; transform: none; }
.tile.is-loading .tile-del:hover { background: var(--danger); }

@media (max-width: 760px) {
  .rev-variants { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .reverse-grid { grid-template-columns: 1fr; }
}

/* ---------- 开发者 ---------- */
.dev-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 0.9fr); gap: 16px; align-items: start; }
.dev-card {
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-solid) 86%, transparent);
  box-shadow: var(--shadow-1);
}
.dev-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dev-card h3 { margin: 0 0 6px; font-size: 13.5px; font-weight: 600; }
.dev-card-head h3 { margin: 0; }
.dev-sub { margin: 0 0 14px; font-size: 11.5px; color: var(--text-3); line-height: 1.7; }
.dev-code {
  margin: 14px 0 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.9;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-all;
}
.dev-note { margin: 0; font-size: 11px; color: var(--text-3); line-height: 1.7; }

.dev-highlight {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 4px 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.dev-highlight svg {
  width: 18px; height: 18px; flex: none; margin-top: 1px;
  fill: var(--accent); stroke: none;
}
.dev-highlight b { display: block; font-size: 14px; font-weight: 700; color: var(--accent); letter-spacing: -0.1px; }
.dev-highlight span { display: block; margin-top: 2px; font-size: 11.5px; color: var(--text-2); }

.dev-warn {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 11.5px;
  line-height: 1.75;
  color: color-mix(in srgb, var(--danger) 88%, var(--text));
  background: color-mix(in srgb, var(--danger) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 28%, transparent);
}
.dev-warn b { color: var(--danger); font-weight: 700; }
.dev-warn u { text-decoration-color: color-mix(in srgb, var(--danger) 60%, transparent); }

.dev-keys { display: grid; gap: 8px; }
.dev-key {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: var(--surface-2);
}
.dev-key-main { flex: 1; min-width: 0; }
.dev-key-main b { display: block; font-size: 12px; font-weight: 500; }
.dev-key-main code { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); }
.dev-key-main span { display: block; font-size: 10px; color: var(--text-3); margin-top: 2px; }
.dev-key .btn { flex: none; }
.dev-wide { grid-column: 1 / -1; margin-top: 16px; }
.dev-inline {
  font-family: var(--mono); font-size: 11px;
  padding: 1px 5px; border-radius: 5px;
  background: var(--surface-2); border: 1px solid var(--line-soft);
  word-break: break-all;
}

.dev-params {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin: 6px 0 14px;
}
.dev-param {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
}
.dev-param b { display: block; font-size: 11px; color: var(--text-3); font-weight: 500; margin-bottom: 4px; }
.dev-param span { font-size: 11.5px; color: var(--text); line-height: 1.7; word-break: break-all; }
.dev-param code {
  font-family: var(--mono); font-size: 10.5px;
  background: color-mix(in srgb, var(--surface-solid) 70%, transparent);
  padding: 1px 4px; border-radius: 4px;
}

.dev-models { margin: 4px 0 14px; }
.dev-table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line-soft); }
.dev-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.dev-table th {
  text-align: left; padding: 8px 10px; font-weight: 500; color: var(--text-3);
  background: var(--surface-2); border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}
.dev-table td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); color: var(--text-2); }
.dev-table tr:last-child td { border-bottom: 0; }
.dev-table td b { color: var(--text); font-weight: 500; }
.dev-table .yes { color: var(--ok); }
.dev-table .no { color: var(--text-3); }
.dev-table .price { font-variant-numeric: tabular-nums; text-align: right; }

.dev-examples { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dev-ex-title { font-size: 11px; color: var(--text-3); margin-bottom: 6px; }
.dev-examples .dev-code { margin: 0; height: auto; align-self: start; }

@media (max-width: 1000px) {
  .dev-examples { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .dev-grid { grid-template-columns: 1fr; }
}

/* ---------- 提示词库抽屉 ---------- */
.lib-tab {
  position: fixed;
  right: 0;
  bottom: 132px;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px 9px 10px;
  border-radius: 12px 0 0 12px;
  background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
  border: 1px solid var(--line);
  border-right: 0;
  color: var(--text-2);
  font-size: 11.5px;
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  transition: color 0.15s, transform 0.15s, box-shadow 0.2s;
}
.lib-tab:hover { color: var(--accent); transform: translateX(-2px); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.14); }
.lib-tab { touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.lib-tab.is-dragging { cursor: grabbing; transform: none !important; transition: none; }
.lib-tab svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lib-tab.is-on { color: var(--accent); }

.lib-mask {
  position: fixed; inset: 0;
  z-index: 100;
  background: rgba(10, 12, 18, 0.16);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  animation: fadeIn 0.22s var(--ease) both;
}
[data-theme="dark"] .lib-mask { background: rgba(0, 0, 0, 0.42); }

.lib-drawer {
  position: fixed;
  top: 14px; right: 14px; bottom: 14px;
  z-index: 101;
  width: min(382px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  border-radius: 26px;
  overflow: hidden;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.4));
  border: 1px solid rgba(255, 255, 255, 0.66);
  box-shadow:
    0 42px 90px rgba(15, 23, 42, 0.24),
    0 4px 14px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px) saturate(190%);
  -webkit-backdrop-filter: blur(14px) saturate(190%);
  transform: translateX(calc(100% + 28px)) scale(0.985);
  opacity: 0.4;
  transition:
    transform 0.42s cubic-bezier(0.22, 0.9, 0.26, 1),
    opacity 0.28s ease;
  will-change: transform, opacity;
}
.lib-drawer.is-open { transform: translateX(0) scale(1); opacity: 1; }

[data-theme="dark"] .lib-drawer {
  background: linear-gradient(165deg, rgba(40, 45, 58, 0.72), rgba(20, 23, 31, 0.58));
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow:
    0 42px 90px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.lib-head { padding: 20px 20px 12px; position: relative; }
.lib-drawer .lib-head,
.lib-drawer .lib-search {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.3s ease 0.08s, transform 0.4s cubic-bezier(0.22, 0.9, 0.28, 1) 0.08s;
}
.lib-drawer.is-open .lib-head,
.lib-drawer.is-open .lib-search { opacity: 1; transform: none; }
.lib-head h2 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -0.35px; }
.lib-head p { margin: 5px 0 0; font-size: 11px; color: var(--text-3); line-height: 1.6; padding-right: 34px; }
.lib-close {
  position: absolute; top: 16px; right: 14px;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  transition: background 0.15s, transform 0.15s;
}
.lib-close:hover { background: rgba(255, 255, 255, 0.85); transform: scale(1.06); }
[data-theme="dark"] .lib-close { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.14); }
.lib-close svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; }

.lib-search { padding: 4px 18px 8px; }
.lib-search input {
  width: 100%;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px);
  font-size: 12px;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.lib-search input::placeholder { color: var(--text-3); }
.lib-search input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}
[data-theme="dark"] .lib-search input { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.12); }
[data-theme="dark"] .lib-search input:focus { background: rgba(255, 255, 255, 0.11); }

.lib-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 18px 20px; display: grid; gap: 10px; align-content: start; }
.lib-list::-webkit-scrollbar { width: 6px; }
.lib-list::-webkit-scrollbar-thumb { background: rgba(120, 130, 160, 0.28); border-radius: 99px; }

body.lib-open { overflow: hidden; }

.lib-item {
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  padding: 11px;
  background: rgba(255, 255, 255, 0.72);
  display: grid;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: border-color 0.18s, transform 0.18s var(--ease), box-shadow 0.18s;
  animation: libRise 0.44s cubic-bezier(0.22, 0.9, 0.28, 1) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
.lib-item:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, rgba(255, 255, 255, 0.7));
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
[data-theme="dark"] .lib-item { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }

@keyframes libRise {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.lib-item-top { display: flex; gap: 10px; align-items: flex-start; }
.lib-thumb {
  width: 54px; height: 54px; border-radius: 12px; object-fit: cover;
  background: var(--surface-3); flex: none;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}
.lib-thumb-ph {
  width: 54px; height: 54px; border-radius: 12px; flex: none;
  display: grid; place-items: center; color: var(--text-2);
  background:
    radial-gradient(120% 120% at 20% 15%, rgba(122, 160, 255, 0.42), transparent 60%),
    radial-gradient(120% 120% at 85% 25%, rgba(190, 130, 255, 0.34), transparent 62%),
    rgba(255, 255, 255, 0.5);
  font-size: 13px; font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.7);
}
[data-theme="dark"] .lib-thumb-ph { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.1); }
.lib-body { min-width: 0; flex: 1; }
.lib-title {
  margin: 0; font-size: 12.5px; font-weight: 600; line-height: 1.4; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lib-desc {
  margin: 2px 0 0; font-size: 10.5px; line-height: 1.5; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lib-meta { margin: 4px 0 0; font-size: 10px; color: var(--text-3); display: flex; gap: 6px; flex-wrap: wrap; }
.lib-actions { display: flex; gap: 6px; }
.lib-actions .btn {
  flex: 1; padding: 5px 10px; font-size: 11px; border-radius: 9px;
  background: rgba(255, 255, 255, 0.7); border: 1px solid rgba(255, 255, 255, 0.8);
}
.lib-actions .btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 35%, transparent);
}
.lib-actions .btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.lib-actions .btn.danger { flex: none; color: #c8433b; background: rgba(255, 255, 255, 0.55); }
[data-theme="dark"] .lib-actions .btn { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.12); }
[data-theme="dark"] .lib-actions .btn.primary { background: var(--accent); border-color: transparent; }
[data-theme="dark"] .lib-actions .btn.danger { color: #ff8a80; background: rgba(255, 255, 255, 0.06); }

@media (prefers-reduced-motion: reduce) {
  .lib-drawer, .lib-item, .lib-mask { transition: none; animation: none; }
}

@media (max-width: 720px) {
  .lib-tab { bottom: 96px; padding: 8px 10px; }
  .lib-tab span { display: none; }
}

/* ---------- 提示词库（页面） ---------- */
.lib-head-tools { display: flex; align-items: center; gap: 10px; }
.lib-search-inline {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  box-shadow: 0 6px 18px rgba(31, 45, 80, 0.07);
}
.lib-search-inline svg { width: 13px; height: 13px; stroke: var(--text-3); fill: none; stroke-width: 1.9; stroke-linecap: round; }
.lib-search-inline input { border: 0; outline: none; background: transparent; font-size: 12px; color: var(--text); width: 150px; }
[data-theme="dark"] .lib-search-inline { background: rgba(40, 44, 56, 0.55); border-color: rgba(255, 255, 255, 0.12); }

.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 16px;
  margin-top: 4px;
}

.lib-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 22px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.4));
  border: 1px solid rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  box-shadow: 0 16px 38px rgba(31, 45, 80, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: transform 0.24s var(--ease), box-shadow 0.24s var(--ease), border-color 0.2s;
}
.lib-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 54px rgba(31, 45, 80, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
[data-theme="dark"] .lib-card {
  background: linear-gradient(155deg, rgba(44, 48, 62, 0.72), rgba(24, 27, 36, 0.52));
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.lib-cover {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background:
    radial-gradient(120% 120% at 18% 12%, hsla(var(--h, 220), 88%, 74%, 0.6), transparent 58%),
    radial-gradient(120% 120% at 88% 18%, hsla(calc(var(--h, 220) + 46), 82%, 72%, 0.5), transparent 62%),
    linear-gradient(150deg, #eef2fb, #e6e9f4);
  display: grid;
  place-items: center;
}
.lib-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s var(--ease); }
.lib-card:hover .lib-cover img { transform: scale(1.04); }
.lib-cover-ph { width: 34px; height: 34px; opacity: 0.45; stroke: var(--text-2); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="dark"] .lib-cover { background: linear-gradient(150deg, #232838, #1a1d27); }

.lib-card-body { padding: 0 2px; flex: 1; }
.lib-card-title {
  margin: 0 0 4px;
  font-size: 13px; font-weight: 600; letter-spacing: -0.15px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lib-card-prompt {
  margin: 0;
  font-size: 11.5px; line-height: 1.65; color: var(--text-3);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 38px;
}
.lib-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.lib-chip {
  font-size: 9.5px;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.65);
}
[data-theme="dark"] .lib-chip { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.1); }

.lib-card-actions { display: flex; gap: 6px; margin-top: auto; }
.lib-card-actions .btn { flex: 1; font-size: 11px; padding: 6px 10px; border-radius: 10px; }
.lib-card-actions .btn.danger { flex: none; }

/* 左侧导航里的词库入口 */
.nav-item.nav-lib svg { stroke: var(--text-2); }
.nav-item.nav-lib.is-on {
  background: linear-gradient(120deg, rgba(122, 160, 255, 0.18), rgba(190, 130, 255, 0.14));
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(12px) saturate(170%);
}
[data-theme="dark"] .nav-item.nav-lib.is-on {
  background: linear-gradient(120deg, rgba(122, 160, 255, 0.22), rgba(190, 130, 255, 0.16));
  border-color: rgba(255, 255, 255, 0.12);
}

@media (max-width: 720px) {
  .lib-head-tools { width: 100%; }
  .lib-search-inline input { width: 100%; }
}

/* ---------- 会员页 ---------- */
.wallet {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 22px 24px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 180% at 0% 0%, var(--accent-soft), transparent 62%),
    color-mix(in srgb, var(--surface-solid) 76%, transparent);
  backdrop-filter: blur(12px) saturate(170%);
  -webkit-backdrop-filter: blur(12px) saturate(170%);
  box-shadow: var(--shadow-1);
  margin-bottom: 20px;
}
.wallet-label { display: block; font-size: 11.5px; color: var(--text-2); }
.wallet-main > b { display: block; font-size: 40px; font-weight: 600; letter-spacing: -1.4px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.wallet-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.wallet-sub { margin: 8px 0 0; font-size: 11.5px; color: var(--text-3); }

.wallet-breakdown { display: grid; grid-template-columns: repeat(3, minmax(104px, 1fr)); gap: 10px; }
.bd-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-solid) 70%, transparent);
  border: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0;
}
.bd-item span { font-size: 10.5px; color: var(--text-3); }
.bd-item b { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bd-item em { font-style: normal; font-size: 10px; color: var(--text-3); white-space: nowrap; }

.pricing-tabs { width: fit-content; margin-bottom: 18px; padding: 3px; }
.pricing-tabs .seg { height: 30px; padding: 0 18px; }

.pricing-panel { animation: fade 0.18s var(--ease); }
.panel-note { margin: 14px 2px 0; font-size: 11px; color: var(--text-3); line-height: 1.7; }
.panel-head-inline { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.panel-head-inline h2 { margin: 0; font-size: 13.5px; font-weight: 600; }

.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.tier {
  position: relative;
  padding: 22px 20px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-solid) 84%, transparent);
  box-shadow: var(--shadow-1);
  display: flex; flex-direction: column; gap: 4px;
  transition: border-color 0.2s, transform 0.26s var(--ease), box-shadow 0.26s var(--ease);
}
.tier:hover { transform: translateY(-3px); box-shadow: 0 18px 44px rgba(0, 0, 0, 0.14); }
.tier.featured { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: 0 12px 34px color-mix(in srgb, var(--accent) 14%, transparent); }
.tier-badge { position: absolute; top: -9px; left: 20px; height: 18px; padding: 0 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 600; display: inline-flex; align-items: center; }
.tier-name { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.tier-price { margin: 6px 0 14px; }
.tier-price em { font-style: normal; font-size: 30px; font-weight: 600; letter-spacing: -0.8px; }
.tier-price span { font-size: 11.5px; color: var(--text-3); margin-left: 4px; }
/* 自动口算：到账多少积分 / 能出几张图（数字来自接口，不是手写权益） */
.tier-figures {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px;
  margin: 2px 0 2px; font-size: 11.5px; color: var(--text-2);
}
.tier-figures b {
  font-size: 14px; font-weight: 600; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.tier-figures .tf-dot { opacity: 0.45; }
.tier-figures .tf-shots b { color: var(--text); }
.tier-list { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 9px; }
.tier-list li { font-size: 11.5px; color: var(--text-2); padding-left: 18px; position: relative; }
.tier-list li::before {
  content: "✓";
  position: absolute; left: 0; top: 0;
  font-size: 10px; line-height: 1.7;
  color: var(--accent);
}
.tier .btn { width: 100%; height: 34px; margin-top: auto; }
/* 限购套餐（9.9 试用）下面那行小字 */
.tier-note { margin: 8px 0 0; font-size: 10.5px; color: var(--text-3); text-align: center; line-height: 1.5; }

.packs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.pack {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 18px 20px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-solid) 84%, transparent);
  box-shadow: var(--shadow-1);
  text-align: left;
  transition: border-color 0.2s, transform 0.26s var(--ease), box-shadow 0.26s var(--ease);
}
.pack:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 18px 44px rgba(0, 0, 0, 0.14); }
.pack-name { font-size: 12px; color: var(--text-2); }
.pack-price { font-size: 26px; font-weight: 600; letter-spacing: -0.8px; font-variant-numeric: tabular-nums; }
.pack-shots { font-size: 10.5px; color: var(--text-3); }
.pack-shots b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.pack em { font-style: normal; font-size: 10.5px; color: var(--text-3); margin-top: 6px; }

/* ---------- 卡密兑换 ---------- */
.redeem-box {
  max-width: 520px;
  padding: 22px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  box-shadow: var(--shadow-1);
}
.redeem-box h3 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.redeem-box .sub { margin: 0 0 14px; font-size: 11.5px; color: var(--text-3); }
.redeem-row { display: flex; gap: 8px; }
.redeem-row input {
  flex: 1; height: 36px; padding: 0 12px;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text);
  font-size: 13px; letter-spacing: 1.2px; font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.redeem-row input:focus { outline: none; border-color: var(--accent); background: var(--surface-solid); }
.redeem-row .btn { height: 36px; padding: 0 18px; }
.redeem-hint { margin: 12px 0 0; font-size: 10.5px; color: var(--text-3); line-height: 1.7; }

.tx-table { display: flex; flex-direction: column; border-radius: var(--r-lg); border: 1px solid var(--line); background: color-mix(in srgb, var(--surface-solid) 84%, transparent); overflow: hidden; box-shadow: var(--shadow-1); }
.tx-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px 70px 92px;
  align-items: center; gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
}
.tx-row:last-child { border-bottom: 0; }
.tx-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tx-row .tx-name { color: var(--text); }
.tx-desc { font-size: 10.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-row .tx-time { color: var(--text-3); font-size: 11px; text-align: right; }
.tx-row .tx-delta { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.tx-row .tx-delta.up { color: var(--ok); }
.tx-row .tx-delta.down { color: var(--text); }
.tx-balance { text-align: right; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ---------- 联系管理员 ---------- */
.contact-box {
  margin-top: 4px; padding: 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  display: flex; gap: 16px; align-items: flex-start; justify-content: space-between;
}
.contact-text { margin: 0; font-size: 12.5px; line-height: 1.9; white-space: pre-wrap; }
.contact-text.is-empty { color: var(--text-3); }
.contact-qr { width: 120px; height: 120px; border-radius: 10px; object-fit: cover; background: var(--surface-3); }
.contact-note { margin: 12px 0 0; font-size: 11px; color: var(--text-3); line-height: 1.7; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ---------- 输入条 ---------- */
.composer-wrap {
  position: fixed; left: 232px; right: 0; bottom: 0; z-index: 40;
  padding: 22px 28px 12px;
  background: linear-gradient(180deg, transparent, var(--bg) 55%);
  pointer-events: none;
  transition: left 0.3s var(--ease), transform 0.3s var(--ease), opacity 0.24s var(--ease);
}
.composer-wrap.is-hidden {
  transform: translateY(calc(100% + 16px));
  opacity: 0;
}
.rail.is-collapsed ~ .main .composer-wrap { left: 68px; }
.composer {
  pointer-events: auto;
  max-width: 860px; margin: 0 auto;
  padding: 12px 12px 9px;
  border-radius: var(--r-xl);
  background: var(--surface);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-2);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.composer:focus-within {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: var(--shadow-2), 0 0 0 4px var(--accent-soft);
}

.composer-top { display: flex; gap: 10px; align-items: flex-start; }
.upload {
  width: 46px; height: 46px; flex: none;
  border-radius: var(--r-md);
  border: 1px dashed var(--line);
  background: var(--surface-2);
  color: var(--text-3);
  display: grid; place-items: center;
  transition: color 0.15s, border-color 0.15s;
}
.upload:hover { color: var(--accent); border-color: var(--accent); }
.upload.is-off { opacity: 0.4; cursor: not-allowed; }
.upload.is-off:hover { color: var(--text-3); border-color: var(--line); }
.upload svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }

#prompt, #inspInput {
  field-sizing: content;
  max-height: min(380px, 42vh);
  max-height: min(380px, 42dvh);
  overflow-y: auto;
  min-width: 0;
}

#prompt {
  flex: 1; min-height: 46px;
  padding: 13px 2px 0;
  border: 0; outline: 0; background: none; resize: none;
  font-size: 13px; line-height: 1.65;
}
#prompt::placeholder { color: var(--text-3); }

.composer-settings { display: contents; }
.composer-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.bar-left { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.bar-right { display: flex; align-items: center; gap: 10px; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 26px; padding: 0 8px;
  border-radius: var(--r-sm);
  font-size: 11.5px; font-weight: 500; color: var(--text-2);
  transition: background 0.15s, color 0.15s;
}
.chip:hover { background: var(--hover); color: var(--text); }
.chip.is-off,
.chip:disabled { opacity: 0.55; cursor: not-allowed; }
.chip.is-off:hover,
.chip:disabled:hover { background: transparent; color: var(--text-2); }
.chip .caret { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 2; opacity: 0.6; }

.cost { font-size: 11px; color: var(--text-3); white-space: nowrap; }

.send {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-3);
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.send svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.send.is-ready { background: var(--accent); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent); }
.send.is-ready:hover { transform: translateY(-1px); }
/* 并发占满：按钮变暗，点了会提示还差多久 */
.send.is-full { background: var(--surface-3); color: var(--text-3); opacity: 0.7; box-shadow: none; }
.send.is-full:hover { transform: none; }
.send { position: relative; }
.send.is-busy { background: color-mix(in srgb, var(--accent) 18%, var(--surface-3)); color: var(--accent); cursor: progress; }
.send.is-busy::after {
  content: "";
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--accent);
  border-right-color: color-mix(in srgb, var(--accent) 40%, transparent);
  animation: genSpin 0.9s linear infinite;
}

.disclaimer { text-align: center; font-size: 10.5px; color: var(--text-3); margin: 8px 0 0; }

.ref-strip { display: flex; gap: 8px; padding: 8px 0 0 56px; flex-wrap: wrap; align-items: center; }
.ref-count { font-size: 10.5px; color: var(--text-3); margin-right: 2px; }
.ref-thumb { position: relative; width: 48px; height: 48px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); }
.ref-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-del {
  position: absolute; top: 2px; right: 2px;
  width: 15px; height: 15px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.6); color: #fff;
}
.ref-del svg { width: 8px; height: 8px; stroke: currentColor; stroke-width: 2.6; fill: none; stroke-linecap: round; }

/* ---------- 登录 ---------- */
.auth-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; font-size: 12.5px; color: var(--text-2); }
.auth-brand .brand-mark { width: 22px; height: 22px; border-radius: 7px; }
.auth-brand .brand-mark svg { width: 13px; height: 13px; }
.auth-brand .brand-name { font-size: 13.5px; }
.auth-brand .brand-name em { font-size: 9.5px; }
#authTabs { width: 100%; margin-bottom: 16px; }
#authTabs .seg { flex: 1; }
.field { margin-bottom: 12px; }
.auth-submit { width: 100%; height: 36px; margin-top: 6px; }
.form-error { margin: 0 0 10px; font-size: 11.5px; color: var(--danger); }
.auth-demo { margin: 14px 0 0; text-align: center; font-size: 11px; color: var(--text-3); line-height: 1.9; }
.auth-demo b { color: var(--text-2); font-weight: 500; }
.link { color: var(--accent); font-size: 11px; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- 作品详情 ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 130;
  display: grid; place-items: center;
  padding: 30px;
  background: var(--scrim);
  backdrop-filter: blur(12px) saturate(120%);
  animation: fade 0.2s var(--ease);
  overflow: hidden;
}
.lb-backdrop {
  position: absolute; inset: -60px;
  background-size: cover;
  background-position: center;
  filter: blur(70px) saturate(140%);
  opacity: 0.38;
  transform: scale(1.08);
  pointer-events: none;
}
[data-theme="light"] .lb-backdrop { opacity: 0.22; }

.lb-close {
  position: absolute; top: 20px; right: 20px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--surface-solid) 86%, transparent);
  border: 1px solid var(--line);
  color: var(--text-2);
  backdrop-filter: blur(10px);
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.lb-close:hover { color: var(--text); transform: scale(1.05); }
.lb-close svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; }

.lb-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px; width: min(1120px, 100%); max-height: 88vh;
}
.lb-media { display: grid; place-items: center; min-height: 0; position: relative; overflow: hidden; }
.lb-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 42px;
  height: 42px;
  margin-top: -21px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(18, 20, 26, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  transition: background 0.16s var(--ease), transform 0.16s var(--ease);
}
.lb-nav:hover { background: rgba(18, 20, 26, 0.58); transform: scale(1.06); }
.lb-nav:active { transform: scale(0.96); }
.lb-nav:focus { outline: none; }
.lb-nav:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 70%, #fff); outline-offset: 2px; }
.lb-nav[hidden], .lb-counter[hidden] { display: none; }
.lb-nav svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.lb-prev { left: 14px; }
.lb-next { right: 14px; }
.lb-counter {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 3;
  transform: translateX(-50%);
  padding: 5px 12px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(18, 20, 26, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.lb-zoom {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(18, 20, 26, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
}
.lb-zoom button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.lb-zoom button:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.lb-zoom button:active { background: rgba(255, 255, 255, 0.24); }
.lb-zoom button:disabled { opacity: 0.32; cursor: not-allowed; background: transparent; }
.lb-zoom button.is-reset {
  width: auto;
  min-width: 38px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.lb-zoom span {
  min-width: 42px;
  text-align: center;
  color: rgba(255, 255, 255, 0.82);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.lb-media img {
  max-width: 100%; max-height: 88vh;
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
  background: var(--surface-2);
  transform-origin: center center;
  transition: transform 0.18s var(--ease);
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}
.lb-media img.is-zoomed { cursor: grab; touch-action: none; }
.lb-media img.is-panning { cursor: grabbing; transition: none; }

.lb-side {
  padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
  height: fit-content; max-height: 88vh; overflow: auto;
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-solid) 94%, transparent);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-2);
  backdrop-filter: blur(12px);
}
.lb-eyebrow {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--text-3);
}

.lb-prompt-block {
  padding: 11px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
}
.lb-prompt-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.4px;
  text-transform: uppercase; color: var(--text-3);
}
.lb-copy-inline {
  width: 22px; height: 22px; border-radius: 6px;
  display: grid; place-items: center;
  color: var(--text-3);
}
.lb-copy-inline:hover { color: var(--accent); background: var(--accent-soft); }
.lb-copy-inline svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lb-prompt { margin: 7px 0 0; font-size: 12.5px; line-height: 1.75; max-height: 148px; overflow: auto; }

.lb-meta { margin: 0; display: grid; gap: 0; }
.lb-meta > div {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 7px 1px;
  font-size: 11.5px; border-bottom: 1px solid var(--line-soft);
}
.lb-meta > div:last-child { border-bottom: 0; }
.lb-meta dt { color: var(--text-3); }
.lb-meta dd { margin: 0; color: var(--text); font-variant-numeric: tabular-nums; }

.lb-refs { display: flex; gap: 6px; flex-wrap: wrap; }
.lb-refs img {
  width: 46px; height: 46px; border-radius: 8px;
  object-fit: cover; border: 1px solid var(--line); background: var(--surface-2);
}

.lb-actions { display: grid; gap: 7px; margin-top: 2px; }
.lb-actions .btn { width: 100%; height: 33px; }
.lb-actions .btn .heart { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.8; margin-right: 6px; }
.lb-actions .btn.is-liked { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.lb-actions .btn.is-liked .heart { fill: var(--danger); stroke: var(--danger); }
.case-tag.is-like { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }

/* ---------- 浮层 ---------- */
.popover {
  position: fixed; z-index: 140;
  min-width: 200px;
  padding: 6px;
  border-radius: var(--r-lg);
  background: var(--surface-solid);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-2);
  backdrop-filter: var(--glass);
  animation: pop 0.16s var(--ease);
}
.popover-head { padding: 8px 10px 6px; font-size: 11px; font-weight: 600; color: var(--text-3); }
.popover-body { display: grid; gap: 2px; max-height: 320px; overflow: auto; }

.menu .menu-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 7px 10px;
  border-radius: var(--r-sm);
  font-size: 12.5px; text-align: left; color: var(--text);
}
.menu .menu-item:hover { background: var(--hover); }
.menu .menu-item.is-on { color: var(--accent); }
.menu .menu-item .check { width: 12px; height: 12px; stroke: var(--accent); fill: none; stroke-width: 2.4; opacity: 0; }
.menu .menu-item.is-on .check { opacity: 1; }
.menu .menu-item small { color: var(--text-3); font-size: 10.5px; font-weight: 400; }
.menu .menu-label { padding: 6px 10px 4px; font-size: 10.5px; color: var(--text-3); }
.menu .menu-sep { height: 1px; background: var(--line-soft); margin: 4px 6px; }

/* 菜单本身可滚动：模型多了或屏幕矮时不会顶出屏幕 */
.popover.menu {
  max-height: min(62vh, 420px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.menu .menu-item > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* @ 引用参考图的菜单 */
.menu .menu-item.mention-item { justify-content: flex-start; gap: 10px; }
.mention-item .mention-thumb {
  width: 26px; height: 26px;
  flex: none;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.mention-item span { color: var(--text); }
.menu .menu-item.mention-add { color: var(--accent); }
.menu .menu-item.is-active { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.menu .menu-item.is-active span { color: var(--accent); }
.menu .menu-empty { padding: 8px 12px; font-size: 11.5px; color: var(--text-3); }

.notif-item { display: flex; gap: 10px; padding: 8px; border-radius: var(--r-sm); font-size: 11.5px; color: var(--text-2); align-items: center; }
.notif-item:hover { background: var(--hover); }
.notif-item img { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; background: var(--surface-3); }
.notif-item b { display: block; color: var(--text); font-weight: 500; font-size: 12px; }

/* 公告列表 */
.ann-item {
  display: flex; flex-direction: column; gap: 3px;
  width: 100%; text-align: left;
  padding: 10px; border-radius: var(--r-sm);
  transition: background 0.15s;
}
.ann-item:hover { background: var(--hover); }
.ann-head { display: flex; align-items: center; gap: 6px; }
.ann-head b { font-size: 12px; font-weight: 600; color: var(--text); }
.ann-pin {
  font-size: 9px; padding: 1px 6px; border-radius: 999px;
  color: #b45309; background: rgba(245, 158, 11, 0.16);
}
.ann-body {
  font-size: 11px; line-height: 1.6; color: var(--text-3);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ann-time { font-size: 10px; color: var(--text-3); opacity: 0.8; }

/* ---------- 登录态 ---------- */
.user-chip { display: flex; align-items: center; gap: 7px; padding: 3px 9px 3px 3px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-solid); }
.user-chip:hover { border-color: var(--accent); }
.user-chip .avatar {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, #6e8bff, #b06bff);
}
.user-chip .user-name { font-size: 12px; font-weight: 500; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 响应式 ---------- */
@media (prefers-reduced-motion: reduce) {
  .insp-shell, .insp-side, .insp-thread, .insp-thread-title,
  .insp-pop, .insp-feed.is-swap, .insp-top.is-swap,
  .insp-assets-panel, .insp-assets-mask { transition: none !important; animation: none !important; }
}

@media (max-width: 1100px) {
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .templates { grid-template-columns: repeat(2, 1fr); }
  .refs-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .rail { display: none; }
  .composer-wrap { left: 0 !important; }
  .view { padding: 18px 16px 40px; }
  #view-create { padding-bottom: 200px; }
  .topbar { padding: 0 16px; }
  .templates { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiers { grid-template-columns: 1fr; }
  .lb-inner { grid-template-columns: 1fr; max-height: 90vh; overflow: auto; }
  .view-head { flex-direction: column; align-items: flex-start; }
}



/* ================= 灵感工作台（整屏对话） ================= */
#view-inspire { max-width: none; padding: 0; }

.insp-shell {
  position: relative;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  height: calc(100dvh - 56px);
  min-height: 520px;
  border-top: 1px solid var(--line-soft);
  transition: grid-template-columns 0.32s var(--ease);
}

/* 左侧：会话列表 */
.insp-side {
  display: flex; flex-direction: column; min-height: 0;
  min-width: 0; overflow: hidden;
  border-right: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--surface-solid) 55%, transparent);
  transition: opacity 0.22s var(--ease), border-color 0.22s var(--ease);
}
/* 折叠时靠列宽动画，里面的内容固定 252px 宽，跟着被裁掉，不会挤成一条线 */
.insp-side-top, .insp-threads { width: 252px; }
.insp-side-top { display: flex; align-items: center; gap: 8px; padding: 14px 12px 10px; }
.insp-side-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; }
.insp-side-top .btn { flex: none; }
.insp-threads { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.insp-thread { display: flex; align-items: center; border-radius: 10px; transition: background 0.16s var(--ease); }
.insp-thread:hover { background: var(--hover); }
.insp-thread.is-on { background: var(--accent-soft); }
.insp-thread-open { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 8px 9px; text-align: left; }
.insp-thread-title { font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.16s var(--ease); }
.insp-thread.is-on .insp-thread-title { color: var(--accent); font-weight: 600; }
.insp-thread-meta { display: flex; align-items: center; gap: 6px; }
.insp-thread-time { font-size: 10px; color: var(--text-3); }
.insp-thread-count {
  font-style: normal; font-size: 9.5px; line-height: 1.5;
  padding: 0 6px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--text-3); white-space: nowrap;
}
.insp-thread-del {
  flex: none; width: 24px; height: 24px; margin-right: 6px;
  border-radius: 7px; font-size: 11px; color: var(--text-3);
  opacity: 0; transition: opacity 0.15s, background 0.15s, color 0.15s;
}
.insp-thread:hover .insp-thread-del { opacity: 1; }
.insp-thread-del:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.insp-side-empty { margin: auto; padding: 20px 10px; font-size: 11.5px; color: var(--text-3); text-align: center; }

/* 右侧：对话 */
.insp-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.insp-top {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 12px max(18px, calc((100% - 880px) / 2));
  border-bottom: 1px solid var(--line-soft);
}
.insp-top-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.insp-top-title b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.insp-top-title span { font-size: 10.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.insp-assets-btn {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.insp-assets-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linejoin: round; }
.insp-assets-btn em { font-style: normal; font-weight: 600; color: var(--accent); }
.insp-assets-btn:hover { border-color: var(--accent); color: var(--accent); }

.insp-feed {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 22px max(18px, calc((100% - 880px) / 2)) 10px;
  display: flex; flex-direction: column; gap: 24px;
}

.insp-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 24px; text-align: center;
  animation: inspFade 0.3s var(--ease) both;
}
.insp-empty svg { width: 30px; height: 30px; stroke: var(--text-3); fill: none; stroke-width: 1.4; }
.insp-empty p { margin: 0; font-size: 12.5px; color: var(--text-3); }
.insp-seeds { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; max-width: 560px; }
.insp-seeds button {
  font-size: 12px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.insp-seeds button:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* 消息进场：从下面轻轻浮上来（只给新消息加 .insp-pop，重新渲染不会全体重播） */
@keyframes inspPop {
  from { opacity: 0; transform: translateY(9px) scale(0.995); }
  to { opacity: 1; transform: none; }
}
.insp-pop { animation: inspPop 0.32s var(--ease) both; }
@keyframes inspFade { from { opacity: 0; } to { opacity: 1; } }
.insp-feed.is-swap, .insp-top.is-swap { animation: inspFade 0.24s var(--ease); }

/* 消息气泡：用户浅色气泡，AI 直接铺字（ChatGPT 那种） */
.insp-msg { display: flex; gap: 10px; align-items: flex-start; }
.insp-msg.is-user { justify-content: flex-end; }
.insp-avatar {
  flex: none; width: 26px; height: 26px; margin-top: 1px;
  border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font-size: 10px; font-weight: 700;
}
.insp-bubble { min-width: 0; max-width: 100%; }
.insp-msg.is-user .insp-bubble {
  max-width: 76%; padding: 10px 14px;
  border-radius: 15px 15px 4px 15px;
  background: var(--surface-3); color: var(--text);
}
.insp-msg.is-ai .insp-bubble { flex: 1; padding-top: 2px; }
.insp-say { font-size: 14px; line-height: 1.9; white-space: pre-wrap; word-break: break-word; }
.insp-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.insp-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line-soft); }

/* AI 给的这版提示词 */
.insp-prompt-card {
  margin-top: 10px; padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed color-mix(in srgb, var(--accent) 38%, var(--line));
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.insp-prompt-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.insp-prompt-head > span { font-size: 10.5px; font-weight: 600; color: var(--accent); letter-spacing: 0.2px; }
.insp-prompt-head > em { font-style: normal; font-size: 10px; color: var(--text-3); }
.insp-prompt-text { margin: 0; font-size: 13px; line-height: 1.85; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.insp-prompt-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.insp-prompt-actions button {
  font-size: 10.5px; padding: 2px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-solid); color: var(--text-2);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.insp-prompt-actions button:hover { color: var(--accent); border-color: var(--accent); }
.insp-prompt-actions button.is-main { background: var(--accent); border-color: transparent; color: #fff; }
.insp-prompt-actions button.is-main:hover { background: color-mix(in srgb, var(--accent) 88%, #000); color: #fff; }

/* 打字中 */
.insp-typing { display: flex; gap: 4px; padding: 6px 0 2px; }
.insp-typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--text-3); animation: inspBlink 1.2s infinite; }
.insp-typing i:nth-child(2) { animation-delay: 0.2s; }
.insp-typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes inspBlink { 0%, 60%, 100% { opacity: 0.25; } 30% { opacity: 1; } }

/* 对话里出的图 */
.insp-msg.is-gen { padding-left: 36px; }
.insp-gen-card {
  width: min(420px, 100%);
  padding: 10px 11px 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}
.insp-gen-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.insp-gen-head > span { font-size: 10.5px; color: var(--text-3); white-space: nowrap; }
.insp-gen-skel {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--text-3); font-size: 11.5px;
}
.insp-gen-skel.is-failed {
  aspect-ratio: auto; padding: 18px 12px;
  color: var(--danger); background: color-mix(in srgb, var(--danger) 7%, transparent);
}
.insp-orbit {
  width: 14px; height: 14px; flex: none;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-top-color: var(--accent);
  animation: genSpin 0.9s linear infinite;
}
/* 一张：居中大图；多张（Midjourney 一次出 4 张）：两列网格，别把卡片撑爆 */
.insp-gen-imgs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; justify-items: center; }
.insp-gen-imgs.is-multi { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; justify-items: stretch; }
.insp-gen-imgs img {
  max-width: 100%; max-height: 420px; width: auto; height: auto;
  display: block; border-radius: 10px; background: var(--surface-3);
  cursor: zoom-in;
}
.insp-gen-imgs.is-multi img {
  width: 100%; height: auto; max-height: 320px;
  object-fit: cover;
}
/* 选中的那张（「继续调整」会用它） */
.insp-gen-imgs img.is-picked { outline: 2px solid var(--accent); outline-offset: 2px; }
.insp-gen-card.is-multi { width: min(560px, 100%); }
.insp-gen-prompt {
  margin: 9px 0 0; font-size: 10.5px; line-height: 1.7; color: var(--text-3);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* 输入区：一个圆角盒子，像 ChatGPT 的输入条 */
.insp-composer { flex: none; padding: 6px max(18px, calc((100% - 880px) / 2)) 16px; }
.insp-box {
  padding: 10px 12px 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-1);
}
.insp-refs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.insp-ref { position: relative; width: 54px; height: 54px; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); }
.insp-ref img { width: 100%; height: 100%; object-fit: cover; display: block; }
.insp-ref em {
  position: absolute; left: 3px; bottom: 2px;
  font-style: normal; font-size: 9px; padding: 0 5px; border-radius: 5px;
  background: rgba(0, 0, 0, 0.55); color: #fff;
}
.insp-ref button {
  position: absolute; top: 2px; right: 2px;
  width: 15px; height: 15px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 9px;
}
.insp-ref-count { font-size: 10px; color: var(--text-3); line-height: 1.6; }
#inspInput {
  width: 100%; min-height: 28px;
  padding: 2px 2px 0; border: 0; outline: 0; resize: none; background: none;
  font-size: 14px; line-height: 1.7; color: var(--text);
}
#inspInput::placeholder { color: var(--text-3); }
.insp-bar { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.insp-model {
  height: 30px; padding: 0 8px; max-width: 150px; min-width: 0;
  border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font-size: 11.5px;
  text-overflow: ellipsis;
}
.insp-model:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.insp-ratio { max-width: 92px; }
.insp-selects { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.insp-attach {
  font-size: 11.5px; padding: 5px 10px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2);
  transition: color 0.15s, border-color 0.15s;
}
.insp-attach:hover { color: var(--accent); border-color: var(--accent); }
.insp-attach:disabled { opacity: 0.45; cursor: not-allowed; }
.insp-attach:disabled:hover { color: var(--text-2); border-color: var(--line); }
.insp-cost { margin-left: auto; font-size: 10.5px; color: var(--text-3); white-space: nowrap; }
.insp-bar .btn { height: 32px; padding: 0 18px; }
.insp-bar .btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 资产盒子：右侧抽屉，点图放大 */
.insp-assets { position: absolute; inset: 0; z-index: 40; }
.insp-assets-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35); }
.insp-assets-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(368px, 90%);
  display: flex; flex-direction: column;
  background: var(--surface-solid);
  border-left: 1px solid var(--line);
  box-shadow: -30px 0 70px rgba(0, 0, 0, 0.28);
  animation: inspSlideIn 0.22s var(--ease) both;
}
@keyframes inspSlideIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes inspSlideOut { from { transform: none; opacity: 1; } to { transform: translateX(24px); opacity: 0; } }
@keyframes inspFadeOut { from { opacity: 1; } to { opacity: 0; } }
.insp-assets.is-closing .insp-assets-panel { animation: inspSlideOut 0.17s var(--ease) both; }
.insp-assets.is-closing .insp-assets-mask { animation: inspFadeOut 0.17s var(--ease) both; }
.insp-assets .insp-assets-panel { animation: inspSlideIn 0.24s var(--ease) both; }
.insp-assets .insp-assets-mask { animation: inspFade 0.24s var(--ease) both; }
.insp-assets-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 14px 14px 10px; border-bottom: 1px solid var(--line-soft);
}
.insp-assets-head b { font-size: 13px; font-weight: 600; }
.insp-assets-head em { font-style: normal; margin-left: 4px; color: var(--accent); }
.insp-assets-close { width: 26px; height: 26px; border-radius: 8px; color: var(--text-3); }
.insp-assets-close:hover { background: var(--hover); color: var(--text); }
.insp-assets-grid { flex: 1; overflow-y: auto; padding: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-content: start; }
.insp-assets-grid .insp-asset {
  position: relative; aspect-ratio: 3 / 4; overflow: hidden;
  border-radius: 10px; border: 1px solid var(--line-soft); background: var(--surface-2);
}
.insp-assets-grid .insp-asset img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.insp-assets-grid .insp-asset:hover img { transform: scale(1.03); }
.insp-assets-grid .insp-asset img { transition: transform 0.25s var(--ease); }
.insp-assets-empty { padding: 30px 14px; text-align: center; font-size: 12px; color: var(--text-3); }

/* 会话栏收起 / 展开：按钮在会话栏标题那一行，收起后挪到对话区左上角 */
.insp-side-toggle {
  flex: none; width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 7px; border: 1px solid transparent;
  color: var(--text-2); background: transparent;
  transition: background 0.15s, color 0.15s;
}
.insp-side-toggle:hover { background: var(--hover); color: var(--text); }
.insp-side-toggle svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linejoin: round; }
.insp-top .insp-side-toggle { width: 30px; height: 30px; border-radius: 8px; }
.insp-top .insp-side-toggle svg { width: 16px; height: 16px; }

.insp-shell.is-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.insp-shell.is-collapsed .insp-side { opacity: 0; border-right-color: transparent; pointer-events: none; }

/* 分页：加载更多 / 加载更早 */
.insp-more {
  align-self: center;
  margin: 4px auto 6px;
  font-size: 11px; padding: 5px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text-3);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.insp-more:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.insp-assets-grid .insp-more { grid-column: 1 / -1; justify-self: center; }

/* ===== 工作台：锚点 / 参数 / 版本 / 消息操作 ===== */
.insp-anchor-row {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 0 0 6px;
}
.insp-anchor-label { font-size: 10px; color: var(--text-3); letter-spacing: 0.4px; }
.insp-anchor-add {
  font-size: 10.5px; padding: 3px 9px; border-radius: 999px;
  border: 1px dashed var(--line); color: var(--text-3); background: transparent;
}
.insp-anchor-add:hover { color: var(--accent); border-color: var(--accent); }
.insp-anchors { display: flex; flex-wrap: wrap; gap: 6px; }
.insp-anchor {
  position: relative; width: 40px; height: 40px; border-radius: 8px;
  overflow: hidden; border: 1px solid var(--accent);
}
.insp-anchor img { width: 100%; height: 100%; object-fit: cover; display: block; }
.insp-anchor em {
  position: absolute; left: 2px; bottom: 1px; font-style: normal;
  font-size: 8px; padding: 0 3px; border-radius: 3px;
  background: rgba(0, 0, 0, 0.55); color: #fff;
}
.insp-anchor button {
  position: absolute; top: 1px; right: 1px; width: 13px; height: 13px;
  border-radius: 50%; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 8px;
  display: grid; place-items: center;
}

.insp-bar { flex-wrap: wrap; row-gap: 6px; }
.insp-res { max-width: 74px; }
.insp-count { max-width: 70px; }
.insp-auto {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; color: var(--text-3); white-space: nowrap; cursor: pointer;
}
.insp-auto input { width: 13px; height: 13px; accent-color: var(--accent); }
.insp-search input { accent-color: #2f9e8f; }
.insp-search { color: var(--text-2); }
.insp-search.is-off { opacity: 0.45; }
.insp-search-note {
  margin: 6px 0 2px; padding: 7px 10px; border-radius: 8px;
  background: color-mix(in srgb, #2f9e8f 10%, transparent);
  border: 1px solid color-mix(in srgb, #2f9e8f 28%, transparent);
  color: #237a6e; font-size: 11px;
}
/* 思考过程（接口返回 reasoning 才有）：默认折叠成一行，点开看全文 */
.insp-think { margin: 0 0 8px; }
.insp-think summary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 0; cursor: pointer; list-style: none; user-select: none;
  font-size: 11px; color: var(--text-3);
}
.insp-think summary::-webkit-details-marker { display: none; }
.insp-think summary::before {
  content: "▸"; font-size: 9px; transition: transform 0.15s var(--ease);
}
.insp-think[open] summary::before { transform: rotate(90deg); }
.insp-think summary:hover { color: var(--accent); }
.insp-think summary span:first-of-type { font-weight: 500; }
.insp-think summary span + span { opacity: 0.75; }
.insp-think-body {
  margin: 4px 0 2px; padding: 7px 12px;
  border-left: 2px solid color-mix(in srgb, var(--text-3) 38%, transparent);
  border-radius: 0 8px 8px 0;
  background: color-mix(in srgb, var(--text-3) 6%, transparent);
  max-height: 320px; overflow-y: auto;
  font-size: 12px; line-height: 1.85; color: var(--text-2);
  white-space: pre-wrap; word-break: break-word;
}

.insp-sources { margin-top: 8px; border-top: 1px dashed var(--line-soft); padding-top: 7px; }.insp-sources summary {
  cursor: pointer; font-size: 11px; color: var(--text-3);
  list-style: none; user-select: none;
}
.insp-sources summary::-webkit-details-marker { display: none; }
.insp-sources summary::before {
  content: "▸"; display: inline-block; margin-right: 5px; transition: transform .15s;
}
.insp-sources[open] summary::before { transform: rotate(90deg); }
.insp-sources summary:hover { color: var(--accent); }
.insp-source-list { display: flex; flex-direction: column; gap: 6px; margin-top: 7px; }
.insp-source-list a {
  display: block; padding: 6px 8px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--line-soft);
  text-decoration: none; color: var(--text-2);
}
.insp-source-list a:hover { border-color: var(--accent); color: var(--text); }
.insp-source-list a b { display: block; font-size: 11px; font-weight: 500; line-height: 1.5; }
.insp-source-list a span { display: block; margin-top: 2px; font-size: 9.5px; color: var(--text-3); }
.insp-gen-cost { font-size: 10.5px; color: var(--text-3); white-space: nowrap; }
.insp-cost { margin-left: auto; }

/* 每条消息的小操作 */
.insp-msg-actions {
  display: flex; justify-content: flex-end; gap: 4px;
  margin-top: 6px; opacity: 0; transition: opacity 0.15s;
}
.insp-msg:hover .insp-msg-actions, .insp-msg:focus-within .insp-msg-actions { opacity: 1; }
.insp-msg-actions button {
  font-size: 10px; padding: 1px 8px; border-radius: 999px;
  color: var(--text-3); border: 1px solid transparent;
}
.insp-msg-actions button:hover { color: var(--danger); border-color: var(--line); background: var(--surface-2); }
.insp-msg-actions button.is-safe:hover { color: var(--accent); }

/* 资产格子上的操作 */
.insp-assets-grid .insp-asset { cursor: zoom-in; }
.insp-asset-acts {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; gap: 2px; padding: 4px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
  opacity: 0; transition: opacity 0.15s;
}
.insp-asset:hover .insp-asset-acts, .insp-asset:focus-within .insp-asset-acts { opacity: 1; }
.insp-asset-acts button {
  flex: 1; font-size: 9.5px; padding: 3px 2px; border-radius: 6px;
  background: rgba(0, 0, 0, 0.45); color: #fff;
}
.insp-asset-acts button:hover { background: rgba(0, 0, 0, 0.7); }
.insp-assets-head .insp-assets-tools { display: flex; gap: 6px; align-items: center; }
.insp-assets-head .insp-assets-tools button { font-size: 10.5px; color: var(--text-2); }
.insp-assets-head .insp-assets-tools button:hover { color: var(--accent); }

/* 版本时间线 */
.insp-versions-list { flex: 1; overflow-y: auto; padding: 10px 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.insp-version {
  padding: 9px 10px; border-radius: 10px;
  border: 1px solid var(--line-soft); background: var(--surface-2);
}
.insp-version.is-latest { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.insp-version-head { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.insp-version-head b { font-size: 11px; color: var(--accent); }
.insp-version-head span { font-size: 9.5px; color: var(--text-3); }
.insp-version-prompt {
  font-size: 11px; line-height: 1.6; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.insp-version-thumbs { display: flex; gap: 4px; margin-top: 6px; }
.insp-version-thumbs img { width: 38px; height: 38px; border-radius: 6px; object-fit: cover; cursor: zoom-in; }
.insp-version-acts { display: flex; gap: 4px; margin-top: 7px; }
.insp-version-acts button {
  font-size: 10px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--text-3); background: var(--surface-solid);
}
.insp-version-acts button:hover { color: var(--accent); border-color: var(--accent); }

/* 锚点卡 */
.insp-cards-list { flex: 1; overflow-y: auto; padding: 10px 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.insp-card-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px; border-radius: 10px; border: 1px solid var(--line-soft); background: var(--surface-2);
}
.insp-card-item .insp-card-thumbs { display: flex; gap: 3px; flex: none; }
.insp-card-item .insp-card-thumbs img { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; }
.insp-card-item .insp-card-main { flex: 1; min-width: 0; }
.insp-card-item .insp-card-main b { display: block; font-size: 11.5px; }
.insp-card-item .insp-card-main span { font-size: 9.5px; color: var(--text-3); }
.insp-card-item .insp-card-acts { display: flex; gap: 4px; flex: none; }
.insp-card-item .insp-card-acts button {
  font-size: 10px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--text-3); background: var(--surface-solid);
}
.insp-card-item .insp-card-acts button:hover { color: var(--accent); border-color: var(--accent); }
.insp-card-item .insp-card-acts button.danger:hover { color: var(--danger); border-color: var(--danger); }

.insp-card-tools { display: flex; gap: 6px; padding: 2px 2px 8px; }
.insp-card-tools button {
  flex: 1; font-size: 11px; padding: 5px 8px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface-solid); color: var(--text-2);
}
.insp-card-tools button:hover { color: var(--accent); border-color: var(--accent); }

/* 版本对比 */
.insp-compare { position: absolute; inset: 0; z-index: 45; display: grid; place-items: center; padding: 20px; }
.insp-compare-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); }
.insp-compare-box {
  position: relative; width: min(860px, 100%); max-height: 84%; overflow: auto;
  padding: 18px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--surface-solid); box-shadow: var(--shadow-2);
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.insp-compare-col h4 { margin: 0 0 6px; font-size: 12px; color: var(--accent); }
.insp-compare-col p { margin: 0; font-size: 11.5px; line-height: 1.7; color: var(--text-2); white-space: pre-wrap; }
.insp-compare-col .insp-compare-imgs { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.insp-compare-col .insp-compare-imgs img { width: 66px; height: 66px; border-radius: 7px; object-fit: cover; cursor: zoom-in; }
.insp-compare-close { position: absolute; top: 10px; right: 12px; color: var(--text-3); }
.insp-compare-close:hover { color: var(--text); }

@media (max-width: 860px) {
  .insp-bar .insp-cost { margin-left: 0; }
  .insp-bar #inspSend { flex: 1 1 100%; height: 36px; }
  .insp-compare-box { grid-template-columns: 1fr; }
  .insp-msg-actions, .insp-asset-acts { opacity: 1; }
  .insp-anchor { width: 36px; height: 36px; }
  .insp-res, .insp-count { max-width: 64px; }
}

/* =====================================================================
   灵感工作台 · macOS Tahoe / Liquid Glass 视觉刷新
   只影响 #view-inspire，不改其他页面。
   ===================================================================== */
#view-inspire {
  --insp-ui: "SF Pro Text", -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Hiragino Sans GB", "HarmonyOS Sans SC", "MiSans", "Noto Sans SC",
    "Microsoft YaHei", sans-serif;
  --insp-display: "SF Pro Display", -apple-system, BlinkMacSystemFont,
    "PingFang SC", "Hiragino Sans GB", "HarmonyOS Sans SC", "MiSans",
    "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --insp-serif: "New York", "Songti SC", "Noto Serif SC", "Source Han Serif SC",
    "STSong", ui-serif, serif;
  padding: 10px 14px 14px;
  font-family: var(--insp-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.insp-shell {
  height: calc(100dvh - 56px - 24px);
  grid-template-columns: 264px minmax(0, 1fr);
  border: 1px solid color-mix(in srgb, var(--line) 55%, rgba(255, 255, 255, 0.75));
  border-radius: 26px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 6% 0%, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0) 56%),
    radial-gradient(90% 70% at 100% 100%, color-mix(in srgb, var(--accent) 5%, transparent) 0%, transparent 60%),
    color-mix(in srgb, var(--surface-solid) 46%, transparent);
  box-shadow:
    0 32px 90px rgba(15, 23, 42, 0.16),
    0 2px 8px rgba(15, 23, 42, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
}
[data-theme="dark"] .insp-shell {
  border-color: rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(120% 90% at 6% 0%, rgba(255, 255, 255, 0.08) 0%, transparent 56%),
    radial-gradient(90% 70% at 100% 100%, rgba(90, 130, 255, 0.12) 0%, transparent 62%),
    color-mix(in srgb, var(--surface-solid) 52%, transparent);
  box-shadow:
    0 36px 100px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

/* 左侧会话栏 */
.insp-side {
  border-right: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  background: color-mix(in srgb, var(--surface-solid) 32%, transparent);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
}
.insp-side-top, .insp-threads { width: 264px; }
.insp-side-top { padding: 15px 14px 10px; }
.insp-side-title {
  font-family: var(--insp-display);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: var(--text-2);
}
.insp-side-top .btn {
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  border-color: color-mix(in srgb, var(--line) 60%, transparent);
  background: color-mix(in srgb, var(--surface-solid) 68%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  font-size: 11px;
}
.insp-threads { padding: 0 9px 12px; gap: 3px; }
.insp-thread {
  border: 1px solid transparent;
  border-radius: 12px;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease),
    box-shadow 0.18s var(--ease), transform 0.18s var(--ease);
}
.insp-thread:hover { background: color-mix(in srgb, var(--surface-solid) 60%, transparent); }
.insp-thread.is-on {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent) 14%, transparent),
    color-mix(in srgb, var(--accent) 6%, transparent));
  border-color: color-mix(in srgb, var(--accent) 20%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 4px 14px color-mix(in srgb, var(--accent) 8%, transparent);
}
.insp-thread-open { padding: 9px 10px; gap: 3px; }
.insp-thread-title { font-size: 12.5px; letter-spacing: 0.005em; }
.insp-thread.is-on .insp-thread-title { color: var(--accent); font-weight: 600; }
.insp-thread-time { font-size: 10px; letter-spacing: 0.01em; }
.insp-thread-count {
  padding: 0 6px;
  border-color: color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--surface-solid) 45%, transparent);
  font-size: 9.5px;
}

/* 顶栏 */
.insp-top {
  min-height: 64px;
  padding: 14px max(20px, calc((100% - 880px) / 2));
  border-bottom: 1px solid color-mix(in srgb, var(--line) 45%, transparent);
  background: color-mix(in srgb, var(--surface-solid) 22%, transparent);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
}
.insp-top-title { gap: 3px; }
.insp-top-title b {
  font-family: var(--insp-display);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.015em;
  cursor: text;
}
.insp-top-title span { font-size: 11px; letter-spacing: 0.01em; }
.insp-assets-btn {
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border-color: color-mix(in srgb, var(--line) 55%, rgba(255, 255, 255, 0.75));
  background: color-mix(in srgb, var(--surface-solid) 58%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  font-size: 11px;
  letter-spacing: 0.01em;
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
}
.insp-assets-btn:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-solid) 60%);
}

/* 对话区 */
.insp-feed {
  padding: 28px max(20px, calc((100% - 880px) / 2)) 14px;
  gap: 26px;
  overflow-x: hidden;
  overflow-anchor: none;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text-3) 35%, transparent) transparent;
}
.insp-feed::-webkit-scrollbar { width: 8px; }
.insp-feed::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-3) 28%, transparent);
}
.insp-feed::-webkit-scrollbar-track { background: transparent; }

.insp-empty svg { width: 34px; height: 34px; opacity: 0.55; }
.insp-empty p {
  font-family: var(--insp-serif);
  font-size: 15px;
  letter-spacing: 0.03em;
  color: var(--text-2);
}
.insp-seeds button {
  padding: 8px 15px;
  border-radius: 999px;
  border-color: color-mix(in srgb, var(--line) 55%, rgba(255, 255, 255, 0.7));
  background: color-mix(in srgb, var(--surface-solid) 55%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  font-size: 12.5px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* 消息 */
.insp-msg { gap: 12px; }
.insp-avatar {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  margin-top: 0;
  background: linear-gradient(145deg, #6e8bff 0%, #a06bff 55%, #ff8cc4 120%);
  color: #fff;
  font-family: var(--insp-display);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow:
    0 5px 14px rgba(110, 139, 255, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.insp-msg.is-user .insp-bubble {
  max-width: 74%;
  padding: 12px 16px;
  border-radius: 18px 18px 6px 18px;
  background: linear-gradient(150deg,
    color-mix(in srgb, var(--accent) 13%, var(--surface-solid) 70%),
    color-mix(in srgb, var(--accent) 6%, var(--surface-solid) 55%));
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line));
  box-shadow:
    0 8px 22px color-mix(in srgb, var(--accent) 8%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.insp-msg.is-ai .insp-bubble {
  flex: 1;
  max-width: 100%;
  padding: 16px 18px 14px;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--line) 52%, rgba(255, 255, 255, 0.68));
  background: color-mix(in srgb, var(--surface-solid) 50%, transparent);
  box-shadow:
    0 10px 30px rgba(15, 23, 42, 0.055),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
}
[data-theme="dark"] .insp-msg.is-ai .insp-bubble {
  border-color: rgba(255, 255, 255, 0.09);
  background: color-mix(in srgb, var(--surface-solid) 52%, transparent);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
.insp-say {
  font-size: 14.5px;
  line-height: 1.92;
  letter-spacing: 0.012em;
  color: var(--text);
}
.insp-msg.is-ai .insp-say {
  font-family: var(--insp-serif);
  font-size: 15px;
  font-weight: 400;
  line-height: 2.04;
  letter-spacing: 0.018em;
  color: color-mix(in srgb, var(--text) 94%, transparent);
  font-feature-settings: "palt" 1;
}
.insp-thumbs img { width: 68px; height: 68px; border-radius: 10px; }

/* 提示词卡 */
.insp-prompt-card {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
  border-radius: 14px;
  background: linear-gradient(150deg,
    color-mix(in srgb, var(--accent) 7%, var(--surface-solid) 55%),
    color-mix(in srgb, var(--surface-solid) 42%, transparent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.insp-prompt-head > span {
  flex: none;
  white-space: nowrap;
  font-family: var(--insp-display);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.insp-prompt-head > em { font-size: 10px; letter-spacing: 0.02em; }
.insp-prompt-text {
  font-size: 13px;
  line-height: 1.9;
  letter-spacing: 0.01em;
  color: var(--text);
}
.insp-prompt-actions button {
  height: 24px;
  padding: 0 11px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-solid) 62%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  font-size: 10.5px;
}
.insp-prompt-actions button.is-main {
  background: linear-gradient(180deg, #2b9bff 0%, #0071e3 100%);
  box-shadow: 0 5px 14px rgba(0, 113, 227, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* 出图卡片 */
.insp-msg.is-gen { padding-left: 40px; }
.insp-gen-card {
  width: min(460px, 100%);
  padding: 12px 13px 12px;
  border-radius: 18px;
  border-color: color-mix(in srgb, var(--line) 50%, rgba(255, 255, 255, 0.65));
  background: color-mix(in srgb, var(--surface-solid) 48%, transparent);
  box-shadow:
    0 10px 28px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
}
.insp-gen-card.is-multi { width: min(580px, 100%); }
.insp-gen-imgs img { border-radius: 14px; }
.insp-gen-head > span { font-size: 10.5px; letter-spacing: 0.02em; }

/* 来源 */
.insp-sources { border-top-color: color-mix(in srgb, var(--line) 55%, transparent); }
.insp-sources summary { font-size: 10.5px; letter-spacing: 0.02em; }
.insp-source-list a {
  border-color: color-mix(in srgb, var(--line) 45%, transparent);
  background: color-mix(in srgb, var(--surface-solid) 45%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.insp-source-list a b { font-size: 11px; line-height: 1.55; }
.insp-source-list a span { font-size: 9.5px; }

/* 输入区 */
.insp-composer { padding: 8px max(20px, calc((100% - 880px) / 2)) 18px; }
.insp-box {
  padding: 13px 15px 11px;
  border-radius: 24px;
  border: 1px solid color-mix(in srgb, var(--line) 52%, rgba(255, 255, 255, 0.75));
  background: color-mix(in srgb, var(--surface-solid) 68%, transparent);
  box-shadow:
    0 20px 50px rgba(15, 23, 42, 0.12),
    0 2px 8px rgba(15, 23, 42, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px) saturate(170%);
  -webkit-backdrop-filter: blur(14px) saturate(170%);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.insp-box:focus-within {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--accent) 9%, transparent),
    0 22px 54px rgba(15, 23, 42, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
#inspInput {
  font-size: 15px;
  line-height: 1.8;
  letter-spacing: 0.012em;
}
#inspInput::placeholder { letter-spacing: 0.01em; }
.insp-bar { margin-top: 10px; gap: 8px; }
.insp-model {
  height: 32px;
  border-radius: 10px;
  border-color: color-mix(in srgb, var(--line) 55%, transparent);
  background: color-mix(in srgb, var(--surface-solid) 52%, transparent);
  font-size: 11.5px;
  letter-spacing: 0.01em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.insp-attach {
  height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  border-color: color-mix(in srgb, var(--line) 55%, transparent);
  background: color-mix(in srgb, var(--surface-solid) 52%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  font-size: 11.5px;
}
.insp-anchor-add { border-color: color-mix(in srgb, var(--line) 60%, transparent); }
.insp-anchor {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 12%, transparent);
}
.insp-ref { width: 56px; height: 56px; border-radius: 11px; }
.insp-cost { font-size: 10.5px; letter-spacing: 0.02em; }
.insp-gen-cost { font-size: 10.5px; letter-spacing: 0.02em; }
.insp-bar .btn {
  height: 34px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 550;
  letter-spacing: 0.02em;
}
.insp-bar .btn.primary {
  background: linear-gradient(180deg, #2b9bff 0%, #0071e3 100%);
  border-color: transparent;
  box-shadow:
    0 7px 18px rgba(0, 113, 227, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.insp-bar .btn.primary:hover {
  background: linear-gradient(180deg, #3aa4ff 0%, #0a7be8 100%);
}

/* 右侧抽屉 */
.insp-assets-panel {
  top: 10px;
  right: 10px;
  bottom: 10px;
  width: min(378px, calc(100% - 20px));
  border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--line) 50%, rgba(255, 255, 255, 0.7));
  background: color-mix(in srgb, var(--surface-solid) 72%, transparent);
  box-shadow:
    -24px 24px 70px rgba(15, 23, 42, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
}
[data-theme="dark"] .insp-assets-panel {
  border-color: rgba(255, 255, 255, 0.1);
  background: color-mix(in srgb, var(--surface-solid) 78%, transparent);
  box-shadow: -24px 24px 70px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
.insp-assets-head { padding: 16px 16px 12px; }
.insp-assets-head b { font-family: var(--insp-display); font-size: 13px; letter-spacing: -0.01em; }
.insp-assets-grid { gap: 10px; padding: 14px; }
.insp-assets-grid .insp-asset { border-radius: 13px; }
.insp-versions-list, .insp-cards-list { padding: 12px 14px 18px; gap: 9px; }
.insp-version { border-radius: 13px; background: color-mix(in srgb, var(--surface-solid) 45%, transparent); }
.insp-card-item { border-radius: 13px; background: color-mix(in srgb, var(--surface-solid) 45%, transparent); }

/* 窄一点的桌面：侧栏收一点，别挤掉对话区 */
@media (min-width: 861px) and (max-width: 1180px) {
  .insp-shell { grid-template-columns: 236px minmax(0, 1fr); }
  .insp-side-top, .insp-threads { width: 236px; }
  .insp-feed, .insp-top { padding-left: 22px; padding-right: 22px; }
  .insp-composer { padding-left: 22px; padding-right: 22px; }
}

/* 中等宽度桌面：参数下拉换成可读的网格，别挤成 “1...” */
@media (min-width: 861px) and (max-width: 1100px) {
  .insp-bar .insp-selects {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.8fr) minmax(0, 0.7fr) minmax(0, 0.7fr);
    flex: 1 1 100%;
    width: 100%;
    gap: 6px;
  }
  .insp-selects .insp-model { width: 100%; max-width: none; }
}

/* 词库悬浮按钮默认抬到输入框上方，不再压住发送按钮 */
.lib-tab { bottom: 206px; }



/* Long-form editing from the composer toolbar. */
.prompt-expand svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; }
#promptEditor {
  width: min(740px, calc(100% - 20px)); margin: auto; padding: 0; color: var(--text);
  background: var(--surface-solid); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-2);
}
#promptEditor::backdrop { background: var(--scrim); }
#promptEditor form { display: flex; flex-direction: column; gap: 12px; padding: clamp(14px,3vw,24px); max-height: 85dvh; overflow: auto; }
#promptEditor h2 { font-size: 18px; margin: 0; }
#promptDraft { width: 100%; height: 44dvh; min-height: 90px; padding: 12px; resize: none; font: inherit; font-size: 16px; line-height: 1.75; color: inherit; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
#promptEditor summary { cursor: pointer; font-size: 13px; }
.prompt-versions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.prompt-versions h3 { margin: 10px 0 4px; font-size: 13px; }
.prompt-versions pre { font: inherit; font-size: 13px; max-height: 18dvh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
#promptEditor footer { display: flex; gap: 8px; align-items: center; }
#promptSize { margin-right: auto; color: var(--text-2); font-size: 12px; }
@media (max-width: 860px) {
  #promptEditor form { max-height: min(88dvh, var(--m-visible-height, 88dvh)); }
  #promptDraft { height: min(48dvh, calc(var(--m-visible-height, 100dvh) * .48)); }
}


#shotDialog { margin: auto; width: min(780px, calc(100% - 20px)); max-height: 90dvh; overflow: auto; border: 1px solid var(--line); border-radius: 18px; padding: 18px; background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow-2); }
#shotDialog::backdrop { background: var(--scrim); }
#shotDialog header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
#shotDialog h2 { margin: 0; font-size: 19px; }
.shot-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); align-items: start; gap: 16px; }
#shotOriginal { width: 100%; max-height: 55dvh; object-fit: contain; border-radius: 10px; background: var(--surface-2); }
#shotFields { display: grid; gap: 12px; min-width: 0; padding: 0; margin: 0; border: 0; }
#shotFields label { display: grid; gap: 4px; min-width: 0; font-size: 13px; }
.shot-row { display: flex; flex-wrap: wrap; gap: 8px; }
.shot-row label { flex: 1 1 70px; }
#shotFields select, #shotFields textarea { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 8px; color: inherit; background: var(--surface-2); padding: 7px; font: inherit; }
#shotFields .shot-upload { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px dashed var(--text-3); border-radius: 10px; min-height: 44px; cursor: pointer; }
.shot-upload input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.shot-upload:focus-within { outline: 2px solid var(--accent); }
#shotThumb { width: 52px; height: 44px; object-fit: contain; }
#shotCards, #shotBorrow { display: grid; gap: 8px; }
#shotCards label { display: flex; align-items: center; gap: 6px; }
#shotResults { display: flex; flex-wrap: wrap; gap: 8px; }
#shotResults img { display: block; width: 100px; height: 100px; object-fit: cover; border-radius: 8px; }
#shotStatus { color: var(--text-2); font-size: 13px; }
@media(max-width:640px) {
  .shot-body { grid-template-columns: 1fr; }
  #shotOriginal { max-height: 22dvh; }
  #shotFields textarea, #shotFields select { font-size: 16px; }
  #shotRun, #shotAnalyze { min-height: 44px; }
}

#shotStage { position: relative; isolation: isolate; overflow: hidden; border-radius: 12px; aspect-ratio: 1.3; background: radial-gradient(ellipse at 48% 48%,#36404a,#171b22 80%); color: white; touch-action: none; user-select: none; cursor: grab; }
#shotStage:active { cursor: grabbing; }
.shot-platform { position: absolute; inset: 0; display: grid; place-items: center; perspective: 650px; pointer-events: none; }
.shot-platform::before { content: ''; position: absolute; inset: 42% -60% -76%; transform: rotateX(62deg); background-image: linear-gradient(#fff1 1px,transparent 1px),linear-gradient(90deg,#fff1 1px,transparent 1px); background-size: 24px 24px; }
#shotObject { position: relative; width: 49%; height: 57%; transform-style: preserve-3d; }
#shotObject > div { position: absolute; backface-visibility: hidden; }
.shot-front,.shot-back { inset: 0; background: #323e48; border: 1px solid #ffffff42; }
.shot-front { transform: translateZ(15px); }
.shot-front img { width: 100%; height: 100%; object-fit: contain; }
.shot-back { display: grid; place-items: center; transform: rotateY(180deg) translateZ(15px); font-size: 12px; color: #bcc6ce; background: repeating-linear-gradient(-45deg,#34404a 0 8px,#384550 8px 9px); }
.shot-side { width: 30px; height: 100%; background: #4c5964; }
.shot-side.left { left: -15px; transform: rotateY(-90deg); }
.shot-side.right { right: -15px; transform: rotateY(90deg); }
.shot-edge { height: 30px; width: 100%; background: #71808a; }
.shot-edge.top { top: -15px; transform: rotateX(90deg); }
.shot-edge.bottom { bottom: -15px; transform: rotateX(-90deg); }
#shotStage.has-light::after { content:''; position:absolute; inset:0; pointer-events:none; background: radial-gradient(ellipse at var(--lx) var(--ly),#ffedb775,transparent 55%,#090e1d55); }
#shotLamp { position:absolute; left:var(--lx); top:var(--ly); transform:translate(-50%,-50%); width:38px;height:38px;border-radius:50%;border:1px solid #ffe3a7;background:#352e21;color:#ffdb87;cursor:move;z-index:2;font-size:22px; }
.shot-stage-label { position:absolute;top:8px;left:10px;font-size:11px;color:#fff;pointer-events:none; }
#shotOrbit { position:absolute; right:3px; bottom:0; width:74px;height:50px;pointer-events:none; }
.shot-readout,.shot-distance { display:flex; align-items:center; gap:8px; font-size:12px; }
.shot-readout { justify-content:space-between; min-height:36px; }
.shot-distance input { flex:1; min-width:0; }
.shot-guide { color:var(--text-2);font-size:12px;margin:6px 0; }
@media(max-width:640px) { #shotStage { height:clamp(170px,29dvh,250px); aspect-ratio:auto; } }

#exploreTags { flex-basis: 100%; }
.explore-options, .case-compare { font-size: 13px; color: var(--text); }
.explore-options summary, .case-compare summary { cursor: pointer; padding: 7px 0; }
.explore-options > div { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.explore-options select, .case-compare select {
  font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 7px; padding: 6px;
}
.case-compare { width: 100%; }
.compare-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.compare-pair figure { margin: 0; min-width: 0; }
.compare-pair figcaption { height: 36px; display: flex; align-items: center; }
.lb-refs .compare-pair img { width: 100%; aspect-ratio: 1; height: auto; object-fit: contain; }

.plaza-tools, .plaza-pages, #pzDialog header, .pz-author, .pz-event { display: flex; align-items: center; gap: 10px; }
.plaza-tools { justify-content: space-between; flex-wrap: wrap; margin-bottom: 20px; gap: 8px; }
.pz-scopes {
  display: inline-flex; align-items: center; gap: 2px; padding: 4px;
  border: 1px solid color-mix(in srgb, var(--line) 86%, transparent);
  border-radius: 14px; background: color-mix(in srgb, var(--surface-solid) 68%, transparent);
  box-shadow: 0 5px 18px rgba(0,0,0,.05), inset 0 1px 0 color-mix(in srgb, #fff 46%, transparent);
  backdrop-filter: blur(12px) saturate(150%); -webkit-backdrop-filter: blur(12px) saturate(150%);
}
.pz-scopes button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 32px; padding: 0 13px; border: 0; border-radius: 10px;
  font: inherit; font-size: 12px; white-space: nowrap; background: transparent;
  color: var(--text-2); cursor: pointer; transition: color .2s, background .25s, box-shadow .25s, transform .2s var(--mac-spring);
}
.pz-scopes button svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .72; }
.pz-scopes button:first-child svg { fill: currentColor; stroke: none; }
.pz-scopes button[aria-pressed="true"] {
  color: var(--text); background: var(--surface-solid);
  box-shadow: 0 2px 7px rgba(0,0,0,.10), inset 0 0 0 1px color-mix(in srgb, var(--line) 75%, transparent);
  font-weight: 600;
}
.pz-scopes button[aria-pressed="true"] svg { color: var(--accent); opacity: 1; }
.pz-scopes button:hover:not([aria-pressed="true"]) { color: var(--text); background: color-mix(in srgb, var(--surface-solid) 48%, transparent); }
.pz-scopes button:active { transform: scale(.96); }
.plaza-tools select, #pzDialog input:not([type=checkbox]) { font: inherit; color: var(--text); background: var(--surface-solid); border: 1px solid var(--line); border-radius: 9px; padding: 8px; }
.plaza-tools select { font-size: 12px; }
.plaza-pages { justify-content: center; margin: 18px 0; font-variant-numeric: tabular-nums; }
.pz-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(210px,100%),1fr)); gap: 18px; }
.pz-card,.pz-event { min-width: 0; text-align: left; font: inherit; color: var(--text); cursor: pointer; background: var(--surface-solid); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.pz-card { display: flex; flex-direction: column; align-items: stretch; padding: 0; transition: box-shadow .18s; }
@media (hover:hover) { .pz-card:hover { box-shadow: var(--shadow-1); } }
.pz-card:focus-visible,.pz-event:focus-visible,.pz-scopes button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pz-card > img { display: block; width: 100%; aspect-ratio: 4/5; object-fit: contain; background: var(--surface-2); }
.pz-card strong { margin: 12px 12px 6px; display: block; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.pz-card .pz-author { margin: 0 12px 10px; min-width: 0; overflow-wrap: anywhere; }
.pz-author,.pz-card small,#pzStatus { font-size: 12px; color: var(--text-2); }
.pz-card small { display: flex; justify-content: space-between; border-top: 1px solid var(--line-soft); margin-top: auto; padding: 8px 12px; font-variant-numeric: tabular-nums; }
.pz-author svg,.pz-event svg { width: 23px; height: 23px; flex: none; }
.avatar svg { width: 100%; height: 100%; display: block; }
.pz-activity { display: grid; gap: 8px; }
.pz-event { padding: 14px; overflow-wrap: anywhere; }
#pzStatus:not(:empty) { text-align: center; padding: 28px 12px; background: var(--surface-2); border-radius: 14px; }
body[data-view="plaza"] .lb-media {
  box-sizing: border-box; min-width: 0; height: min(88dvh, calc(100dvh - 60px));
  grid-template: minmax(0, 1fr) / minmax(0, 1fr); padding-bottom: 52px;
}
body[data-view="plaza"] #lbImage {
  width: auto; height: auto; min-width: 0; min-height: 0; max-width: 100%; max-height: 100%;
  object-fit: contain; border-radius: 0;
}
@media (max-width: 860px) {
  body[data-view="plaza"] .lb-media {
    height: calc(56dvh + var(--m-safe-t)); padding: calc(var(--m-safe-t) + 48px) 10px 46px;
  }
}
#lbWorkTitle { margin: 0; overflow-wrap: anywhere; font-size: 22px; }
#lbWorkActions:not([hidden]) { display: contents; }
#lbWorkActions [aria-pressed="true"] { color: var(--danger); }
#pzDialog { margin:auto; color:var(--text); background:var(--surface); border:1px solid var(--line); border-radius:16px; width:min(510px,94vw); max-height:86dvh; padding:20px; overflow:auto; }
#pzDialog::backdrop { background:rgb(0 0 0 / .6); }
#pzDialog header { justify-content:space-between; margin-bottom:15px; }
#pzDialog h3 { margin:0; overflow-wrap:anywhere; }
#pzDialog form { display:grid; gap:14px; }
#pzDialog form label:not(.pz-check) { display:grid; gap:6px; }
#pzDialog .pz-check { display:flex; align-items:center; gap:8px; }
#pzDialog footer { margin-top:14px; flex-wrap:wrap; }
@media(max-width:640px){ .pz-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; } }


/* macOS motion overrides loaded after component styles */
body .view:not([hidden]) { animation: macPageIn .34s var(--mac-spring) both; }
body .lightbox { animation: macLightboxIn .28s var(--mac-spring) both; }
body .pz-card, body .pz-event, body .tile, body .case {
  transition: transform .28s var(--mac-spring), box-shadow .28s ease, border-color .22s ease;
}
body .pz-card:hover, body .pz-event:hover, body .tile:hover, body .case:hover {
  transform: translateY(-3px);
}
body .btn:active, body .icon-btn:active, body .seg:active, body .tag-chip:active {
  transform: scale(.94);
  transition-duration: .08s;
}
body .field input:focus, body .field select:focus, body .field textarea:focus {
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .plaza-tools { align-items: stretch; }
  .pz-scopes { width: 100%; justify-content: stretch; }
  .pz-scopes button { flex: 1 1 0; min-width: 0; padding: 0 7px; gap: 5px; }
  .pz-scopes button span { overflow: hidden; text-overflow: ellipsis; }
}
