/* ============================================================
   魔视 · AI 视频生成工作台
   主题变体：橙墨书页（浅色）
   —— 宣纸暖白底 + 浓墨字 + 朱橙（朱砂印泥）单点缀
   —— 通篇衬线，界格式发丝线；层级靠排印，不靠装饰
   —— 与 style.css（墨夜·深色）选择器一一对应，二选一加载
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* 宣纸暖白 */
  --bg:          #f5eede;
  --surface:     #faf4e7;
  --surface-2:   #efe7d2;
  --surface-3:   #e6dbc0;
  --border:      #ddd0b4;
  --border-2:    #c6b695;

  /* 浓墨 */
  --text:        #2e2519;
  --text-2:      #5c5241;
  --text-3:      #8b7f6a;

  /* 松绿：与主主题青绿同族，离开朱砂橙 */
  --accent:      #2F6B58;
  --accent-2:    #245547;
  --accent-ink:  #f4fffb;
  --accent-soft: rgba(47, 107, 88, .10);

  /* 语义色：墨调压饱和 */
  --green: #5e7d4f;
  --amber: #a8722a;
  --red:   #ad4433;

  --r-xs: 2px;
  --r-sm: 2px;
  --r-md: 3px;

  --topbar-h: 48px;
  --mode-h:   44px;
  --pane-w:   380px;
  --dock-w:   clamp(420px, 38vw, 720px);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Noto Serif SC", "Source Han Serif SC", "Songti SC",
                  "STSong", "SimSun", serif;
}

html, body { height: 100%; }

body {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.hidden { display: none !important; }
svg { flex: none; }

::selection { background: var(--accent); color: var(--accent-ink); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border: 3px solid var(--bg); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-2); }
::-webkit-scrollbar-track { background: transparent; }

#app { display: flex; flex-direction: column; height: 100vh; }
@supports (height: 100dvh) { #app { height: 100dvh; } }

/* ============ 顶栏：书口双细线 ============ */
.topbar {
  height: var(--topbar-h);
  flex: none;
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 0 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-2);
  box-shadow: 0 3px 0 -2px var(--border);   /* 第二道发丝线，书口意 */
}

.brand { display: flex; align-items: baseline; gap: 9px; }
.logo-mark { width: 16px; height: 16px; color: var(--accent); align-self: center; }
.logo-text {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .08em;
  margin-right: -.08em;
  color: var(--text);
}

.nav-list { display: flex; gap: 2px; }
.nav-item {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-3);
  font: inherit;
  font-size: 13px;
  padding: 5px 11px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: color .15s, background .15s;
}
.nav-item:hover { color: var(--text-2); background: var(--surface-2); }
.nav-item.active { color: var(--accent); background: var(--accent-soft); }

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--text-3);
}
.status-indicator { display: flex; align-items: center; gap: 6px; }
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-3);
  transition: background .3s;
}
.status-dot.ok    { background: var(--green); }
.status-dot.warn  { background: var(--amber); }
.status-dot.error,
.status-dot.err   { background: var(--red); }
.user-name { color: var(--text-2); }

/* ============ 按钮 ============ */
.btn-ghost {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-2);
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 12px;
  padding: 6px 13px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.btn-ghost svg { width: 13px; height: 13px; }
.btn-ghost:hover { color: var(--text); border-color: var(--text-3); background: var(--surface-2); }

/* 主按钮：朱砂印 */
.btn-primary {
  appearance: none;
  width: 100%;
  border: 0;
  padding: 10px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .2em;
  text-indent: .2em;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .15s;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-2); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }

/* ============ 主体 ============ */
.main-content { flex: 1; min-height: 0; overflow: hidden; }
.page { display: none; height: 100%; overflow-y: auto; }
.page.active { display: block; }

/* ============ 模式栏 ============ */
.mode-row {
  min-height: var(--mode-h);
  height: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.segmented {
  display: inline-flex;
  padding: 2px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
}
.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-3);
  font: inherit;
  font-size: 12.5px;
  padding: 4px 14px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.tab:hover { color: var(--text-2); }
