/* ============================================================
   顺影 AIGC · 工作台样式
   基调：浅灰底 + 白卡片 + 细边框，橙色只用于选中与主操作
   ============================================================ */

:root {
  --bg: #F6F7F8;
  --surface: #FFFFFF;
  --surface-2: #FAFAFB;
  --line: #E9EAEC;
  --line-2: #DDE0E3;
  --ink: #1B1C1E;
  --ink-2: #5F6368;
  --ink-3: #9AA0A6;
  --brand: #E8642F;
  --brand-dark: #D4531F;
  --brand-soft: #FFF2EB;
  --brand-soft-2: #FBDCCB;
  --ok: #2E9E6B;
  --ok-soft: #EAF7F0;
  --ok-line: #CDEBDA;
  --err: #D64545;
  --err-soft: #FDEDED;
  --err-line: #F6D6D6;
  --alt: #4C6FFF;
  --alt-soft: #EEF2FF;
  --thumb-a: #F3F4F6;
  --thumb-b: #E8EAED;
  --track: #EDEEF0;
  --elev: rgba(255, 255, 255, .96);
  --elev-2: rgba(255, 255, 255, .92);
  --stage: #14161A;

  --r-xl: 18px;
  --r-lg: 14px;
  --r-md: 11px;
  --r-sm: 8px;

  --rail: 84px;
  --shadow-sm: 0 1px 2px rgba(18, 20, 23, .05);
  --shadow-md: 0 2px 6px rgba(18, 20, 23, .05), 0 18px 40px -28px rgba(18, 20, 23, .28);
  --shadow-pop: 0 10px 24px -8px rgba(18, 20, 23, .14), 0 32px 64px -40px rgba(18, 20, 23, .3);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  color-scheme: light;
}

/* 夜间模式：同一套变量换值，组件不用改 */
[data-theme="dark"] {
  --bg: #0E0F12;
  --surface: #17181C;
  --surface-2: #1D1F24;
  --line: #272A31;
  --line-2: #353A43;
  --ink: #EAECEF;
  --ink-2: #A9AFB9;
  --ink-3: #737A85;
  --brand: #F4713C;
  --brand-dark: #FF8A57;
  --brand-soft: #2C1D16;
  --brand-soft-2: #4B2A1A;
  --ok: #4FBE8D;
  --ok-soft: #12251C;
  --ok-line: #234A38;
  --err: #E8777A;
  --err-soft: #2A1618;
  --err-line: #4C2326;
  --alt: #8FA4FF;
  --alt-soft: #1A2032;
  --thumb-a: #202329;
  --thumb-b: #191B20;
  --track: #2A2D34;
  --elev: rgba(23, 24, 28, .96);
  --elev-2: rgba(24, 26, 30, .92);
  --stage: #0A0B0D;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, .4), 0 18px 40px -28px rgba(0, 0, 0, .8);
  --shadow-pop: 0 10px 24px -8px rgba(0, 0, 0, .6), 0 32px 64px -40px rgba(0, 0, 0, .9);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
svg { display: block; }
::selection { background: var(--brand-soft-2); }

.app { display: flex; min-height: 100vh; }

/* ── 左侧窄栏 ─────────────────────────────────────────── */

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.rail-logo {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 13px;
  background: transparent;
  margin-bottom: 12px;
  transition: background .18s, transform .18s;
}
.rail-logo:hover { background: var(--surface-2); transform: translateY(-1px); }
.rail-logo img {
  height: 32px; width: auto;
  object-fit: contain;
  display: block;
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  align-items: center;
  overflow-y: auto;
  scrollbar-width: none;
}
.rail-nav::-webkit-scrollbar { display: none; }

.rail-item {
  position: relative;
  width: 68px;
  padding: 10px 0 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border-radius: 11px;
  color: var(--ink-3);
  transition: color .18s, background .18s;
}
.rail-item .ri-ico svg { width: 23px; height: 23px; }
.rail-item .ri-label { font-size: 12px; line-height: 1; letter-spacing: .01em; }
.rail-item:hover { color: var(--ink-2); background: var(--surface-2); }
.rail-item.is-on { color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.rail-item.is-on::after {
  content: '';
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  border-radius: 3px 0 0 3px;
  background: var(--brand);
}

.rail-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  width: 60px;
}

.rail-mini {
  position: relative;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  color: var(--ink-3);
  transition: color .18s, background .18s;
}
.rail-mini svg { width: 21px; height: 21px; }
.rail-mini:hover { color: var(--ink); background: var(--surface-2); }
.rail-mini.is-on { color: var(--brand); background: var(--brand-soft); }

/* 主题切换：亮色显示太阳，暗色显示月亮 */
.rail-mini .i-moon { display: none; }
[data-theme="dark"] .rail-mini .i-sun { display: none; }
[data-theme="dark"] .rail-mini .i-moon { display: block; }

/* 外观切换浮层 */
.themepop {
  position: fixed;
  z-index: 62;
  min-width: 158px;
  padding: 6px;
  transform: translateY(-50%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-pop);
}
.themepop-title {
  margin: 3px 0 5px;
  padding: 0 9px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.themepop button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 9px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink-2);
  text-align: left;
  transition: background .15s, color .15s;
}
.themepop button > svg:first-child { width: 17px; height: 17px; flex: none; }
.themepop button:hover { background: var(--surface-2); color: var(--ink); }
.themepop button.is-on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.themepop .tp-check {
  width: 14px; height: 14px;
  margin-left: auto;
  flex: none;
  opacity: 0;
  transition: opacity .15s;
}
.themepop button.is-on .tp-check { opacity: 1; }

/* 未读公告的小红点 */
.rail-mini .dot {
  position: absolute;
  top: 7px; right: 8px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--err);
  box-shadow: 0 0 0 2px var(--surface);
}

.rail-mini.is-user {
  width: 32px; height: 32px;
  margin-top: 2px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border-radius: 50%;
}
.rail-mini.is-user .avatar { display: grid; place-items: center; width: 100%; height: 100%; }

.user-menu {
  position: fixed;
  left: calc(var(--rail) + 8px);
  bottom: 16px;
  width: 200px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-pop);
  z-index: 45;
}
.user-menu b { display: block; font-size: 13px; }
.user-menu em {
  display: block;
  font-style: normal;
  font-size: 11.5px;
  color: var(--ink-3);
  margin: 2px 0 10px;
  word-break: break-all;
}
.user-menu button {
  width: 100%;
  height: 30px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-2);
}
.user-menu button:hover { border-color: var(--err); color: var(--err); }

/* ── 主区域 ───────────────────────────────────────────── */

.main { flex: 1; margin-left: var(--rail); min-width: 0; }

.page {
  max-width: 1160px;
  margin: 0 auto;
  padding: 30px 32px 100px;
}

.phead { margin-bottom: 22px; }
.phead h1 {
  margin: 0 0 6px;
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -.01em;
}
.phead p { margin: 0; font-size: 13px; color: var(--ink-3); }
.phead h1 span { color: var(--brand); }

