/* 显影 · 首页改版预览（自己写的 CSS）
   版式与观感参考了同类产品的做法：白底 + 浅色面板 + 单一强调色 + 8/12/16/胶囊 四档圆角
   强调色只在这一个变量里，想换成品牌橙就改 --accent 一行 */

:root {

  /* 浅色：象牙白底 + 暖灰面板 + 深松绿主色 + 香槟金点缀 */
  /* 语义色（成功 / 进行中 / 失败）：全站只在这里定义这一次 */
  --ok: #2e7d52;
  --warn: #d98324;
  --bad: #c0392b;
  --accent: #c2622e;
  --accent-2: #b4446b;
  --accent-soft: #fbeee6;
  --accent-ink: #ffffff;
  --gold: #c79a4e;

  --bg: #fffaf5;
  --panel: #f9f0e8;
  --panel-2: #f3e6da;
  --hover: #eddcce;
  --ink: #2a1f18;
  --ink-2: #6b5a4d;
  --ink-3: #a08e80;
  --dark-ink: #2a1f18;
  --line: #f0e2d6;
  /* 渐变专用:主色渐变 / 按钮底色 / 背景柔光(素色套自动用主色拼一个) */
  --accent-grad: linear-gradient(96deg, var(--accent) 0%, var(--accent-2) 100%);
  --btn-bg: var(--dark-ink);
  --btn-ink: var(--bg);
  --wash: radial-gradient(880px 500px at 8% -4%, rgb(194 98 46 / .12), transparent 60%),

  --r-chip: 10px;
  --r-card: 16px;
  --r-pill: 9999px;
  --font: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --shadow-1: 0 1px 2px rgb(21 23 31 / .04), 0 8px 24px rgb(21 23 31 / .05);
  --ease: cubic-bezier(.16, 1, .3, 1);
}
[data-theme="dark"] {
  /* 深色：墨绿黑底 + 松绿主色 + 香槟金点缀 */
  /* 语义色（与浅色同名变量一一对应，只换明度） */
  --ok: #6fcf97;
  --warn: #f0b46a;
  --bad: #f27a6a;
  --accent: #f0a06a;
  --accent-2: #e77fa8;
  --accent-soft: #33231c;
  --accent-ink: #1a120c;
  --gold: #e0b877;

  --bg: #120e0c;
  --panel: #1b1613;
  --panel-2: #231d18;
  --hover: #2c241e;
  --ink: #f1eae2;
  --ink-2: #b5a79a;
  --ink-3: #857668;
  --dark-ink: #f1eae2;
  --line: #2a221c;
}
[data-palette="2"] {
  /* 雾蓝石墨（雾霾蓝 + 石墨灰） 浅色 */
  /* 浅色：冷白底 + 蓝灰面板 + 雾霾蓝主色 */
  --accent: #3f5e7a;
  --accent-2: #547799;
  --accent-soft: #e9eef4;
  --accent-ink: #ffffff;
  --gold: #b9a06a;

  --bg: #f8f9fb;
  --panel: #eff2f6;
  --panel-2: #e6eaf1;
  --hover: #dde3ec;
  --ink: #1b2027;
  --ink-2: #5c6572;
  --ink-3: #909aa8;
  --dark-ink: #1b2027;
  --line: #e2e7ee;
}
[data-theme="dark"][data-palette="2"] {
  /* 深色：石墨蓝黑 + 雾蓝主色 */
  --accent: #8fb0cc;
  --accent-2: #a5c2da;
  --accent-soft: #232c36;
  --accent-ink: #12161b;
  --gold: #cdb37c;

  --bg: #0f1216;
  --panel: #161a20;
  --panel-2: #1c2128;
  --hover: #242b34;
  --ink: #e9ecf1;
  --ink-2: #9fa8b4;
  --ink-3: #737d8a;
  --dark-ink: #e9ecf1;
  --line: #242a32;
}
[data-palette="3"] {
  /* 燕麦胡桃（燕麦白 + 胡桃棕） 浅色 */
  /* 浅色：燕麦白底 + 米灰面板 + 胡桃棕主色 */
  --accent: #8a6a4f;
  --accent-2: #a2815f;
  --accent-soft: #f0e9e1;
  --accent-ink: #ffffff;
  --gold: #c0a068;

  --bg: #fbf9f5;
  --panel: #f4efe7;
  --panel-2: #ebe4d9;
  --hover: #e4dccf;
  --ink: #241f1a;
  --ink-2: #665e54;
  --ink-3: #9b9184;
  --dark-ink: #241f1a;
  --line: #e7dfd3;
}
[data-theme="dark"][data-palette="3"] {
  /* 深色：咖啡黑 + 胡桃棕主色 */
  --accent: #c9a17c;
  --accent-2: #d8b394;
  --accent-soft: #2b241d;
  --accent-ink: #16120e;
  --gold: #d5b47f;

  --bg: #12100e;
  --panel: #1a1714;
  --panel-2: #211d19;
  --hover: #2a251f;
  --ink: #efeae3;
  --ink-2: #a89f94;
  --ink-3: #7c746a;
  --dark-ink: #efeae3;
  --line: #2a251f;
}



* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  background-image: var(--wash);
  background-repeat: no-repeat;
  background-size: cover;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 13px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  transition: background .24s var(--ease), color .24s var(--ease);
}

button { font: inherit; cursor: pointer; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 22px;
  height: 64px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 22px; height: 22px; border-radius: 7px;
  background: conic-gradient(from 200deg, var(--accent), #ff5bb0, #ffb03a, var(--accent));
}
.brand-name { font-size: 16px; font-weight: 700; }

.modes { display: flex; gap: 6px; background: var(--panel); padding: 4px; border-radius: var(--r-pill); }
.mode {
  border: 0; background: transparent; color: var(--ink-2);
  padding: 7px 18px; border-radius: var(--r-pill); font-size: 13.5px;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.mode:hover { color: var(--ink); }
.mode.on { background: var(--bg); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-1); }

.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.quota { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; }

.icon-btn {
  position: relative;
  width: 34px; height: 34px; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: transparent; color: var(--ink-2);
}
.ico-sun, .ico-moon {
  position: absolute; inset: 0; margin: auto;
  width: 12px; height: 12px; border-radius: 50%;
}
.ico-sun { background: var(--warn); }
.ico-moon { background: var(--accent); }
[data-theme="light"] .ico-sun { display: block; }
[data-theme="light"] .ico-moon { display: none; }
[data-theme="dark"] .ico-sun { display: none; }
[data-theme="dark"] .ico-moon { display: block; }

.user-chip { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line); }
.outline-btn {
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  padding: 7px 18px; border-radius: var(--r-pill);
  transition: background .16s var(--ease), border-color .16s var(--ease);
}
.outline-btn:hover { background: var(--panel); }