.tab.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--accent);
}

.spec-fields { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.prompt-specs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.spec-controls {
  display: flex;
  align-items: center;
  gap: 14px 18px;
  flex-wrap: wrap;
  min-width: 0;
}
.spec-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: .02em;
  margin-left: auto;
}
.spec-meta span + span::before {
  content: "·";
  margin-right: 10px;
  color: var(--border-2);
}
.sf { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.sf-k {
  font-family: var(--font-display);
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
}
.ratio-seg .tab { padding: 5px 12px; font-size: 12.5px; }

/* ============ 工作区 ============ */
.workspace {
  display: grid;
  grid-template-columns: var(--pane-w) 1fr;
  height: calc(100% - var(--mode-h));
}

/* --- 输入台 --- */
.input-pane {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 16px 18px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group.grow { flex: 1; min-height: 0; }

.label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: .18em;
}
.hint { font-size: 11px; color: var(--text-3); }

.prompt-input {
  width: 100%;
  flex: 1;
  min-height: 110px;
  padding: 11px 12px;
  font: inherit;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  outline: none;
  resize: none;
  transition: border-color .15s;
}
.prompt-input::placeholder { color: var(--text-3); }
.prompt-input:focus { border-color: var(--accent); }

.mode-note { display: flex; flex-direction: column; gap: 3px; }
.mn-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}
.mn-title:empty { display: none; }
.mn-desc {
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 提示词左侧输入 + 右侧小字 Tips */
.prompt-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 260px);
  gap: 10px;
  align-items: start;
  min-height: 0;
}
.prompt-compose .prompt-input { min-height: 128px; }
.prompt-tips {
  padding: 10px 11px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: auto;
  max-height: 420px;
}
.tips-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}
.tips-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--text-2);
}
.tips-sub {
  font-size: 10.5px;
  color: var(--accent);
  white-space: nowrap;
}
.tips-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tips-list li {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-3);
}
.tip-text { margin-bottom: 4px; color: var(--text-2); }
.tip-ex {
  margin: 0;
  padding: 6px 7px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 10px;
  line-height: 1.45;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  white-space: pre-wrap;
  word-break: break-word;
  cursor: pointer;
}
.tip-ex:hover { border-color: var(--accent); }
.tip-fill {
  appearance: none;
  margin-top: 4px;
  padding: 2px 8px;
  font: inherit;
  font-size: 10.5px;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
}
.tip-fill:hover { border-color: var(--accent); background: var(--surface-2); }
@media (max-width: 780px) {
  .prompt-compose { grid-template-columns: 1fr; }
  .prompt-tips { max-height: 240px; }
}

/* --- 上传 --- */
.upload-zone {
  border: 1px dashed var(--border-2);
  border-radius: var(--r-sm);
  background: var(--bg);
  padding: 18px 12px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.upload-zone:hover { border-color: var(--accent); background: var(--accent-soft); }
.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
}
.upload-placeholder svg { width: 18px; height: 18px; }
.upload-meta { font-size: 11px; opacity: .75; }

.r2v-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
}
.r2v-preview-item {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-xs);
  overflow: hidden;
  border: 1px solid var(--border-2);
  background: var(--bg);
}
.r2v-preview-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.remove-btn {
  position: absolute;
  top: 3px; right: 3px;
  width: 22px; height: 22px;
  border: 0;
  border-radius: var(--r-xs);
  background: rgba(46, 37, 25, .75);
  color: var(--bg);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.remove-btn:hover { background: var(--red); color: #fff; }

/* --- 高级参数 --- */
.advanced-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-3);
  padding: 8px 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  user-select: none;
  transition: color .15s, border-color .15s;
}
.advanced-toggle:hover { color: var(--text-2); border-color: var(--border-2); }
.advanced-toggle svg { width: 13px; height: 13px; transition: transform .2s; }
.advanced-toggle.open { color: var(--text-2); border-color: var(--border-2); }
.advanced-toggle.open svg { transform: rotate(180deg); }

