.preset-table th:last-child,.preset-table td:last-child{position:sticky;right:0;background:var(--surface);box-shadow:-4px 0 8px -6px var(--sub);z-index:1;white-space:nowrap}
:root {
  /* Krea Editorial Light Gallery (默认高定浅色画廊) */
  --bg: #f6f6f4;
  --bg-side: #fafafa;
  --surface: #ffffff;
  --surface-sub: #ebebdf4d;
  --surface-muted: #efefec;
  --surface-hover: #e5e5e0;
  --glass: rgba(246, 246, 244, 0.86);
  --glass-panel: rgba(255, 255, 255, 0.94);
  --text: #09090b;
  --sub: #52525b;
  --muted: #71717a;
  --line: rgba(9, 9, 11, 0.075);
  --line-strong: rgba(9, 9, 11, 0.15);
  --line2: rgba(9, 9, 11, 0.045);

  /* 曜石黑主视觉 + Krea 微光靛蓝点缀 */
  --pri-bg: #09090b;
  --pri-bg-hover: #27272a;
  --pri-fg: #ffffff;
  --brand: #09090b;
  --brand-soft: rgba(9, 9, 11, 0.055);
  --accent: #6366f1;
  --accent-soft: rgba(99, 102, 241, 0.1);

  /* 语义状态色 */
  --ok: #047857;
  --ok-soft: rgba(16, 185, 129, 0.1);
  --ok-border: rgba(16, 185, 129, 0.24);
  --bad: #dc2626;
  --bad-soft: rgba(239, 68, 68, 0.09);
  --bad-border: rgba(239, 68, 68, 0.24);
  --warn: #b45309;
  --warn-soft: rgba(245, 158, 11, 0.11);
  --warn-border: rgba(245, 158, 11, 0.28);

  --sh-nav: 0 2px 6px rgba(9, 9, 11, 0.06), 0 1px 2px rgba(9, 9, 11, 0.04);
  --sh1: 0 2px 8px -2px rgba(9, 9, 11, 0.05), 0 1px 2px rgba(9, 9, 11, 0.02);
  --sh2: 0 18px 42px -14px rgba(9, 9, 11, 0.11), 0 4px 14px -2px rgba(9, 9, 11, 0.05);
  --sh3: 0 32px 80px -20px rgba(9, 9, 11, 0.32), 0 12px 28px -8px rgba(9, 9, 11, 0.14);
  --ring: 0 0 0 3px rgba(9, 9, 11, 0.1);
  --dot-grid: rgba(9, 9, 11, 0.075);
  --shimmer-a: #e8e8e3;
  --shimmer-b: #f3f3ef;
}

[data-theme="dark"] {
  /* Krea Cinema Dark Studio (沉浸式暗黑工作台) */
  --bg: #09090b;
  --bg-side: #0e0e11;
  --surface: #141418;
  --surface-sub: #1c1c22;
  --surface-muted: #1c1c22;
  --surface-hover: #26262e;
  --glass: rgba(9, 9, 11, 0.84);
  --glass-panel: rgba(20, 20, 24, 0.94);
  --text: #f4f4f5;
  --sub: #a1a1aa;
  --muted: #71717a;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.17);
  --line2: rgba(255, 255, 255, 0.05);

  --pri-bg: #f4f4f5;
  --pri-bg-hover: #ffffff;
  --pri-fg: #09090b;
  --brand: #f4f4f5;
  --brand-soft: rgba(255, 255, 255, 0.08);
  --accent: #818cf8;
  --accent-soft: rgba(129, 140, 248, 0.15);

  --ok: #34d399;
  --ok-soft: rgba(16, 185, 129, 0.14);
  --ok-border: rgba(52, 211, 153, 0.28);
  --bad: #f87171;
  --bad-soft: rgba(239, 68, 68, 0.14);
  --bad-border: rgba(248, 113, 113, 0.28);
  --warn: #fbbf24;
  --warn-soft: rgba(245, 158, 11, 0.14);
  --warn-border: rgba(251, 191, 36, 0.28);

  --sh-nav: 0 2px 8px rgba(0, 0, 0, 0.45);
  --sh1: 0 2px 10px rgba(0, 0, 0, 0.35);
  --sh2: 0 20px 44px -12px rgba(0, 0, 0, 0.65);
  --sh3: 0 32px 84px -16px rgba(0, 0, 0, 0.82);
  --ring: 0 0 0 3px rgba(255, 255, 255, 0.16);
  --dot-grid: rgba(255, 255, 255, 0.06);
  --shimmer-a: #18181c;
  --shimmer-b: #222228;
}

* { box-sizing: border-box; }
/* Clip horizontal overflow without creating an ancestor scroll container for sticky navigation. */
html, body { margin: 0; padding: 0; overflow-x: clip; }
body {
  font: 13.5px/1.6 -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.22s ease, color 0.22s ease;
}
body.lock { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
input, textarea, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
i[data-ic] { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.svg { flex: none; }
[hidden] { display: none !important; }

button:focus-visible,
[role="button"]:focus-visible,
.slot:focus-within,
.h-slot:focus-within,
.switch input:focus-visible + span,
.chk:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============ Krea One-Sidebar App Shell 骨架（展开/收起严格同轴对齐） ============ */
.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}
.m-topbar,
.side-backdrop {
  display: none;
}

.k-sidebar {
  width: 240px;
  height: 100vh;
  height: 100dvh;
  position: sticky;
  top: 0;
  align-self: flex-start;
  z-index: 45;
  flex: none;
  display: flex;
  flex-direction: column;
  padding: 10px 8px 12px;
  background: var(--bg-side);
  border-right: 1px solid var(--line);
  transition: width 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
  user-select: none;
}

/* 顶部：左侧折叠按钮（固定 36px 图标列） + 右侧品牌名（对齐 Krea 顶栏） */
.k-brand-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0;
}
.k-side-tog {
  width: 36px;
  height: 34px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--sub);
  display: inline-grid;
  place-items: center;
  flex: none;
  padding: 0;
  margin: 0;
  transition: background-color 0.15s, color 0.15s;
}
.k-side-tog svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.75;
}
.k-side-tog:hover {
  background: rgba(128, 128, 128, 0.08);
  color: var(--text);
}
.brand {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  color: var(--sub);
  cursor: pointer;
  white-space: nowrap;
  min-width: 0;
  height: 32px;
  padding: 0 6px 0 0;
  border-radius: 8px;
  transition: color 0.15s;
}
.brand:hover { color: var(--text); }
.brand-chev svg {
  width: 12px;
  height: 12px;
  color: var(--muted);
}
#siteName {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.logo {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  color: var(--pri-fg);
  font-size: 8px;
  font-weight: 800;
  background: var(--pri-bg);
  flex: none;
}
.logo.has-image { border: 0; background: transparent; }
.logo img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.logo-preview { width: 64px; height: 64px; }
.logo-upload input { display: none; }