.phead-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.phead-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-2);
}
.pill::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink-3);
}
.pill.is-live { color: var(--ok); border-color: var(--ok-line); background: var(--ok-soft); }
.pill.is-live::before { background: var(--ok); }

/* ── 首页入口卡 ───────────────────────────────────────── */

.entries {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.entry {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.entry:hover {
  border-color: var(--brand-soft-2);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.entry-ico {
  flex: none;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
}
.entry-ico.is-alt { background: var(--alt-soft); color: var(--alt); }
.entry-ico svg { width: 21px; height: 21px; }
.entry-body { flex: 1; min-width: 0; }
.entry-body b { display: block; font-size: 15px; font-weight: 650; margin-bottom: 4px; }
.entry-body em {
  display: block;
  font-style: normal;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink-3);
}
.entry-go {
  flex: none;
  align-self: center;
  font-size: 12px;
  color: var(--ink-3);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  transition: color .2s, border-color .2s;
}
.entry:hover .entry-go { color: var(--brand); border-color: var(--brand-soft-2); background: var(--brand-soft); }

/* ── 区块 ─────────────────────────────────────────────── */

.block { margin-top: 36px; }

.bhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.bhead h2 { margin: 0; font-size: 15px; font-weight: 650; }
.more {
  font-size: 12.5px;
  color: var(--ink-3);
  padding: 4px 8px;
  border-radius: var(--r-sm);
}
.more:hover { color: var(--brand); background: var(--brand-soft); }

.btools { display: flex; align-items: center; gap: 10px; }

.search {
  position: relative;
  display: flex;
  align-items: center;
  width: 250px;
  height: 34px;
  padding: 0 12px;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color .2s, box-shadow .2s;
}
.search:focus-within { border-color: var(--brand-soft-2); box-shadow: 0 0 0 3px rgba(232, 100, 47, .09); }
.search svg { width: 15px; height: 15px; color: var(--ink-3); flex: none; }
.search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: none;
  font-size: 12.5px;
}
.search input::placeholder { color: var(--ink-3); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  height: 30px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--ink-2);
  transition: all .18s;
}
.chip:hover { border-color: var(--line-2); color: var(--ink); }
.chip.is-on {
  background: var(--brand-soft);
  border-color: var(--brand-soft-2);
  color: var(--brand);
  font-weight: 600;
}

.inline-empty {
  margin: 0;
  padding: 26px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-3);
  border: 1px dashed var(--line-2);
  border-radius: var(--r-lg);
  background: var(--surface);
}

/* ── 作品卡 ───────────────────────────────────────────── */

.recent {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.mine {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 14px;
}
.grid.is-assets { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }

.rcard, .wcard {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  text-align: left;
  transition: border-color .2s, box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
}
.rcard:hover, .wcard:hover {
  border-color: var(--brand-soft-2);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.rthumb, .wthumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--thumb-a), var(--thumb-b));
  overflow: hidden;
}
.rthumb img, .wthumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.play-badge {
  position: absolute;
  right: 8px; bottom: 8px;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--elev-2);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.play-badge svg { width: 12px; height: 12px; margin-left: 1px; }

.wmeta { padding: 10px 12px 12px; }
.wtitle {
  margin: 0 0 3px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wsub {
  margin: 0;
  font-size: 11px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 500;
  background: var(--surface-2);
  color: var(--ink-3);
  border: 1px solid var(--line);
}
.tag.is-run { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-soft-2); }
.tag.is-ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.tag.is-fail { background: var(--err-soft); color: var(--err); border-color: var(--err-line); }

.wcard .del {
  position: absolute;
  top: 8px; right: 8px;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--elev-2);
  color: var(--ink-2);
  opacity: 0;
  transition: opacity .18s, color .18s;
  font-size: 14px;
  line-height: 1;
}
.wcard:hover .del { opacity: 1; }
.wcard .del:hover { color: var(--err); }

/* ── 模型条 ───────────────────────────────────────────── */

.modelbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.mcur {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  min-width: 0;
  max-width: none;
  flex: 1 1 auto;
  transition: all .18s;
}
.mcur:hover { background: var(--brand-soft); border-color: var(--brand-soft-2); }
.mcur-tag {
  flex: none;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--brand-soft);
  color: var(--brand);
}
.mcur:hover .mcur-tag { background: var(--surface); }
.mcur-name { font-size: 14px; font-weight: 650; white-space: nowrap; }
.mcur-spec {
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mcur-caret {
  flex: none;
  margin-left: 2px;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--ink-3);
}
.mcur.is-off .mcur-name::after {
  content: '未绑定';
  margin-left: 6px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--err);
  background: var(--err-soft);
  padding: 1px 5px;
  border-radius: 4px;
  vertical-align: 1px;
}


/* ── 创作台 ───────────────────────────────────────────── */

.studio {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 328px;
  gap: 14px;
  align-items: start;
}

.studio-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.studio-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 14px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 16px 16px;
}

.chead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.chead .ccount {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.chead .opt {
  margin-left: 6px;
  font-style: normal;
  font-size: 10.5px;
  font-weight: 400;
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 4px;
}

/* 参考图拖拽区 */
.drop {
  position: relative;
  height: clamp(216px, 30vh, 292px);
  border-radius: var(--r-md);
  border: 1.5px dashed var(--line-2);
  background: var(--surface-2);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.drop.is-wide { height: 190px; }
.drop:hover, .drop.is-over { border-color: var(--brand-soft-2); background: var(--brand-soft); }

.drop-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: 20px;
  color: var(--ink-3);
}
.drop-empty svg { width: 30px; height: 30px; color: var(--line-2); margin-bottom: 2px; }
.drop:hover .drop-empty svg { color: var(--brand); }
.drop-empty b { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.drop-empty em { font-style: normal; font-size: 11.5px; }

.drop-preview { position: absolute; inset: 0; }
.drop-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ratio-mask {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  border: 1.5px dashed rgba(255, 255, 255, .95);
  box-shadow: 0 0 0 9999px rgba(20, 22, 26, .34);
  border-radius: 4px;
  transition: width .3s cubic-bezier(.4, 0, .2, 1), height .3s cubic-bezier(.4, 0, .2, 1);
  pointer-events: none;
}

.drop-meta {
  position: absolute;
  left: 8px; bottom: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(20, 22, 26, .6);
  color: #fff;
  font-size: 11px;
  backdrop-filter: blur(6px);
}

.drop-remove {
  position: absolute;
  top: 8px; right: 8px;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--elev);
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1;
  box-shadow: var(--shadow-sm);
}
.drop-remove:hover { color: var(--err); }

.ctip { margin: 10px 0 0; font-size: 11.5px; color: var(--ink-3); line-height: 1.6; }

/* 描述框 */
textarea {
  display: block;
  width: 100%;
  min-height: 132px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: 13.5px;
  line-height: 1.7;
  resize: vertical;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
textarea::placeholder { color: var(--ink-3); }
textarea:focus { border-color: var(--brand-soft-2); box-shadow: 0 0 0 3px rgba(232, 100, 47, .08); }

/* 多行提示词 */
.chead-tools { display: flex; align-items: center; gap: 8px; }
.mini-btn {
  height: 24px;
  padding: 0 9px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 11.5px;
  font-weight: 400;
  color: var(--ink-2);
}
.mini-btn:hover { border-color: var(--brand-soft-2); color: var(--brand); background: var(--brand-soft); }

.rowlist { display: flex; flex-direction: column; gap: 10px; }
.rrow {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  transition: border-color .18s;
}
.rrow:focus-within { border-color: var(--brand-soft-2); }

.rr-top { display: flex; align-items: flex-start; gap: 10px; }
.rr-index {
  flex: none;
  width: 20px; height: 20px;
  margin-top: 3px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink-3);
}
.rr-input {
  flex: 1;
  min-width: 0;
  min-height: 76px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 13px;
  line-height: 1.65;
  resize: vertical;
  outline: none;
}
.rr-input:focus { border-color: var(--brand-soft-2); box-shadow: 0 0 0 3px rgba(232, 100, 47, .07); }
.rr-input::placeholder { color: var(--ink-3); }

.rr-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
  padding-left: 30px;
}
.tools { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 33px;
  padding: 0 11px;
  border-radius: var(--r-sm);
  border: 1px dashed var(--line-2);
  background: var(--surface);
  color: var(--ink-3);
  font-size: 12px;
  transition: all .18s;
}
.tool-btn:hover { border-color: var(--brand-soft-2); color: var(--brand); background: var(--brand-soft); }
.tool-btn.is-on { border-style: solid; border-color: var(--brand-soft-2); background: var(--brand-soft); color: var(--brand); }
.tool-btn svg { width: 15px; height: 15px; }

