/* 工作台改版（design/ui-refresh-v2）：标题 + 输入框工具栏 + 下方列表。
   背景沿用线上中性色；只取设计稿的墨色、细线和圆角，赤陶色仅用于小面积提示。 */
#app {
  --wb-ink: #1F1D1A;
  --wb-ink-2: #4A463F;
  --wb-muted: #6F6A62;
  --wb-faint: #A39D93;
  --wb-line: rgba(25, 25, 22, 0.10);
  --wb-line-2: rgba(25, 25, 22, 0.06);
  --wb-line-input: rgba(25, 25, 22, 0.18);
  --wb-chip-on: rgba(25, 25, 22, 0.06);
  --wb-accent: #D9602A;
}
[data-theme="dark"] #app {
  --wb-ink: #f1f1eb;
  --wb-ink-2: #d4d4cc;
  --wb-muted: #a4a79d;
  --wb-faint: #7f8078;
  --wb-line: rgba(255, 255, 247, 0.12);
  --wb-line-2: rgba(255, 255, 247, 0.07);
  --wb-line-input: rgba(255, 255, 247, 0.2);
  --wb-chip-on: rgba(255, 255, 247, 0.08);
  --wb-accent: #E4875A;
}
#app .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 页面标题 ---------- */
#app .wb-head { margin: 4px 0 18px; }
#app .wb-head h1 { margin: 0; color: var(--wb-ink); font-size: 24px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
#app .wb-head p { margin: 6px 0 0; color: var(--wb-muted); font-size: 13px; line-height: 1.6; }
#app .text-creation-page { max-width: 880px; }

/* ---------- 细标签切换 ---------- */
#app .wb-tabs { display: flex; gap: 20px; margin: 0 0 10px; padding: 0; border: 0; }
#app .wb-tabs button {
  min-height: 32px;
  padding: 0 0 6px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--wb-muted);
  font-size: 13px;
  cursor: pointer;
}
#app .wb-tabs button.active { border-bottom-color: var(--wb-ink); background: none; color: var(--wb-ink); font-weight: 600; }

/* ---------- 输入框 ---------- */
#app .text-creation-page .wb-composer {
  margin: 0 0 28px;
  padding: 0;
  border: 1px solid var(--wb-line-input);
  border-radius: 14px;
  background: var(--bg-card);
  box-shadow: none;
}
#app .text-creation-page .wb-composer:hover { box-shadow: none; }
#app .text-creation-page .wb-composer:focus-within { border-color: var(--wb-faint); }
#app .creation-zone .script-form,
#app .creation-zone #form-article-script { display: block; padding: 0; }
#app :is(.wb-composer, .wx-publish-card) .wb-composer-input {
  display: block;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 16px 18px 6px;
  border: 0;
  border-radius: 14px 14px 0 0;
  background: transparent;
  box-shadow: none;
  color: var(--wb-ink);
  font-size: 15px;
  line-height: 1.6;
  resize: none;
  outline: none;
}
#app :is(.wb-composer, .wx-publish-card) .wb-composer-input::placeholder { color: var(--wb-faint); }
#app :is(.wb-composer, .wx-publish-card) .wb-composer-title { padding-bottom: 0; font-weight: 600; }
#app .wb-composer .selected-theme-context { margin: 4px 18px 0; }
/* 工具栏：图标 + 短标签，主按钮靠右。 */
#app .wb-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 8px 10px 10px; }
#app .wb-bar .wb-group { display: contents; }
#app .wb-bar .wb-bar-scroll { display: contents; }
#app .wb-sep { flex: none; width: 1px; height: 18px; margin: 0 6px; background: var(--wb-line); }
#app .wb-grow { flex: 1 1 8px; }
#app :is(.wb-composer, .wx-publish-card) .wb-chip {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  height: 32px;
  min-height: 32px;
  margin: 0;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--wb-ink-2);
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}
#app :is(.wb-composer, .wx-publish-card) .wb-chip:hover { background: var(--wb-chip-on); }
#app :is(.wb-composer, .wx-publish-card) .wb-chip svg { flex: none; width: 16px; height: 16px; color: var(--wb-muted); }
#app :is(.wb-composer, .wx-publish-card) .wb-chip[aria-expanded="true"] { background: var(--wb-chip-on); color: var(--wb-ink); }
/* 开关型：原复选框铺满整个标签，点击和键盘都直接作用在原控件上。 */
#app :is(.wb-composer, .wx-publish-card) .wb-toggle input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
#app :is(.wb-composer, .wx-publish-card) .wb-toggle:has(input:checked) { background: var(--wb-chip-on); color: var(--wb-ink); font-weight: 600; }
#app :is(.wb-composer, .wx-publish-card) .wb-toggle:has(input:checked) svg { color: var(--wb-ink); }
#app :is(.wb-composer, .wx-publish-card) .wb-toggle:has(input:focus-visible) { outline: 2px solid var(--wb-ink); outline-offset: 1px; }
/* 选择型：原生 select 去掉外框，手机上由系统选择器从底部弹出。 */
#app :is(.wb-composer, .wx-publish-card) .wb-chip select {
  appearance: none;
  -webkit-appearance: none;
  width: auto;
  max-width: 11em;
  height: 32px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  font-size: 13px;
  text-overflow: ellipsis;
  cursor: pointer;
  field-sizing: content;
}
/* 下拉获得焦点时整块选项变底色，与其他选项的选中态一致；键盘聚焦时在块外侧描边。 */
#app :is(.wb-composer, .wx-publish-card) .wb-chip select:focus { outline: 0; }
#app :is(.wb-composer, .wx-publish-card) .wb-chip:focus-within { background: var(--wb-chip-on); color: var(--wb-ink); }
#app :is(.wb-composer, .wx-publish-card) .wb-chip:has(select:focus-visible) { outline: 2px solid var(--wb-ink); outline-offset: 2px; }
/* 画面模板：小色块 + 模板名，点击打开原模板广场。 */
#app .text-creation-page .wb-template,
#app .text-creation-page .wb-template .video-template-selected {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  grid-template-columns: none;
}
#app .text-creation-page .wb-template .video-template-mini-preview {
  flex: none;
  width: 20px;
  height: 14px;
  min-height: 0;
  border-radius: 3px;
  aspect-ratio: auto;
}
#app .text-creation-page .wb-template strong { max-width: 9em; overflow: hidden; color: inherit; font-size: 13px; font-weight: 400; text-overflow: ellipsis; }
#app .text-creation-page .wb-template .video-template-inline-options { display: inline-flex; align-items: center; gap: 4px; color: var(--wb-muted); font-size: 12px; }
#app .text-creation-page .wb-template .video-template-inline-options select { min-height: 32px; padding: 0 6px; font-size: 13px; }
/* 主按钮 */
#app :is(.wb-composer, .wx-publish-card) .wb-go {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  min-width: 0;
  height: 34px;
  min-height: 34px;
  margin: 0;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: var(--wb-ink);
  color: var(--bg-card);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
#app :is(.wb-composer, .wx-publish-card) .wb-go svg { width: 14px; height: 14px; }
#app :is(.wb-composer, .wx-publish-card) .wb-go:disabled { opacity: 0.45; }
#app .wb-hint { margin: -18px 2px 28px; padding: 0; border: 0; background: none; color: var(--wb-muted); font-size: 12px; line-height: 1.6; }