.advanced-params {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.advanced-params input[type="number"] {
  width: 96px;
  padding: 5px 8px;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xs);
  outline: none;
}
.advanced-params input:focus { border-color: var(--accent); }

/* ============ 右侧：作品流 / 生成态 ============ */
.preview-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 18px;
  overflow-y: auto;
  background: var(--bg);
}

.preview-empty {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100%;
}
.recent-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
  flex: none;
}
.recent-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--text);
}
.recent-note { font-size: 12px; color: var(--text-3); }

.recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(216px, 1fr));
  gap: 14px;
  align-content: start;
}
.recent-item {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .15s;
}
.recent-item:hover { border-color: var(--accent); }
.recent-item video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  background: #000;
  object-fit: cover;
}
.recent-item[data-ratio="9:16"] video {
  aspect-ratio: 9 / 16;
  object-fit: contain;
}
.recent-prompt {
  padding: 9px 11px 10px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.recent-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-3);
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: .06em;
  padding: 64px 0;
}

/* 生成中 */
.preview-queue {
  width: 100%;
  max-width: 460px;
  margin: auto;
  text-align: center;
}
.queue-status {
  font-family: var(--font-display);
  font-size: 13.5px;
  letter-spacing: .12em;
  color: var(--text-2);
  margin-bottom: 12px;
}
.queue-bar { height: 2px; background: var(--surface-3); overflow: hidden; }
.queue-bar span {
  display: block;
  height: 100%;
  width: 35%;
  background: var(--accent);
  animation: sweep 1.4s ease-in-out infinite;
}
@keyframes sweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(390%); }
}

/* 完成 */
.preview-result { width: 100%; margin: auto; display: flex; flex-direction: column; gap: 12px; }
.result-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 72vh;
  object-fit: contain;
  background: #000;
  border: 1px solid var(--border-2);
  display: block;
  margin: 0 auto;
}
body[data-ratio="9:16"] .result-video {
  width: auto;
  max-width: min(100%, 42vh);
  aspect-ratio: 9 / 16;
}
.result-actions { display: flex; gap: 8px; }
.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 11px;
  color: var(--text-3);
}

/* 失败 */
.preview-error {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-3);
  font-size: 13px;
}
.preview-error svg { width: 22px; height: 22px; color: var(--red); }

/* ============ 元信息 ============ */
.gallery-item-meta { display: flex; flex-wrap: wrap; gap: 3px 14px; font-size: 11px; color: var(--text-3); }
.mi { white-space: nowrap; }

/* 画廊卡片「⋯」菜单：删除入口（软删除，数据保留） */
.g-more {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 26px;
  height: 26px;
  padding: 0;
  font-size: 15px;
  line-height: 24px;
  text-align: center;
  color: var(--text-2);
  background: rgba(255, 255, 255, .82);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.g-more:hover { color: var(--text); background: #fff; }
.g-menu {
  position: fixed;
  z-index: 90;
  min-width: 104px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(31, 30, 29, .14);
}
.g-menu-item {
  display: block;
  width: 100%;
  padding: 7px 10px;
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.g-menu-item:hover { background: var(--surface-2); }
.g-menu-del:hover { color: var(--red); }
.gv-delete:not(:disabled):hover { color: var(--red); border-color: var(--red); }

/* 删除确认弹窗（站内风格，替代原生 confirm） */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
}
.confirm-overlay.hidden { display: none; }
.confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 6, 4, .72);
  backdrop-filter: blur(6px);
}
.confirm-card {
  position: relative;
  z-index: 1;
  width: min(360px, calc(100% - 48px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
}
.confirm-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--text);
  margin-bottom: 8px;
}
.confirm-text {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-2);
}
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.btn-danger {
  appearance: none;
  border: 0;
  padding: 8px 18px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--red);
  border-radius: 8px;
  cursor: pointer;
}
.btn-danger:hover { filter: brightness(.92); }