.tool-thumb {
  position: relative;
  width: 33px; height: 33px;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--line);
}
.tool-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tool-thumb button {
  position: absolute;
  top: 0; right: 0;
  width: 15px; height: 15px;
  display: grid; place-items: center;
  background: var(--elev-2);
  color: var(--ink-2);
  font-size: 10px;
  line-height: 1;
}
.tool-thumb button:hover { color: var(--err); }

.racts { display: flex; align-items: center; gap: 2px; flex: none; }
.rr-act {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 6px;
  color: var(--ink-3);
  transition: background .16s, color .16s;
}
.rr-act:hover { background: var(--surface-2); color: var(--ink); }
.rr-act.is-danger:hover { background: var(--err-soft); color: var(--err); }
.rr-act svg { width: 15px; height: 15px; }

.addrow {
  width: 100%;
  height: 40px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--r-md);
  border: 1px dashed var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  transition: all .18s;
}
.addrow:hover { border-color: var(--brand-soft-2); color: var(--brand); background: var(--brand-soft); }
.addrow svg { width: 15px; height: 15px; }

.rowhint { margin: 10px 0 0; font-size: 11.5px; color: var(--ink-3); line-height: 1.7; }

/* 参考图缩略图条（多张） */
.refrow {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.refrow-label {
  flex: none;
  padding-top: 18px;
  font-size: 12px;
  color: var(--ink-3);
}

.thumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.thumb {
  position: relative;
  width: 54px; height: 54px;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .rm {
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  background: rgba(20, 22, 26, .52);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  opacity: 0;
  transition: opacity .16s;
}
.thumb:hover .rm { opacity: 1; }

.thumbs .add {
  width: 54px; height: 54px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  border: 1.5px dashed var(--line-2);
  background: var(--surface);
  color: var(--ink-3);
  transition: all .18s;
}
.thumbs .add:hover { color: var(--brand); border-color: var(--brand-soft-2); background: var(--brand-soft); }
.thumbs .add svg { width: 18px; height: 18px; }

/* 三类参考素材的添加按钮：模型支持哪类才出现哪类 */
.media-btn {
  position: relative;
  width: 54px; height: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: var(--r-sm);
  border: 1.5px dashed var(--line-2);
  background: var(--surface);
  color: var(--ink-3);
  font-size: 10.5px;
  line-height: 1;
  transition: all .18s;
}
.media-btn svg { width: 17px; height: 17px; }
.media-btn:hover { color: var(--brand); border-color: var(--brand-soft-2); background: var(--brand-soft); }
.media-btn.has { border-style: solid; border-color: var(--line); color: var(--ink-2); }
.media-btn.is-full { opacity: .7; }
.media-btn i {
  position: absolute;
  top: -6px; right: -6px;
  min-width: 18px; height: 16px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 9.5px;
  font-style: normal;
  font-weight: 600;
}

/* 缺引用时的可点标签：点一下把 @视频1 插到提示词里 */
.rr-refs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-left: 30px;
}
.rr-refs-tip { font-size: 11.5px; color: var(--ink-3); }
.refchips { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.refchip {
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px dashed var(--brand-soft-2);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  line-height: 1;
  transition: all .16s;
}
.refchip:hover { background: var(--brand); border-style: solid; color: #fff; }

/* 视频素材取首帧，音频给个音符块 */
.thumb.is-video video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.thumb.is-audio { display: grid; place-items: center; background: var(--surface-2); }
.thumb.is-audio .aicon { display: grid; place-items: center; color: var(--ink-3); }
.thumb.is-audio .aicon svg { width: 20px; height: 20px; }
.thumb .mtag {
  position: absolute;
  left: 3px; bottom: 3px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(18, 20, 23, .6);
  color: #fff;
  font-size: 9px;
  font-style: normal;
  line-height: 1.35;
}

/* 行内的工具条要让缩略图能换行 */
.rr-foot { flex-wrap: wrap; }
.tools { flex-wrap: wrap; }

/* 时长与比例的可选项个数不固定（Seedance 7 档、P 系列 6 档），
   交给网格按可用宽度自动排几列，避免挤成一排省略号 */
.durwrap { min-width: 0; }
.durwrap .seg,
#ratioSeg {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
  gap: 3px;
}
.durwrap .seg button,
#ratioSeg button { flex: none; width: 100%; padding: 0 4px; }

.durctl { display: flex; align-items: center; gap: 10px; min-width: 0; }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  min-width: 0;
  height: 4px;
  border-radius: 999px;
  background: var(--track);
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--brand);
  box-shadow: 0 1px 3px rgba(18, 20, 23, .16);
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--brand);
}
.durnum {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: none;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.durnum input {
  width: 32px;
  border: none;
  background: none;
  outline: none;
  text-align: right;
  font-size: 12.5px;
  font-weight: 600;
  -moz-appearance: textfield;
  appearance: textfield;
}
.durnum input::-webkit-outer-spin-button,
.durnum input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.durnum span { font-size: 11.5px; color: var(--ink-3); }

.inspire { margin-top: 12px; }
.itabs { display: flex; gap: 4px; margin-bottom: 9px; }
.itabs button {
  height: 26px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 12px;
  color: var(--ink-3);
  transition: all .18s;
}
.itabs button:hover { color: var(--ink-2); background: var(--surface-2); }
.itabs button.is-on { color: var(--brand); background: var(--brand-soft); font-weight: 600; }

.ichips { display: flex; flex-wrap: wrap; gap: 7px; }
.ichip {
  height: 27px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12px;
  color: var(--ink-2);
  transition: all .18s;
}
.ichip:hover { border-color: var(--brand-soft-2); color: var(--brand); background: var(--brand-soft); }
.ichip.is-on { border-color: var(--brand-soft-2); color: var(--brand); background: var(--brand-soft); }

/* 参数行 */
.prow {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}
.plabel { font-size: 12px; color: var(--ink-3); }

.seg {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.seg button {
  flex: 1;
  min-width: 0;
  height: 27px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 6px;
  transition: all .16s;
}
.seg button:hover { color: var(--ink); }
.seg button.is-on {
  background: var(--surface);
  color: var(--brand);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(18, 20, 23, .09);
}

.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  height: 35px;
  padding: 0 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.stepper button {
  width: 26px; height: 26px;
  border-radius: 5px;
  font-size: 15px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  line-height: 1;
}
.stepper button:hover:not(:disabled) { color: var(--brand); border-color: var(--brand-soft-2); }
.stepper button:disabled { opacity: .4; cursor: not-allowed; }
.stepper span {
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* 提交条 */
.submitbar {
  position: sticky;
  bottom: 12px;
  z-index: 22;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 10px 12px 10px 16px;
  background: var(--elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(8px);
}
.cost { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.cost-text {
  font-size: 12.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.cost-tag {
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-3);
}
.cost-tag.is-live { background: var(--brand-soft); border-color: var(--brand-soft-2); color: var(--brand); }
.cost-tag.is-off { background: var(--err-soft); border-color: var(--err-line); color: var(--err); }

/* ── 按钮 ─────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 18px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .18s, border-color .18s, color .18s, box-shadow .18s;
}
.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 1px 2px rgba(232, 100, 47, .3);
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:disabled {
  background: var(--line-2);
  color: #fff;
  box-shadow: none;
  cursor: not-allowed;
}
.btn-quiet {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink-2);
  font-weight: 500;
}
.btn-quiet:hover { border-color: var(--line-2); color: var(--ink); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn-block { width: 100%; }

#generateBtn, #imageGenerateBtn { min-width: 148px; height: 40px; }

/* ── 队列 ─────────────────────────────────────────────── */

.queue {
  margin-top: 14px;
  padding: 14px 16px 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.qlist { display: flex; flex-direction: column; }

.q-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.q-item:first-child { border-top: none; }

.q-thumb {
  flex: none;
  width: 40px; height: 40px;
  border-radius: 7px;
  overflow: hidden;
  background: var(--surface-2);
}
.q-thumb img { width: 100%; height: 100%; object-fit: cover; }

.q-body { flex: 1; min-width: 0; }
.q-prompt {
  margin: 0 0 5px;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.q-bar {
  height: 4px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
}
.q-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--brand);
  transition: width .4s ease;
}
.q-item.is-failed .q-bar i { background: var(--err); }
.q-item.is-done .q-bar i { background: var(--ok); }
.q-stage {
  margin: 5px 0 0;
  font-size: 11px;
  color: var(--ink-3);
}
.q-item.is-failed .q-stage { color: var(--err); }

.q-state {
  flex: none;
  font-size: 11.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  min-width: 42px;
  text-align: right;
}
.q-item.is-done .q-state { color: var(--ok); }
.q-item.is-failed .q-state { color: var(--err); }

/* ── 空状态 ───────────────────────────────────────────── */

.empty {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 52px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--line-2);
  border-radius: var(--r-lg);
}
.empty.is-show { display: flex; }
.empty b { font-size: 14px; }
.empty em { font-style: normal; font-size: 12.5px; color: var(--ink-3); margin-bottom: 10px; }

/* ── 提示词库 / 模型广场 ──────────────────────────────── */

.libgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 12px;
}
.libcard {
  padding: 14px 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  text-align: left;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.libcard:hover {
  border-color: var(--brand-soft-2);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.libcard b { display: block; font-size: 13px; margin-bottom: 5px; }
.libcard p { margin: 0 0 10px; font-size: 12.5px; color: var(--ink-2); line-height: 1.65; }
.libcard span {
  font-size: 11px;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 2px 8px;
  border-radius: 999px;
}

.mgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.mcard {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  text-align: left;
  transition: border-color .2s, box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mcard:hover {
  border-color: var(--brand-soft-2);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.mcard-top { display: flex; align-items: center; gap: 10px; }
.mcard-ico {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}
.mcard-top b { font-size: 13.5px; }
.mcard-top em {
  display: block;
  font-style: normal;
  font-size: 11.5px;
  color: var(--ink-3);
}
.mcard p { margin: 0; font-size: 12px; color: var(--ink-3); line-height: 1.65; }
.mcard-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.mtag {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.mtag.is-credit { background: var(--brand-soft); border-color: var(--brand-soft-2); color: var(--brand); }
.mtag.is-ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.mtag.is-off { background: var(--err-soft); border-color: var(--err-line); color: var(--err); }

/* ── 弹窗通用 ─────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.mask {
  position: absolute;
  inset: 0;
  background: rgba(18, 20, 24, .4);
  backdrop-filter: blur(2px);
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.mbox {
  position: relative;
  width: min(420px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 26px;
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-pop);
  animation: popIn .2s cubic-bezier(.2, .8, .3, 1);
}
.mbox.is-wide { width: min(760px, 100%); }
@keyframes popIn {
  from { opacity: 0; transform: translateY(8px) scale(.99); }
  to { opacity: 1; transform: none; }
}

.auth-brand { margin: 2px 0 16px; }
.auth-brand .brand-full { height: 52px; width: auto; display: block; }
/* 深色下字标会糊，换成「标记 + 文字」的组合 */
.auth-brand .brand-alt { display: none; align-items: center; gap: 11px; }
.auth-brand .brand-alt img { height: 28px; width: auto; display: block; }
.auth-brand .brand-alt b { font-size: 18px; font-weight: 650; letter-spacing: .01em; color: var(--ink); }
[data-theme="dark"] .auth-brand .brand-full { display: none; }
[data-theme="dark"] .auth-brand .brand-alt { display: inline-flex; }

.mbox h2 { margin: 0 0 6px; font-size: 18px; font-weight: 650; }
.msub { margin: 0 0 18px; font-size: 12.5px; color: var(--ink-3); line-height: 1.65; }

.mbox-x {
  position: absolute;
  top: 12px; right: 12px;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 7px;
  color: var(--ink-3);
  font-size: 18px;
  line-height: 1;
}
.mbox-x:hover { background: var(--surface-2); color: var(--ink); }

.tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  margin-bottom: 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.tabs button {
  flex: 1;
  height: 30px;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.tabs button.is-on {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(18, 20, 23, .08);
}

.field { display: block; margin-bottom: 13px; }
.field > span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--ink-2);
}
.field input,
.field select {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 13px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus,
.field select:focus {
  border-color: var(--brand-soft-2);
  box-shadow: 0 0 0 3px rgba(232, 100, 47, .08);
}
.field input::placeholder { color: var(--ink-3); }

.inline { display: flex; gap: 8px; }
.inline input { flex: 1; min-width: 0; }
.inline .btn { flex: none; height: 38px; }

.ferr {
  margin: 0 0 12px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--err-soft);
  color: var(--err);
  font-size: 12px;
  line-height: 1.6;
}

.ffoot {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 10px;
}
.link { color: var(--brand); font-size: 12px; }
.link:hover { text-decoration: underline; }

.auth-panel .btn-block { margin-top: 4px; }
#tabProviders .btn-block { margin-top: 4px; }

/* ── 模型选择弹窗 ─────────────────────────────────────── */

.mmodal {
  position: relative;
  width: min(580px, 100%);
  max-height: min(78vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  animation: popIn .2s cubic-bezier(.2, .8, .3, 1);
}

.msearch {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.msearch svg { width: 16px; height: 16px; color: var(--ink-3); flex: none; }
.msearch input {
  flex: 1;
  min-width: 0;
  height: 24px;
  border: none;
  outline: none;
  background: none;
  font-size: 13.5px;
}
.msearch input::placeholder { color: var(--ink-3); }

.mtabs {
  display: flex;
  gap: 4px;
  padding: 10px 16px 4px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: none;
}
.mtabs::-webkit-scrollbar { display: none; }
.mtabs button {
  flex: none;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: nowrap;
}
.mtabs button:hover { background: var(--surface-2); }
.mtabs button.is-off { opacity: .45; }
.chip.is-off { opacity: .45; }
.mtabs button.is-on {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.mlist {
  flex: 1;
  overflow-y: auto;
  padding: 4px 10px 12px;
}
.mgroup {
  padding: 12px 8px 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: .02em;
}

.mp-item {
  display: flex;
  gap: 11px;
  width: 100%;
  padding: 11px 10px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  text-align: left;
  transition: background .16s, border-color .16s;
}
.mp-item:hover { background: var(--surface-2); }
.mp-item.is-on { background: var(--brand-soft); border-color: var(--brand-soft-2); }

.mpi-ico {
  flex: none;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
}
.mp-item.is-on .mpi-ico { border-color: var(--brand-soft-2); color: var(--brand); background: var(--surface); }

.mpi-body { flex: 1; min-width: 0; }
.mpi-title { display: flex; align-items: center; gap: 8px; }
.mpi-title b { font-size: 13px; font-weight: 600; }
.mpi-state {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-3);
}
.mpi-state.is-ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.mpi-state.is-off { background: var(--err-soft); border-color: var(--err-line); color: var(--err); }

.mpi-desc {
  margin: 4px 0 8px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mpi-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.mpi-tags span {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.mpi-tags .t-credit { background: var(--brand-soft); border-color: var(--brand-soft-2); color: var(--brand); }
.mpi-tags .t-ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.mp-empty { padding: 40px 16px; text-align: center; font-size: 12.5px; color: var(--ink-3); }

/* ── 图片创作：左参数面板 + 右生成结果 ───────────────────── */

.ic-head { margin-bottom: 20px; }
.ic-eyebrow {
  font-size: 11px;
  letter-spacing: .09em;
  color: var(--ink-3);
  margin-bottom: 7px;
}
.ic-head h1 {
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
}
.ic-sub {
  margin-top: 8px;
  max-width: 660px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink-2);
}

.ic-body {
  display: grid;
  grid-template-columns: 348px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.ic-panel {
  position: sticky;
  top: 14px;
  display: flex;
  flex-direction: column;
  gap: 17px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
}

.ic-field { display: flex; flex-direction: column; gap: 8px; position: relative; }
.ic-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ic-label { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.ic-opt { font-size: 11.5px; color: var(--ink-3); }

/* 模型下拉 */
.ic-select {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 40px;
  padding: 0 11px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: 12.5px;
  color: var(--ink);
  text-align: left;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.ic-select:hover { border-color: var(--brand-soft-2); }
.ic-select.is-open {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.ic-dot {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--brand), #F7A870);
}
.ic-select-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ic-caret {
  flex: none;
  width: 0;
  height: 0;
  border-left: 4.5px solid transparent;
  border-right: 4.5px solid transparent;
  border-top: 5px solid var(--ink-3);
}

.ic-pop {
  position: absolute;
  z-index: 45;
  left: 0;
  right: auto;
  top: calc(100% + 6px);
  width: 430px;
  max-width: calc(100vw - 96px);
  display: flex;
  flex-direction: column;
  max-height: 430px;
  overflow: hidden;
  background: var(--elev);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 18px 44px rgba(18, 20, 23, .16);
}
.ic-pop[hidden] { display: none; }
.ic-search {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.ic-search svg { flex: none; width: 15px; height: 15px; color: var(--ink-3); }
.ic-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: none;
  font: inherit;
  font-size: 12.5px;
  color: var(--ink);
}
.ic-pop-list { flex: 1; overflow: auto; padding: 6px; }

.ic-item {
  display: flex;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  border-radius: var(--r-md);
  background: none;
  text-align: left;
  cursor: pointer;
}
.ic-item:hover { background: var(--surface-2); }
.ic-item.is-on { background: var(--brand-soft); }
.ic-item-ico {
  flex: none;
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--track);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
}
.ic-item.is-on .ic-item-ico { background: var(--brand); color: #fff; }
.ic-item-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ic-item-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}
.ic-item-check { color: var(--brand); font-size: 11px; }
.ic-item-desc {
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ic-item-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 1px; }
.ic-tag {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  font-size: 10.5px;
  color: var(--ink-2);
}
.ic-tag.is-credit { color: var(--brand); background: var(--brand-soft); border-color: var(--brand-soft-2); }
.ic-tag.is-ok { color: var(--ok); background: var(--ok-soft); border-color: var(--ok-line); }
.ic-pop-foot { flex: none; padding: 9px 12px; border-top: 1px solid var(--line); text-align: right; }
.ic-pop-foot button {
  border: none;
  background: none;
  font-size: 11.5px;
  color: var(--ink-2);
  cursor: pointer;
}
.ic-pop-foot button:hover { color: var(--brand); }
.ic-pop-empty { padding: 26px 12px; text-align: center; font-size: 12px; color: var(--ink-3); }

/* 提示词 / 参考图 */
.ic-panel textarea {
  width: 100%;
  min-height: 118px;
  resize: vertical;
  padding: 11px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface-2);
  font: inherit;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.ic-panel textarea::placeholder { color: var(--ink-3); }
.ic-panel textarea:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.ic-tip { font-size: 11px; line-height: 1.6; color: var(--ink-3); }
.ic-thumbs .thumb, .ic-thumbs .add { width: 58px; height: 58px; }

/* 比例：带小方框图 */
.ratio-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.ratio-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  padding: 0 4px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 11.5px;
  cursor: pointer;
  transition: all .15s;
}
.ratio-btn:hover { border-color: var(--brand-soft-2); color: var(--ink); }
.ratio-btn.is-on {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}
.ratio-btn.is-off {
  opacity: .38;
  cursor: not-allowed;
  border-style: dashed;
}
.ratio-ico {
  flex: none;
  border: 1.3px solid currentColor;
  border-radius: 2px;
  opacity: .85;
}

.ic-seg button { height: 30px; font-size: 12px; }

/* 清晰度 / 数量并排 */
.ic-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ic-row2 .seg button { padding: 0 2px; }

/* 底部生成区 */
.ic-foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 2px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}
.ic-cost {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-2);
}
.ic-note { font-size: 11.5px; color: var(--ink-3); }
.ic-note.is-live { color: var(--brand); }
.ic-note.is-off { color: var(--err); }
.ic-generate { width: 100%; height: 42px; font-size: 13px; }

/* 右侧结果 */
.ic-results { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ic-results-title { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.ic-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 420px;
  padding: 40px 20px;
}
.ic-empty-ico {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink-3);
}
.ic-empty-ico svg { width: 22px; height: 22px; }
.ic-empty b { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.ic-empty em { font-size: 12px; font-style: normal; color: var(--ink-3); }

.ic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 12px; }
.ic-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.ic-card img { display: block; width: 100%; height: auto; }
.ic-card-bar {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  gap: 6px;
  padding: 26px 8px 8px;
  background: linear-gradient(to top, rgba(12, 14, 17, .62), rgba(12, 14, 17, 0));
  opacity: 0;
  transition: opacity .16s;
}
.ic-card:hover .ic-card-bar { opacity: 1; }
.ic-card-bar button {
  flex: 1;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, .93);
  font-size: 11px;
  color: #1B1C1E;
  cursor: pointer;
}
.ic-card-bar button:hover { background: #fff; }

.ic-queue { margin-top: 4px; }

@media (max-width: 1000px) {
  .ic-body { grid-template-columns: minmax(0, 1fr); }
  .ic-panel { position: static; }
  .ic-empty { min-height: 220px; }
}

/* ── 模型广场：列表式 ─────────────────────────────────────── */

.mp-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.mp-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 300px;
  max-width: 100%;
  height: 36px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
}
.mp-search svg { flex: none; width: 15px; height: 15px; color: var(--ink-3); }
.mp-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: none;
  font: inherit;
  font-size: 12.5px;
  color: var(--ink);
}
.mp-series { margin-bottom: 18px; }
.mp-tools .chips { margin-bottom: 0; }
.chip em { font-style: normal; font-size: 11px; opacity: .68; }

.mp-group + .mp-group { margin-top: 26px; }
.mp-grouphead {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}
.mp-grouphead b { font-size: 14px; font-weight: 600; color: var(--ink); }
.mp-grouphead span { font-size: 11.5px; color: var(--ink-3); }

.mp-card {
  padding: 16px 18px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.mp-card + .mp-card { margin-top: 12px; }

.mp-card-top { display: flex; align-items: center; gap: 9px; }
.mp-logo {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--brand), #F7A870);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.mp-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.mp-type {
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 10.5px;
  color: var(--ink-3);
}
.mp-go {
  margin-left: auto;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 11.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .15s;
}
.mp-go:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.mp-go svg { width: 13px; height: 13px; }

.mp-metas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.mp-desc {
  margin: 11px 0 12px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--ink-2);
}

.mp-specs { border-top: 1px solid var(--line); padding: 8px 0 12px; }
.mp-specrow { display: flex; gap: 10px; padding: 4px 0; font-size: 11.5px; line-height: 1.7; }
.mp-specrow dt { flex: none; width: 62px; color: var(--ink-3); }
.mp-specrow dd { flex: 1; min-width: 0; color: var(--ink-2); }

.mp-none { padding: 60px 16px; text-align: center; font-size: 12.5px; color: var(--ink-3); }


/* 视频页空状态：视频模型下架期间顶掉整个创作台 */
.vempty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 56px 24px 60px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
}
.vempty-ico {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  margin-bottom: 4px;
}
.vempty-ico svg { width: 26px; height: 26px; }
.ve-title { font-size: 15.5px; font-weight: 600; color: var(--ink); }
.ve-desc {
  max-width: 460px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--ink-2);
}
.vempty .btn { margin-top: 8px; }

/* 首页入口上的「即将开放」小标 */
.entry-soon {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.6;
  vertical-align: 1.5px;
}

.mfoot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--ink-3);
}

/* ── 接口配置 ─────────────────────────────────────────── */

.prov-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }

.prov-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.prov-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.prov-name {
  flex: 1;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  outline: none;
}
.prov-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.prov-adv { margin: 4px 0 10px; }
.prov-adv summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--ink-3);
  padding: 4px 0;
}
.prov-adv textarea {
  min-height: 96px;
  margin-top: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
}
.prov-foot { display: flex; align-items: center; gap: 10px; }
.prov-state { font-size: 11.5px; color: var(--ok); }
.link-btn { font-size: 12px; color: var(--ink-3); }
.link-btn:hover { color: var(--err); }