#app .wb-composer .article-tab-panel { margin: 0; padding: 0 12px; }
#app .wb-composer .article-tab-panel[hidden] { display: none; }
#app .wb-composer :is(.wb-chip, .wb-template, .wb-pop-wrap)[hidden] { display: none !important; }
#app .wb-bar .article-tab.active,
#app .wb-bar .article-tab[aria-pressed="true"] { background: var(--wb-chip-on); color: var(--wb-ink); }
#app .wb-bar .article-tab.active svg,
#app .wb-bar .article-tab[aria-pressed="true"] svg { color: var(--wb-ink); }
#app .wb-composer .existing-article-picker { display: flex; align-items: center; gap: 8px; padding: 8px 0 0; }
#app .wb-composer .existing-article-picker select { flex: 1; min-width: 0; padding: 10px 6px; border-radius: 8px; }
#app .wb-composer .existing-article-preview { margin: 8px 0 0; color: var(--wb-muted); font-size: 12px; }
#app :is(.wb-composer, .wx-publish-card) .wb-upload { margin: 10px 0 0; }
#app #creation-material-panel { display: none; }
#app #rewrite-mode-hint { display: none; }
/* ---------- 小浮层（桌面下拉，手机底部面板） ---------- */
#app .wb-pop-wrap { position: relative; display: inline-flex; flex: none; }
#app .wb-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 80;
  width: min(440px, calc(100vw - 48px));
  max-height: min(60vh, 520px);
  overflow-y: auto;
  padding: 14px;
  border: 1px solid var(--wb-line);
  border-radius: 12px;
  background: var(--bg-card);
  box-shadow: 0 16px 40px rgba(25, 25, 22, 0.14);
  color: var(--wb-ink);
}
#app .wb-pop[hidden] { display: none; }
#app .text-creation-page .wb-pop.creation-sources-stage { grid-column: auto; grid-row: auto; align-self: auto; border-color: var(--wb-line); background: var(--bg-card); }
#app .wb-pop .source-picker { max-height: none; overflow: visible; }
.wb-pop-scrim { position: fixed; inset: 0; z-index: 255; background: rgba(31, 29, 26, 0.36); }
.wb-pop-scrim[hidden] { display: none; }

/* ---------- 列表 ---------- */
#app .wb-recent { margin-top: 8px; }
#app .wb-sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 4px; }
#app .wb-sec-head h2 { margin: 0; color: var(--wb-ink); font-size: 15px; font-weight: 600; }
#app .wb-sec-head a { color: var(--wb-muted); font-size: 13px; text-decoration: underline; text-decoration-color: var(--wb-line-input); text-underline-offset: 4px; }
#app .wb-list .home-recent-card {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 10px 4px;
  border: 0;
  border-bottom: 1px solid var(--wb-line-2);
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--wb-ink);
  text-align: left;
  cursor: pointer;
}
#app .wb-list .home-recent-card:hover { background: var(--wb-chip-on); }
#app .wb-list .home-recent-icon { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: none; color: var(--wb-muted); font-size: 12px; }
#app .wb-list .home-recent-card strong { display: block; overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
#app .wb-list .home-recent-card small { color: var(--wb-faint); font-size: 12px; }
#app .wb-list .home-recent-arrow { color: var(--wb-faint); }
#app .wb-list .home-empty-state { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 4px; color: var(--wb-muted); font-size: 13px; }
#app .wb-list .home-empty-state button { min-height: 32px; padding: 0 12px; border: 1px solid var(--wb-line-input); border-radius: 8px; background: none; color: var(--wb-ink); font-size: 13px; }

/* 结果区：去掉厚边框和彩色顶线，保持细线分隔。 */
#app .text-creation-page .creation-result-zone { margin: 0 0 28px; border: 1px solid var(--wb-line); box-shadow: none; }
#app .text-creation-page .creation-result-zone::before { color: var(--wb-muted); }
#app .text-creation-page .creation-result-zone--article::before { display: none; }

/* 文章编辑：文本创作结果区、我的创作、发布中心草稿共用一套。 */
#app .ae-scope .ae-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 0; padding: 0 0 12px; border-bottom: 1px solid var(--wb-line); }
#app .ae-head-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
#app .ae-head-main .card-title { margin: 0; color: var(--wb-ink); font-size: 15px; font-weight: 600; }
#app .ae-head-acts, #app .publish-draft-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
#app .ae-head-acts .btn, #app .publish-draft-actions .btn { min-height: 34px; margin-left: 4px; }
#app .ae-state { margin-right: 6px; color: var(--wb-faint); font-size: 12px; white-space: nowrap; }
#app .ae-state[data-tone="dirty"] { color: var(--wb-accent); }
#app .ae-icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; min-height: 34px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--wb-muted); cursor: pointer; }
#app .ae-icon-btn:hover { background: var(--wb-chip-on); color: var(--wb-ink); }
#app .ae-icon-btn svg { width: 17px; height: 17px; }
#app .ae-pop-wrap { position: relative; display: inline-flex; }
#app .ae-menu, #app .ae-scope .result-download-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; min-width: 156px; padding: 4px; border: 1px solid var(--wb-line); border-radius: 10px; background: var(--bg-card); box-shadow: 0 10px 28px rgba(25, 25, 22, 0.10); }
#app .ae-menu[hidden] { display: none; }
#app :is(.ae-menu, .ae-scope .result-download-menu) button { display: block; width: 100%; min-height: 36px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: var(--wb-ink); font-size: 13px; text-align: left; }
#app :is(.ae-menu, .ae-scope .result-download-menu) button:hover { background: var(--wb-chip-on); }
#app .ae-back { display: inline-flex; align-items: center; min-height: 32px; margin: 0 0 8px; padding: 0; border: 0; background: none; color: var(--wb-muted); font-size: 13px; cursor: pointer; }
#app .ae-back:hover { color: var(--wb-ink); }

#app .ae-doc { max-width: 720px; margin: 0 auto; padding: 28px 0 4px; }
#app .ae-scope .ae-title { display: block; width: 100%; min-height: 0; padding: 0; overflow: hidden; resize: none; font-family: inherit; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--wb-ink); font-size: 28px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
#app .ae-scope .ae-digest { display: block; width: 100%; min-height: 0; margin: 14px 0 0; padding: 2px 0 2px 12px; overflow: hidden; border: 0; border-left: 2px solid var(--wb-line-input); border-radius: 0; background: none; box-shadow: none; color: var(--wb-muted); font-family: inherit; font-size: 15px; line-height: 1.7; resize: none; }
#app .ae-scope :is(.ae-title, .ae-digest):focus-visible, #app .ae-body:focus-visible { outline: none; }
#app .ae-scope :is(.ae-title, .ae-digest)::placeholder { color: var(--wb-faint); }

#app .ae { margin-top: 22px; }
#app .ae-tools { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 2px; padding: 6px 0; border-bottom: 1px solid var(--wb-line-2); background: var(--bg-card); }
#app .ae-tool { display: inline-grid; place-items: center; width: 32px; height: 32px; min-height: 32px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--wb-muted); line-height: 1; cursor: pointer; }
#app .ae-tool:hover:not(:disabled) { background: var(--wb-chip-on); color: var(--wb-ink); }
#app .ae-tool:disabled { opacity: 0.35; cursor: default; }
#app .ae-tool svg { width: 16px; height: 16px; }
#app .ae-grow { flex: 1; }
#app .ae-note { margin-right: 8px; color: var(--wb-faint); font-size: 12px; }
#app .ae-src { min-height: 28px; padding: 0 10px; border: 1px solid var(--wb-line-input); border-radius: 6px; background: none; color: var(--wb-muted); font-size: 12px; line-height: 26px; cursor: pointer; }
#app .ae-src[aria-pressed="true"] { border-color: var(--wb-ink); background: var(--wb-ink); color: var(--bg-card); }
#app .ae-src:disabled { opacity: 0.6; cursor: default; }