/* 第一组：主导航（无分割线、无厚边框白卡，36px 图标列 + 6px 间距） */
.k-nav-pri {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 18px;
  padding: 0;
  border: 0;
}
.k-nav-pri button {
  position: relative;
  width: 100%;
  height: 34px;
  padding: 0 10px 0 0;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 500;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: left;
  transition: background-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.k-nav-pri button > i[data-ic] {
  width: 36px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  flex: none;
}
.k-nav-pri button > i[data-ic] svg {
  width: 16.5px;
  height: 16.5px;
  stroke-width: 1.85;
}
.k-nav-pri button:hover {
  background: rgba(128, 128, 128, 0.065);
}
.k-nav-pri button.on,
.k-nav-pri button.on:hover {
  background: rgba(128, 128, 128, 0.1);
  color: var(--text);
  font-weight: 600;
}
.k-nav-pri .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  margin-left: auto;
  flex: none;
}
.run-pill {
  margin-left: auto;
  font-style: normal;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

/* 第二组：中部模板分类 / 后台模块列表（展开显示图标+名称，收起保留同轴图标列） */
.k-side-mid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  padding: 20px 0 8px;
  scrollbar-width: none;
}
.k-side-mid::-webkit-scrollbar { display: none; }
.k-sec-title {
  font-size: 12px;
  font-weight: 500;
  color: #a1a1aa;
  padding: 0 0 6px 9px;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.k-cat-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.k-cat-list .cat {
  width: 100%;
  height: 34px;
  padding: 0 10px 0 0;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 500;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: left;
  transition: background-color 0.14s, color 0.14s;
  white-space: nowrap;
}
.k-cat-list .cat .cat-ic {
  width: 36px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  flex: none;
  color: inherit;
}
.k-cat-list .cat .cat-ic svg {
  width: 16.5px;
  height: 16.5px;
  stroke-width: 1.85;
}
.k-cat-list .cat .cat-name {
  font-weight: inherit;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.k-cat-list .cat:hover {
  background: rgba(128, 128, 128, 0.065);
}
.k-cat-list .cat.on,
.k-cat-list .cat.on:hover {
  background: rgba(128, 128, 128, 0.1);
  color: var(--text);
  font-weight: 600;
}

/* 底部固定船坞：无顶部分割线、始终吸底（margin-top: auto），无外层套娃白卡 */
.k-side-foot {
  margin-top: auto;
  border-top: 0;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.k-side-item {
  width: 100%;
  height: 34px;
  padding: 0 8px 0 0;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 500;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: left;
  transition: background-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.k-side-item > i[data-ic] {
  width: 36px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  flex: none;
}
.k-side-item > i[data-ic] svg {
  width: 16.5px;
  height: 16.5px;
  stroke-width: 1.85;
}
.k-nav-pri button > i[data-ic] svg,
.k-cat-list .cat .cat-ic svg,
.k-side-item > i[data-ic] svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.65;
}
.k-nav-pri button.on > i[data-ic] svg,
.k-cat-list .cat.on .cat-ic svg { stroke-width: 1.85; }
.k-side-item:hover {
  background: rgba(128, 128, 128, 0.065);
}
.k-side-item.on {
  background: rgba(128, 128, 128, 0.1);
  color: var(--text);
  font-weight: 600;
}
.k-bal-pill {
  margin-left: auto;
  background: #172554;
  color: #ffffff;
  font-size: 11px;
  font-weight: 650;
  padding: 2px 8px;
  border-radius: 999px;
  border: 0;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .k-bal-pill {
  background: #312e81;
  color: #e0e7ff;
}
.k-user-card {
  margin-top: 6px;
  padding: 3px 6px 3px 2px;
  border-radius: 9px;
  background: transparent;
  border: 0;
  box-shadow: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.15s;
}
.k-user-card:hover {
  background: rgba(128, 128, 128, 0.065);
}
.k-user-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  border-radius: 7px;
  min-height: 36px;
}
#authActions { display: flex; flex: none; align-items: center; }
.k-auth-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 550;
  white-space: nowrap;
}
.k-auth-action:hover { background: var(--surface-hover); }
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #efefec;
  border: 1px solid rgba(9, 9, 11, 0.05);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--text);
  flex: none;
}
[data-theme="dark"] .avatar {
  background: #1c1c22;
  border-color: rgba(255, 255, 255, 0.08);
}
.k-user-meta {
  min-width: 0;
  flex: 1;
  line-height: 1.3;
}
.k-user-meta b {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.k-user-meta span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 桌面端侧栏折叠态 (Icon Rail：52px 宽，所有图标中心严格锁定在 x=26px 同轴线上) */
@media (min-width: 901px) {
  body.side-collapsed .k-sidebar {
    width: 52px;
    padding: 10px 8px 12px;
  }
  body.side-collapsed .brand,
  body.side-collapsed .k-nav-pri .t,
  body.side-collapsed .k-nav-pri .run-pill,
  body.side-collapsed .k-sec-title,
  body.side-collapsed .k-cat-list .cat .cat-name,
  body.side-collapsed .k-side-item .t,
  body.side-collapsed .k-side-item .k-bal-pill,
  body.side-collapsed .k-user-meta,
  body.side-collapsed #authActions {
    display: none;
  }
  body.side-collapsed .k-side-mid {
    padding: 20px 0 8px;
  }
  body.side-collapsed .k-brand-row,
  body.side-collapsed .k-nav-pri button,
  body.side-collapsed .k-cat-list .cat,
  body.side-collapsed .k-side-item {
    width: 36px;
    padding: 0;
    justify-content: center;
  }
  body.side-collapsed .k-user-card {
    width: 36px;
    padding: 2px;
    justify-content: center;
    background: transparent;
  }
  body.side-collapsed .k-nav-pri .dot {
    position: absolute;
    top: 6px;
    right: 6px;
  }
}

/* 右侧主内容画布 */
.k-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ============ 通用按钮与表单控件 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 7.5px 15px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  transition: all 0.16s cubic-bezier(0.2, 0.8, 0.2, 1);
  white-space: nowrap;
}
.btn:hover:not(:disabled) {
  border-color: var(--text);
  background: var(--surface-muted);
  color: var(--text);
}
.btn:active:not(:disabled) { transform: scale(0.985); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn.pri {
  border: 1px solid transparent;
  color: var(--pri-fg);
  background: var(--pri-bg);
  box-shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.28);
}
.btn.pri:hover:not(:disabled) {
  background: var(--pri-bg-hover);
  color: var(--pri-fg);
  border-color: transparent;
  box-shadow: 0 8px 22px -4px rgba(0, 0, 0, 0.36);
}
.btn.pri:disabled {
  background: var(--surface-hover);
  color: var(--muted);
  box-shadow: none;
  transform: none;
  opacity: 0.7;
}
.btn.lg { padding: 11px 22px; font-size: 14px; border-radius: 14px; }
.btn.sm { padding: 5.5px 12px; font-size: 12px; border-radius: 999px; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--sub); }
.btn.ghost:hover:not(:disabled) { border-color: transparent; background: var(--surface-muted); color: var(--text); }
.btn.danger { color: var(--bad); border-color: var(--bad-border); background: var(--surface); }
.btn.danger:hover:not(:disabled) { color: var(--bad); background: var(--bad-soft); border-color: var(--bad); }
.btn.warnbtn {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: var(--warn-border);
  box-shadow: none;
}
.btn.warnbtn:hover:not(:disabled) { color: var(--warn); background: var(--warn-soft); filter: brightness(0.96); }

.grow { flex: 1; }
.link {
  border: 0;
  background: none;
  color: var(--sub);
  font-weight: 600;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  margin-left: auto;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
}
.link:hover { color: var(--text); }

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  place-items: center;
  color: var(--sub);
  flex: none;
  transition: all 0.15s;
}
.icon-btn.sm { width: 28px; height: 28px; border-radius: 8px; }
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface-muted); }
.icon-btn[data-act="delwork"]:hover { color: #fca5a5; border-color: rgba(248, 113, 113, 0.45); background: rgba(239, 68, 68, 0.25); }

.in {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 9px 12px;
  background: var(--surface);
  color: var(--text);
  outline: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-size: 13.5px;
}
.in::placeholder { color: var(--muted); }
.in:hover:not(:disabled) { border-color: var(--sub); }
.in:focus { border-color: var(--text); box-shadow: var(--ring); }
.in.sm { padding: 6px 10px; border-radius: 9px; font-size: 13px; }
textarea.in { resize: vertical; min-height: 80px; line-height: 1.6; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }

.lab {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  margin: 16px 0 7px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}
.lab small { font-weight: 500; color: var(--muted); font-size: 11.5px; }
.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  display: flex;
  gap: 6px;
  align-items: flex-start;
  line-height: 1.5;
}
.hint > .svg { margin-top: 2px; color: var(--sub); }
.consent-hint {
  margin-top: 8px;
  padding: 8px 11px;
  border-radius: 10px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
}

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 16px; }
.panel {
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--sh1);
  border: 1px solid var(--line);
}
.pad { padding: 22px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 10px;
  padding: 6px 12px;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--sub);
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.chip:hover { border-color: var(--text); color: var(--text); }
.chip.on,
.chip.on:hover {
  border-color: var(--pri-bg);
  color: var(--pri-fg);
  background: var(--pri-bg);
}
.rbox {
  display: inline-block;
  height: 11px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  margin-right: 5px;
  flex: none;
}