/* ---------------- 外壳 ---------------- */
.shell { display: flex; flex: 1; align-items: stretch; }

.rail {
  width: 84px;
  padding: 16px 10px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--line);
}
.rail-item {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  border: 0; background: transparent; color: var(--ink-2);
  padding: 9px 0; border-radius: 12px; font-size: 11.5px;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.rail-item:hover { background: var(--panel); color: var(--ink); }
.rail-item.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.rail-ico { width: 16px; height: 16px; border-radius: 5px; background: currentColor; opacity: .55; }
.rail-item.on .rail-ico { opacity: 1; }
.rail-gap { flex: 1; }

.main { flex: 1; padding: 30px 40px 56px; max-width: 1100px; }

/* ---------------- 大标题 ---------------- */
.headline { margin: 0 0 22px; display: flex; flex-direction: column; gap: 2px; }
.headline .l1 { font-size: 38px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.headline .l2 {
  font-size: 38px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2;
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------------- 输入卡 ---------------- */
.composer {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--bg);
  box-shadow: var(--shadow-1);
  padding: 18px 20px 14px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-1); }

.prompt {
  width: 100%;
  min-height: 96px;
  border: 0; outline: none; resize: none;
  background: transparent; color: var(--ink);
  font: 15px/1.7 var(--font);
}
.prompt::placeholder { color: var(--ink-3); }

.composer-bottom {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 13px; border-top: 1px solid var(--line);
}
.chips { display: flex; gap: 9px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: var(--r-chip);
  background: transparent; color: var(--ink);
  transition: background .16s var(--ease), border-color .16s var(--ease);
}
.chip:hover { background: var(--panel); border-color: var(--accent); }
.chip-k { color: var(--ink-3); font-size: 12px; }
.chip-v { font-weight: 600; }
/* hidden 会被 display:inline-flex 覆盖,必须单独压掉(踩过的坑) */
.chip[hidden] { display: none !important; }

.composer-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.cost { color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.cost b { color: var(--ink); font-variant-numeric: tabular-nums; }
.cost-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent-soft); border: 1px solid var(--accent); }

.go {
  height: 40px; padding: 0 24px;
  border: 0; border-radius: var(--r-chip);
  background: var(--btn-bg); color: var(--btn-ink);
  font-weight: 600;
  transition: transform .16s var(--ease), opacity .16s var(--ease);
}
.go:hover { transform: translateY(-1px); }
.go:active { transform: none; }

.status { margin: 12px 2px 30px; color: var(--ink-2); font-size: 13px; }