#app .ae-body { position: relative; min-height: 40vh; padding: 18px 0 32px; color: var(--wb-ink-2); font-size: 15.5px; line-height: 1.9; overflow-wrap: anywhere; outline: none; }
#app .ae-body.is-empty::before { position: absolute; top: 18px; left: 0; color: var(--wb-faint); content: attr(data-placeholder); pointer-events: none; }
#app .ae-body :is(h1, h2, h3, h4, h5, h6) { margin: 30px 0 10px; color: var(--wb-ink); font-weight: 700; line-height: 1.45; }
#app .ae-body h1 { font-size: 22px; }
#app .ae-body h2 { font-size: 19px; }
#app .ae-body h3 { font-size: 16.5px; }
#app .ae-body :is(h4, h5, h6) { font-size: 15.5px; }
#app .ae-body > :first-child { margin-top: 0; }
#app .ae-body p { margin: 0 0 14px; }
#app .ae-body blockquote { margin: 0 0 14px; padding: 2px 0 2px 14px; border-left: 3px solid var(--wb-line-input); color: var(--wb-muted); }
#app .ae-body blockquote p:last-child { margin-bottom: 0; }
#app .ae-body :is(ul, ol) { margin: 0 0 14px; padding-left: 1.5em; }
#app .ae-body li { margin: 4px 0; }
#app .ae-body img { display: block; max-width: 100%; height: auto; margin: 8px 0; border-radius: 8px; cursor: grab; }
#app .ae-body img.is-picked { outline: 2px solid var(--wb-accent); outline-offset: 2px; }
#app .ae-body img.is-new { animation: ae-img-in 1.2s ease-out; }
@keyframes ae-img-in { from { box-shadow: 0 0 0 4px var(--wb-accent); } to { box-shadow: 0 0 0 4px transparent; } }
#app .ae { position: relative; }
#app .ae-imgbar { position: absolute; z-index: 4; display: flex; gap: 2px; padding: 3px; border-radius: 8px; background: rgba(31, 29, 26, 0.88); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18); }
#app .ae-imgbar[hidden] { display: none; }
#app .ae-imgbar button { min-height: 28px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: #fff; font-size: 12.5px; cursor: pointer; }
#app .ae-imgbar button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.16); }
#app .ae-imgbar button:disabled { opacity: 0.35; cursor: default; }
#app .ae-imgbar .is-danger { color: #FFB59A; }
#app .ae-drop { position: absolute; z-index: 3; height: 2px; border-radius: 1px; background: var(--wb-accent); pointer-events: none; }
#app .ae-drop[hidden] { display: none; }
#app .ae-ctx { position: absolute; z-index: 40; min-width: 168px; padding: 4px; border: 1px solid var(--wb-line); border-radius: 10px; background: var(--bg-card); box-shadow: 0 10px 28px rgba(25, 25, 22, 0.12); }
#app .ae-ctx[hidden] { display: none; }
#app .ae-ctx button { display: block; width: 100%; min-height: 34px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: var(--wb-ink); font-size: 13px; text-align: left; cursor: pointer; }
#app .ae-ctx button:hover:not(:disabled) { background: var(--wb-chip-on); }
#app .ae-ctx button:disabled { color: var(--wb-faint); cursor: default; }
#app .ae-ctx hr { margin: 4px 6px; border: 0; border-top: 1px solid var(--wb-line-2); }
#app .ae-ctx .is-danger { color: var(--wb-danger, #C2410C); }
#app .ae-picks { width: 300px; max-height: 320px; overflow-y: auto; }
#app .ae-picks-head { padding: 6px 8px 8px; color: var(--wb-muted); font-size: 12px; }
#app .ae-picks-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 4px 4px; }
#app .ae-ctx .ae-picks-grid button { min-height: 0; aspect-ratio: 1; padding: 0; overflow: hidden; border: 1px solid var(--wb-line-2); background: var(--wb-chip-on); }
#app .ae-picks-grid img { display: block; width: 100%; height: 100%; object-fit: cover; }
#app .ae-picks-empty { padding: 4px 8px 10px; color: var(--wb-faint); font-size: 12px; line-height: 1.6; }
#app .ae-body hr { margin: 24px 0; border: 0; border-top: 1px solid var(--wb-line); }
#app .ae-body pre { margin: 0 0 14px; padding: 12px 14px; overflow-x: auto; border-radius: 8px; background: var(--wb-chip-on); font-size: 13px; line-height: 1.7; }
#app .ae-body code { padding: 1px 4px; border-radius: 4px; background: var(--wb-chip-on); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }
#app .ae-body pre code { padding: 0; background: none; }
#app .ae-body a { color: var(--wb-accent); text-decoration: underline; text-underline-offset: 2px; }
#app .ae .ae-source { display: none; }
#app .ae.is-source .ae-body { display: none; }
#app .ae.is-source .ae-source { display: block; width: 100%; min-height: 50vh; margin-top: 12px; padding: 14px 16px; border: 1px solid var(--wb-line-input); border-radius: 10px; background: var(--bg-primary, transparent); color: var(--wb-ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; line-height: 1.75; resize: vertical; }
#app .ae-scope .article-references { max-width: 720px; margin: 8px auto 0; padding: 14px 0 4px; border-top: 1px solid var(--wb-line-2); color: var(--wb-muted); font-size: 13px; line-height: 1.7; }
#app .publish-draft .ae-doc { padding-top: 20px; }

/* 手机排版预览（文本创作、我的创作）。 */
#app .ae-work { display: grid; grid-template-columns: minmax(0, 1fr) 340px; }
#app .ae-main { min-width: 0; padding-right: 40px; }
#app .ae-mseg { display: none; }
#app .ae-preview { position: sticky; top: 12px; align-self: start; padding: 24px 0 20px 32px; border-left: 1px solid var(--wb-line); }
#app .ae-pv-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; color: var(--wb-muted); font-size: 12px; }
#app .ae-pv-head [data-ae-pv-status] { color: var(--wb-faint); }
#app .ae-phone { width: 290px; height: min(600px, calc(100vh - 220px)); min-height: 420px; margin: 0 auto; padding: 9px; border-radius: 34px; background: #1F1D1A; }
#app .ae-phone-screen { position: relative; height: 100%; overflow: hidden; border-radius: 26px; background: #fff; }
#app .ae-phone-screen iframe { position: absolute; top: 0; left: 0; width: 375px; border: 0; background: #fff; transform-origin: 0 0; }
#app .ae-pv-note { max-width: 290px; margin: 12px auto 0; color: var(--wb-faint); font-size: 12px; line-height: 1.6; text-align: center; }
#app .ae-preview { max-height: calc(100vh - 24px); overflow-y: auto; scrollbar-width: thin; }