.presets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 8px;
}
.pre {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 14px;
  padding: 10px 12px;
  text-align: left;
  transition: all 0.16s;
  position: relative;
}
.pre:hover { border-color: var(--sub); background: var(--surface-muted); }
.pre.on,
.pre.on:hover {
  border-color: var(--text);
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px var(--text);
}
.pre b { display: flex; align-items: center; justify-content: space-between; gap: 4px; font-size: 13px; color: var(--text); }
.pre b i {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--sub);
  border: 1px solid var(--line);
}
.pre.on b i { background: var(--pri-bg); color: var(--pri-fg); border-color: transparent; }
.pre small { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; font-family: ui-monospace, SFMono-Regular, monospace; }
.pre span { display: block; font-size: 12px; font-weight: 600; color: var(--sub); margin-top: 3px; }
.pre.on span { color: var(--text); }

.more {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-muted);
  transition: border-color 0.15s;
}
.more.open { background: var(--surface); border-color: var(--line-strong); }
.more-h {
  width: 100%;
  border: 0;
  background: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--sub);
}
.more-h:hover { color: var(--text); }
.more-h span { font-weight: 500; color: var(--muted); margin-left: auto; font-size: 12px; }
.more-h .svg:last-child { transition: transform 0.2s; }
.more.open .more-h .svg:last-child { transform: rotate(180deg); }
.more-b { padding: 4px 14px 14px; border-top: 1px solid var(--line2); }

.guide { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.g {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 999px;
}
.g.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-border); }
.g.no { background: var(--bad-soft); color: var(--bad); border: 1px solid var(--bad-border); }

.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute;
  inset: 0;
  background: var(--surface-hover);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition: 0.2s;
  cursor: pointer;
}
.switch span::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text);
  transition: 0.2s;
}
.switch input:checked + span { background: var(--pri-bg); border-color: var(--pri-bg); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--pri-fg); }

.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}
.stepper button {
  border: 0;
  background: transparent;
  width: 30px;
  height: 28px;
  font-size: 15px;
  font-weight: 600;
  color: var(--sub);
  transition: background 0.15s;
}
.stepper button:hover { background: var(--surface-muted); color: var(--text); }
.stepper span { min-width: 28px; text-align: center; font-weight: 700; font-size: 13px; }

.cost { font-size: 12px; color: var(--muted); line-height: 1.5; }
.foot-note { font-size: 11.5px; color: var(--muted); text-align: center; width: 100%; }
.prog { height: 6px; border-radius: 999px; background: var(--surface-muted); overflow: hidden; }
.prog i { display: block; height: 100%; width: 0; background: var(--pri-bg); border-radius: inherit; transition: width 0.4s ease; }
.prog.warn i { background: var(--warn); }

.shimmer {
  background: linear-gradient(100deg, var(--shimmer-a) 30%, var(--shimmer-b) 50%, var(--shimmer-a) 70%);
  background-size: 200% 100%;
  animation: sh 1.4s infinite;
}
@keyframes sh { to { background-position: -200% 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes spin { to { transform: rotate(360deg); } }
.enter { animation: rise 0.26s cubic-bezier(0.2, 0.8, 0.2, 1); }

.skel-card { pointer-events: none; }

/* ============ 视图 1：首页 Home（对齐 Krea.ai /app 极简高对比工作台） ============ */
@keyframes popIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.plaza {
  max-width: 1520px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px 64px;
}

/* 首页工作台：严格对齐参考图二（极简居中输入框 + 顶部柔和微光 + 底部单排 5 张生图推荐卡） */
.home-first-fold {
  position: relative;
  min-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 0 28px;
  background: radial-gradient(48% 22% at 50% 0%, rgba(168, 85, 247, 0.075) 0%, rgba(99, 102, 241, 0.035) 50%, transparent 100%);
}

/* 第一层：Hero 居中极简输入框 */
.home-hero-wrap {
  position: relative;
  z-index: 25;
  width: 100%;
  max-width: 680px;
  margin: 0 auto 48px;
}
.k-home-head {
  text-align: center;
  margin-bottom: 20px;
}
.hero-title {
  font-size: clamp(19px, 2vw, 22px);
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}

.hero-composer {
  position: relative;
  z-index: 2;
  max-width: 680px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 14px 16px;
  box-shadow:
    0 14px 36px -12px rgba(9, 9, 11, 0.07),
    0 2px 8px -2px rgba(9, 9, 11, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.2s ease;
}
[data-theme="dark"] .hero-composer {
  box-shadow:
    0 16px 40px -12px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}
.hero-composer:hover {
  border-color: rgba(9, 9, 11, 0.26);
}
[data-theme="dark"] .hero-composer:hover {
  border-color: rgba(255, 255, 255, 0.24);
}
.hero-composer:focus-within {
  border-color: var(--text);
  box-shadow:
    0 18px 42px -12px rgba(9, 9, 11, 0.13),
    0 0 0 3px var(--brand-soft);
}
.hero-composer > * {
  position: relative;
  z-index: 1;
}

.hero-refs-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.hero-refs {
  display: flex;
  align-items: center;
  gap: 6px;
}
.h-slot {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--surface-muted);
  display: grid;
  place-items: center;
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s ease, background-color 0.15s ease, opacity 0.15s ease, color 0.15s ease;
  flex: none;
}
.h-slot input { display: none; }
.h-slot img { width: 100%; height: 100%; object-fit: cover; }
.h-slot.filled { border: 1px solid var(--line-strong); cursor: default; }
.h-slot.fade-1 { opacity: 0.45; }
.h-slot.fade-2 { opacity: 0.18; }
.h-slot.fade-3 { opacity: 0.1; }
.h-slot:hover, .h-slot.drag {
  opacity: 1 !important;
  border-color: var(--line-strong);
  color: var(--text);
  background: var(--surface-hover);
}
.h-slot .rm {
  position: absolute;
  right: 2px;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 0;
  background: rgba(9, 9, 11, 0.78);
  color: #fff;
  display: grid;
  place-items: center;
  padding: 0;
}
.h-slot .rm:hover { background: var(--bad); }
.hero-ref-hint {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.k-kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.5px 6px;
  letter-spacing: -0.01em;
}

.hero-ta {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.55;
  padding: 6px 0 8px;
  margin: 0;
  resize: none;
  min-height: 50px;
}
.hero-ta::placeholder { color: var(--muted); }

.hero-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 6px;
  flex-wrap: wrap;
}
.hero-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.h-pill {
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--sub);
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}
.h-pill em {
  font-style: normal;
  font-size: 10.5px;
  color: var(--muted);
  margin-left: 1px;
}
.h-pill:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: var(--surface);
}
.h-pill.on, .h-pill.on:hover {
  border-color: var(--pri-bg);
  background: var(--pri-bg);
  color: var(--pri-fg);
}
.h-pill.on em {
  color: var(--pri-fg);
  opacity: 0.8;
}

.hero-send-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.hero-send {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--pri-bg);
  background: var(--pri-bg);
  color: var(--pri-fg);
  display: inline-grid;
  place-items: center;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s, transform 0.15s;
}
.hero-send:hover:not(:disabled) {
  background: var(--pri-bg-hover);
  border-color: var(--pri-bg-hover);
  color: var(--pri-fg);
}
.hero-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.hero-send.is-running:disabled {
  opacity: 1;
  background: var(--pri-bg);
  color: var(--pri-fg);
  border-color: var(--pri-bg);
}
.spin-ring {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: spin 0.75s linear infinite;
}