/* ============ 作品页 ============ */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 22px 18px 0;
}
.section-head h1 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .12em;
}
.section-note {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--text-3);
  margin-left: 10px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(224px, 1fr));
  gap: 14px;
  padding: 16px 18px 28px;
}
.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-3);
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: .06em;
  padding: 56px 0;
}
.gallery-item {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .15s;
}
.gallery-item:hover { border-color: var(--accent); }
.gallery-item video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  background: #111;
  object-fit: contain;
}
.gallery-item[data-ratio="9:16"] video {
  aspect-ratio: 16 / 9;
  object-fit: contain;
}
.gallery-item-info { padding: 10px 12px 11px; }
.gallery-item-prompt {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 4px;
}
.gallery-item-prompt.clampable:not(.expanded) {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}
.gallery-item-prompt.expanded {
  max-height: 360px;
  overflow: auto;
}
.prompt-expand {
  appearance: none;
  display: inline-block;
  margin: 0 0 6px;
  padding: 0;
  font: inherit;
  font-size: 11px;
  color: var(--accent);
  background: none;
  border: 0;
  cursor: pointer;
}
.prompt-expand:hover { text-decoration: underline; }

.gallery-viewer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  box-sizing: border-box;
}
.gallery-viewer.hidden { display: none; }
.gv-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(40, 28, 18, .55);
  backdrop-filter: blur(6px);
}
.gv-card {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(92dvh, 920px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px 16px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gv-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.gv-title {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: .1em;
  color: var(--text-2);
}
.gv-video {
  width: 100%;
  max-height: 48dvh;
  background: #000;
  border-radius: var(--r-sm);
  aspect-ratio: 16 / 9;
  object-fit: contain;
}
.gallery-viewer[data-ratio="9:16"] .gv-video {
  aspect-ratio: 9 / 16;
  max-height: 56dvh;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
}
.gv-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}
.ref-images {
  flex: 1 0 100%;
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  box-sizing: border-box;
}
.ref-images-head { margin-bottom: 8px; }
.ref-images-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.ref-thumb {
  margin: 0;
  width: 96px;
}
.ref-thumb a {
  display: block;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: #111;
  aspect-ratio: 1;
}
.ref-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ref-thumb figcaption {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-3);
  text-align: center;
}
.gv-refs .ref-images {
  margin-top: 0;
  padding: 0;
  background: transparent;
  border: 0;
}
.gv-prompt-wrap {
  margin: 0;
  padding: 10px 12px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.gv-prompt-wrap .result-prompt {
  max-height: 28dvh;
  overflow: auto;
}
.gv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.result-prompt-wrap {
  flex: 1 0 100%;
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  box-sizing: border-box;
}
.result-prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.result-prompt {
  margin: 0;
  font: inherit;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: none;
  overflow: visible;
}

/* ============ 登录 ============ */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(46, 37, 25, .45);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  z-index: 100;
}
.login-card {
  width: min(330px, calc(100vw - 40px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 30px 28px 26px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  box-shadow: 0 24px 60px -24px rgba(46, 37, 25, .35);
}
.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .06em;
  text-indent: .06em;
  margin-bottom: 10px;
  color: var(--text);
}
.login-logo svg { width: 20px; height: 20px; color: var(--accent); }
.login-card input {
  padding: 9px 11px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color .15s;
}
.login-card input:focus { border-color: var(--accent); }
.login-card input::placeholder { color: var(--text-3); }
.login-error { font-size: 11px; color: var(--red); min-height: 15px; }
.login-card button {
  appearance: none;
  border: 0;
  padding: 10px;
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .3em;
  text-indent: .3em;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .15s;
}
.login-card button:hover { background: var(--accent-2); }
.login-card .login-back,
.login-card .login-back:hover {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-3);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .04em;
  text-indent: 0;
  padding: 4px;
  margin-top: 2px;
  cursor: pointer;
}
.login-card .login-back:hover { color: var(--text); }