/* 排版样式面板（预览栏手机上方）。 */
#app :is(.ae-lay, .ae-cpop, .ae-bpop, .ae-dlg, .ae-brand-btn) { --ui-control-height: 0px; }
#app .ae-lay { margin: 0 0 14px; padding: 12px; border: 1px solid var(--wb-line-2); border-radius: 12px; background: var(--bg-card); }
#app .ae-lay-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; color: var(--wb-ink); font-size: 13px; font-weight: 600; }
#app .ae-lay-toggle { min-height: 26px; padding: 0 10px; border: 1px solid var(--wb-line-input); border-radius: 999px; background: none; color: var(--wb-muted); font-size: 12px; cursor: pointer; }
#app .ae-lay.is-open .ae-lay-toggle { border-color: var(--wb-ink); color: var(--wb-ink); }
#app .ae-lay-chips { display: flex; flex-wrap: wrap; gap: 6px; }
#app .ae-lay-hint { color: var(--wb-faint); font-size: 12px; }
#app .ae-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border: 1px solid var(--wb-line-input); border-radius: 999px; background: none; color: var(--wb-ink-2); font-size: 12.5px; line-height: 1; cursor: pointer; }
#app .ae-chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--wb-faint)); }
#app .ae-chip small { color: var(--wb-faint); font-size: 11px; }
#app .ae-chip.is-on { border-color: var(--wb-ink); background: var(--wb-ink); color: var(--bg-card); }
#app .ae-chip.is-on small { color: inherit; opacity: 0.7; }
#app .ae-chip.is-custom { cursor: default; }
#app .ae-chip.is-custom i { background: conic-gradient(#d92c4a, #d9682a, #2f6b4f, #1f5fbf, #7a4fd1, #d92c4a); }
#app .ae-lay-body { display: grid; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--wb-line-2); }
#app .ae-lay-body[hidden] { display: none; }
#app .ae-lay-row, #app .ae-lay-range { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 8px; margin: 0; }
#app .ae-lay-row { grid-template-columns: 44px minmax(0, 1fr); }
#app .ae-lay-label { color: var(--wb-muted); font-size: 12px; }
#app .ae-sw { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#app .ae-sw button, #app .ae-ctx .ae-sw button { display: block; width: 20px; min-width: 0; height: 20px; min-height: 0; padding: 0; border: 1px solid rgba(0, 0, 0, 0.12); border-radius: 50%; background: var(--c); cursor: pointer; }
#app .ae-sw button[aria-pressed="true"], #app .ae-sw-custom.is-on { box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 3.5px var(--wb-ink); }
#app .ae-sw-custom { position: relative; display: block; width: 20px; height: 20px; overflow: hidden; border-radius: 50%; background: conic-gradient(#d92c4a, #d9682a, #e8c547, #2f6b4f, #1f5fbf, #7a4fd1, #d92c4a); cursor: pointer; }
#app .ae-sw-custom.is-on { background: var(--c); }
#app .ae-sw-custom input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
#app .ae-lay-range input { width: 100%; min-height: 0; accent-color: var(--wb-ink); }
#app .ae-lay-range output { min-width: 38px; color: var(--wb-ink-2); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
#app .ae-lay-check { display: flex; align-items: center; gap: 6px; margin: 0 0 0 52px; color: var(--wb-muted); font-size: 12px; }
#app .ae-lay-seg { display: flex; flex-wrap: wrap; gap: 4px; }
#app .ae-lay-seg button { min-height: 26px; padding: 0 9px; border: 1px solid var(--wb-line-input); border-radius: 6px; background: none; color: var(--wb-muted); font-size: 12px; cursor: pointer; }
#app .ae-lay-seg button[aria-pressed="true"] { border-color: var(--wb-ink); color: var(--wb-ink); font-weight: 600; }
#app .ae-lay-acts { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 4px; }
#app .ae-lay-acts button { min-height: 28px; padding: 0 10px; border: 1px solid var(--wb-line-input); border-radius: 6px; background: none; color: var(--wb-ink); font-size: 12px; cursor: pointer; }
#app .ae-lay-acts button:disabled { color: var(--wb-faint); cursor: default; }
#app .ae-lay-acts .is-danger { color: var(--wb-danger, #C2410C); }
#app .ae-lay-msg { min-height: 0; margin: 0; color: var(--wb-muted); font-size: 12px; }
#app .ae-lay-msg:empty { display: none; }
#app .ae-lay-summary { margin: 6px 0 0; color: var(--wb-faint); font-size: 12px; }
#app .ae-lay-summary:empty { display: none; }

/* 编辑器里的颜色、高亮与品牌标识开关。 */
#app .ae-body mark { padding: 0 2px; border-radius: 2px; background: var(--ae-hl, #fff1a8); color: inherit; }
#app .ae-brand-btn { display: inline-flex; flex: none; align-items: center; gap: 5px; min-height: 28px; margin-right: 8px; padding: 0 10px; border: 1px solid var(--wb-line-input); border-radius: 999px; background: none; color: var(--wb-muted); font-size: 12px; white-space: nowrap; cursor: pointer; }
#app .ae-brand-btn svg { width: 15px; height: 15px; }
#app .ae-brand-btn[aria-pressed="true"] { border-color: var(--ae-tc, var(--wb-ink)); color: var(--ae-tc, var(--wb-ink)); background: color-mix(in srgb, var(--ae-tc, #1F1D1A) 8%, transparent); }
#app .ae-cpop { width: 210px; padding: 2px 4px 4px; }
#app .ae-cpop .ae-sw { gap: 8px; padding: 0 6px 8px; }
#app .ae-cpop .ae-sw button, #app .ae-cpop .ae-sw-custom { width: 22px; height: 22px; }
#app .ae-ctx .ae-cpop-reset { min-height: 30px; font-size: 12.5px; color: var(--wb-muted); }
#app .ae-bpop { width: 260px; padding: 6px; }
#app .ae-bpop-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 8px; cursor: pointer; }
#app .ae-bpop-row b { display: block; color: var(--wb-ink); font-size: 13px; font-weight: 600; }
#app .ae-bpop-row small { color: var(--wb-faint); font-size: 11.5px; }
#app .ae-switch { position: relative; flex: none; width: 34px; height: 20px; margin: 0; border-radius: 999px; background: var(--wb-line-input); appearance: none; cursor: pointer; transition: background 0.15s; }
#app .ae-switch::after { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); content: ""; transition: transform 0.15s; }
#app .ae-switch:checked { background: var(--ae-tc, var(--wb-ink)); }
#app .ae-switch:checked::after { transform: translateX(14px); }
#app .ae-switch:disabled { opacity: 0.4; cursor: default; }
#app .ae-bpop-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 0 8px; }
#app .ae-bpop-thumbs figure { margin: 0; }
#app .ae-bpop-thumbs img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--wb-line-2); border-radius: 6px; }
#app .ae-bpop-thumbs figcaption { margin-top: 3px; color: var(--wb-faint); font-size: 11px; text-align: center; }
#app .ae-ctx .ae-bpop-edit { border: 1px solid var(--wb-line-input); text-align: center; }