.empty-mini {
  margin: 0 0 10px;
  padding: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
  border: 1px dashed var(--line-2);
  border-radius: var(--r-md);
}

.bind-head, .bind-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 76px 64px;
  gap: 8px;
  align-items: center;
}
.bind-head {
  padding: 0 4px 8px;
  font-size: 11px;
  color: var(--ink-3);
}
.bind-row { padding: 7px 4px; border-top: 1px solid var(--line); }
.bind-row select,
.bind-row input {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 12px;
  outline: none;
}
.bind-name { min-width: 0; }
.bind-name b { display: block; font-size: 12.5px; font-weight: 600; }
.bind-name span { font-size: 10.5px; color: var(--ink-3); }
.bind-state { font-size: 11.5px; color: var(--ink-3); }

/* ── 播放器 ───────────────────────────────────────────── */

.pbox {
  position: relative;
  width: min(760px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-pop);
  animation: popIn .2s cubic-bezier(.2, .8, .3, 1);
}
.pstage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--stage);
}
.pstage video { width: 100%; height: 100%; object-fit: contain; background: var(--stage); display: block; }
.pstage img { width: 100%; height: 100%; object-fit: cover; display: block; }

.kb-frame { position: absolute; inset: 0; overflow: hidden; }
.kb-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  animation: kb 14s ease-in-out infinite alternate;
}
@keyframes kb {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to { transform: scale(1.14) translate3d(-1.5%, -1.5%, 0); }
}
.player-note {
  position: absolute;
  left: 10px; bottom: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(20, 22, 26, .62);
  color: #fff;
  font-size: 10.5px;
  backdrop-filter: blur(6px);
}