/* stack 变体仅作用于非创作页；创作页固定为 B 工位左右栏（与主主题同步） */
body[data-layout="stack"] .workspace:not(#page-create .workspace) {
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
}
body[data-layout="stack"]:not(:has(#page-create.active)) .input-pane {
  flex-direction: row;
  align-items: flex-start;
  gap: 16px;
  border-right: 0;
  border-bottom: 1px solid var(--border);
  overflow: visible;
}
body[data-layout="stack"] #page-create .workspace {
  grid-template-columns: var(--dock-w) 6px minmax(0, 1fr);
  grid-template-rows: none;
}
body[data-layout="stack"] #page-create .input-pane {
  flex-direction: column;
  border-right: 1px solid var(--border);
  border-bottom: 0;
  overflow: hidden;
}
body[data-layout="stack"] .input-pane .form-group.grow { flex: 1; }
body[data-layout="stack"] .input-pane .form-group:not(.grow) { width: 190px; flex: none; }
body[data-layout="stack"] #page-create .input-pane .form-group:not(.grow) { width: auto; }
body[data-layout="stack"] .input-pane .btn-primary {
  width: 150px;
  flex: none;
  align-self: flex-end;
}
body[data-layout="stack"] #page-create .input-pane .btn-primary {
  width: 100%;
  align-self: stretch;
}
body[data-layout="stack"] .prompt-input { min-height: 76px; }
body[data-layout="stack"] #page-create .prompt-input { min-height: 180px; }

/* ============ 模板 / 参考图序 / 阶段进度 / seed 复用 ============ */
.mode-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tpl-btn { flex: none; font-size: 12.5px; padding: 4px 12px; white-space: nowrap; }
.prompt-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 260px);
  gap: 10px;
  align-items: center;
  min-height: 32px;
}
.prompt-head-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.prompt-head .label { margin: 0; }
.prompt-head-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
@media (max-width: 780px) {
  .prompt-head { grid-template-columns: 1fr; }
}
.rewrite-btn {
  appearance: none;
  flex: none;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: var(--r-sm);
  cursor: pointer;
  white-space: nowrap;
}
.rewrite-btn:hover:not(:disabled) { background: var(--accent-2); }
.rewrite-btn:disabled { opacity: .45; cursor: not-allowed; }
.rewrite-status {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-3);
  letter-spacing: 0;
}