/* 品牌标识设置弹窗。 */
#app .ae-dlg { width: min(460px, calc(100vw - 32px)); padding: 22px 22px 18px; border: 0; border-radius: 14px; background: var(--bg-card); color: var(--wb-ink); box-shadow: 0 24px 60px rgba(25, 25, 22, 0.22); }
#app .ae-dlg::backdrop { background: rgba(25, 25, 22, 0.36); }
#app .ae-dlg-head { display: flex; align-items: center; justify-content: space-between; }
#app .ae-dlg-head h3 { margin: 0; font-size: 17px; }
#app .ae-dlg-x { width: 30px; height: 30px; min-height: 0; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--wb-muted); font-size: 20px; line-height: 1; cursor: pointer; }
#app .ae-dlg-sub { margin: 6px 0 16px; color: var(--wb-muted); font-size: 12.5px; line-height: 1.6; }
#app .ae-slots { display: grid; gap: 10px; }
#app .ae-slot { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 12px; }
#app .ae-slot.is-busy { opacity: 0.5; pointer-events: none; }
#app .ae-slot-img { display: grid; place-items: center; width: 76px; height: 76px; min-height: 0; padding: 0; overflow: hidden; border: 1px dashed var(--wb-line-input); border-radius: 10px; background: var(--wb-chip-on); color: var(--wb-faint); font-size: 12px; cursor: pointer; }
#app .ae-slot-img img { width: 100%; height: 100%; object-fit: cover; }
#app .ae-slot-meta b { display: block; font-size: 13.5px; }
#app .ae-slot-meta > span { color: var(--wb-faint); font-size: 12px; }
#app .ae-slot-acts { display: flex; gap: 6px; margin-top: 6px; }
#app .ae-slot-acts button { min-height: 26px; padding: 0 10px; border: 1px solid var(--wb-line-input); border-radius: 6px; background: none; color: var(--wb-ink); font-size: 12px; cursor: pointer; }
#app .ae-slot-acts button[hidden] { display: none; }
#app .ae-dlg-field { display: grid; gap: 6px; margin: 16px 0 0; font-size: 12.5px; color: var(--wb-muted); }
#app .ae-dlg-field input { min-height: 36px; padding: 0 10px; border: 1px solid var(--wb-line-input); border-radius: 8px; background: none; color: var(--wb-ink); font-size: 13.5px; }
#app .ae-dlg-check { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 13px; }
#app .ae-dlg-err { margin: 10px 0 0; color: var(--wb-danger, #C2410C); font-size: 12.5px; }
#app .ae-dlg-err:empty { display: none; }
#app .ae-dlg-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
@media (min-width: 769px) and (max-width: 1180px) {
  #app .ae-work { grid-template-columns: minmax(0, 1fr) 280px; }
  #app .ae-main { padding-right: 24px; }
  #app .ae-preview { padding-left: 20px; }
  #app .ae-phone { width: 250px; }
}
/* ==================== 手机（≤768px） ==================== */
@media (max-width: 768px) {
  /* clip 防横向溢出但不把 body 变成滚动容器；旧浏览器回退到原有的 hidden。 */
  body { overflow-x: clip; }
  .main { padding-left: 16px; padding-right: 16px; }
  #app .wb-head { margin-top: 6px; }
  #app .wb-head h1 { font-size: 22px; }
  #app .ae-head-acts { width: 100%; }
  #app .ae-head-acts .ae-state { order: 9; width: 100%; margin: 2px 0 0; }
  #app .ae-head-acts .btn { flex: 1 1 0; min-height: 40px; }
  #app .ae-icon-btn { width: 40px; height: 40px; min-height: 40px; }
  #app .ae-doc { padding-top: 20px; }
  #app :is(#article-result, #creation-article-editor, #wx-article-editor) .ae-head { flex-direction: row; align-items: center; justify-content: space-between; text-align: left; }
  #app :is(#article-result, #creation-article-editor, #wx-article-editor) .ae-head-main { justify-content: flex-start; width: 100%; }
  #app :is(#article-result, #creation-article-editor, #wx-article-editor) .ae-title { font-size: 22px; line-height: 1.35; }
  #app :is(#article-result, #creation-article-editor, #wx-article-editor) .ae-digest { font-size: 16px; }
  #app .ae-body { font-size: 16px; }
  #app .ae-head-acts .btn, #app .ae-src { white-space: nowrap; }
  #app .ae-head-acts .btn-primary { flex-grow: 1.4; }
  #app .ae-tools { position: static; overflow-x: auto; scrollbar-width: none; }
  #app .ae-tool { width: 34px; height: 38px; min-height: 38px; flex: none; }
  #app .ae-body { min-height: 50vh; }
  #app .ae-work { grid-template-columns: minmax(0, 1fr); }
  #app .ae-main { padding-right: 0; }
  #app .ae-mseg { display: flex; gap: 4px; margin: 12px 0 0; padding: 3px; border-radius: 10px; background: var(--wb-chip-on); }
  #app .ae-mseg button { flex: 1; min-height: 36px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--wb-muted); font-size: 14px; }
  #app .ae-mseg button[aria-pressed="true"] { background: var(--bg-card); color: var(--wb-ink); box-shadow: 0 1px 2px rgba(25, 25, 22, 0.08); }
  #app .ae-preview { display: none; position: static; max-height: none; overflow: visible; padding: 20px 0 8px; border-left: 0; }
  #app .ae-scope.is-preview .ae-main { display: none; }
  #app .ae-scope.is-preview .ae-preview { display: block; }
  #app .ae-phone { width: min(300px, 100%); height: 560px; }
  /* 16px 字号避免 iOS 聚焦时放大页面。 */
  #app :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]), select, textarea),
  .modal :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]), select, textarea) {
    font-size: 16px;
  }

  /* 输入框工具栏单行横滑，主按钮固定在右侧变圆形。 */
  #app :is(.wb-composer, .wx-publish-card) .wb-composer-input { font-size: 16px; }
  #app .wb-bar {
    flex-wrap: nowrap;
    gap: 8px;
    padding: 6px 8px 6px 8px;
  }
  /* 选项区横滑并在右缘渐隐，提示还有更多；主按钮固定在最右，不压住选项。 */
  #app .wb-bar .wb-bar-scroll {
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
  }
  #app .wb-bar .wb-bar-scroll::-webkit-scrollbar { display: none; }
  #app .wb-bar .wb-grow { display: none; }
  #app :is(.wb-composer, .wx-publish-card) .wb-chip { height: 44px; min-height: 44px; font-size: 14px; }
  #app :is(.wb-composer, .wx-publish-card) .wb-chip select { height: 44px; font-size: 16px; }
  #app :is(.wb-composer, .wx-publish-card) .wb-go {
    position: static;
    flex: none;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 50%;
    box-shadow: none;
    font-size: 0;
  }
  #app :is(.wb-composer, .wx-publish-card) .wb-go svg { width: 18px; height: 18px; }
  #app :is(.wb-composer, .wx-publish-card) .wb-go .btn-text,
  #app :is(.wb-composer, .wx-publish-card) .wb-go .btn-loading { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  #app .wb-bar .article-tab { min-width: 44px; justify-content: center; padding: 0 10px; }

  /* 浮层在手机上变成底部面板。 */
  #app .wb-pop {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 270;
    width: auto;
    max-height: 78vh;
    max-height: 78dvh;
    padding: 6px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    border: 0;
    border-radius: 18px 18px 0 0;
    /* 遮暗由面板自身的大阴影完成：浮层位于横滑工具栏内，单独的遮罩层会被画在面板之上。 */
    box-shadow: 0 0 0 100vmax rgba(31, 29, 26, 0.36), 0 -12px 40px rgba(31, 29, 26, 0.18);
    overscroll-behavior: contain;
  }
  .wb-pop-scrim { background: transparent; }
  #app .wb-pop::before { display: block; width: 36px; height: 4px; margin: 4px auto 12px; border-radius: 4px; background: var(--wb-line-input); content: ''; }
  body.wb-pop-open { overflow: hidden; }
  /* 页面淡入动画保留的透明度会自成层叠上下文，把面板压在底栏下；面板打开时取消。 */
  body.wb-pop-open #app .tab-content.active { animation: none; opacity: 1; }
  #app .wb-list .home-recent-card { min-height: 60px; }

  /* 底部标签栏：选题 / 文本 / 卡片 / 发布 / 更多。 */
  .sidebar { border-radius: 0; border-top: 1px solid rgba(25, 25, 22, 0.1); box-shadow: none; }
  [data-theme="dark"] .sidebar { border-top-color: rgba(255, 255, 247, 0.12); box-shadow: none; }
  .sidebar .mobile-bottom-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: stretch; padding: 0 4px env(safe-area-inset-bottom, 0px); }
  #app .sidebar .mobile-bottom-nav .nav-item.nav-item {
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-height: 56px;
    margin: 0;
    padding: 6px 0 4px;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: var(--wb-muted);
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .sidebar .mobile-bottom-nav .nav-item::before { display: none; }
  .sidebar .mobile-bottom-nav .nav-item span { max-width: none; font-size: 12px; line-height: 1.2; }
  .sidebar .mobile-bottom-nav .nav-item svg { width: 22px; height: 22px; stroke: currentColor; }
  .sidebar .mobile-bottom-nav .nav-item:hover { background: none; }
  #app .sidebar .mobile-bottom-nav .nav-item.nav-item.active { color: var(--wb-ink); font-weight: 600; }
  .sidebar .mobile-bottom-nav .nav-item.active svg { stroke: currentColor; }

  /* 顶栏：账号只显示按钮，不再折行。 */
  .mobile-top-bar .user-email { display: none; }
  .mobile-top-bar .user-info { display: flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; box-shadow: none; }
  .task-nav-count { background: var(--wb-accent, #D9602A); color: #fff; }
  /* “更多”底部面板 */
  .mobile-more-scrim:not([hidden]) { position: fixed; inset: 0; z-index: 260; background: rgba(31, 29, 26, 0.36); opacity: 0; transition: opacity 0.25s ease; }
  .mobile-more-scrim.is-open { opacity: 1; }
  .mobile-more-sheet:not([hidden]) {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 270;
    display: block;
    max-height: 86vh;
    max-height: 86dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    border-radius: 18px 18px 0 0;
    background: var(--bg-card);
    color: var(--wb-ink);
    box-shadow: 0 -12px 40px rgba(31, 29, 26, 0.16);
    transform: translateY(105%);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .mobile-more-sheet.is-open { transform: none; }
  .mobile-more-sheet::before { display: block; width: 36px; height: 4px; margin: 4px auto 10px; border-radius: 4px; background: var(--wb-line-input); content: ''; }
  body.mobile-more-open { overflow: hidden; }
  .mobile-more-user { display: flex; align-items: center; gap: 12px; padding: 6px 4px 14px; border-bottom: 1px solid var(--wb-line-2); }
  .mobile-more-user .user-avatar { flex: none; width: 40px; height: 40px; }
  .mobile-more-user-text { display: grid; flex: 1; min-width: 0; }
  .mobile-more-user-text strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-more-user-text small { color: var(--wb-muted); font-size: 12px; }
  .mobile-more-user .btn[hidden] { display: none; }
  .mobile-more-list { display: grid; }
  .mobile-more-list > a,
  .mobile-more-list > button {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 52px;
    margin: 0;
    padding: 0 4px;
    border: 0;
    border-bottom: 1px solid var(--wb-line-2);
    border-radius: 0;
    background: none;
    color: var(--wb-ink);
    font: inherit;
    font-size: 15px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
  }
  .mobile-more-list > [hidden] { display: none; }
  .mobile-more-list > :last-child { border-bottom: 0; }
  .mobile-more-list svg { flex: none; width: 20px; height: 20px; color: var(--wb-muted); }
  .mobile-more-list > .active { font-weight: 600; }
  .mobile-more-list .nav-lock, .mobile-more-list .task-nav-count { margin-left: auto; }
  .mobile-more-list .task-nav-count + .nav-lock { margin-left: 6px; }
  .mobile-more-list #mobile-more-logout { color: var(--danger); }

  /* 卡片编辑器：iframe 高度扣掉顶栏和底栏，只在框内滚动，底部不再被底栏挡住。 */
  .main.main--cards-embed { padding-bottom: calc(57px + env(safe-area-inset-bottom, 0px)); }
  #tab-cards.tab-cards-embed { min-height: 0; }
  #tab-cards .cards-embed-frame {
    flex: none;
    height: calc(100dvh - 58px - 57px - env(safe-area-inset-bottom, 0px));
    min-height: 0;
  }
  /* 卡片详情：独立全屏页，返回靠页内「‹ 卡片生成」。 */
  body.card-detail-open .mobile-top-bar,
  body.card-detail-open .sidebar,
  body.card-detail-open .task-dock { display: none !important; }
  body.card-detail-open .main.main--cards-embed { margin: 0; padding: 0; }
  body.card-detail-open #tab-cards .cards-embed-frame { height: 100dvh; }

  /* 浮动任务坞避开底栏。 */
  .task-dock { bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
}

/* ==================== 发布中心 ==================== */
#app .publish-page { max-width: 880px; }
#app #tab-publish > .wx-publish-card {
  margin: 0;
  padding: 0;
  border: 1px solid var(--wb-line-input);
  border-radius: 16px;
  background: var(--bg-card);
  box-shadow: none;
  overflow: visible;
}
#app #tab-publish > .wx-publish-card:focus-within { border-color: var(--wb-faint); }
#app #tab-publish .wx-cover-publish-workspace { overflow: visible; }
#app #tab-publish [hidden] { display: none !important; }

/* 第一行：作品类型 + 标题（原 select）+ 编辑草稿 */
#app .publish-work { display: flex; align-items: center; gap: 12px; margin: 0; padding: 14px 20px 8px; }
#app .publish-kind { flex: none; color: var(--wb-faint); font-size: 12px; }
#app .publish-pick { position: relative; display: flex; flex: 1; align-items: center; min-width: 0; margin: 0; }
#app #tab-publish .publish-pick-btn {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--wb-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
#app #tab-publish .publish-pick-btn > span { flex: 1; min-width: 0; overflow: hidden; font-size: 16px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
#app #tab-publish .publish-pick-btn:focus-visible { outline: 2px solid var(--wb-ink); outline-offset: 2px; border-radius: 8px; }
#app #tab-publish .publish-pick-btn:disabled { cursor: default; }
#app #tab-publish :is(.publish-pick-id, .publish-article-item b) { flex: none; color: var(--wb-faint); font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; }
#app #tab-publish .publish-native { display: none; }
#app .publish-caret { flex: none; width: 12px; height: 12px; color: var(--wb-muted); }
#app #tab-publish .publish-article-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; }
#app #tab-publish .publish-article-item > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#app #tab-publish .publish-article-item small { flex: none; color: var(--wb-faint); font-size: 12px; }
#app #tab-publish .publish-article-item.is-on { background: var(--wb-chip-on); font-weight: 600; }
#app .publish-work .publish-draft-link { flex: none; min-height: 28px; font-size: 12px; }

/* 第二行：封面来源标签，下方一排 16:9 缩略图 */
#app #tab-publish .wx-cover-publish-workspace > .publish-cover-tabs {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 20px;
  padding: 10px 0 0;
  border-top: 1px dashed var(--wb-line);
  grid-template-columns: none;
}
#app .publish-cover-label { flex: none; width: 28px; color: var(--wb-muted); font-size: 12px; }
#app #tab-publish .publish-cover-tabs .wx-cover-mode-option { position: relative; display: inline-flex; }
#app #tab-publish .publish-cover-tabs .wx-cover-mode-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
#app #tab-publish .publish-cover-tabs .wx-cover-mode-option span {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 0;
  padding: 4px 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--wb-muted);
  font-size: 12px;
  white-space: nowrap;
}
#app #tab-publish .publish-cover-tabs .wx-cover-mode-option input:checked + span { color: var(--wb-ink); font-weight: 600; }
#app #tab-publish .publish-cover-tabs .wx-cover-mode-option input:checked + span::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1.5px;
  border-radius: 2px;
  background: var(--wb-ink);
  content: '';
}
#app #tab-publish .publish-cover-tabs .wx-cover-mode-option input:focus-visible + span { outline: 2px solid var(--wb-ink); outline-offset: 2px; }
/* AI 配图描述：只在选 AI 配图时出现，单行。 */
/* 左边缘对齐「可编辑卡片」：外边距 20 + 标签宽 28 + 间距 16。 */
#app .publish-prompt { display: flex; align-items: center; gap: 8px; margin: 8px 20px 0 64px; }
#app #tab-publish .publish-prompt-go {
  flex: none;
  min-height: 32px;
  margin: 0;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: var(--wb-ink);
  color: var(--bg-card);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