/* Krea 快捷创作模式胶囊条 + 灵感词（对齐 Krea /app 输入框下方工具入口） */
.k-quick-strip {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.k-tool-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.k-tool-pill {
  height: 34px;
  padding: 0 13px 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: var(--sh1);
  transition: border-color 0.15s, background-color 0.15s;
}
.k-tool-pill:hover {
  border-color: var(--text);
  background: var(--surface-muted);
}
.kt-ic {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: var(--surface-muted);
  color: var(--text);
}
.kt-ic.photo { background: rgba(16, 185, 129, 0.12); color: var(--ok); }
.kt-ic.direct { background: rgba(99, 102, 241, 0.12); color: var(--accent); }
.kt-ic.studio { background: rgba(245, 158, 11, 0.13); color: var(--warn); }
.kt-ic.kt-works { background: var(--brand-soft); color: var(--text); }

.hero-ideas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ideas-label {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
}
.idea {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--sub);
  font-size: 11.5px;
  border-radius: 999px;
  padding: 3px 10px;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
}
.idea span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idea:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line-strong);
}

/* 参数弹出浮层 */
.hero-pop {
  position: absolute;
  left: 16px;
  top: calc(100% + 8px);
  width: min(460px, calc(100vw - 40px));
  z-index: 35;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--sh2);
  animation: popIn 0.14s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.hero-pop.pop-sm { width: min(300px, calc(100vw - 40px)); }
.pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 10px;
}
.pop-head small { color: var(--muted); font-weight: 500; font-family: ui-monospace, monospace; }

/* 方案 A：首页输入框正下方原地展开的生成结果抽屉 */
.home-drawer {
  max-width: 820px;
  margin: 14px auto 0;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 15px 18px;
  box-shadow: var(--sh2);
  animation: popIn 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.hd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.home-res-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 12px;
}

/* 第二层：首页单排 5 张精选推荐卡片（严格对齐参考图二） */
.featured-sec {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}
.feat-row-title {
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
  margin: 0 0 12px 2px;
  letter-spacing: -0.01em;
}
.feat-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}
.feat-row .card {
  margin: 0;
  display: block;
}
.feat-row .thumb {
  aspect-ratio: 4/3 !important;
  border-radius: 14px;
}
.feat-app-ic {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: #09090b;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
  pointer-events: none;
}
.feat-item-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--sub);
  margin-top: 8px;
  padding-left: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s;
}
.feat-item:hover .feat-item-title {
  color: var(--text);
}
.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 14px;
  flex-wrap: wrap;
}
.sec-head h2 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 750;
  letter-spacing: -0.02em;
}
.sec-head p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}
.sec-head-r {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.k-cat-Shortcuts {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.k-cat-chip {
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--sub);
  font-size: 12px;
  font-weight: 500;
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}
.k-cat-chip:hover {
  border-color: var(--text);
  color: var(--text);
}
.feat-more-btn {
  color: var(--text);
  font-weight: 600;
  gap: 4px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}
.feat-more-btn:hover {
  border-color: var(--text);
  background: var(--surface-muted);
}

.feat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.feat-card {
  cursor: pointer;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 8px;
  box-shadow: var(--sh1);
  transition: border-color 0.18s ease, box-shadow 0.22s ease;
}
.feat-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--sh2);
}
.feat-thumb {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-muted);
}
.feat-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease;
}
.feat-thumb img.ok { opacity: 1; }
.feat-card:hover .feat-thumb img { transform: scale(1.035); }

.feat-top-tags {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 2;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  pointer-events: none;
}
.c-pill.feat {
  background: rgba(255, 255, 255, 0.92);
  color: #09090b;
}

.feat-ov {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, transparent 45%, rgba(9, 9, 11, 0.55) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 10px;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.feat-card:hover .feat-ov,
.feat-card:focus-visible .feat-ov { opacity: 1; }
.k-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #ffffff;
  color: #09090b;
  font-size: 11.5px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.feat-meta {
  padding: 9px 4px 3px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.feat-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.feat-meta-top b {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feat-cost-pill {
  font-size: 11px;
  font-weight: 600;
  color: var(--sub);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
  flex: none;
}
.feat-meta-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
}
.feat-desc {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feat-uses {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: none;
  font-variant-numeric: tabular-nums;
}

/* 独立分类模板页视图（严格对齐图二：顶部仅居中胶囊搜索框 + 支持上传图片搜相似） */
.gallery-sec {
  padding-top: 16px;
}
.k-gallery-top {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.k-search-pill {
  width: min(620px, 100%);
  height: 44px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid transparent;
  padding: 0 6px 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.k-search-pill:hover {
  border-color: var(--line);
}
.k-search-pill:focus-within,
.k-search-pill.drag {
  background: var(--surface);
  border-color: var(--line-strong);
  box-shadow: var(--sh1);
}
.k-search-add {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  cursor: pointer;
  flex: none;
  transition: color 0.15s, background-color 0.15s;
}
.k-search-add input {
  display: none;
}
.k-search-add svg {
  width: 16px;
  height: 16px;
}
.k-search-add:hover {
  color: var(--text);
  background: rgba(128, 128, 128, 0.12);
}
.k-search-img-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 2px 6px 2px 3px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  flex: none;
  box-shadow: var(--sh1);
}
.k-search-img-chip img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}
.k-search-img-chip .chip-rm {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 0;
  background: var(--surface-muted);
  color: var(--sub);
  display: inline-grid;
  place-items: center;
  padding: 0;
}
.k-search-img-chip .chip-rm:hover {
  background: var(--bad);
  color: #ffffff;
}
.k-search-pill input[type="search"] {
  border: 0;
  outline: 0;
  flex: 1;
  min-width: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}
.k-search-pill input[type="search"]::placeholder {
  color: var(--muted);
}
.k-search-pill input[type="search"]::-webkit-search-cancel-button {
  display: none;
}
.k-search-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: #71717a;
  color: #ffffff;
  display: inline-grid;
  place-items: center;
  padding: 0;
  flex: none;
  transition: background-color 0.15s, transform 0.15s;
}
.k-search-btn svg {
  width: 15px;
  height: 15px;
}
.k-search-btn:hover {
  background: var(--text);
}
.cat-page-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.back-home-btn {
  border: 1px solid var(--line-strong) !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  padding: 6px 12px;
  box-shadow: var(--sh1);
}
.back-home-btn:hover {
  background: var(--surface-muted) !important;
}
.gallery-sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.gallery-sec-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.025em;
}
.gallery-sec-head p {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.plaza-bar {
  margin-bottom: 20px;
}
.plaza-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--sub);
  padding: 5.5px 13px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12.5px;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.pill:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface-muted);
}
.pill.on,
.pill.on:hover {
  background: var(--pri-bg);
  border-color: var(--pri-bg);
  color: var(--pri-fg);
}

.auds {
  display: inline-flex;
  gap: 2px;
  align-items: center;
  background: var(--surface-muted);
  padding: 3px 5px 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.auds button {
  border: 0;
  background: none;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--sub);
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s;
}
.auds button:hover { color: var(--text); }
.auds button.on,
.auds button.on:hover {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--sh1);
}

.hero-r { margin-left: auto; gap: 10px; }
.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.seg button {
  border: 0;
  background: transparent;
  padding: 4px 11px;
  border-radius: 999px;
  color: var(--sub);
  font-weight: 600;
  font-size: 12px;
  transition: all 0.15s;
}
.seg button:hover { color: var(--text); }
.seg button.on,
.seg button.on:hover { background: var(--surface); color: var(--text); box-shadow: var(--sh1); }
.count { font-size: 12px; font-weight: 600; color: var(--muted); }