.pprompt { margin: 14px 2px 10px; font-size: 13.5px; line-height: 1.7; }
.pfoot { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.pmeta { font-size: 11.5px; color: var(--ink-3); }

/* ── Toast ────────────────────────────────────────────── */

.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(27, 28, 30, .93);
  color: #fff;
  font-size: 12.5px;
  box-shadow: var(--shadow-pop);
  animation: toastIn .22s ease;
}
.toast.is-out { opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s; }
.toast.is-warn { background: rgba(196, 62, 30, .95); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ── 系统公告 ─────────────────────────────────────────── */

.notice-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 58vh;
  overflow-y: auto;
  margin: 4px -2px 0;
  padding: 0 2px;
}

.notice-item {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
}
.notice-item.is-new {
  border-color: var(--brand-soft-2);
  box-shadow: inset 3px 0 0 var(--brand);
}
.notice-top { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.notice-tag {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--surface);
  color: var(--brand);
  border: 1px solid var(--brand-soft-2);
  font-weight: 600;
}
.notice-date { font-size: 11.5px; color: var(--ink-3); margin-left: auto; }
.notice-item h3 { margin: 0 0 6px; font-size: 13.5px; font-weight: 650; }
.notice-item p {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.75;
  white-space: pre-line;
}
.notice-item .btn { margin-top: 10px; }
.notice-foot { margin: 14px 0 0; font-size: 11.5px; color: var(--ink-3); }