/* ref2v 参考图序号与交换 */
.r2v-preview-item .ref-tag {
  position: absolute;
  left: 3px; bottom: 3px;
  padding: 1px 6px;
  font-size: 10.5px;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: var(--r-xs);
  pointer-events: none;
}
.swap-btn {
  appearance: none;
  grid-column: 1 / -1;
  border: 1px dashed var(--border-2);
  background: transparent;
  color: var(--text-3);
  font: inherit;
  font-size: 11.5px;
  padding: 5px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.swap-btn:hover { color: var(--accent); border-color: var(--accent); }

/* 四段真实进度（stage 由 worker 从 video-api 写回） */
.stage-steps {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px 0;
  margin-top: 14px;
  font-size: 11px;
  color: var(--text-3);
}
.stage-steps[hidden] { display: none; }
.stage-steps .step { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.stage-steps .step + .step::before {
  content: '';
  width: 14px;
  height: 1px;
  background: var(--border-2);
  margin: 0 6px;
}
.stage-steps .step::after {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--border-2);
}
.stage-steps .step.done::after { background: var(--text-3); }
.stage-steps .step.active { color: var(--accent); }
.stage-steps .step.active::after { background: var(--accent); }

/* 结果元信息里的可点项（seed 复用） */
.mi-link {
  color: var(--accent);
  cursor: pointer;
}
.mi-link:hover { text-decoration: underline; }

/* ============ 响应式 ============ */
@media (max-width: 1040px) { :root { --pane-w: 324px; } }

@media (max-width: 780px) {
  body { overflow: auto; }
  #app { height: auto; min-height: 100dvh; }
  .page.active { height: auto; overflow: visible; }
  .main-content { overflow: visible; }
  .topbar { position: sticky; top: 0; z-index: 50; gap: 10px; padding: 0 10px; }
  .logo-text { letter-spacing: .12em; margin-right: -.12em; }
  .nav-item { padding: 5px 8px; }
  .topbar-right { gap: 8px; min-width: 0; }
  .status-indicator { flex: none; }
  #status-text { display: none; }
  .user-name { display: none; }
  #theme-toggle, #logout-btn { flex: none; padding: 5px 8px; }

  .mode-row { height: auto; flex-wrap: wrap; padding: 10px 14px; gap: 10px; }
  .spec-fields { gap: 12px; }

  .workspace { grid-template-columns: 1fr; height: auto; }
  .input-pane { flex-direction: column; border-right: 0; border-bottom: 1px solid var(--border); }
  .input-pane .form-group:not(.grow) { width: auto; }
  .input-pane .btn-primary { width: 100%; align-self: stretch; }
  .preview-panel { min-height: 260px; }
  .recent-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

  .gallery-grid { grid-template-columns: 1fr; padding: 12px 14px 24px; }
  .section-head { padding: 16px 14px 0; }
}

/* ===== 接口页（与 style.css 同一套，避免切到书页后接口文档失去版式） ===== */
.api-wrap { max-width: 860px; margin: 0 auto; padding: 8px 8px 40px; }
.api-note {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 16px; margin: 14px 0 20px; color: var(--text-2); font-size: 13.5px; line-height: 1.7;
}
.api-note code { background: var(--surface-3); border-radius: 4px; padding: 1px 6px; }
.api-block { margin: 0 0 22px; }
.api-block h2 {
  font-size: 15px; margin: 0 0 8px; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.api-block h2 code { font-size: 12.5px; color: var(--accent); background: none; }
.code {
  background: var(--surface-3); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 16px; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 1.8; color: var(--text); white-space: pre-wrap; word-break: break-all;
}
.code-hl { color: var(--accent); font-weight: 600; }
.code-hl-row { color: var(--accent); font-weight: 600; }
.api-fields { margin-top: 6px; font-size: 12.5px; color: var(--text-3); line-height: 1.7; }
.param-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 12.5px; }
.param-table th, .param-table td {
  text-align: left; vertical-align: top;
  padding: 7px 8px; border-bottom: 1px solid var(--border);
  line-height: 1.55;
}
.param-table th { color: var(--text-3); font-weight: 500; white-space: nowrap; }
.param-table td:first-child { white-space: nowrap; }
.param-table code { font-size: 12px; }
.admin-only-tag {
  font-size: 11px; font-weight: 400; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 20px; padding: 1px 8px;
}
.key-issue-row { display: flex; gap: 10px; margin: 4px 0 12px; }
.key-issue-row input {
  flex: 1; background: var(--surface); border: 1px solid var(--border-2); border-radius: 8px;
  padding: 9px 12px; font-size: 13.5px; color: var(--text); outline: none;
}
.key-issue-row input:focus { border-color: var(--accent); }
.key-issue-row .btn-primary { flex-shrink: 0; }
.code-cm { color: var(--text-3); }
.key-new-box {
  background: var(--surface-2); border: 1px dashed var(--accent); border-radius: 10px;
  padding: 12px 16px; margin-bottom: 12px;
}
.key-new-tip { font-size: 13px; color: var(--text); margin-bottom: 8px; }
.key-new-box .code { margin-bottom: 10px; }
.key-table { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.key-row {
  display: grid; grid-template-columns: 1fr 1.2fr 0.9fr 1.2fr 0.5fr 0.7fr 0.6fr;
  gap: 8px; align-items: center; padding: 9px 14px; font-size: 12.5px;
  border-bottom: 1px solid var(--border); color: var(--text-2); background: var(--surface);
}
.key-row:last-child { border-bottom: none; }
.key-head { background: var(--surface-3); color: var(--text-3); font-weight: 600; }
.key-mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.key-st.ok { color: #3a7d44; }
.key-st.revoked { color: var(--text-3); }
.key-revoke { padding: 3px 10px; font-size: 12px; }
.key-empty { padding: 18px; text-align: center; color: var(--text-3); font-size: 13px; }
.key-usage { color: var(--accent); font-weight: 600; }
.gallery-more-wrap { display: flex; justify-content: center; padding: 6px 0 20px; }
@media (max-width: 780px) {
  .key-row { grid-template-columns: 1fr 1fr; row-gap: 2px; }
  .key-head { display: none; }
}

/* ===== 首页 ===== */
body.is-guest .auth-only { display: none !important; }
body:not(.is-guest) .guest-only { display: none !important; }
.home {
  max-width: 880px;
  margin: 0 auto;
  padding: 64px 28px 72px;
}
.home-kicker {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: .18em;
  color: var(--text-3);
}
.home h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 600;
  letter-spacing: .06em;
  line-height: 1.2;
}
.home-lede {
  max-width: 28em;
  margin: 16px 0 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-2);
}
.home-cta {
  appearance: none;
  margin-top: 26px;
  border: 0;
  padding: 11px 22px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.home-cta:hover { background: var(--accent-2); }
.home-intro { margin-top: 42px; max-width: 40em; }
.home-intro h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}
.home-intro p {
  margin: 0 0 12px;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--text);
}
.home-steps {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.home-steps li {
  position: relative;
  margin: 0;
  padding: 8px 0 8px 28px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-2);
  counter-increment: step;
}
.home-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 9px;
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--accent);
}
.home-modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 48px;
}
.home-modes article {
  padding: 16px 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.home-modes h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}