.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.search {
  width: 240px;
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0 9px 0 13px;
  height: 35px;
  color: var(--muted);
  transition: width 0.2s ease, border-color 0.15s, box-shadow 0.15s;
}
.search:focus-within {
  width: 280px;
  border-color: var(--text);
  box-shadow: var(--ring);
  color: var(--text);
}
.search input {
  border: 0;
  outline: 0;
  flex: 1;
  background: transparent;
  color: var(--text);
  min-width: 0;
  font-size: 12.5px;
}
.search input::-webkit-search-cancel-button { display: none; }
.search-clear {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 0;
  background: var(--surface-muted);
  color: var(--sub);
  display: grid;
  place-items: center;
  padding: 0;
  flex: none;
}
.search-clear:hover { background: var(--surface-hover); color: var(--text); }

/* Krea 纯画面零缝拼接瀑布流墙（严格对齐参考图二：0~1px 极细拼接缝、直角无圆角、消除 inline-block 基线空隙） */
.masonry {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, max(195px, calc((100% - 4px) / 5))), 1fr));
  grid-auto-rows: 1px;
  column-gap: 1px;
  align-items: start;
  border-radius: 14px 14px 0 0;
  overflow: clip;
}
.masonry > .card { margin: 0; min-width: 0; }
.masonry:has(> .empty) { display: block; }
.card {
  display: block;
  width: 100%;
  break-inside: avoid;
  page-break-inside: avoid;
  margin: 0 0 1px;
  background: transparent;
  border-radius: 0;
  border: 0;
  cursor: pointer;
  line-height: 1.5;
}
.card:hover { z-index: 2; }
.thumb {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  background: var(--surface-muted);
  border: 0;
  box-shadow: none;
  line-height: 0;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: transform 0.38s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease;
}
.thumb img.ok { opacity: 1; }
.card:hover .thumb img { transform: scale(1.03); }

.ov-badges {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  min-width: 0;
}
.c-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2.5px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 650;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  white-space: nowrap;
}
.c-pill.photo {
  background: rgba(255, 255, 255, 0.94);
  color: #09090b;
}
.c-pill.direct {
  background: rgba(9, 9, 11, 0.76);
  color: #f4f4f5;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.c-pill.pin {
  background: #09090b;
  color: #ffffff;
}
.c-pill.cost {
  background: rgba(9, 9, 11, 0.68);
  color: #e4e4e7;
  font-variant-numeric: tabular-nums;
}

.card-ov {
  position: absolute;
  inset: 0;
  z-index: 3;
  padding: 10px;
  background: radial-gradient(circle at top right, rgba(9, 9, 11, 0.25) 0%, transparent 55%);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.card:hover .card-ov,
.card:focus-visible .card-ov,
.card:focus-within .card-ov {
  opacity: 1;
  pointer-events: auto;
}
.card-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5.5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}
.card-cta:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.88);
  color: #ffffff;
  transform: scale(1.03);
}
.card-cta:active {
  transform: scale(0.98);
}
.card-ov-bot h3 {
  margin: 0 0 3px;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-ov-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.8);
}
.card-ov-meta .uses {
  color: #ffffff;
  margin-left: auto;
}

.meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.tag {
  font-size: 11px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  padding: 1px 7px;
  border-radius: 6px;
  font-weight: 500;
}
.tag.brand { color: var(--text); background: var(--surface-muted); border-color: var(--line-strong); font-weight: 600; }
.uses {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.6;
  color: var(--sub);
  padding: 64px 20px;
  column-span: all;
  grid-column: 1 / -1;
}
.empty .art {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--text);
  margin-bottom: 14px;
}
.empty h3 { margin: 0 0 6px; color: var(--text); font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; }
.empty p { margin: 0; font-size: 13px; color: var(--muted); max-width: 380px; }
.empty-acts { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; justify-content: center; }

/* ============ 运营位横幅（供管理后台预览使用） ============ */
.banner2 {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  min-height: 128px;
  background: radial-gradient(120% 180% at 88% 10%, rgba(99, 102, 241, 0.32) 0%, rgba(168, 85, 247, 0.14) 42%, rgba(9, 9, 11, 0) 75%), #0c0c0f;
  color: #f4f4f5;
  display: flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.bn-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.45; }
.banner2::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(9, 9, 11, 0.92) 0%, rgba(9, 9, 11, 0.55) 60%, rgba(9, 9, 11, 0.15) 100%);
}
.bn-in {
  position: relative;
  z-index: 1;
  padding: 20px 26px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.bn-in h2 { margin: 6px 0 3px; font-size: 20px; font-weight: 800; color: #fff; }
.bn-in p { margin: 0; color: #a1a1aa; font-size: 13px; }
.bn-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #e4e4e7;
}
.bn-cta {
  background: #ffffff !important;
  color: #09090b !important;
  border: 0 !important;
  font-weight: 700 !important;
}

/* ============ 板块三（1）：经典左图右控做同款双栏大弹窗 ============ */
.mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(9, 9, 11, 0.68);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.mask.show { display: flex; animation: fade 0.2s; }
.dlg {
  width: min(1080px, 100%);
  height: min(750px, calc(100vh - 40px));
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  box-shadow: var(--sh3);
  display: grid;
  grid-template-columns: 1.12fr 1fr;
  overflow: hidden;
  animation: rise 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.dlg-l {
  position: relative;
  background: #0c0c0f;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 0;
}
.bgblur {
  position: absolute;
  inset: -40px;
  background-size: cover;
  background-position: center;
  filter: blur(44px) saturate(1.2);
  opacity: 0.35;
}
.dlg-l img.main {
  position: relative;
  max-width: 88%;
  max-height: 86%;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  object-fit: contain;
}
.dlg-x {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 4;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(18, 18, 21, 0.72);
  backdrop-filter: blur(8px);
  color: #fff;
  display: grid;
  place-items: center;
  transition: transform 0.15s, background 0.15s;
}
.dlg-x:hover { background: rgba(39, 39, 42, 0.95); transform: scale(1.05); }
.car {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 38px;
  height: 38px;
  margin-top: -19px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(18, 18, 21, 0.72);
  backdrop-filter: blur(8px);
  color: #fff;
  display: grid;
  place-items: center;
  transition: background 0.15s;
}
.car:hover { background: rgba(39, 39, 42, 0.95); }
.car.l { left: 14px; }
.car.r { right: 14px; }
.dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 3;
}
.dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.45); transition: all 0.2s; }
.dots i.on { background: #fff; width: 18px; border-radius: 3px; }
.ex-mark, .ai-mark {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 3;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(18, 18, 21, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  color: #f4f4f5;
}
.viewtog {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  box-shadow: var(--sh2);
}
.painting {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 2;
  background: rgba(9, 9, 11, 0.65);
  backdrop-filter: blur(18px);
}
.painting > div { display: flex; flex-direction: column; align-items: center; }
.painting p { margin: 16px 0 0; font-weight: 700; color: #f4f4f5; }
.orb {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #6366f1, #ec4899, #f59e0b, #6366f1);
  animation: spin 2.2s linear infinite;
  box-shadow: 0 0 60px rgba(99, 102, 241, 0.45);
  flex: none;
}
.orb.sm { width: 36px; height: 36px; box-shadow: none; }

.cmp {
  position: relative;
  height: 84%;
  max-width: 86%;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  --p: 50%;
}
.cmp > img, .cmp-top img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cmp-top { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--p)) 0 0); }
.cmp-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--p);
  width: 2px;
  background: #fff;
  transform: translateX(-1px);
  pointer-events: none;
}
.cmp-line span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--sh2);
  color: #09090b;
}
.cmp input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.cmp em {
  position: absolute;
  bottom: 12px;
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(9, 9, 11, 0.72);
  color: #fff;
  pointer-events: none;
}
.cmp .cmp-l { left: 12px; }
.cmp .cmp-r { right: 12px; }