/* ---------------- 作品区 ---------------- */
.works-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 16px; }
.works-head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.works-tabs { display: flex; gap: 16px; margin-left: auto; }
.wt { border: 0; background: transparent; color: var(--ink-3); padding: 2px 0; }
.wt.on { color: var(--ink); font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.card { border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; background: var(--bg); transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-1); }
.thumb { position: relative; height: 148px; background: var(--panel); }
.th1 { background: linear-gradient(130deg, #dfe4ff, #f3e9ff); }
.th2 { background: linear-gradient(130deg, #1f2340, #4a3fa8); }
.th3 { background: linear-gradient(130deg, #fff1e6, #ffe7f0); }
.th4 { background: linear-gradient(130deg, #eef0f7, #e6e9f6); }
.badge {
  position: absolute; left: 10px; top: 10px;
  padding: 3px 9px; border-radius: var(--r-pill);
  font-size: 11.5px; background: rgb(255 255 255 / .9); color: var(--ink);
}
.badge.ok { color: var(--ok); }
.badge.run { color: var(--warn); }
.badge.queue { color: var(--ink-2); }
.badge.fail { color: var(--bad); }
.card-meta { display: flex; justify-content: space-between; padding: 10px 12px; color: var(--ink-2); font-size: 12px; }
.cost-mini { font-variant-numeric: tabular-nums; }

/* ---------------- 失败段（任务绝不静默消失） ---------------- */
.card-fail { display: block; padding: 13px 14px 11px; text-align: left; }
.fail-tag {
  display: inline-block; padding: 2px 9px; border-radius: var(--r-pill);
  font-size: 11.5px; color: var(--bad); background: rgb(192 57 43 / .10);
  border: 1px solid rgb(192 57 43 / .20);
}
.fail-prompt { margin: 9px 0 5px; font-size: 13.5px; line-height: 1.5; color: var(--ink); word-break: break-word; }
.fail-err { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--ink-2); word-break: break-word; }
.fail-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 11px; }
.fail-when { font-size: 12px; color: var(--ink-3); }
.fail-more { font-size: 12.5px; color: var(--ink-3); }
.retry-btn {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer;
  padding: 5px 14px; border-radius: var(--r-pill); font-size: 12.5px;
  transition: border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.retry-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

/* ---------------- 页脚 ---------------- */
.foot {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 30px 26px;
  color: var(--ink-3); font-size: 12px;
  border-top: 1px solid var(--line);
}
.foot a { color: var(--ink-3); text-decoration: none; }
.foot a:hover { color: var(--ink); }
.foot-sep { width: 1px; height: 12px; background: var(--line); }

/* ---------------- 窄屏 ---------------- */
@media (max-width: 900px) {
  .rail { display: none; }
  .main { padding: 20px 18px 40px; }
  .headline .l1, .headline .l2 { font-size: 26px; }
  .topbar { gap: 12px; padding: 0 14px; }
  .quota, .user-chip { display: none; }
  .composer-right { margin-left: 0; width: 100%; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ==========================================================================
   动效层 —— 数值全部取自采集到的参考站 CSS(不照抄代码,只对齐时长/曲线/幅度)
      · 进场     naturalPopIn 式的"弹一下":scale .94 -> 1.02 -> 1,opacity 0 -> 1
      · 阶梯     每块延迟 60ms 依次出现(参考站用 .6s / .1s 延迟)
      · 下划线   :before 的 width 0 -> 100%,.3s ease-in-out(参考站招牌动作)
      · 微交互   hover 缩放 .3s ease-in-out;颜色/边框 .2s ease
      · 状态     生成中 = pulse 2s;排队中 = ping 1s;加载 = spin 1s linear
   ========================================================================== */

@keyframes popIn {
  0%   { opacity: 0; transform: scale(.94) }
  55%  { opacity: .6; transform: scale(1.02) }
  100% { opacity: 1; transform: scale(1) }
}

@keyframes riseIn {
  0%   { opacity: 0; transform: translateY(10px) }
  100% { opacity: 1; transform: translateY(0) }
}

@keyframes pulseSoft {
  0%, 100% { opacity: 1 }
  50%      { opacity: .45 }
}

@keyframes pingRing {
  0%   { transform: scale(1); opacity: .7 }
  75%, 100% { transform: scale(1.9); opacity: 0 }
}

@keyframes spin {
  to { transform: rotate(1turn) }
}

/* 进场:标题两行 + 输入卡 + 状态行 + 作品区,依次弹出来 */
.headline .l1,
.headline .l2,
.composer,
.status,
.works { animation: popIn .34s cubic-bezier(.25, .1, .25, 1) both; }

.headline .l1 { animation-delay: 0ms }
.headline .l2 { animation-delay: 60ms }
.composer     { animation-delay: 120ms }
.status       { animation-delay: 180ms }
.works        { animation-delay: 240ms }

/* 切换图片/视频时,让内容重新弹一次(JS 加 .replay) */
body.replay .headline .l1, body.replay .headline .l2, body.replay .composer, body.replay .status {
  animation: popIn .3s cubic-bezier(.25, .1, .25, 1) both;
}
body.replay .headline .l2 { animation-delay: 40ms }
body.replay .composer     { animation-delay: 80ms }
body.replay .status       { animation-delay: 120ms }

/* 顶栏两个模式按钮:选中时轻微上浮 */
.mode.on { animation: riseIn .24s ease-out both; }

/* 左栏 / 作品筛选:下划线从左滑出(参考站招牌动作) */
.rail-item, .wt { position: relative; }
.rail-item::after, .wt::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  height: 2px;
  width: 0;
  border-radius: 2px;
  background: var(--accent);
  transform: translateX(-50%);
  transition: width .3s ease-in-out;
}
.rail-item.on::after, .wt.on::after { width: 22px; }

/* 参数芯片:hover 轻微放大 + 背景过渡 */
.chip { transition: background .2s ease, border-color .2s ease, transform .3s ease-in-out, box-shadow .3s ease-in-out; }
.chip:hover { transform: scale(1.03); box-shadow: var(--shadow-1); }
.chip:active { transform: scale(.97); }

/* 生成键:hover 上浮放大,按下回落 */
.go { transition: transform .3s ease-in-out, box-shadow .3s ease-in-out, opacity .2s ease; }
.go:hover { transform: translateY(-1px) scale(1.02); box-shadow: 0 10px 24px -10px var(--accent); }
.go:active { transform: scale(.98); }

/* 作品卡:hover 抬起(参考站 .3s ease-in-out 的节奏) */
.card { transition: transform .3s ease-in-out, box-shadow .3s ease-in-out, border-color .3s ease-in-out; }
.card:hover { transform: translateY(-4px); border-color: var(--accent); }

/* 缩略图:hover 时里面的画面轻微放大(用背景色块模拟,换成真图同理) */
.thumb { transition: transform .6s ease-out; }
.card:hover .thumb { transform: scale(1.04); }

/* 徽章状态:生成中呼吸 / 排队中脉冲圈 / 已完成轻轻亮一下 */
.badge.run { animation: pulseSoft 2s cubic-bezier(.4, 0, .6, 1) infinite; }
.badge.queue::after {
  content: "";
  position: absolute;
  left: 12px; top: 14px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .5;
  animation: pingRing 1s cubic-bezier(0, 0, .2, 1) infinite;
}
.badge.ok { animation: pulseSoft 3s ease-in-out 1 both; }

/* 主题切换按钮:hover 转一点 */
.icon-btn { transition: background .2s ease, border-color .2s ease, transform .3s ease-in-out; }
.icon-btn:hover { transform: rotate(12deg) scale(1.06); border-color: var(--accent); }

/* 用户胶囊 / 登录键:hover */
.outline-btn { transition: background .2s ease, border-color .2s ease, transform .3s ease-in-out; }
.outline-btn:hover { border-color: var(--accent); transform: translateY(-1px); }

/* 生成中的转圈(需要时给任意元素加 .spinning 即可) */
.spinning::before {
  content: "";
  display: inline-block;
  width: 12px; height: 12px;
  margin-right: 6px;
  border: 2px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  vertical-align: -2px;
  animation: spin 1s linear infinite;
}

/* 输入框聚焦时的光圈(参考站 .2s ease 的颜色过渡) */
.composer { transition: border-color .2s ease, box-shadow .2s ease; }

@media (max-width: 900px) {
  .rail-item::after, .wt::after { display: none; }
}

/* ==========================================================================
   版面层 —— 首页一个居中、收窄的"舞台";我的作品是另一个更宽的版面
   ========================================================================== */

/* 主区改成:整块在可用空间里居中 */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 32px 40px 48px;
  max-width: none;
}

/* 每个视图自己决定宽度:首页窄一点更像"作品页",作品页宽一点放得下网格 */
.view { width: 100%; display: flex; justify-content: center; }
/* display:flex 会盖掉 [hidden],必须单独压回去(同一类坑踩第二次了) */
.view[hidden] { display: none !important; }
.stage { width: 100%; max-width: 760px; }
.stage-wide { max-width: 1060px; }

/* 作品视图从顶部开始排,不再垂直居中 */
body[data-view="works"] .main { justify-content: flex-start; }
body[data-view="works"] .foot { border-top: 0; }

/* 首页的标题:收窄之后字号调整为更好的比例 */
body[data-view="home"] .headline { margin-bottom: 20px; }
body[data-view="home"] .headline .l1,
body[data-view="home"] .headline .l2 { font-size: 36px; }
body[data-view="home"] .composer { padding: 22px 24px 16px; }
body[data-view="home"] .prompt { min-height: 104px; }
body[data-view="home"] .status { text-align: center; margin: 14px 2px 0; }

/* 输入卡更"贵"一点:更软的投影 + 更亮的高光边 */
.composer {
  box-shadow: 0 1px 2px rgb(21 23 31 / .04), 0 14px 40px -18px rgb(21 23 31 / .22);
}
[data-theme="dark"] .composer {
  box-shadow: 0 1px 2px rgb(0 0 0 / .3), 0 18px 46px -20px rgb(0 0 0 / .6);
}

/* 视图切换时,作品页的标题和网格也重播一次 */
body.replay .view-works .works-head,
body.replay .view-works .grid { animation: popIn .3s cubic-bezier(.25, .1, .25, 1) both; }
body.replay .view-works .grid { animation-delay: 70ms; }

/* 左栏只有两项时,视觉上更干净:间距拉开一点 */
.rail { gap: 8px; padding-top: 20px; }

/* 窄屏:舞台不再收窄,内边距缩小 */
@media (max-width: 900px) {
  .main { padding: 18px 16px 32px; justify-content: flex-start; }
  body[data-view="home"] .headline .l1,
  body[data-view="home"] .headline .l2 { font-size: 26px; }
  .stage, .stage-wide { max-width: 100%; }
}

/* 底部标签栏:只在手机显示 */
.tabbar { display: none; }

/* ==========================================================================
   手机端（≤720px）—— 不是把桌面缩小,而是按手机的习惯重排
   1. 关掉手机浏览器自带的"文字自动放大"(否则顶栏被折成两行、行距被撑散)
   2. 顶栏只留 品牌 + 主题 + 登录;图片/视频 换到第二行,做成两个大按钮
   3. 底部固定标签栏,手机上才有入口去"我的作品"
   4. 手指点得着的尺寸:芯片 42px、生成键 46px、正文 15px
   ========================================================================== */
@media (max-width: 720px) {
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

  body { font-size: 15px; }

  /* --- 顶栏 --- */
  .topbar {
    height: auto;
    flex-wrap: wrap;
    padding: 10px 14px;
    row-gap: 10px;
    gap: 10px;
  }
  .brand, .brand-name { white-space: nowrap; flex-shrink: 0; }
  .brand-name { font-size: 15px; }
  .brand-mark { width: 20px; height: 20px; border-radius: 6px; }
  .top-right { gap: 8px; margin-left: auto; }
  .icon-btn { width: 32px; height: 32px; }
  .outline-btn { white-space: nowrap; padding: 7px 15px; font-size: 14px; }
  .quota, .user-chip { display: none; }

  /* 图片/视频:掉到第二行,整行两个大按钮 */
  .modes { order: 3; flex: 1 1 100%; padding: 4px; }
  .mode { flex: 1; text-align: center; padding: 9px 0; font-size: 14px; white-space: nowrap; }

  /* --- 主区:顶部对齐,不留大片空 --- */
  .main { padding: 16px 14px 0; justify-content: flex-start; }
  .rail { display: none; }
  .stage, .stage-wide { max-width: 100%; }

  .headline { margin-bottom: 14px; }
  body[data-view="home"] .headline .l1,
  body[data-view="home"] .headline .l2 { font-size: 25px; letter-spacing: -.01em; line-height: 1.28; }

  /* --- 输入卡:手指点得着 --- */
  body[data-view="home"] .composer { padding: 14px 14px 12px; border-radius: 14px; }
  body[data-view="home"] .prompt { min-height: 84px; font-size: 15px; line-height: 1.65; }
  .composer-bottom { gap: 10px; margin-top: 10px; padding-top: 11px; }
  .chips { gap: 8px; }
  .chip { height: 42px; padding: 0 12px; font-size: 14px; }
  .chip-k { font-size: 12px; }
  .composer-right { margin-left: 0; width: 100%; justify-content: space-between; gap: 10px; }
  .go { height: 46px; padding: 0 30px; font-size: 15px; }
  .cost { font-size: 13px; }

  .status { text-align: left; font-size: 13px; margin: 10px 2px 0; }

  /* --- 作品页:两列更像 App --- */
  .works-head { margin-bottom: 12px; }
  .works-head h2 { font-size: 16px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .thumb { height: 130px; }
  .card-meta { padding: 8px 10px; font-size: 12px; }

  /* --- 底部标签栏 --- */
  .tabbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 30;
    display: flex;
    background: var(--bg);
    border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    border: 0;
    background: transparent;
    color: var(--ink-3);
    font-size: 11.5px;
    padding: 6px 0;
    border-radius: 12px;
  }
  .tab-item.on { color: var(--accent); font-weight: 600; }
  .tab-ico { width: 18px; height: 18px; border-radius: 6px; background: currentColor; opacity: .5; }
  .tab-item.on .tab-ico { opacity: 1; }

  /* 内容给底部栏让位,页脚在手机上收起来 */
  .shell { padding-bottom: 74px; }
  .foot { display: none; }
}

/* 触屏没有 hover:去掉那些位移/缩放,只留按下反馈 */
@media (hover: none) {
  .chip:hover { transform: none; box-shadow: none; }
  .card:hover { transform: none; }
  .card:hover .thumb { transform: none; }
  .go:hover { transform: none; }
  .icon-btn:hover { transform: none; }
  .outline-btn:hover { transform: none; }
  .mode:hover { color: var(--ink-2); }
  .chip:active, .tab-item:active, .rail-item:active { background: var(--panel); }
  .go:active { transform: scale(.98); }
}




/* 试色开关(仅本地用,上线删掉这一块) */
.palette-switch { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.ps-label { font-size: 12px; color: var(--ink-3); }
.ps {
  width: 24px; height: 24px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1;
  transition: border-color .2s ease, background .2s ease, color .2s ease;
}
.ps:hover { border-color: var(--accent); }
.ps.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
@media (max-width: 720px) { .palette-switch { display: none; } }

[data-palette="4"] {
  /* 深夜蓝（墨蓝 + 亮蓝） 浅色 */
  --accent: #3d4f8c;
  --accent-2: #5468a8;
  --accent-soft: #e9ebf6;
  --accent-ink: #ffffff;
  --gold: #b99a5e;
  --bg: #f7f7fb;
  --panel: #eeeff7;
  --panel-2: #e5e7f2;
  --hover: #dcdff0;
  --ink: #1a1b26;
  --ink-2: #5a5f75;
  --ink-3: #8f95ab;
  --dark-ink: #1a1b26;
  --line: #e3e5f0;
}
[data-theme="dark"][data-palette="4"] {
  /* 深夜蓝（墨蓝 + 亮蓝） 深色 */
  --accent: #7aa2f7;
  --accent-2: #94b6ff;
  --accent-soft: #1e2438;
  --accent-ink: #12141c;
  --gold: #d4b06a;
  --bg: #16161e;
  --panel: #1e1f2a;
  --panel-2: #24263a;
  --hover: #2b2e44;
  --ink: #c8cbe0;
  --ink-2: #8a90ad;
  --ink-3: #666b85;
  --dark-ink: #c8cbe0;
  --line: #282a3a;
}

[data-palette="5"] {
  /* 北境灰（冷灰 + 冰川蓝） 浅色 */
  --accent: #5e81ac;
  --accent-2: #7597c0;
  --accent-soft: #e9eef4;
  --accent-ink: #ffffff;
  --gold: #bfa46a;
  --bg: #f8f9fb;
  --panel: #eceff4;
  --panel-2: #e2e7ef;
  --hover: #d8dee9;
  --ink: #2e3440;
  --ink-2: #5b6472;
  --ink-3: #8d96a3;
  --dark-ink: #2e3440;
  --line: #e0e5ec;
}
[data-theme="dark"][data-palette="5"] {
  /* 北境灰（冷灰 + 冰川蓝） 深色 */
  --accent: #88c0d0;
  --accent-2: #9fd0dd;
  --accent-soft: #26303a;
  --accent-ink: #1b1f26;
  --gold: #d7c08a;
  --bg: #222731;
  --panel: #2e3440;
  --panel-2: #353c4a;
  --hover: #3e4655;
  --ink: #e5e9f0;
  --ink-2: #a4adbb;
  --ink-3: #78818f;
  --dark-ink: #e5e9f0;
  --line: #3b4252;
}

[data-palette="6"] {
  /* 玫瑰灰（灰粉 + 暖玫瑰） 浅色 */
  --accent: #9d5b6b;
  --accent-2: #b77283;
  --accent-soft: #f6ecee;
  --accent-ink: #ffffff;
  --gold: #bb9c6a;
  --bg: #fffaf8;
  --panel: #f7eff0;
  --panel-2: #f0e3e6;
  --hover: #ead6da;
  --ink: #2a2225;
  --ink-2: #6b5c60;
  --ink-3: #a08e93;
  --dark-ink: #2a2225;
  --line: #eee0e3;
}
[data-theme="dark"][data-palette="6"] {
  /* 玫瑰灰（灰粉 + 暖玫瑰） 深色 */
  --accent: #d9a1ad;
  --accent-2: #e6b7c1;
  --accent-soft: #33232c;
  --accent-ink: #1c1517;
  --gold: #d6b884;
  --bg: #191724;
  --panel: #211e2b;
  --panel-2: #2a2634;
  --hover: #332e3f;
  --ink: #e4dde4;
  --ink-2: #a89da8;
  --ink-3: #7c7280;
  --dark-ink: #e4dde4;
  --line: #2e2937;
}

[data-palette="7"] {
  /* 青瓷（青瓷灰绿 + 米白） 浅色 */
  --accent: #6b8e8a;
  --accent-2: #82a6a1;
  --accent-soft: #eaf0ee;
  --accent-ink: #ffffff;
  --gold: #c0a978;
  --bg: #f8faf8;
  --panel: #eaeef0;
  --panel-2: #e0e7e6;
  --hover: #d5dfdd;
  --ink: #1f2624;
  --ink-2: #566361;
  --ink-3: #8b9795;
  --dark-ink: #1f2624;
  --line: #dfe7e6;
}
[data-theme="dark"][data-palette="7"] {
  /* 青瓷（青瓷灰绿 + 米白） 深色 */
  --accent: #8fbcb4;
  --accent-2: #a4cdc5;
  --accent-soft: #23302e;
  --accent-ink: #141917;
  --gold: #d6c08a;
  --bg: #121614;
  --panel: #1a201e;
  --panel-2: #212826;
  --hover: #2a3230;
  --ink: #e2eae7;
  --ink-2: #a2aeab;
  --ink-3: #76817f;
  --dark-ink: #e2eae7;
  --line: #262e2c;
}

[data-palette="8"] {
  /* 玄墨金（近黑 + 古铜金） 浅色 */
  --accent: #a4812f;
  --accent-2: #bd9a45;
  --accent-soft: #f4efe3;
  --accent-ink: #ffffff;
  --gold: #b08830;
  --bg: #faf9f6;
  --panel: #f2f0ea;
  --panel-2: #eae7de;
  --hover: #e2ded2;
  --ink: #131313;
  --ink-2: #5c5a55;
  --ink-3: #96938c;
  --dark-ink: #131313;
  --line: #e6e3da;
}
[data-theme="dark"][data-palette="8"] {
  /* 玄墨金（近黑 + 古铜金） 深色 */
  --accent: #d4b463;
  --accent-2: #e0c47d;
  --accent-soft: #2c2617;
  --accent-ink: #17140d;
  --gold: #d4b463;
  --bg: #0e0e0e;
  --panel: #171614;
  --panel-2: #1f1d19;
  --hover: #282520;
  --ink: #f0eee9;
  --ink-2: #a7a39b;
  --ink-3: #7b776f;
  --dark-ink: #f0eee9;
  --line: #242220;
}

[data-palette="9"] {
  /* 极光墨（青绿→靛蓝 · 极光柔光） 浅色 */
  --accent: #1f6f7a;
  --accent-2: #3f5fa8;
  --accent-soft: #e8f0f3;
  --accent-ink: #ffffff;
  --gold: #c0a86a;
  --bg: #f7f9fb;
  --panel: #eef2f6;
  --panel-2: #e4eaf2;
  --hover: #d8e1ec;
  --ink: #16202a;
  --ink-2: #566274;
  --ink-3: #8b95a5;
  --dark-ink: #16202a;
  --line: #e1e8f0;
  --wash: radial-gradient(900px 520px at 12% -6%, rgb(31 111 122 / .13), transparent 62%),
          radial-gradient(760px 460px at 88% 4%, rgb(63 95 168 / .13), transparent 60%);
}
[data-theme="dark"][data-palette="9"] {
  /* 极光墨（青绿→靛蓝 · 极光柔光） 深色 */
  --accent: #6fd3c7;
  --accent-2: #7f9dff;
  --accent-soft: #17302f;
  --accent-ink: #0a1417;
  --gold: #d6bd84;
  --bg: #0b0f12;
  --panel: #12181d;
  --panel-2: #182027;
  --hover: #202a33;
  --ink: #e7edf2;
  --ink-2: #9daab6;
  --ink-3: #6f7c88;
  --dark-ink: #e7edf2;
  --line: #1d262e;
  --btn-ink: #07100f;
  --wash: radial-gradient(1000px 560px at 10% -8%, rgb(111 211 199 / .16), transparent 62%),
          radial-gradient(820px 500px at 92% 2%, rgb(127 157 255 / .16), transparent 60%);
}

[data-palette="10"] {
  /* 霞光（琥珀→玫红 · 晨曦柔光） 浅色 */
  --accent: #c2622e;
  --accent-2: #b4446b;
  --accent-soft: #fbeee6;
  --accent-ink: #ffffff;
  --gold: #c79a4e;
  --bg: #fffaf5;
  --panel: #f9f0e8;
  --panel-2: #f3e6da;
  --hover: #eddcce;
  --ink: #2a1f18;
  --ink-2: #6b5a4d;
  --ink-3: #a08e80;
  --dark-ink: #2a1f18;
  --line: #f0e2d6;
  --wash: radial-gradient(880px 500px at 8% -4%, rgb(194 98 46 / .12), transparent 60%),
          radial-gradient(780px 460px at 92% 6%, rgb(180 68 107 / .12), transparent 58%);
}
[data-theme="dark"][data-palette="10"] {
  /* 霞光（琥珀→玫红 · 晨曦柔光） 深色 */
  --accent: #f0a06a;
  --accent-2: #e77fa8;
  --accent-soft: #33231c;
  --accent-ink: #1a120c;
  --gold: #e0b877;
  --bg: #120e0c;
  --panel: #1b1613;
  --panel-2: #231d18;
  --hover: #2c241e;
  --ink: #f1eae2;
  --ink-2: #b5a79a;
  --ink-3: #857668;
  --dark-ink: #f1eae2;
  --line: #2a221c;
  --btn-ink: #180f09;
  --wash: radial-gradient(980px 540px at 6% -6%, rgb(240 160 106 / .15), transparent 60%),
          radial-gradient(860px 500px at 94% 4%, rgb(231 127 168 / .15), transparent 58%);
}

[data-palette="11"] {
  /* 深海（深海蓝→青碧） 浅色 */
  --accent: #1f5b8f;
  --accent-2: #2aa0b8;
  --accent-soft: #e8f1f7;
  --accent-ink: #ffffff;
  --gold: #bda768;
  --bg: #f6f9fc;
  --panel: #ecf2f7;
  --panel-2: #e1eaf2;
  --hover: #d4e0ea;
  --ink: #14202b;
  --ink-2: #516273;
  --ink-3: #8797a6;
  --dark-ink: #14202b;
  --line: #dfe8f0;
  --wash: radial-gradient(920px 520px at 14% -8%, rgb(31 91 143 / .13), transparent 62%),
          radial-gradient(740px 440px at 86% 0%, rgb(42 160 184 / .13), transparent 58%);
}
[data-theme="dark"][data-palette="11"] {
  /* 深海（深海蓝→青碧） 深色 */
  --accent: #4f9fd8;
  --accent-2: #5fd3d8;
  --accent-soft: #142a35;
  --accent-ink: #071418;
  --gold: #d2bd85;
  --bg: #090f14;
  --panel: #111820;
  --panel-2: #172029;
  --hover: #1f2a34;
  --ink: #e5eef5;
  --ink-2: #9aadbd;
  --ink-3: #6c7f8f;
  --dark-ink: #e5eef5;
  --line: #1c2732;
  --btn-ink: #05100f;
  --wash: radial-gradient(1000px 560px at 12% -10%, rgb(79 159 216 / .17), transparent 62%),
          radial-gradient(800px 480px at 90% 0%, rgb(95 211 216 / .15), transparent 58%);
}

[data-palette="12"] {
  /* 暮山紫（暮紫→远蓝 · 克制版） 浅色 */
  --accent: #5b4a9e;
  --accent-2: #3f6fb0;
  --accent-soft: #eeecf8;
  --accent-ink: #ffffff;
  --gold: #b79a63;
  --bg: #faf9ff;
  --panel: #f1f0fa;
  --panel-2: #e8e7f5;
  --hover: #dcdbef;
  --ink: #1e1c2a;
  --ink-2: #5d5a72;
  --ink-3: #908da6;
  --dark-ink: #1e1c2a;
  --line: #e6e5f2;
  --wash: radial-gradient(900px 520px at 10% -6%, rgb(91 74 158 / .12), transparent 60%),
          radial-gradient(760px 460px at 90% 4%, rgb(63 111 176 / .12), transparent 58%);
}
[data-theme="dark"][data-palette="12"] {
  /* 暮山紫（暮紫→远蓝 · 克制版） 深色 */
  --accent: #9d8bf0;
  --accent-2: #7fb4ff;
  --accent-soft: #241f3a;
  --accent-ink: #120f1c;
  --gold: #cdb481;
  --bg: #0d0c14;
  --panel: #14131d;
  --panel-2: #1b1a26;
  --hover: #24222f;
  --ink: #e9e7f2;
  --ink-2: #a4a0b8;
  --ink-3: #77748c;
  --dark-ink: #e9e7f2;
  --line: #211f2c;
  --btn-ink: #0d0a16;
  --wash: radial-gradient(1000px 560px at 8% -8%, rgb(157 139 240 / .17), transparent 60%),
          radial-gradient(820px 480px at 92% 2%, rgb(127 180 255 / .15), transparent 58%);
}

[data-palette="13"] {
  /* 银杏（银杏金→橄榄绿） 浅色 */
  --accent: #a8802a;
  --accent-2: #6f8f3f;
  --accent-soft: #f7f2e2;
  --accent-ink: #ffffff;
  --gold: #c2a24f;
  --bg: #fdfbf3;
  --panel: #f6f2e6;
  --panel-2: #eee8d7;
  --hover: #e5ddc7;
  --ink: #262316;
  --ink-2: #615b47;
  --ink-3: #97907a;
  --dark-ink: #262316;
  --line: #eae3d1;
  --wash: radial-gradient(880px 500px at 12% -6%, rgb(168 128 42 / .12), transparent 60%),
          radial-gradient(760px 460px at 88% 4%, rgb(111 143 63 / .12), transparent 58%);
}
[data-theme="dark"][data-palette="13"] {
  /* 银杏（银杏金→橄榄绿） 深色 */
  --accent: #e0b45f;
  --accent-2: #a8c46a;
  --accent-soft: #2c2718;
  --accent-ink: #16130a;
  --gold: #dcc077;
  --bg: #101009;
  --panel: #191811;
  --panel-2: #211f16;
  --hover: #2a271c;
  --ink: #efeadb;
  --ink-2: #ada592;
  --ink-3: #7e7767;
  --dark-ink: #efeadb;
  --line: #282519;
  --btn-ink: #131007;
  --wash: radial-gradient(960px 540px at 10% -8%, rgb(224 180 95 / .15), transparent 60%),
          radial-gradient(820px 480px at 90% 2%, rgb(168 196 106 / .14), transparent 58%);
}

/* 试色开关:素色 1-8 与渐变 9-13 之间加个小竖线 */
.ps-sep { width: 1px; height: 16px; background: var(--line); margin: 0 4px; display: inline-block; }
/* 参考图方块:虚线框 + 居中加号(和采集到的参考站一个做法) */
.composer-top { display: flex; gap: 14px; align-items: flex-start; }
.ref-tile {
  flex: 0 0 auto;
  width: 86px; height: 104px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink-2);
  font: inherit;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  transition: border-color .2s ease, background .2s ease, transform .3s ease-in-out;
}
.ref-tile:hover { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.02); }
.ref-plus { font-size: 20px; color: var(--ink-3); line-height: 1; }
.ref-cap { font-size: 12px; }
.ref-num { font-size: 11px; color: var(--ink-3); }
@media (max-width: 720px) {
  .ref-tile { width: 72px; height: 84px; }
}/* ===== 首页改版新增样式:参考图胶囊 / 下拉菜单 / 轻提示 / 视频锁 ===== */
/* 追加到 style.css 末尾,全部走主题变量 */

/* 参考图行:在输入框上方,一个"+"号,上传后变成胶囊 */
.ref-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.ref-count { font-size: 11px; color: var(--ink-3); margin-left: 2px; }
.ref-add {
  width: 30px; height: 30px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink-2);
  display: inline-grid; place-items: center;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .3s ease-in-out;
}
.ref-add:hover { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.08); }
.ref-add:active { transform: scale(.94); }
.ref-plus { font-size: 17px; line-height: 1; }

/* 上传后的参考图:胶囊(小图 + 文字 + 删除) */
.ref-chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 3px 9px 3px 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  animation: popIn .28s cubic-bezier(.25,.1,.25,1) both;
}
.ref-chip img { width: 24px; height: 24px; border-radius: 999px; object-fit: cover; display: block; }
.ref-name { font-size: 12px; color: var(--ink-2); }
.ref-x {
  border: 0; background: transparent; color: var(--ink-3);
  font-size: 14px; line-height: 1; cursor: pointer; padding: 0 2px;
  transition: color .2s ease;
}
.ref-x:hover { color: var(--bad); }

/* 下拉三角 */
.caret {
  width: 0; height: 0; margin-left: 2px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--ink-3);
  transition: transform .2s ease;
}
.chip:hover .caret { border-top-color: var(--accent); }

/* 下拉菜单 */
.menu {
  position: absolute;
  left: 20px; top: calc(100% + 8px);      /* 实际位置由 JS 贴着触发胶囊计算 */
  min-width: 190px; max-width: 320px;
  max-height: 340px; overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  box-shadow: 0 18px 50px -20px rgb(21 23 31 / .34);
  padding: 6px;
  z-index: 40;
}
[data-theme="dark"] .menu { box-shadow: 0 18px 50px -18px rgb(0 0 0 / .7); }
.menu.replay { animation: popIn .2s cubic-bezier(.25,.1,.25,1) both; }
.menu-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 10px;
  border: 0; border-radius: 9px;
  background: transparent; color: var(--ink);
  font: inherit; text-align: left; cursor: pointer;
  transition: background .16s ease, color .16s ease;
}
.menu-item:hover { background: var(--panel); }
.menu-item.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.mi-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mi-note { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.mi-tick { width: 12px; flex: 0 0 12px; position: relative; }
.menu-item.on .mi-tick::after {
  content: ""; position: absolute; left: 0; top: -2px;
  width: 6px; height: 10px;
  border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(42deg);
}
.menu-empty { padding: 14px 10px; color: var(--ink-3); font-size: 12px; text-align: center; }

/* 输入区要能被菜单绝对定位 */
.composer { position: relative; }

/* 轻提示 */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  z-index: 60;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  color: var(--ink);
  font-size: 13px;
  box-shadow: 0 14px 40px -18px rgb(21 23 31 / .4);
  backdrop-filter: blur(8px);
}
@supports not (backdrop-filter: blur(8px)) { .toast { background: var(--bg); } }
.toast.replay { animation: toastIn .26s cubic-bezier(.25,.1,.25,1) both; }
@keyframes toastIn {
  0% { opacity: 0; transform: translateX(-50%) translateY(10px) scale(.96); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* 视频锁 */
.mode.locked { color: var(--ink-3); cursor: not-allowed; }
.mode.locked:hover { color: var(--ink-2); }
.mode.locked .lock {
  width: 13px; height: 13px; margin-right: 5px;
  fill: currentColor; opacity: .75;
  vertical-align: -2px;
}
.mode.shake { animation: shakeX .5s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

@media (max-width: 720px) {
  /* 手机:菜单跟着胶囊走,宽度跟着屏幕,高度不超过半屏,条目高一点好点 */
  .menu {
    min-width: 0;
    max-width: calc(100vw - 40px);
    max-height: 46vh;
    border-radius: 14px;
    padding: 5px;
  }
  .menu-item { padding: 12px 11px; font-size: 15px; border-radius: 10px; }
  .mi-note { font-size: 12px; }
  .menu-empty { padding: 18px 10px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .ref-chip, .menu.replay, .toast.replay, .mode.shake { animation: none !important; }
}


/* ===== 我的作品:上锁态 / 顶部提醒 / 下载按钮 ===== */
.works-locked { display: grid; place-items: center; padding: 40px 0 10px; }
.locked-card {
  width: 100%; max-width: 420px;
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--panel);
  padding: 28px 24px; text-align: center;
  animation: popIn .32s cubic-bezier(.25,.1,.25,1) both;
}
.locked-lock {
  display: inline-block; width: 30px; height: 30px; margin-bottom: 12px;
  border-radius: 10px; background: var(--accent-soft);
  position: relative;
}
.locked-lock::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 10px; height: 9px; margin: -2px 0 0 -5px;
  border-radius: 3px; background: var(--accent);
}
.locked-card h2 { margin: 0 0 8px; font-size: 17px; }
.locked-card p { margin: 0 0 18px; color: var(--ink-2); font-size: 13px; line-height: 1.7; }
.locked-card .go { display: inline-flex; align-items: center; height: 40px; padding: 0 26px; text-decoration: none; border-radius: 10px; }

.keep-warning {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--accent-soft);
  padding: 12px 14px; margin-bottom: 22px;
  color: var(--ink); font-size: 13px; line-height: 1.7;
  animation: popIn .3s cubic-bezier(.25,.1,.25,1) both;
}
.keep-warning b { flex: 0 0 auto; color: var(--accent); }
.keep-warning u { text-decoration-thickness: 1px; text-underline-offset: 3px; }

.card .dl {
  position: absolute; right: 10px; top: 10px;
  height: 26px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg); color: var(--ink);
  font: inherit; font-size: 12px; cursor: pointer;
  opacity: 0; transform: translateY(-4px);
  transition: opacity .2s ease, transform .3s ease-in-out;
}
.card:hover .dl { opacity: 1; transform: none; }
.dl:hover { border-color: var(--accent); color: var(--accent); }

.works-foot { margin: 22px 2px 0; color: var(--ink-3); font-size: 12px; }

@media (max-width: 720px) {
  .card .dl { opacity: 1; transform: none; }
  .keep-warning { font-size: 12.5px; }
}

/* ===== 登录/注册浮层:背景虚化 + 卡片居中 ===== */
.auth-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: color-mix(in srgb, var(--bg) 55%, rgb(0 0 0 / 45%));
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: maskIn .2s ease both;
}
@supports not (backdrop-filter: blur(7px)) { .auth-mask { background: rgb(0 0 0 / 45%); } }
@keyframes maskIn { from { opacity: 0 } to { opacity: 1 } }