/* ── 开放 API 文档 ─────────────────────────────────────── */

.page.is-doc { max-width: 1200px; }

.docwrap {
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

.doctoc {
  position: sticky;
  top: 22px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding-right: 8px;
  border-right: 1px solid var(--line);
}
.doctoc-title {
  margin: 0 0 8px;
  padding-left: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.doctoc nav { display: flex; flex-direction: column; gap: 1px; padding-bottom: 14px; }
.doctoc a {
  display: block;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-2);
  transition: background .15s, color .15s;
}
.doctoc a.is-l3 { padding-left: 22px; font-size: 12px; color: var(--ink-3); }
.doctoc a:hover { background: var(--surface-2); color: var(--ink); }
.doctoc a.is-on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

.docbody {
  min-width: 0;
  font-size: 14px;
  line-height: 1.78;
  color: var(--ink-2);
}
.docbody h2 {
  margin: 40px 0 12px;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -.01em;
  color: var(--ink);
  scroll-margin-top: 24px;
}
.docbody h2:first-child { margin-top: 0; }
.docbody h3 {
  margin: 26px 0 10px;
  font-size: 15.5px;
  font-weight: 650;
  color: var(--ink);
  scroll-margin-top: 24px;
}
.docbody h4 { margin: 20px 0 8px; font-size: 14px; font-weight: 650; color: var(--ink); }
.docbody p { margin: 0 0 12px; }
.docbody ul, .docbody ol { margin: 0 0 14px; padding-left: 22px; }
.docbody li { margin: 5px 0; }
.docbody hr { border: none; border-top: 1px solid var(--line); margin: 30px 0; }
.docbody strong { color: var(--ink); font-weight: 650; }
.docbody a { color: var(--brand); }
.docbody a:hover { text-decoration: underline; }

.docbody code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-size: 12.5px;
  padding: 1.5px 5px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  word-break: break-word;
}