.home-modes p {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-2);
}
.home-modes code { font-size: 12px; }
.home-specs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 28px 0 0;
  padding: 0;
}
.home-specs div { margin: 0; }
.home-specs dt {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--text-3);
}
.home-specs dd {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
}
@media (max-width: 780px) {
  .home { padding: 36px 18px 48px; }
  .home h1 { font-size: 32px; letter-spacing: .04em; }
  .home-modes, .home-specs { grid-template-columns: 1fr; }
}

/* ===== 创作页 · B 剪辑工位（与主主题同步）===== */
#page-create.page { overflow: hidden; }
#page-create .workspace {
  display: grid;
  grid-template-columns: var(--dock-w) 6px minmax(0, 1fr);
  height: 100%;
  overflow: hidden;
  padding: 0;
  gap: 0;
  background: var(--bg);
  align-items: stretch;
}
#page-create .dock-resizer {
  width: 6px;
  cursor: col-resize;
  background: transparent;
  border-left: 1px solid var(--border);
  transition: background .15s;
}
#page-create .dock-resizer:hover,
#page-create .dock-resizer.dragging {
  background: var(--accent-soft);
}
#page-create .dock-resizer:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
#page-create .input-pane {
  width: auto;
  max-width: none;
  height: 100%;
  min-height: 0;
  flex: none;
  gap: 0;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#page-create .dock-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
#page-create .compose-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  background: transparent;
  border-bottom: 0;
}
#page-create .compose-toolbar .mode-main {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
#page-create .compose-toolbar .segmented {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 3px;
  border: 0;
}
#page-create .compose-toolbar .segmented .tab {
  flex: 1 1 auto;
  text-align: center;
  padding: 7px 8px;
  border-radius: var(--r-sm);
}
#page-create .compose-toolbar .tpl-btn { align-self: flex-start; }
#page-create .compose-toolbar .mode-note { margin: 0; }
#page-create .compose-toolbar .mn-desc {
  display: block;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.55;
}
#page-create .dock-scroll > .form-group,
#page-create .dock-scroll > .form-group.grow { padding: 0; }
#page-create .compose-footer {
  flex: none;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