.auth-card {
  position: relative;
  width: 100%;
  max-width: 384px;
  border-radius: 16px;
  background: var(--bg);
  color: var(--ink);
  padding: 34px 30px 26px;
  text-align: center;
  box-shadow: 0 30px 80px -30px rgb(0 0 0 / .5);
}
.auth-card.replay { animation: popIn .34s cubic-bezier(.25,.1,.25,1) both; }

.auth-x {
  position: absolute; right: 10px; top: 10px;
  width: 30px; height: 30px;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-3);
  font-size: 17px; line-height: 1; cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .3s ease-in-out;
}
.auth-x:hover { background: var(--panel); color: var(--ink); transform: rotate(90deg); }

.auth-title { margin: 0 0 6px; font-size: 23px; font-weight: 800; letter-spacing: -.01em; }
.auth-sub { margin: 0 0 22px; color: var(--ink-2); font-size: 13px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.field { text-align: left; display: block; }
.field-cap { display: block; font-size: 12px; color: var(--ink-3); margin: 0 0 6px 2px; }
.field input {
  width: 100%; height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); color: var(--ink);
  font: inherit; font-size: 14px; outline: none;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.field input::placeholder { color: var(--ink-3); }
.field input:focus { border-color: var(--accent); background: var(--bg); box-shadow: 0 0 0 3px var(--accent-soft); }

.auth-go {
  margin-top: 4px; height: 46px;
  border: 0; border-radius: 10px;
  background: var(--btn-bg); color: var(--btn-ink);
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: transform .3s ease-in-out, box-shadow .3s ease-in-out;
}
.auth-go:hover { transform: translateY(-1px) scale(1.01); box-shadow: 0 12px 28px -14px var(--accent); }
.auth-go:active { transform: scale(.985); }

.auth-foot { margin: 18px 0 0; color: var(--ink-2); font-size: 13px; }
.auth-foot a { color: var(--accent); font-weight: 600; text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* 登录浮层与账号面板【共用】的错误提示；没有内容时不占位置 */
.auth-err { margin: 10px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--bad); }
.auth-err:empty { display: none; }

@media (max-width: 480px) {
  .auth-card { padding: 28px 20px 22px; border-radius: 14px; }
  .auth-title { font-size: 21px; }
}

/* 【项目铁律】带 display 的元素必须单独压掉 hidden,否则藏不住(踩过三次):
   .auth-mask 是 grid、.field 是 block —— 这里统一兜住 */
.auth-mask[hidden], .field[hidden], .menu[hidden], .view[hidden], .chip[hidden], .toast[hidden], .works-locked[hidden], .works-body[hidden] {
  display: none !important;
}

/* ===== AIGX 字标:渐变字 + 收紧字距 + 一点光晕,不依赖任何外部字体 ===== */
.brand-name {
  font-family: "Segoe UI Variable Display", "SF Pro Display", "Segoe UI", "PingFang SC",
               "Microsoft YaHei", system-ui, sans-serif;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: .01em;
  line-height: 1;
  background: linear-gradient(96deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 22px rgb(0 0 0 / 0);
}
/* 小方块里的字标改用同色系描边,和上面的渐变呼应 */
.brand-mark { box-shadow: inset 0 0 0 1px rgb(255 255 255 / .18); }
[data-theme="dark"] .brand-name {
  background: linear-gradient(96deg, var(--accent-2) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* 顶栏标:垫一块浅色圆角底,和页面背景隔开,不再"糊"在一起 */
.brand { gap: 10px; }
.brand-mark { width: 26px; height: 26px; flex: 0 0 auto; display: block; }

/* 图标直接站着,不要底座 */
.brand-mark { width: 26px; height: 26px; display: block; flex: 0 0 auto; }

/* 顶栏图标 = 透明 logo,不要任何底座(覆盖早期那版渐变方块规则) */
.brand-mark, img.brand-mark {
  background: none !important;
  background-image: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border: 0 !important;
  width: 26px; height: 26px;
  display: block;
  flex: 0 0 auto;
}

/* 下拉菜单隐藏滚动条(保留滚轮滚动):长列表(比如 14 个画幅)不再拖一条灰条 */
.menu { scrollbar-width: none; -ms-overflow-style: none; }
.menu::-webkit-scrollbar { width: 0; height: 0; display: none; }
/* 列表上下留一点内边距,滚到头不会被圆角切掉 */
.menu { padding: 6px; }
.menu-item:first-child { margin-top: 0; }
.menu .menu-item:last-child { margin-bottom: 0; }

/* 提示条必须压在浮层上面,不然被虚化挡住看不清 */
.toast { z-index: 200 !important; }

/* 作品缩略图:按原始比例完整显示,不裁切、不拉伸 */
.thumb { display: flex; align-items: center; justify-content: center; overflow: hidden; }
.thumb img, .thumb video {
  width: 100%; height: 100%;
  object-fit: contain;          /* 自适应比例:整张图都在框里 */
  display: block;
}
.grid-empty { grid-column: 1 / -1; color: var(--ink-3); font-size: 13px; padding: 14px 2px; }

/* 账号管理面板 */
.acct-card { max-width: 400px; text-align: left; }
.acct-card .auth-title, .acct-card .auth-sub { text-align: center; }
.acct-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 2px; font-size: 13.5px; }
.acct-k { color: var(--ink-3); }
.acct-v { color: var(--ink); font-weight: 600; }
.acct-sep { height: 1px; background: var(--line); margin: 14px 0 16px; }
.acct-cap { font-size: 12px; color: var(--ink-3); margin: 0 0 10px; }
.acct-card .field { margin-bottom: 10px; }
#user-chip { cursor: pointer; }