#app #tab-publish .publish-prompt-go:disabled { opacity: 0.5; cursor: progress; }
#app #tab-publish:has(input[name="wx-cover-provider"][value="card"]:checked) #wx-cover-prompt-row { display: none; }
#app #tab-publish .publish-prompt input {
  width: 100%;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: var(--wb-chip-on);
  box-shadow: none;
  color: var(--wb-ink);
  font-size: 13px;
}
#app #tab-publish .publish-prompt input::placeholder { color: var(--wb-faint); }
#app #tab-publish #wx-cover-candidates {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  max-width: none;
  margin: 0 20px 0 61px;
  padding: 10px 3px 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
#app #tab-publish #wx-cover-candidates::-webkit-scrollbar { display: none; }
/* 封面操作菜单展开时临时撑高缩略图行，避免被横向滚动容器裁掉。 */
#app #tab-publish #wx-cover-candidates:has(.wx-cover-card__more[open]) { padding-bottom: 150px; }
#app #tab-publish .wx-cover-card {
  position: relative;
  display: block;
  flex: none;
  width: 136px;
  overflow: visible;
  border: 0;
  border-radius: 6px;
  background: none;
  box-shadow: none;
}
#app #tab-publish .wx-cover-card__pick {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 6px;
  background: var(--wb-chip-on);
  cursor: pointer;
}
#app #tab-publish .wx-cover-card__image { width: 100%; height: 100%; object-fit: cover; }
#app #tab-publish .wx-cover-card__empty { display: block; width: auto; height: auto; padding: 0; color: var(--wb-faint); font-size: 12px; }
#app #tab-publish .wx-cover-card.is-selected .wx-cover-card__pick { box-shadow: 0 0 0 1.5px var(--wb-bg-card, var(--bg-card)), 0 0 0 3px var(--wb-ink); }
#app #tab-publish .wx-cover-card__pick:focus-visible { outline: 2px solid var(--wb-ink); outline-offset: 3px; }
#app .wx-cover-card__more { position: absolute; top: 4px; right: 4px; }
#app .wx-cover-card__more > summary {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  color: #1F1D1A;
  list-style: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}