.docbody blockquote {
  margin: 0 0 20px;
  padding: 14px 16px;
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--brand-soft);
  color: var(--ink-2);
}
.docbody blockquote p { margin: 0; }

.dc-fig {
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface);
}
.dc-fig figcaption {
  padding: 7px 13px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--ink-3);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.dc-fig pre { margin: 0; padding: 13px 15px; overflow-x: auto; }
.dc-fig code {
  background: none;
  border: none;
  padding: 0;
  font-size: 12.5px;
  line-height: 1.68;
  color: var(--ink);
  white-space: pre;
}

.dc-table {
  margin: 0 0 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.dc-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dc-table th {
  text-align: left;
  padding: 9px 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.dc-table td { padding: 9px 13px; border-bottom: 1px solid var(--line); vertical-align: top; }
.dc-table tr:last-child td { border-bottom: none; }

.doc-loading { color: var(--ink-3); }

/* ── 响应式 ───────────────────────────────────────────── */

@media (max-width: 1180px) {
  .studio { grid-template-columns: minmax(0, 1fr) 300px; }
  .recent, .mine { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
  .studio { grid-template-columns: 1fr; }
  .studio-side { position: static; }
  .mcur { max-width: 100%; flex: 1; }
}

@media (max-width: 1120px) {
  .docwrap { grid-template-columns: 1fr; gap: 20px; }
  .doctoc { position: static; max-height: none; border-right: none; border-bottom: 1px solid var(--line); padding: 0 0 10px; }
  .doctoc nav { flex-direction: row; flex-wrap: wrap; gap: 4px; padding-bottom: 0; }
  .doctoc a.is-l3 { display: none; }
}

@media (max-width: 700px) {
  .doctoc nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 -2px;
    padding: 2px 2px 6px;
  }
  .doctoc nav::-webkit-scrollbar { display: none; }
  .doctoc a {
    white-space: nowrap;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 12px;
  }
}

@media (max-width: 820px) {
  :root { --rail: 68px; }
  .page { padding: 22px 18px 64px; }
  .entries { grid-template-columns: 1fr; }
  .recent, .mine { grid-template-columns: repeat(2, 1fr); }
  .phead h1 { font-size: 20px; }
  .search { width: 100%; }
  .btools, .phead-actions { width: 100%; }
  .submitbar { position: static; flex-direction: column; align-items: stretch; gap: 10px; }
  .submitbar .btn { width: 100%; }
  .bind-head { display: none; }
  .bind-row { grid-template-columns: 1fr 1fr; }
  .rail-item { width: 58px; padding: 7px 0 6px; }
  .rail-item .ri-ico svg { width: 21px; height: 21px; }
  .rail-item .ri-label { font-size: 10.5px; }
  .rail-mini { width: 34px; height: 34px; }
  .rail-mini svg { width: 19px; height: 19px; }
  .rail-foot { width: 54px; gap: 4px; padding-top: 10px; }
  .docbody h2 { font-size: 18px; }
  .prov-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .recent, .mine { grid-template-columns: 1fr 1fr; gap: 10px; }
  .wmeta { padding: 8px 10px 10px; }
  .phead-row { align-items: flex-start; }
}

/* ── 钱包与充值 ─────────────────────────────────────────── */
.wal { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.wal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wal-label { font-size: 12.5px; color: var(--ink-3); }
.wal-big { display: flex; align-items: baseline; gap: 6px; }
.wal-big b { font-size: 34px; font-weight: 700; letter-spacing: -.6px; color: var(--ink); line-height: 1.1; }
.wal-big span { font-size: 12.5px; color: var(--ink-3); }
.wal-cash { font-size: 12.5px; color: var(--ink-3); }
.wal-form { display: flex; gap: 8px; }
.wal-form input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13px;
  letter-spacing: .5px;
}
.wal-form input:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.wal-form .btn { height: 38px; flex: none; }
.wal-tip { font-size: 12px; color: var(--ink-3); }
.wal-admin {
  align-self: flex-start;
  height: 30px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12px;
}
.wal-admin:hover { border-color: var(--line-2); color: var(--ink); }

.ledger { display: flex; flex-direction: column; }
.ledger-empty { padding: 26px 4px; font-size: 12.5px; color: var(--ink-3); }
.lg-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px 72px 84px;
  align-items: center;
  gap: 10px;
  padding: 11px 2px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.lg-row:first-child { border-top: none; }
.lg-name { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--ink); }
.lg-name em {
  font-style: normal;
  font-size: 11px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lg-time { font-size: 12px; color: var(--ink-3); }
.lg-delta { font-weight: 600; color: var(--ink-2); text-align: right; }
.lg-delta.is-plus { color: var(--brand); }
.lg-balance { font-size: 12px; color: var(--ink-3); text-align: right; }

/* ── 管理后台 ───────────────────────────────────────────── */
.adstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.adstat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.adstat span { font-size: 11.5px; color: var(--ink-3); }
.adstat b { font-size: 19px; font-weight: 650; letter-spacing: -.3px; }
.ad-hint { font-size: 12.5px; color: var(--ink-3); margin-bottom: 10px; }
.ad-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.ad-form label { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; color: var(--ink-3); }
.ad-form input {
  width: 130px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13px;
}
.ad-form input:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.ad-form .btn { height: 34px; }
.ad-codes { margin-top: 12px; }
.codes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--ink-2);
  margin-bottom: 8px;
}
.codes-body {
  margin: 0;
  padding: 12px 14px;
  max-height: 240px;
  overflow: auto;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--ink);
  white-space: pre;
}
.ad-users { display: flex; flex-direction: column; }
.ad-user {
  display: grid;
  grid-template-columns: 90px 96px 96px minmax(0, 1fr) 78px;
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
}
.ad-user:first-child { border-top: none; }
.au-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink-2); }
.au-bal { font-weight: 600; }
.au-spent, .au-time { color: var(--ink-3); }
.ad-user .mini-btn { justify-self: end; }