.dlg-r { display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.dlg-body { flex: 1; overflow-y: auto; padding: 24px 26px 16px; }
.dlg-foot {
  padding: 14px 26px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass-panel);
  backdrop-filter: blur(12px);
  flex-wrap: wrap;
}
.dlg h2 { font-size: 20px; font-weight: 800; margin: 8px 0 4px; letter-spacing: -0.02em; line-height: 1.35; }
.dlg .sub { color: var(--sub); margin: 0 0 16px; font-size: 13px; }
.sec { margin-top: 18px; }
.sec-t {
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.sec-t em { font-style: normal; font-weight: 600; color: var(--muted); font-size: 11.5px; }

.upload-layout.single {
  display: grid;
  grid-template-columns: 122px 1fr;
  gap: 14px;
  align-items: start;
}
.upload-layout.single .slots { grid-template-columns: 1fr; }
.upload-layout.single .guide { margin-top: 0; }

.locked {
  margin-top: 14px;
  border-radius: 14px;
  padding: 13px 15px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  display: flex;
  gap: 12px;
  align-items: center;
}
.locked .ic {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--text);
  flex: none;
}
.kv { display: flex; flex-wrap: wrap; gap: 8px; }
.kv span {
  border: 1px solid var(--line);
  background: var(--surface-muted);
  border-radius: 10px;
  padding: 5px 11px;
  font-size: 12px;
  color: var(--sub);
}
.kv b { color: var(--text); font-weight: 600; margin-left: 5px; }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.slot {
  position: relative;
  aspect-ratio: 3/4;
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--surface-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  overflow: hidden;
  text-align: center;
  padding: 8px;
}
.slot:hover, .slot.drag {
  border-color: var(--text);
  background: var(--brand-soft);
  color: var(--text);
}
.slot input { display: none; }
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot.filled { border: 1px solid var(--line); cursor: default; background: var(--surface); }
.slot.wide { aspect-ratio: 16/9; }
.slot .rm {
  position: absolute;
  right: 6px;
  top: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 0;
  background: rgba(9, 9, 11, 0.72);
  color: #fff;
  display: grid;
  place-items: center;
  z-index: 1;
  transition: background 0.15s;
}
.slot .rm:hover { background: var(--bad); }

.mini-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mini-slots .slot { aspect-ratio: 1; border-radius: 11px; padding: 4px; font-size: 11px; }

.steps { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 12px; }
.steps li { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.steps .d {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  display: grid;
  place-items: center;
  flex: none;
}
.steps li.on { color: var(--text); font-weight: 600; }
.steps li.on .d { border-color: var(--text); border-top-color: transparent; animation: spin 0.8s linear infinite; }
.steps li.done { color: var(--sub); }
.steps li.done .d { background: var(--ok); border-color: var(--ok); color: #fff; }

.success {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 15px;
  border-radius: 13px;
  background: var(--ok-soft);
  border: 1px solid var(--ok-border);
  color: var(--ok);
  font-weight: 600;
}
.warn-box {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 15px;
  border-radius: 13px;
  background: var(--warn-soft);
  border: 1px solid var(--warn-border);
  color: var(--warn);
  margin-bottom: 12px;
  font-size: 13px;
}
.warn-box b { display: block; margin-bottom: 2px; }
.fail {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 13px 15px;
  border-radius: 14px;
  background: var(--bad-soft);
  border: 1px solid var(--bad-border);
  color: var(--bad);
  margin-bottom: 16px;
}
.fail div div { color: var(--sub); font-size: 12.5px; margin-top: 2px; }

.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs button {
  width: 62px;
  height: 62px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  background: var(--surface-muted);
  transition: border-color 0.15s;
}
.thumbs button.on { border-color: var(--text); box-shadow: var(--ring); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* ============ 板块三（2）：创作界面（严格对齐参考图二、图三：760px 同宽居中轴、右上气泡、左对齐进度卡、极简输入框） ============ */
[data-view="create"] {
  background: var(--surface);
  min-height: 100vh;
}
[data-theme="dark"] [data-view="create"] {
  background: var(--bg);
}
.k-studio {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: 20px 24px 18px;
  gap: 20px;
  width: 100%;
}
.k-canvas-stage {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 0 20px;
  display: flex;
  flex-direction: column;
}
.k-studio-empty {
  margin: auto 0;
  padding: 48px 20px;
}
.k-turn {
  width: 100%;
  display: flex;
  flex-direction: column;
  animation: rise 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* 右上角用户提示词气泡（右边缘与下方输入框右边缘 100% 垂直对齐） */
.k-user-msg {
  align-self: flex-end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  margin-bottom: 18px;
  max-width: 78%;
}
.k-user-refs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.k-user-refs img {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  object-fit: cover;
  border: 1px solid var(--line);
}
.k-prompt-bubble {
  min-width: 36px;
  min-height: 36px;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: left;
  word-break: break-word;
}

/* 左对齐状态标题行（左边缘与下方图片卡、底部输入框左边缘 100% 垂直对齐） */
.k-gen-status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--sub);
}
.k-ai-badge {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: var(--pri-bg);
  color: var(--pri-fg);
  display: inline-grid;
  place-items: center;
  flex: none;
}
.k-ai-badge svg {
  width: 10px;
  height: 10px;
}

/* 左对齐生图进度/结果卡片（严格对齐参考图二、图三） */
.k-gen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  width: 100%;
  align-items: start;
}
.k-gen-grid.single {
  display: block;
}
.k-gen-grid.single .k-gen-card {
  width: min(380px, 100%);
}
.k-gen-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #1c1917;
  border: 1px solid var(--line);
  box-shadow: var(--sh1);
}
.k-gen-card > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.k-gen-card.done > img {
  cursor: zoom-in;
}
.k-gen-blur-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.3s ease;
  pointer-events: none;
}

/* 卡片左上角：环形进度条 + 百分比（如 ◔ 43% / ◔ 57%） */
.k-gen-prog-pill {
  position: absolute;
  left: 12px;
  top: 11px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.k-ring-svg {
  flex: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}
.k-ring-fg {
  transition: stroke-dashoffset 0.24s ease;
}

/* 卡片右上角：半透明模型/画质胶囊（如 Krea 2 Large / 标准 1K） */
.k-gen-model-pill {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 3;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(9, 9, 11, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.92);
  font-size: 10.5px;
  font-weight: 500;
  pointer-events: none;
}

/* 卡片底部：柔和暗角提示词浮层 */
.k-gen-prompt-ov {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 28px 13px 11px;
  background: linear-gradient(180deg, transparent 0%, rgba(9, 9, 11, 0.72) 100%);
  color: rgba(255, 255, 255, 0.76);
  font-size: 11px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  pointer-events: none;
}

.k-gen-card .acts {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 4;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.k-gen-card:hover .acts,
.k-gen-card:focus-within .acts {
  opacity: 1;
}
.k-gen-card .acts button {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(9, 9, 11, 0.72);
  backdrop-filter: blur(8px);
  color: #ffffff;
  display: grid;
  place-items: center;
}
.k-gen-card .acts button:hover {
  background: #09090b;
}

/* 底部极简悬浮输入框（与上方 760px 舞台严格同宽、左右边缘 100% 对齐） */
.k-floating-dock {
  position: sticky;
  bottom: 14px;
  z-index: 25;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}
.k-dock-composer {
  max-width: 760px;
  width: 100%;
  margin: 0;
  padding: 13px 16px 11px;
  border-radius: 20px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: 0 8px 28px -10px rgba(9, 9, 11, 0.06);
}
.k-dock-ta {
  padding: 2px 0 8px;
  min-height: 42px;
  font-size: 13.5px;
}
.k-dock-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0;
  margin: 0;
}
.k-dock-add {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--text);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex: none;
  transition: background-color 0.15s, border-color 0.15s;
}
.k-dock-add input {
  display: none;
}
.k-dock-add:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}
.k-dock-right {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.k-dock-param {
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--sub);
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background-color 0.15s, color 0.15s;
}
.k-dock-param b {
  font-weight: 600;
  color: var(--text);
}
.k-dock-param span {
  color: var(--muted);
}
.k-dock-param svg {
  color: var(--muted);
}
.k-dock-param:hover,
.k-dock-param.on {
  background: var(--surface-muted);
  color: var(--text);
}
.hero-pop.dock-pop {
  top: auto;
  bottom: calc(100% + 10px);
  left: auto;
  right: 0;
}
/* Absolute popovers anchor to the composer, not its zero-height host. */
.hero-composer > #dockPopHost,
.hero-composer > #heroPopHost { position: static; }
.ratio-chips {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}
.ratio-chips .chip {
  padding: 5px 4px;
  font-size: 11.5px;
  border-radius: 9px;
}