#app .wx-cover-card__more > summary::-webkit-details-marker { display: none; }
#app .wx-cover-card__more > summary svg { width: 13px; height: 13px; }
#app .wx-cover-card:is(:hover, :focus-within) .wx-cover-card__more > summary,
#app .wx-cover-card.is-selected .wx-cover-card__more > summary,
#app .wx-cover-card__more[open] > summary { opacity: 1; }
#app :is(.wx-cover-card__menu, .wb-pop--menu) {
  display: grid;
  min-width: 132px;
  padding: 4px;
  border: 1px solid var(--wb-line);
  border-radius: 10px;
  background: var(--bg-card);
  box-shadow: 0 12px 30px rgba(25, 25, 22, 0.14);
}
#app .wx-cover-card__menu { position: absolute; top: 26px; right: 0; z-index: 5; }
#app :is(.wx-cover-card__menu button, .wb-menu-item) {
  min-height: 32px;
  margin: 0;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--wb-ink);
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
#app :is(.wx-cover-card__menu button, .wb-menu-item):hover { background: var(--wb-chip-on); }
#app :is(.wx-cover-card__menu button.is-danger, .wb-link.is-danger) { color: var(--danger); }
#app .wx-cover-gen {
  display: grid;
  flex: none;
  place-items: center;
  width: 136px;
  aspect-ratio: 16 / 9;
  margin: 0;
  padding: 0;
  border: 1px dashed var(--wb-line-input);
  border-radius: 6px;
  background: none;
  color: var(--wb-faint);
  font-size: 12px;
  text-decoration: none;
}
#app a.wx-cover-gen { color: var(--wb-muted); text-decoration: underline; text-decoration-color: var(--wb-line-input); text-underline-offset: 3px; cursor: pointer; }
#app a.wx-cover-gen:hover { border-color: var(--wb-faint); color: var(--wb-ink); }
#app .wx-cover-gen__busy, #app .is-generating .wx-cover-gen__idle { display: none; }
#app .is-generating .wx-cover-gen__busy { display: inline; }

/* 第三行：渠道图标 · 发布时间 · 发送 */
#app #tab-publish .publish-bar { margin: 0; padding: 8px 10px 10px 12px; border: 0; }
#app #tab-publish .publish-channel { width: 32px; padding: 0; justify-content: center; }
#app #tab-publish .publish-channel svg { width: 18px; height: 18px; }
#app #tab-publish .publish-channel.is-on { background: var(--wb-chip-on); }
#app #tab-publish .publish-channel.is-on svg { color: var(--wb-ink); }
#app #tab-publish .publish-channel.needs-bind::after {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--wb-accent);
  content: '';
}
#app #tab-publish .publish-when { padding: 0 8px; color: var(--wb-muted); font-size: 12px; }
#app #tab-publish .publish-bar .wb-chip:disabled { opacity: 0.45; cursor: not-allowed; }
#app #tab-publish .publish-bar .wb-chip:disabled:hover { background: transparent; }
#app #tab-publish .publish-bar .wb-go { height: 36px; min-height: 36px; padding: 0 16px; border-radius: 10px; }
#app .publish-status:empty { display: none; }
#app .publish-status { margin: 0; padding: 0 20px 12px; color: var(--wb-muted); font-size: 12px; }

/* ---------- 发布记录 ---------- */
#app .publish-records { margin-top: 40px; }
#app .publish-records .wb-sec-head { align-items: center; }
#app .publish-records .wb-sec-head h2 { font-size: 16px; }
#app .publish-records .wb-sec-actions .wb-link { font-size: 12px; }
#app .wb-sec-actions { display: inline-flex; align-items: center; gap: 10px; }
#app .wb-link { min-height: 32px; padding: 0; border: 0; background: none; color: var(--wb-muted); font-size: 13px; text-decoration: underline; text-decoration-color: var(--wb-line-input); text-underline-offset: 4px; cursor: pointer; }
#app .wb-link:hover { color: var(--wb-ink); text-decoration-color: var(--wb-ink); }
#app .wb-more { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 7px; background: none; color: var(--wb-faint); cursor: pointer; }
#app .wb-more:hover, #app .wb-more[aria-expanded="true"] { background: var(--wb-chip-on); color: var(--wb-ink); }
#app .wb-more svg { width: 16px; height: 16px; }
#app .publish-records .empty-state { padding: 18px 8px; color: var(--wb-faint); font-size: 13px; text-align: left; }
#app .publish-task-item { border-bottom: 1px solid var(--wb-line-2); }
#app .publish-task-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 120px 150px 80px;
  align-items: center;
  gap: 18px;
  padding: 15px 8px;
}
#app .publish-task-row > svg { width: 18px; height: 18px; color: var(--wb-muted); }
#app .publish-task-title {
  min-width: 0;
  min-height: 0 !important;
  height: auto;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: none;
  color: var(--wb-ink);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