@media (max-width: 1000px) {
  .wal { grid-template-columns: 1fr; }
  .adstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg-row { grid-template-columns: minmax(0, 1fr) 62px 78px; }
  .lg-time { display: none; }
  .ad-user { grid-template-columns: 80px 82px minmax(0, 1fr) 70px; }
  .au-time { display: none; }
}

/* ══ 账号菜单：上面几项是跳转，hover 不该变红 ══ */
.user-menu .um-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  margin-bottom: 6px;
  border-color: transparent;
  background: transparent;
  text-align: left;
}
.user-menu .um-item svg { width: 15px; height: 15px; flex: none; opacity: .8; }
.user-menu .um-item:hover {
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface-2);
}
.user-menu #logoutBtn { margin-top: 2px; }

/* ══ 账号安全 ══ */
.acc-page { max-width: 880px; }
.acc-kicker {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--ink-3);
}
.acc-head { margin-bottom: 20px; }
.acc-head h1 { font-size: 23px; }
.acc-head p { margin-top: 8px; }

.acc-me {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  margin-bottom: 14px;
}
.acc-avatar {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 16px;
  font-weight: 600;
}
.acc-me-body { flex: 1; min-width: 0; }
.acc-me-body b { display: block; font-size: 14.5px; }
.acc-me-body em {
  display: block;
  margin-top: 3px;
  font-style: normal;
  font-size: 12px;
  color: var(--ink-3);
  word-break: break-all;
}
.acc-badge {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--ok);
  background: var(--ok-soft);
  border: 1px solid var(--ok-line);
}

.acc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.acc-list { margin: 2px 0 0; }
.acc-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}
.acc-list > div:first-child { border-top: 0; }
.acc-list dt { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.acc-list dd {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink);
  text-align: right;
  word-break: break-all;
}
.acc-hint {
  margin: 4px 0 10px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink-3);
}
.acc-sep { height: 1px; background: var(--line); margin: 14px 0 4px; }
.acc-tag {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  color: var(--brand);
  background: var(--brand-soft);
}
.acc-select {
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
}

.acc-help { margin-top: 14px; }
.acc-help p {
  margin: 2px 0 10px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-2);
}
.ct-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.ct-row span { font-size: 12.5px; color: var(--ink-3); }
.ct-row b { font-size: 14px; letter-spacing: .02em; }
.ct-note { margin: 6px 0 0; font-size: 12px; color: var(--ink-3); }

@media (max-width: 820px) {
  .acc-grid { grid-template-columns: 1fr; }
  .acc-head h1 { font-size: 20px; }
}

/* ══ 条款与规则 ══ */
.legal-page { max-width: 900px; }
.legal-tabs { display: flex; gap: 8px; margin: 0 0 16px; }
.legal-tabs button {
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  white-space: nowrap;
}
.legal-tabs button.is-on {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 600;
}
.legal-doc { padding: 26px 30px 30px; }
.legal-meta {
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--ink-3);
}
.legal-doc p {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.85;
  color: var(--ink-2);
}
.legal-doc h2 {
  margin: 22px 0 8px;
  font-size: 14px;
  color: var(--ink);
}
.legal-doc h2:first-of-type { margin-top: 4px; }
.legal-doc ul { margin: 0 0 12px; padding-left: 18px; }
.legal-doc li {
  margin-bottom: 5px;
  font-size: 13px;
  line-height: 1.85;
  color: var(--ink-2);
}
.legal-doc b { color: var(--ink); font-weight: 600; }
.legal-contact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.legal-contact span { font-size: 12px; color: var(--ink-3); }
.legal-contact b { font-size: 15px; }
.legal-foot {
  margin-top: 18px;
  font-size: 11.5px;
  color: var(--ink-3);
  text-align: center;
}
.wal-legal { margin: 10px 0 0; font-size: 11.5px; color: var(--ink-3); }
.flegal {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.7;
  color: var(--ink-3);
  text-align: center;
}
.flegal .link { font-size: 11px; }

@media (max-width: 760px) {
  .legal-doc { padding: 18px 16px 22px; }
  .legal-tabs { overflow-x: auto; padding-bottom: 2px; }
}

/* ══ 提交前确认 ══ */
.mbox-cfm { width: min(560px, calc(100vw - 40px)); max-width: 560px; }
.cfm-rows { margin: 6px 0 14px; }
.cfm-rows > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.cfm-rows > div:last-child { border-bottom: 0; }
.cfm-rows dt { font-size: 13px; color: var(--ink-3); }
.cfm-rows dd { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.cfm-rows dd.is-short { color: var(--err); font-weight: 500; font-size: 12.5px; }

.cfm-label { margin: 4px 0 8px; font-size: 12px; color: var(--ink-3); }
.cfm-list {
  max-height: 176px;
  overflow: auto;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.cfm-item { display: flex; gap: 8px; padding: 4px 0; }
.cfm-item + .cfm-item { border-top: 1px dashed var(--line); }
.cfm-item span {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 10.5px;
  color: var(--ink-3);
}
.cfm-item p {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-word;
}
.cfm-foot { margin: 10px 0 0; font-size: 11.5px; line-height: 1.65; color: var(--ink-3); }
.cfm-foot.is-short { color: var(--err); }
.cfm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.cfm-actions .btn { min-width: 92px; }

/* 弹窗内容要盖在遮罩之上：遮罩的 backdrop-filter 会新建层叠上下文，不加这条会被压下去 */
.modal > .mbox { position: relative; z-index: 1; }