.res-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  align-items: start;
}
.res {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  box-shadow: var(--sh1);
  animation: rise 0.3s;
}
.res img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.res .acts {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.2s;
}
.res:hover .acts, .res:focus-within .acts { opacity: 1; }
.res .acts button {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(9, 9, 11, 0.75);
  backdrop-filter: blur(8px);
  color: #fff;
  display: grid;
  place-items: center;
}
.res .acts button:hover { background: #09090b; color: #fff; }
.aibdg {
  position: absolute;
  left: 10px;
  top: 10px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(9, 9, 11, 0.65);
  backdrop-filter: blur(6px);
  color: #fff;
  pointer-events: none;
  z-index: 2;
}

/* ============ 板块三（3）：我的作品（轻量配额胶囊条 + 纯画面圆角资产网格） ============ */
.page {
  max-width: 1460px;
  width: 100%;
  margin: 0 auto;
  padding: 26px 32px 48px;
}
.works-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.works-top-bar h1 {
  font-size: 23px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.025em;
}
.works-top-bar p {
  margin: 3px 0 0;
  color: var(--sub);
  font-size: 13px;
}
.quota-pill {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 8px 18px;
  box-shadow: var(--sh1);
  margin-left: auto;
  flex-wrap: wrap;
}
.qp-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}
.qp-info span { color: var(--muted); font-size: 12px; }
.quota-pill .prog { width: 110px; }

.works {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 18px;
}
.work {
  border-radius: 16px;
  overflow: hidden;
  background: transparent;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.work:hover { z-index: 2; }
.work .thumb {
  aspect-ratio: 3/4;
  border-radius: 16px;
}
.work .thumb img { cursor: zoom-in; }
.work-ov {
  position: absolute;
  inset: 0;
  padding: 12px;
  background: linear-gradient(180deg, rgba(9, 9, 11, 0.24) 0%, transparent 38%, rgba(9, 9, 11, 0.84) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.work:hover .work-ov,
.work:focus-within .work-ov { opacity: 1; }
.work-ov-acts {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
.glass-ic {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(9, 9, 11, 0.7);
  backdrop-filter: blur(8px);
  color: #ffffff;
}
.glass-ic:hover {
  background: #09090b;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
}
.work-ov-info {
  color: #ffffff;
  line-height: 1.4;
}
.work-ov-info b {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.work-ov-info span {
  display: block;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.76);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pend-in {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text);
  padding: 14px;
  text-align: center;
}
.pend-in span { font-size: 12px; color: var(--muted); }

/* ============ 管理后台 ============ */
.admin {
  display: grid;
  grid-template-columns: 204px minmax(0, 1fr);
  gap: 22px;
  max-width: 1460px;
  width: 100%;
  margin: 0 auto;
  padding: 26px 32px 48px;
}
.admin > div { min-width: 0; }
.anav {
  min-width: 0;
  padding: 10px;
  align-self: start;
  position: sticky;
  top: 24px;
}
.anav-list { display: grid; gap: 4px; }
.anav .cat {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 9px 12px;
  border-radius: 11px;
  border: 0;
  background: transparent;
  color: var(--sub);
  font-weight: 600;
  font-size: 13px;
}
.anav .cat:hover { background: var(--surface-muted); color: var(--text); }
.anav .cat.on { background: var(--pri-bg); color: var(--pri-fg); }
.anav .cat span {
  font-size: 13px;
  color: inherit;
  background: transparent;
  padding: 0;
  display: flex;
  gap: 8px;
  align-items: center;
}
.anav .tip {
  font-size: 11.5px;
  color: var(--muted);
  padding: 12px 10px 6px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
  line-height: 1.55;
}
.ahead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.ahead h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 820px; }
th {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
  white-space: nowrap;
}
td { padding: 11px 14px; border-bottom: 1px solid var(--line2); vertical-align: middle; font-size: 13px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-muted); }
.tthumb { width: 42px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--surface-muted); flex: none; }

.st {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2.5px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.st.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-border); }
.st.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-border); }
.st.gray { background: var(--surface-muted); color: var(--sub); border: 1px solid var(--line); }