#app :is(.publish-task-channel, .publish-task-state) { overflow: hidden; color: var(--wb-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
#app .publish-task-state i { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--wb-faint); vertical-align: 1px; }
#app .publish-task-state.is-ok i { background: #5E8B4A; }
#app .publish-task-state.is-bad i { background: #B4432F; }
#app .publish-task-state.is-run i { background: var(--wb-accent); }
#app .publish-task-acts { text-align: right; }
#app .publish-task-acts .wb-link { font-size: 13px; color: var(--wb-ink); }
#app .publish-task-detail { padding: 0 8px 14px 46px; color: var(--wb-muted); font-size: 12px; }
#app .publish-task-detail dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0 0 6px; }
#app .publish-task-detail dt { color: var(--wb-faint); }
#app .publish-task-detail dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- 抽屉：渠道配置、草稿编辑（桌面右侧，手机底部） ---------- */
body.wb-pop-open #app .tab-content.active { animation: none; opacity: 1; }
#app .wb-drawer-head { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
#app #publish-draft-pop #wx-article-id-badge { display: none !important; }
#app .wb-drawer-head h2 { flex: 1; margin: 0; white-space: nowrap; color: var(--wb-ink); font-size: 16px; font-weight: 650; }
#app .wb-drawer-close { display: grid; flex: none; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--wb-muted); cursor: pointer; }
#app .wb-drawer-close:hover { background: var(--wb-chip-on); color: var(--wb-ink); }
#app .wb-drawer-close svg { width: 18px; height: 18px; }
#app #wx-channel-pop .wx-channel-card { margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }
#app #wx-channel-pop .wx-channel-card .card-title { margin: 0 0 4px; font-size: 14px; }
#app .publish-draft { padding: 0; }
#app .publish-draft .card-header { flex-wrap: wrap; justify-content: flex-start; }
#app .publish-draft-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
#app .publish-draft .article-edit-row { margin-bottom: 12px; }
@media (min-width: 769px) {
  .wb-pop-scrim { background: rgba(31, 29, 26, 0.28); }
  #app .wb-pop.wb-pop--menu { right: 0; left: auto; width: auto; padding: 4px; }
  #app #tab-publish .publish-article-pop { left: -8px; right: 0; max-height: 300px; padding: 6px; }
  #app .wb-pop.wb-pop--drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    z-index: 270;
    width: min(480px, 100vw);
    max-height: none;
    padding: 20px 24px 28px;
    border: 0;
    border-left: 1px solid var(--wb-line);
    border-radius: 0;
    box-shadow: -16px 0 40px rgba(25, 25, 22, 0.12);
  }
  #app .wb-pop.wb-pop--drawer.wb-pop--tall { width: min(640px, 100vw); }
  #app .wb-pop--drawer:focus { outline: none; }
}

@media (max-width: 768px) {
  #app #tab-publish > .wx-publish-card { border-radius: 14px; }
  #app .publish-work { gap: 10px; padding: 12px 12px 4px 16px; }
  #app #tab-publish .publish-pick-btn { min-height: 40px; }
  #app .publish-work .publish-draft-link { min-height: 40px; }
  #app #tab-publish .wx-cover-publish-workspace > .publish-cover-tabs { margin: 0 16px; padding-top: 6px; }
  #app #tab-publish .publish-cover-tabs .wx-cover-mode-option span { min-height: 36px; font-size: 13px; }
  #app .publish-prompt { margin: 4px 16px 0 60px; }
  #app #tab-publish .publish-prompt input { min-height: 40px; font-size: 16px; }
  #app #tab-publish .publish-prompt-go { min-height: 40px; font-size: 13px; }
  #app #tab-publish #wx-cover-candidates { margin: 0 16px 0 57px; padding-top: 8px; }
  #app #tab-publish .wx-cover-card, #app .wx-cover-gen { width: 128px; }
  #app #tab-publish .publish-channel { width: 44px; }
  #app #tab-publish .publish-when { padding: 0 10px; font-size: 13px; }
  #app #tab-publish .publish-bar .wb-go { width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; }
  #app .publish-status { padding: 0 16px 12px; }
  #app .publish-records { margin-top: 28px; }
  #app .publish-task-row { grid-template-columns: 20px minmax(0, 1fr) auto; grid-template-rows: auto auto auto; gap: 3px 12px; padding: 14px 4px; }
  #app .publish-task-row > svg { grid-row: 1; align-self: center; }
  #app .publish-task-title { grid-column: 2; grid-row: 1; }
  #app .publish-task-channel { grid-column: 2; grid-row: 2; }
  #app .publish-task-state { grid-column: 2; grid-row: 3; }
  #app .publish-task-acts { grid-column: 3; grid-row: 1 / span 3; }
  #app .publish-task-detail { padding: 0 4px 14px 36px; }
  #app .wb-link { min-height: 44px; }
  #app .wb-more { width: 44px; height: 44px; }
  #app .wb-pop.wb-pop--drawer.wb-pop--tall { height: 92vh; height: 92dvh; max-height: none; }
  #app .publish-draft .card-header { position: sticky; top: -6px; z-index: 1; margin: 0 -16px 12px; padding: 6px 16px 10px; background: var(--bg-card); }
  #app .publish-draft-actions .btn { min-height: 40px; }
  #app .publish-draft .article-edit-markdown { min-height: 40vh; }
}

/* 个人中心：常用代码模型 */
.motion-prefs { display: flex; flex-direction: column; gap: 12px; }
.motion-prefs-picked { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.motion-prefs-count { color: var(--text-muted); font-size: 12px; }
.motion-prefs-chip {
  display: inline-flex; align-items: center; gap: 2px; padding: 4px 6px 4px 10px; border-radius: 999px;
  background: var(--bg-hover, rgba(31, 29, 26, .06)); color: var(--text-primary); font-size: 13px;
}
.motion-prefs-chip button {
  width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: transparent;
  color: var(--text-muted); font-size: 14px; line-height: 1; cursor: pointer;
}
.motion-prefs-chip button:hover:not(:disabled) { background: var(--stroke); color: var(--text-primary); }
.motion-prefs-chip button:disabled { opacity: .35; cursor: default; }
.motion-prefs-all { display: flex; flex-direction: column; gap: 8px; }
.motion-prefs-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.motion-prefs-vendor { min-width: 92px; color: var(--text-muted); font-size: 12px; }
.motion-prefs-model {
  height: 28px; padding: 0 12px; border: 1px solid var(--stroke); border-radius: 999px; background: transparent;
  color: var(--text-secondary); font-size: 13px; cursor: pointer;
}
.motion-prefs-model[aria-pressed="true"] { border-color: var(--text-primary); background: var(--text-primary); color: var(--bg-card, #fff); }
.motion-prefs-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.motion-prefs-default { display: inline-flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 13px; white-space: nowrap; }
.motion-prefs-default select { height: 30px; padding: 0 8px; border: 1px solid var(--stroke); border-radius: 8px; background: var(--bg-card, #fff); color: var(--text-primary); }