#page-create .input-pane .btn-primary {
  width: 100%;
  padding: 12px;
  font-size: 14.5px;
  letter-spacing: .08em;
  text-indent: 0;
  border-radius: var(--r-md);
  font-weight: 600;
}
#page-create .prompt-head {
  display: flex;
  grid-template-columns: none;
  margin-bottom: 8px;
}
#page-create .label {
  font-family: var(--font);
  letter-spacing: .1em;
  font-size: 11.5px;
}
#page-create .sf-k {
  font-family: var(--font);
  letter-spacing: .08em;
  font-size: 11.5px;
}
#page-create .prompt-compose {
  display: flex;
  flex-direction: column;
  grid-template-columns: none;
  gap: 10px;
  flex: 0 0 auto;
  min-height: 0;
}
#page-create .prompt-compose .prompt-input {
  min-height: 200px;
  padding: 13px 14px;
  font-size: 14px;
  line-height: 1.75;
  border-radius: var(--r-md);
  background: #fff;
}
#page-create .prompt-tips {
  flex: none;
  max-height: 132px;
  overflow-y: auto;
  padding: 10px 12px 9px;
  border-radius: var(--r-md);
  background: var(--surface-2);
}
#page-create .prompt-specs {
  margin-top: 12px;
  padding-top: 12px;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
#page-create .spec-meta { margin-left: 0; font-size: 12px; }
#page-create .tips-title { font-size: 12px; }
#page-create .tips-sub { font-size: 11.5px; }
#page-create .tips-list { gap: 8px; }
#page-create .tips-list li { font-size: 12px; line-height: 1.55; }
#page-create .tip-text { font-size: 12px; }
#page-create .tip-ex { font-size: 11.5px; line-height: 1.5; }
#page-create .tip-fill { font-size: 11.5px; padding: 3px 9px; }
#page-create .input-pane .label { font-size: 12px; }
#page-create .input-pane .sf-k { font-size: 12px; }
#page-create .input-pane .hint { font-size: 12px; }
#page-create .input-pane .tab { font-size: 13px; }
#page-create .input-pane .tpl-btn,
#page-create .input-pane .rewrite-btn { font-size: 12.5px; }
#page-create .input-pane .prompt-input { font-size: 14px; }

/* 提示词结构检查面板 */
#page-create .prompt-check {
  border: 1px solid var(--border);
  border-left: 2px solid var(--amber);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 9px 11px 10px;
  font-size: 12.5px;
}
#page-create .prompt-check.has-error {
  border-left-color: var(--red);
}
#page-create .pc-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}
#page-create .pc-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--text-2);
}
#page-create .pc-sum {
  font-size: 11.5px;
  color: var(--text-3);
}
#page-create .pc-close {
  appearance: none;
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--text-3);
  font: inherit;
  font-size: 15px;
  line-height: 1;
  padding: 2px 4px;
  cursor: pointer;
}
#page-create .pc-close:hover { color: var(--text); }
#page-create .pc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 148px;
  overflow-y: auto;
}
#page-create .pc-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: start;
  line-height: 1.5;
  color: var(--text-2);
}
#page-create .pc-icon {
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  line-height: 1.5;
}
#page-create .pc-error .pc-icon { color: var(--red); }
#page-create .pc-warn .pc-icon { color: var(--amber); }
#page-create .pc-error .pc-text { color: var(--text); }
#page-create .pc-fix {
  appearance: none;
  flex: none;
  border: 1px solid var(--border-2);
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: var(--r-xs);
  cursor: pointer;
  white-space: nowrap;
}
#page-create .pc-fix:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

#page-create .preview-panel {
  width: auto;
  max-width: none;
  height: 100%;
  min-height: 0;
  border: 0;
  background: var(--bg);
  padding: 18px 20px 32px;
  overflow-y: auto;
  box-sizing: border-box;
}
#page-create .preview-empty { justify-content: flex-start; padding: 0; }
#page-create .recent-head { margin: 0 0 14px; }
#page-create .recent-title {
  font-family: var(--font);
  font-size: 15px;
  letter-spacing: .06em;
}
#page-create .recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
#page-create .recent-item { border-radius: var(--r-md); }
#page-create .preview-queue { margin: 48px auto; }
#page-create .preview-result { width: 100%; }
#page-create .input-pane .form-group.grow {
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
@media (max-width: 900px) {
  #page-create .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 52vh) minmax(0, 1fr);
    overflow: hidden;
  }
  #page-create .dock-resizer { display: none; }
  #page-create .input-pane {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    height: auto;
    max-height: 52vh;
  }
  #page-create .preview-panel { height: auto; }
  #page-create .recent-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}