.sheet {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(9, 9, 11, 0.55);
  backdrop-filter: blur(6px);
  display: none;
  justify-content: flex-end;
}
.sheet.show { display: flex; animation: fade 0.2s; }
.sheet-p {
  width: min(1060px, 100%);
  height: 100%;
  background: var(--surface);
  display: grid;
  grid-template-columns: 1fr 300px;
  box-shadow: var(--sh3);
  animation: slide 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes slide { from { transform: translateX(36px); opacity: 0; } }
.sheet-f { overflow-y: auto; padding: 24px 26px 60px; }
.sheet-h {
  position: sticky;
  top: -24px;
  z-index: 10;
  margin: -24px -26px 8px;
  padding: 16px 26px 14px;
  background: var(--glass-panel);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.sheet-h h2 { margin: 0; font-size: 18px; font-weight: 800; }
.sheet-pv .thumb { border-radius: 10px; }
.sheet-pv {
  background: var(--bg);
  border-left: 1px solid var(--line);
  padding: 24px 20px;
  overflow-y: auto;
}
.fsec {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  margin-top: 14px;
  background: var(--surface);
}
.fsec-t {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  margin-bottom: 12px;
}
.fsec-t span { margin-left: auto; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.fsec.secret { background: var(--surface-muted); border-color: var(--line-strong); }
.fsec .lockb {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  padding: 2px 10px;
  border-radius: 999px;
}
.ed-top { display: flex; gap: 16px; align-items: flex-start; }
.cover-box { width: 136px; flex: none; }
.chk {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  min-width: 148px;
  flex: 1;
  transition: border-color 0.15s;
}
.chk:hover { border-color: var(--text); }
.chk input { accent-color: var(--pri-bg); margin-top: 3px; }
.chk small { display: block; color: var(--muted); margin-top: 2px; }
.pv-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 12.5px; color: var(--sub); }
.pv-list li { display: flex; gap: 8px; align-items: center; }
.pv-list li .svg { color: var(--ok); }
.pv-list li.no .svg { color: var(--text); }
.statbox { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.statbox div { background: var(--surface-muted); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.statbox b { display: block; font-size: 17px; color: var(--text); }
.statbox span { font-size: 11.5px; color: var(--muted); }

/* 通道的 Sub2API 分组选择器 */
.panel:has(.group-trigger[aria-expanded="true"]) { position: relative; z-index: 30; }
.group-field, .group-picker { min-width: 0; }
.group-picker { position: relative; }
.group-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  min-height: 40px;
}
.group-trigger[aria-expanded="true"] { border-color: var(--text); box-shadow: var(--ring); }
.group-trigger > .group-badge { max-width: calc(100% - 62px); }
.group-chevron { display: flex; align-items: center; gap: 6px; flex: none; color: var(--sub); }
.group-chevron small { font-size: 12px; font-weight: 600; }
.group-placeholder { color: var(--muted); }
.group-hint { font-size: 12px; color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }
.group-hint.warn { color: var(--warn); font-weight: 500; }
.channel-model-list {
  display: grid;
  gap: 5px;
  max-height: 240px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 6px;
  background: var(--surface);
}
.channel-model-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  min-width: 0;
  border-radius: 8px;
  cursor: pointer;
  color: var(--sub);
  font-size: 13px;
}
.channel-model-option:hover { background: var(--surface-muted); }
.channel-model-option.selected { background: var(--pri-bg); color: var(--pri-fg); }
.channel-model-option:focus-within { outline: 2px solid var(--accent); outline-offset: -2px; }
.channel-model-option input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--accent); }
.channel-model-option > span { min-width: 0; }
.channel-model-name { display: block; overflow-wrap: anywhere; }
.channel-model-option small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.channel-model-option.selected small { color: inherit; opacity: .75; }
.channel-model-option.unavailable small { color: var(--warn); }
.channel-model-option:has(input:disabled) { cursor: default; opacity: .65; }
.group-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 500px;
  max-width: calc(100vw - 64px);
  z-index: 45;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: var(--sh2);
  overflow: hidden;
}
.group-search {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 8px;
  padding: 8px 10px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
}
.group-search:focus-within { border-color: var(--text); background: var(--surface); }
.group-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 13px; color: var(--text); }
.group-options { max-height: 280px; overflow-y: auto; overscroll-behavior: contain; padding: 0 8px 8px; }
.group-option {
  display: block;
  width: 100%;
  padding: 10px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line2);
  border-radius: 9px;
  background: var(--surface);
  transition: background 0.12s;
}
.group-option:hover, .group-option:focus-visible, .group-option.selected {
  background: var(--surface-muted);
  outline: 2px solid transparent;
}
.group-option:disabled { opacity: 0.5; cursor: not-allowed; }
.group-option-top { display: flex; gap: 8px; align-items: center; }
.group-option-top > .group-badge { flex: 1; min-width: 0; max-width: 100%; }
.group-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2.5px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  min-width: 0;
  width: fit-content;
  overflow: hidden;
}
.group-badge > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-rate { flex: none; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.group-badge.green, .group-rate.green { color: #15803d; background: #f0fdf4; }
.group-badge.amber, .group-rate.amber { color: #b45309; background: #fffbeb; }
.group-badge.blue, .group-rate.blue { color: #0369a1; background: #f0f9ff; }
.group-badge.purple, .group-rate.purple { color: #7e22ce; background: #faf5ff; }
.group-badge.teal, .group-rate.teal { color: #0f766e; background: #f0fdfa; }
.group-badge.pink, .group-rate.pink { color: #be185d; background: #fdf2f8; }
.group-badge.gray, .group-rate.gray { color: #52525b; background: #f4f4f5; }
.group-description { display: block; font-size: 12px; color: var(--sub); line-height: 1.5; margin-top: 5px; overflow-wrap: anywhere; }
.group-clear { font-size: 12px; color: var(--muted); }
.group-empty { padding: 16px 10px; text-align: center; font-size: 13px; color: var(--sub); }
.group-empty .btn { display: block; margin: 10px auto 0; }
.group-sync { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: 12.5px; color: var(--sub); }
.group-sync .group-error { color: var(--bad); font-weight: 600; }

/* ============ 大图预览与轻提示 ============ */
.lb {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(9, 9, 11, 0.92);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  padding: 20px;
}
.lb.show { display: flex; animation: fade 0.2s; }
.lb img { max-width: 92vw; max-height: 90vh; border-radius: 16px; box-shadow: var(--sh3); object-fit: contain; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  background: var(--pri-bg);
  color: var(--pri-fg);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  box-shadow: var(--sh2);
  opacity: 0;
  transition: 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 99;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ 响应式适配（1440 / 1024 / 900 / 768 / 390 / 360） ============ */
@media (max-width: 1240px) {
  .plaza, .k-studio, .page, .admin { padding: 20px 22px 40px; }
  .feat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .home-first-fold { min-height: calc(100vh - 24px); }
  .admin { grid-template-columns: 184px 1fr; gap: 18px; }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .group-menu { left: auto; right: 0; }
}

@media (max-width: 900px) {
  .app-shell { flex-direction: column; }
  .m-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: 54px;
    padding: 0 14px;
    background: var(--glass);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .m-brand {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.02em;
    cursor: pointer;
  }
  .k-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 80;
    width: 256px;
    transform: translateX(-104%);
    box-shadow: var(--sh3);
  }
  body.side-open .k-sidebar {
    transform: translateX(0);
  }
  body.side-open .side-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 75;
    background: rgba(9, 9, 11, 0.48);
    backdrop-filter: blur(4px);
    animation: fade 0.18s;
  }

  .plaza, .k-studio, .page, .admin { padding: 16px; }
  .feat-row {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .feat-row::-webkit-scrollbar { display: none; }
  .feat-row .card { width: 180px; flex: none; }

  .admin { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .anav { position: static; padding: 6px 8px; }
  .anav .tip { display: none; }
  .anav-list {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .anav-list::-webkit-scrollbar { display: none; }
  .anav .cat { width: auto; white-space: nowrap; flex: none; padding: 7px 13px; }

  .mask { padding: 0; }
  .dlg {
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
    border: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }
  .dlg-l { flex: none; height: clamp(240px, 38vh, 340px); }
  .dlg-r { flex: 1; }
  .dlg-body { overflow: visible; padding: 18px 18px 12px; }
  .dlg-foot {
    position: sticky;
    bottom: 0;
    z-index: 10;
    padding: 12px 18px calc(14px + env(safe-area-inset-bottom, 0px));
  }

  .sheet-p { grid-template-columns: 1fr; overflow-y: auto; }
  .sheet-f { overflow: visible; padding-bottom: 24px; }
  .sheet-pv { border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 640px) {
  .plaza, .k-studio, .page, .admin { padding: 12px; }
  .hero-title { font-size: 21px; margin-bottom: 12px; }
  .hero-composer { padding: 12px; border-radius: 18px; }
  .h-slot { width: 38px; height: 38px; }
  .hero-pop { left: 0; right: 0; width: 100%; }

  .pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .pills::-webkit-scrollbar { display: none; }
  .pill { flex: none; padding: 5px 12px; font-size: 12px; }
  .auds {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .auds::-webkit-scrollbar { display: none; }
  .auds button { flex: none; }
  .hero-r { width: 100%; justify-content: space-between; margin-left: 0; }
  .search, .search:focus-within { width: 100%; }
  .search-wrap { width: 100%; }

  .masonry { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { margin-bottom: 1px; }
  .thumb { border-radius: 0; }
  .card-ov { opacity: 1; background: rgba(9, 9, 11, 0.12); padding: 8px; }

  .upload-layout.single { grid-template-columns: 104px 1fr; gap: 10px; }
  .ratio-chips { grid-template-columns: repeat(4, 1fr); }
  .dock-presets { grid-template-columns: 1fr; min-width: 100%; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .group-menu { left: 0; right: auto; width: 100%; max-width: 100%; }
  .ed-top { flex-direction: column; }
  .statbox { grid-template-columns: 1fr 1fr; }
  .works-top-bar { align-items: stretch; }
  .quota-pill { width: 100%; margin-left: 0; border-radius: 16px; justify-content: space-between; }
  .works { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .work-ov { opacity: 1; }
}

/* Account/quote integration preserves Gemini's visual layout. */
.quote-dialog{max-width:460px;width:calc(100% - 32px);box-sizing:border-box;border:1px solid var(--line);border-radius:20px;padding:24px;background:var(--surface,#fff);color:var(--text,#18181b)}
.quote-dialog::backdrop{background:rgba(0,0,0,.55)}.quote-dialog h2{margin-top:0}.quote-dialog dl>div{display:flex;justify-content:space-between;gap:16px;margin:16px 0}.quote-dialog dd{font-weight:650;margin:0}.quote-dialog .row{justify-content:flex-end}.pending-order{position:sticky;top:0;z-index:30;display:flex;gap:12px;align-items:center;justify-content:center;flex-wrap:wrap;background:var(--surface,#fff);padding:12px;border-bottom:1px solid var(--line)}.pending-order[hidden]{display:none}.job-finance{font-size:13px;line-height:1.7;padding:12px 0;color:var(--sub)}.price-additions{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}
