@font-face {
  font-family: 'Chulian Art Serif';
  src: url('./assets/chulian-art-serif-500.woff2') format('woff2');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

/* 取值复制自 _ref/theme/tokens.css；本样稿新增的间距与动效也集中成变量。 */
:root[data-g20271-chulian] {
  color-scheme: light;
  --font-ui: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-work: var(--font-ui);
  --font-art: 'Source Han Serif SC', 'Songti SC', 'SimSun', serif;
  --font-title: var(--font-ui);
  --cl-art-font: 'Chulian Art Serif', 'Source Han Serif SC', 'Songti SC', serif;
  --bg: #f8f9fa; --surface: #ffffff; --surface-2: #f2f4f5; --surface-3: #e9edf0; --surface-4: #e9edf0;
  --ink: #25282d; --muted: #626b75; --faint: #626b75;
  --line: #e5e8eb; --line-subtle: #e5e8eb; --line-strong: #aeb5bd; --control-line: #aeb5bd;
  --field-bg: #f2f4f5; --field-line: #aeb5bd;
  --accent: #a44e67; --accent-soft: #f3e8ec; --accent-line: #a44e6780; --on-accent: #ffffff; --focus: #8c4759;
  --fill-hover: #e9edf0; --fill-pressed: #dfe4e8; --fill-selected: #f3e8ec;
  --action-primary-bg: #25282d; --action-primary-ink: #ffffff;
  --cl-primary-hover: #3b4047; --cl-primary-active: #15191e; --cl-primary-focus: #eab2bf;
  --cl-spend: #c42d5f; --cl-spend-hover: #b32755; --cl-spend-active: #a92450; --cl-on-spend: #ffffff;
  --cl-selected-hover: #efdee4; --cl-code-bg: #f3e8ec; --cl-code-hover: #efdee4; --cl-code-active: #e1c8d2; --cl-code-ink: #7f344c;
  --error: #a52b2b; --error-soft: #fff0ef;
  --md-seg-on: #ffffff; --md-card: #ffffff; --md-card-hover: #ffffff; --segment-selected: #ffffff;
  --r-panel: 16px; --r-control: 10px; --r-object: 12px; --r-popover: 18px; --r-dialog: 24px; --r-composer: 28px; --r-pill: 999px; --r-circle: 50%; --r-hero: 28px;
  --r-sidebar: 20px; --r-xs: 4px; --r-sm: 8px;
  --control-height-form: 36px; --control-height-toolbar: 32px; --ctl-h: 36px; --ctl-h-sm: 32px;
  --card-bg: var(--surface); --card-border: var(--line); --card-border-width: 1px; --card-gap: 12px;
  --shadow-1: 0 1px 2px #25282d0a; --shadow-2: 0 12px 36px #25282d14; --shadow-3: 0 24px 64px #25282d24; --shadow: var(--shadow-1);
  --cl-motion: 130ms; --cl-expand: 180ms;
  --dur-mode: 130ms; --dur-expand: 180ms; --dur-panel: 220ms; --dur-page: 280ms; --dur-home-send: 320ms; --dur-thinking: 1200ms;
  --ease: cubic-bezier(.2,0,0,1);
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s7: 28px; --s8: 32px; --s9: 36px; --s10: 40px; --s12: 48px; --s14: 56px; --s16: 64px; --s18: 72px; --s20: 80px; --s22: 88px;
  --tool-gap: 6px;
  --text-xs: 12px; --text-sm: 13px; --text-md: 15px; --text-lg: 16px; --text-xl: 20px; --text-2xl: 24px;
  --prototype-h: 56px; --rail-w: 88px; --topbar-h: 64px;
  --motion-hover-y: -2px; --motion-enter-y: 4px; --motion-press-y: 1px; --motion-press-scale: .99;
}

:root[data-g20271-chulian][data-mode='dark'] {
  color-scheme: dark;
  --bg: #101214; --surface: #191c1f; --surface-2: #23272b; --surface-3: #30353b; --surface-4: #30353b;
  --ink: #f3f4f6; --muted: #adb4bc; --faint: #adb4bc;
  --line: #30353b; --line-subtle: #30353b; --line-strong: #737d87; --control-line: #737d87;
  --field-bg: #23272b; --field-line: #737d87;
  --accent: #e2a4b7; --accent-soft: #362b33; --accent-line: #e2a4b780; --on-accent: #191c1f; --focus: #e2a4b7;
  --fill-hover: #30353b; --fill-pressed: #353d46; --fill-selected: #362b33;
  --action-primary-bg: #f3f4f6; --action-primary-ink: #191c1f;
  --cl-primary-hover: #d9dde2; --cl-primary-active: #c6ccd3; --cl-primary-focus: #8c4759;
  --cl-spend: #d6336a; --cl-spend-hover: #e3487b; --cl-spend-active: #c42d5f;
  --cl-selected-hover: #45323e; --cl-code-bg: #362b33; --cl-code-hover: #45323e; --cl-code-active: #563d4b; --cl-code-ink: #f1bfcd;
  --error: #ffa8a1; --error-soft: #3c2526;
  --md-seg-on: #3d434a; --md-card: #23272b; --md-card-hover: #30353b; --segment-selected: #3d434a;
  --shadow-1: none; --shadow-2: 0 12px 36px #00000040; --shadow-3: 0 24px 64px #00000066; --shadow: none;
}

:root[data-window='expanded'] { --rail-w: 72px; }
:root[data-motion='reduced'] {
  --cl-motion: 0ms; --cl-expand: 0ms; --dur-mode: 0ms; --dur-expand: 0ms; --dur-panel: 0ms; --dur-page: 0ms; --dur-home-send: 0ms; --dur-thinking: 0ms;
  --motion-hover-y: 0px; --motion-enter-y: 0px; --motion-press-y: 0px; --motion-press-scale: 1;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; }
html { background: var(--bg); }
body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--text-md);
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea { font: inherit; }
button { color: inherit; }
button, [role='button'] { -webkit-tap-highlight-color: transparent; }
button:not(:disabled), [role='button']:not([aria-disabled='true']) { cursor: pointer; }
button:disabled, [aria-disabled='true'] { cursor: not-allowed; opacity: .52; }
button { border: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
svg { display: block; flex: none; }
img { max-width: 100%; }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
input:focus-visible, textarea:focus-visible { outline: none; }
[hidden] { display: none !important; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border: 2px solid transparent; border-radius: var(--r-pill); background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }
.icon { width: 18px; height: 18px; }
.icon-16 { width: 16px; height: 16px; }
.icon-20 { width: 20px; height: 20px; }
.icon-22 { width: 22px; height: 22px; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.error-text { color: var(--error); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.tabular { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

/* 样稿控制条 */
.prototype-bar {
  position: relative;
  z-index: 100;
  height: var(--prototype-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  padding: var(--s2) var(--s4);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.prototype-identity, .prototype-controls, .prototype-pages, .prototype-scheme, .motion-toggle {
  display: flex;
  align-items: center;
}
.prototype-identity { gap: var(--s2); min-width: 0; white-space: nowrap; }
.prototype-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 var(--s2);
  border-radius: var(--r-xs);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 650;
  letter-spacing: .08em;
}
.prototype-title { font-size: var(--text-sm); font-weight: 600; }
.prototype-noop { color: var(--muted); font-size: var(--text-xs); }
.prototype-pages, .prototype-scheme {
  gap: 0;
  padding: 2px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
}
.prototype-pages button, .prototype-scheme button {
  height: 32px;
  padding: 0 var(--s4);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
}
.prototype-pages button:hover, .prototype-scheme button:hover { color: var(--ink); background: var(--fill-hover); }
.prototype-pages button[aria-current='page'], .prototype-scheme button[aria-pressed='true'] {
  background: var(--md-seg-on);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}
.prototype-controls { gap: var(--s3); }
.prototype-icon {
  width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: var(--r-circle); background: transparent; color: var(--muted);
}
.prototype-icon:hover { background: var(--fill-hover); color: var(--ink); }
.prototype-icon svg { width: 18px; height: 18px; }
.motion-toggle { gap: var(--s2); color: var(--muted); font-size: var(--text-xs); white-space: nowrap; cursor: pointer; }
.motion-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
  position: relative;
  width: 32px; height: 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface-3);
}
.switch-track > span {
  position: absolute; top: 2px; left: 2px; width: 12px; height: 12px;
  border-radius: var(--r-circle); background: var(--surface);
  transform: translateX(0);
  transition: transform var(--cl-motion) var(--ease);
}
.motion-toggle input:checked + .switch-track { background: var(--accent); border-color: var(--accent); }
.motion-toggle input:checked + .switch-track > span { transform: translateX(14px); }
.motion-toggle input:focus-visible + .switch-track { outline: 2px solid var(--focus); outline-offset: 2px; }

/* 全站外壳 */
.app-shell {
  height: calc(100dvh - var(--prototype-h));
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  grid-template-rows: var(--topbar-h) minmax(0, 1fr);
  background: var(--bg);
}
.brand {
  grid-column: 1; grid-row: 1;
  display: flex; align-items: center; justify-content: center; gap: var(--s1);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--accent);
}
.brand-mark svg { width: 28px; height: 28px; }
.brand-word { font-family: var(--cl-art-font); font-size: 18px; font-weight: 500; }
.topbar {
  grid-column: 2; grid-row: 1;
  min-width: 0;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  padding: 0 var(--s6);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.topbar-title { min-width: 0; display: flex; align-items: center; gap: var(--s2); font-size: var(--text-md); font-weight: 600; }
.topbar-title .crumb { color: var(--muted); font-weight: 450; }
.topbar-title .current { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: var(--s3); }
.credit-pill {
  display: inline-flex; align-items: center; gap: var(--s2); height: 36px; padding: 0 var(--s3);
  border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface-2);
  font-size: var(--text-sm); font-weight: 600;
}
.credit-star { color: var(--accent); font-size: 18px; line-height: 1; }
.account-avatar {
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: var(--r-circle);
  background: var(--surface-2); color: var(--muted); font-size: var(--text-xs); font-weight: 650;
}
.rail {
  grid-column: 1; grid-row: 2;
  display: flex; flex-direction: column; align-items: center; gap: var(--s1);
  padding: var(--s3) var(--s2);
  border-right: 1px solid var(--line);
  background: var(--surface);
}
.rail-item {
  width: 100%; min-height: 64px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s1);
  border-radius: var(--r-panel);
  background: transparent; color: var(--muted);
  font-size: var(--text-xs); font-weight: 500;
}
.rail-item svg { width: 22px; height: 22px; }
.rail-item:hover { background: var(--fill-hover); color: var(--ink); }
.rail-item[aria-current='page'] { background: var(--accent-soft); color: var(--accent); }
.rail-spacer { flex: 1; }
.stage {
  position: relative;
  grid-column: 2; grid-row: 2;
  min-width: 0; min-height: 0;
  overflow: hidden;
  background: var(--bg);
}

/* 公共控件 */
.btn {
  min-height: 36px;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  padding: 0 var(--s4);
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--ink);
  font-size: var(--text-sm); font-weight: 500;
  white-space: nowrap;
  transition: transform var(--cl-motion) var(--ease), opacity var(--cl-motion) var(--ease);
}
.btn:hover { background: var(--fill-hover); }
.btn:active { transform: translateY(var(--motion-press-y)) scale(var(--motion-press-scale)); }
.btn.small { min-height: 32px; padding: 0 var(--s3); font-size: var(--text-sm); }
.btn.quiet { background: transparent; color: var(--muted); }
.btn.quiet:hover { color: var(--ink); background: var(--fill-hover); }
.btn.outlined { border-color: var(--line); background: var(--surface); }
.btn.primary { background: var(--action-primary-bg); color: var(--action-primary-ink); border-color: var(--action-primary-bg); }
.btn.primary:hover { background: var(--cl-primary-hover); border-color: var(--cl-primary-hover); }
.btn.spend { background: var(--cl-spend); color: var(--cl-on-spend); border-color: var(--cl-spend); }
.btn.spend:hover { background: var(--cl-spend-hover); border-color: var(--cl-spend-hover); }
.btn.danger { background: transparent; color: var(--error); }
.icon-btn {
  width: 36px; height: 36px; flex: none;
  display: inline-grid; place-items: center;
  border-radius: var(--r-circle); background: transparent; color: var(--muted);
  transition: transform var(--cl-motion) var(--ease), opacity var(--cl-motion) var(--ease);
}
.icon-btn:hover { background: var(--fill-hover); color: var(--ink); }
.icon-btn:active { transform: translateY(var(--motion-press-y)); }
.icon-btn.small { width: 32px; height: 32px; }
.icon-btn svg { width: 18px; height: 18px; }
.seg {
  display: inline-flex; align-items: center; gap: 0;
  padding: 2px; border-radius: var(--r-pill); background: var(--surface-2);
}
.seg > button {
  min-height: 32px; padding: 0 var(--s5); border-radius: var(--r-pill);
  background: transparent; color: var(--muted); font-size: var(--text-sm); font-weight: 500;
}
.seg > button:hover { color: var(--ink); }
.seg > button[aria-pressed='true'] { background: var(--md-seg-on); color: var(--ink); box-shadow: var(--shadow-1); }
.chip {
  display: inline-flex; align-items: center; gap: var(--s1);
  min-height: 28px; padding: 0 var(--s2);
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); color: var(--muted);
  font-size: var(--text-xs); white-space: nowrap;
}
.chip.selected { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s3); }
.section-head h2 { font-size: var(--text-lg); line-height: 24px; font-weight: 600; }
.section-head .section-meta { color: var(--muted); font-size: var(--text-xs); }
.text-button { padding: 0; background: transparent; color: var(--muted); font-size: var(--text-xs); }
.text-button:hover { color: var(--accent); }

/* 主控形象：同一轮廓，四种状态 */
.master-avatar {
  position: relative;
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-object);
  background: var(--accent-soft);
  color: var(--accent);
}
.master-avatar.large { width: 44px; height: 44px; border-radius: var(--r-panel); }
.master-avatar svg { width: 22px; height: 22px; overflow: visible; }
.master-avatar.large svg { width: 28px; height: 28px; }
.master-avatar .thinking-dot { opacity: .35; }
.master-avatar.state-thinking .thinking-dot { animation: master-thinking var(--dur-thinking) var(--ease) infinite; }
.master-avatar.state-thinking .thinking-dot:nth-of-type(2) { animation-delay: 120ms; }
.master-avatar.state-thinking .thinking-dot:nth-of-type(3) { animation-delay: 240ms; }
.master-avatar .orbit {
  transform-origin: 16px 16px;
  animation: master-orbit var(--dur-thinking) linear infinite;
}
.master-avatar.state-idle .orbit, .master-avatar.state-waiting .orbit, .master-avatar.state-thinking .orbit { display: none; }
.master-avatar .wait-mark { display: none; }
.master-avatar.state-waiting .wait-mark { display: block; }
.master-avatar.state-waiting { border-style: dashed; }
@keyframes master-thinking { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-1px); } }
@keyframes master-orbit { to { transform: rotate(360deg); } }

/* 首页 */
.home-page { height: 100%; overflow-y: auto; padding: var(--s10) var(--s6) var(--s16); }
.home-content { width: 100%; max-width: 880px; margin: 0 auto; }
.home-hero { text-align: center; }
.art-title {
  font-family: var(--cl-art-font);
  font-size: 48px;
  line-height: 60px;
  font-weight: 500;
  letter-spacing: .02em;
}
.home-tabs { margin: var(--s4) auto var(--s7); }
.home-tabs.seg { display: flex; width: 192px; }
.home-tabs > button { flex: 1; }
.quick-cards { display: grid; grid-template-columns: 1.45fr 1fr 1fr; gap: var(--s3); margin-bottom: var(--s5); }
.quick-card {
  position: relative;
  min-width: 0; height: 108px;
  display: flex; flex-direction: column; justify-content: space-between; align-items: stretch;
  padding: var(--s4);
  overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-panel);
  background: var(--surface); color: var(--ink); text-align: left;
  box-shadow: var(--shadow-1);
  transition: transform var(--cl-motion) var(--ease), opacity var(--cl-motion) var(--ease);
}
.quick-card:hover { transform: translateY(var(--motion-hover-y)); border-color: var(--line-strong); }
.quick-card:active { transform: translateY(var(--motion-press-y)); }
.quick-card[aria-pressed='true'] { border-color: var(--accent); background: var(--accent-soft); }
.quick-card-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); }
.quick-card-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r-control); background: var(--surface-2); color: var(--accent); }
.quick-card[aria-pressed='true'] .quick-card-icon { background: var(--surface); }
.quick-card-title { position: relative; z-index: 1; display: flex; align-items: center; gap: var(--s2); font-size: var(--text-lg); line-height: 24px; font-weight: 600; }
.quick-card-desc { position: relative; z-index: 1; margin-top: var(--s1); color: var(--muted); font-size: var(--text-xs); line-height: 16px; }
.quick-card-watermark { position: absolute; right: var(--s4); bottom: var(--s3); color: var(--line); opacity: .6; }
.quick-card-watermark svg { width: 56px; height: 56px; }
.home-composer-zone { position: relative; }
.home-composer-wrap { display: flex; justify-content: center; }
.skill-suggestions { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows var(--dur-expand) var(--ease), opacity var(--dur-expand) var(--ease); }
.skill-suggestions.is-open { grid-template-rows: 1fr; opacity: 1; }
.skill-suggestions-inner { min-height: 0; overflow: hidden; }
.skill-suggestions-list { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: var(--s2); padding-top: var(--s3); }
.skill-pill {
  min-height: 32px; display: inline-flex; align-items: center; gap: var(--s2);
  padding: 0 var(--s3); border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); color: var(--muted); font-size: var(--text-xs);
}
.skill-pill:hover { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.skill-pill .slash { color: var(--accent); font-weight: 650; }
.home-recent { margin-top: var(--s8); }
.recent-projects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.project-card {
  min-width: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface);
  text-align: left; box-shadow: var(--shadow-1);
  transition: transform var(--cl-motion) var(--ease), opacity var(--cl-motion) var(--ease);
}
.project-card:hover { transform: translateY(var(--motion-hover-y)); border-color: var(--line-strong); }
.project-card-art { position: relative; aspect-ratio: 16 / 7; overflow: hidden; background: var(--surface-2); }
.project-card-art svg { width: 100%; height: 100%; }
.project-card-body { padding: var(--s3); }
.project-card-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; line-height: 20px; font-weight: 550; }
.project-card-meta { margin-top: var(--s1); color: var(--muted); font-size: var(--text-xs); line-height: 16px; }
.recent-episodes { overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface); }
.recent-episode {
  width: 100%; min-height: 64px;
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; align-items: center; gap: var(--s3);
  padding: var(--s2) var(--s4);
  border-bottom: 1px solid var(--line); background: transparent; text-align: left;
}
.recent-episode:last-child { border-bottom: 0; }
.recent-episode:hover { background: var(--surface-2); }
.episode-number { color: var(--accent); font-size: var(--text-sm); font-weight: 650; font-variant-numeric: tabular-nums; }
.episode-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 500; }
.episode-project, .episode-state { color: var(--muted); font-size: var(--text-xs); white-space: nowrap; }

/* 同一个输入组件 */
.composer {
  position: relative;
  width: 100%; min-height: 132px; max-height: 40dvh;
  display: flex; flex-direction: column;
  padding: var(--s4) var(--s5) var(--s3);
  border: 1px solid var(--field-line);
  border-radius: var(--r-composer);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  color: var(--ink);
}
.home-page .composer { max-width: 100%; }
.home-page .composer.is-collapsed { width: calc(100% - 64px); }
.composer.is-collapsed { min-height: 56px; height: 56px; max-height: 56px; padding: 0 var(--s3) 0 var(--s5); }
.composer:focus-within { border-color: var(--focus); }
.composer.has-error { border-color: var(--error); }
.composer.is-dragging { border-color: var(--accent); background: var(--accent-soft); }
.composer-attachments { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s2); }
.attachment-chip {
  max-width: 100%; min-height: 28px;
  display: inline-flex; align-items: center; gap: var(--s1);
  padding: 2px var(--s2); border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--muted); font-size: var(--text-xs);
}
.attachment-chip > span { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-chip button { width: 20px; height: 20px; display: grid; place-items: center; padding: 0; border-radius: var(--r-circle); background: transparent; color: var(--muted); }
.attachment-chip button:hover { background: var(--fill-hover); color: var(--ink); }
.attachment-chip svg { width: 14px; height: 14px; }
.composer-main { flex: 1; min-height: 32px; display: flex; align-items: center; gap: var(--s2); }
.composer:not(.is-collapsed) .composer-main { align-items: stretch; }
.composer-writing { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: var(--s3); }
.composer.is-collapsed .composer-writing { align-items: center; }
.composer textarea {
  flex: 1; min-width: 0; width: 100%; min-height: 52px; max-height: 216px;
  padding: 0; resize: none; overflow-y: auto;
  border: 0; border-radius: 0; background: transparent; color: var(--ink);
  font-size: var(--text-md); line-height: 24px;
}
.composer.is-collapsed textarea { min-height: 24px; height: 24px; max-height: 24px; overflow: hidden; white-space: nowrap; }
.composer textarea::placeholder { color: var(--muted); opacity: 1; }
.reference-slot-add {
  width: 44px; height: 52px; flex: none;
  display: grid; place-items: center;
  border: 1px dashed var(--line-strong); border-radius: var(--r-control);
  background: var(--surface-2); color: var(--muted);
}
.reference-slot-add:hover { border-color: var(--accent); color: var(--accent); }
.reference-slot-add svg { width: 18px; height: 18px; }
.composer-ref-stack { display: flex; align-items: center; gap: var(--s1); flex: none; }
.composer-ref-thumb { position: relative; width: 44px; height: 52px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-control); background: var(--surface-2); }
.composer-ref-thumb svg { width: 100%; height: 100%; }
.composer-ref-thumb button { position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; display: grid; place-items: center; padding: 0; border-radius: var(--r-circle); background: var(--surface); color: var(--muted); box-shadow: var(--shadow-1); }
.composer-ref-thumb button svg { width: 12px; height: 12px; }
.collapsed-send { flex: none; margin-left: var(--s2); }
.composer:not(.is-collapsed) .collapsed-send { display: none; }
.composer-toolbar-wrap { display: grid; grid-template-rows: 1fr; opacity: 1; transition: grid-template-rows var(--dur-expand) var(--ease), opacity var(--dur-expand) var(--ease); }
.composer-toolbar-inner { min-height: 0; overflow: hidden; }
.composer.is-collapsed .composer-toolbar-wrap { grid-template-rows: 0fr; opacity: 0; }
.composer.is-collapsed .composer-attachments, .composer.is-collapsed .composer-error, .composer.is-collapsed .queue-row, .composer.is-collapsed .reference-slot-add, .composer.is-collapsed .composer-ref-stack { display: none; }
.composer-toolbar { min-height: 36px; display: flex; align-items: center; gap: var(--s2); padding-top: var(--s2); }
.toolbar-tools { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--tool-gap); overflow-x: auto; scrollbar-width: none; }
.toolbar-tools::-webkit-scrollbar { display: none; }
.tool-btn {
  height: 32px; flex: none;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s1);
  padding: 0 10px;
  border: 1px solid transparent; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--muted);
  font-size: var(--text-sm); line-height: 20px; white-space: nowrap;
}
.tool-btn:hover { background: var(--fill-hover); color: var(--ink); }
.tool-btn[aria-expanded='true'], .tool-btn[aria-pressed='true'] { background: var(--accent-soft); color: var(--accent); }
.tool-btn.mode { background: var(--accent-soft); color: var(--accent); font-weight: 550; }
.tool-btn.quiet { background: transparent; }
.tool-btn svg { width: 18px; height: 18px; }
.tool-btn .chevron { width: 14px; height: 14px; }
.toolbar-actions { flex: none; display: flex; align-items: center; gap: var(--s2); }
.composer-cost { display: flex; flex-direction: column; align-items: flex-end; color: var(--ink); font-size: var(--text-xs); line-height: 16px; white-space: nowrap; }
.composer-cost strong { color: var(--cl-spend); font-weight: 600; }
.composer-cost small { color: var(--muted); font-size: 10px; line-height: 12px; }
.send-button {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-circle); background: var(--action-primary-bg); color: var(--action-primary-ink);
  transition: transform var(--cl-motion) var(--ease), opacity var(--cl-motion) var(--ease);
}
.send-button:hover { background: var(--cl-primary-hover); }
.send-button:active { transform: translateY(var(--motion-press-y)) scale(var(--motion-press-scale)); }
.send-button svg { width: 18px; height: 18px; }
.send-button.script { width: auto; min-width: 116px; padding: 0 var(--s4); border-radius: var(--r-pill); background: var(--cl-spend); color: var(--cl-on-spend); font-size: var(--text-sm); }
.send-button.script:hover { background: var(--cl-spend-hover); }
.composer-error { display: flex; align-items: flex-start; gap: var(--s1); margin-top: var(--s2); color: var(--error); font-size: var(--text-xs); line-height: 16px; }
.composer-error svg { width: 16px; height: 16px; margin-top: 0; }
.queue-row { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s2); color: var(--muted); font-size: var(--text-xs); }
.drag-hint { display: none; position: absolute; inset: 0; z-index: 2; place-items: center; border-radius: inherit; background: var(--accent-soft); color: var(--accent); font-weight: 600; pointer-events: none; }
.composer.is-dragging .drag-hint { display: grid; }
.composer.compact { padding: var(--s3) var(--s4) var(--s2); border-radius: var(--r-sidebar); }
.composer.compact .tool-btn { padding: 0 var(--s2); }
.composer.compact .composer-cost small { display: none; }

/* 创作页：会话 / 对话 / 参数 */
.create-page { height: 100%; display: grid; grid-template-columns: 224px minmax(0, 1fr) auto; min-width: 0; min-height: 0; }
.history-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--surface); }
.history-head { padding: var(--s4) var(--s4) var(--s3); }
.history-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s3); }
.history-title-row h2 { font-size: var(--text-lg); font-weight: 600; }
.search-field {
  height: 36px; display: flex; align-items: center; gap: var(--s2);
  padding: 0 var(--s3); border: 1px solid var(--line); border-radius: var(--r-control); background: var(--field-bg); color: var(--muted);
}
.search-field:focus-within { border-color: var(--focus); }
.search-field svg { width: 16px; height: 16px; }
.search-field input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: transparent; color: var(--ink); font-size: var(--text-sm); }
.search-field input::placeholder { color: var(--muted); }
.history-filters { display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: var(--s3); }
.history-filter { min-height: 28px; padding: 0 var(--s2); border-radius: var(--r-pill); background: transparent; color: var(--muted); font-size: var(--text-xs); }
.history-filter:hover { background: var(--fill-hover); color: var(--ink); }
.history-filter[aria-pressed='true'] { background: var(--accent-soft); color: var(--accent); }
.history-count { padding: 0 var(--s4) var(--s2); color: var(--muted); font-size: var(--text-xs); }
.history-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 var(--s2) var(--s3); }
.history-group h3 { margin: var(--s3) var(--s2) var(--s1); color: var(--muted); font-size: var(--text-xs); line-height: 16px; font-weight: 500; }
.history-item {
  width: 100%; display: flex; align-items: flex-start; gap: var(--s2);
  padding: 10px var(--s2); border-radius: var(--r-object); background: transparent; text-align: left;
}
.history-item:hover { background: var(--fill-hover); }
.history-item[aria-current='true'] { background: var(--accent-soft); }
.history-item-icon { width: 28px; height: 28px; display: grid; place-items: center; flex: none; border-radius: var(--r-sm); background: var(--surface-2); color: var(--muted); }
.history-item[aria-current='true'] .history-item-icon { background: var(--surface); color: var(--accent); }
.history-item-icon svg { width: 16px; height: 16px; }
.history-item-text { flex: 1; min-width: 0; }
.history-item-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; line-height: 20px; font-weight: 500; }
.history-item-meta { margin-top: 2px; color: var(--muted); font-size: var(--text-xs); line-height: 16px; }
.history-empty { padding: var(--s8) var(--s4); color: var(--muted); text-align: center; font-size: var(--text-sm); }
.history-empty .btn { margin-top: var(--s3); }
.history-footer { padding: var(--s3); border-top: 1px solid var(--line); }
.history-footer .btn { width: 100%; }
.chat-column { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--bg); }
.chat-header { min-width: 0; min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 0 var(--s5); border-bottom: 1px solid var(--line); background: var(--surface); }
.chat-header-title { min-width: 0; display: flex; align-items: center; gap: var(--s2); }
.chat-header-title h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-md); line-height: 24px; font-weight: 600; }
.chat-header-actions { display: flex; align-items: center; gap: var(--s1); }
.mobile-history-button { display: none; }
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; scroll-padding-bottom: var(--s6); }
.chat-content { width: 100%; max-width: 808px; margin: 0 auto; padding: var(--s6); display: flex; flex-direction: column; gap: var(--s6); }
.chat-footer { flex: none; padding: var(--s3) var(--s6) var(--s4); background: var(--bg); }
.chat-footer-inner { width: 100%; max-width: 760px; margin: 0 auto; }
.chat-hint { display: flex; justify-content: center; gap: var(--s3); margin-top: var(--s2); color: var(--muted); font-size: var(--text-xs); line-height: 16px; }
.chat-hint span { display: inline-flex; align-items: center; gap: var(--s1); }
.keycap { min-width: 20px; height: 20px; display: inline-grid; place-items: center; padding: 0 var(--s1); border: 1px solid var(--line); border-radius: var(--r-xs); background: var(--surface); font-size: 11px; line-height: 16px; }
.params-panel { width: 360px; min-width: 0; min-height: 0; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--surface); }
.params-header { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 0 var(--s4); border-bottom: 1px solid var(--line); }
.params-header-title { display: flex; align-items: center; gap: var(--s2); }
.params-header h2 { font-size: var(--text-md); font-weight: 600; }
.params-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 var(--s4); }
.param-section { padding: var(--s4) 0; border-bottom: 1px solid var(--line); }
.param-section:last-child { border-bottom: 0; }
.param-section h3 { margin-bottom: var(--s3); font-size: var(--text-sm); line-height: 20px; font-weight: 600; }
.param-section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s3); }
.param-section-head h3 { margin: 0; }
.param-label { display: block; margin-bottom: var(--s2); color: var(--muted); font-size: var(--text-xs); line-height: 16px; }
.field-select {
  width: 100%; min-height: 44px;
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s2) var(--s3); border: 1px solid var(--field-line); border-radius: var(--r-object); background: var(--field-bg); text-align: left;
}
.field-select:hover { border-color: var(--focus); }
.field-select .field-leading { width: 32px; height: 32px; display: grid; place-items: center; flex: none; border-radius: var(--r-control); background: var(--surface); color: var(--accent); }
.field-select .field-copy { flex: 1; min-width: 0; }
.field-select .field-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; line-height: 20px; font-weight: 550; }
.field-select .field-desc { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: var(--text-xs); line-height: 16px; }
.model-details { margin-top: var(--s2); padding: var(--s3); border-radius: var(--r-object); background: var(--surface-2); color: var(--muted); font-size: var(--text-xs); line-height: 20px; }
.model-details strong { color: var(--ink); font-weight: 550; }
.template-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.template-actions .btn { padding: 0 var(--s2); }
.param-ref-grid { display: flex; flex-wrap: wrap; gap: var(--s2); }
.param-ref-item { position: relative; width: 64px; height: 72px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-object); background: var(--surface-2); }
.param-ref-item svg { width: 100%; height: 100%; }
.param-ref-item .ref-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px var(--s1); background: var(--surface); color: var(--muted); font-size: 10px; line-height: 14px; text-align: center; }
.param-ref-item .ref-remove { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; display: grid; place-items: center; padding: 0; border-radius: var(--r-circle); background: var(--surface); color: var(--muted); }
.param-ref-item .ref-remove svg { width: 12px; height: 12px; }
.param-ref-add { width: 64px; height: 72px; display: grid; place-items: center; border: 1px dashed var(--line-strong); border-radius: var(--r-object); background: transparent; color: var(--muted); }
.param-ref-add:hover { border-color: var(--accent); color: var(--accent); }
.audio-ref-row { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s3); }
.audio-ref { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s2); padding: var(--s2); border: 1px solid var(--line); border-radius: var(--r-object); background: var(--surface-2); }
.audio-ref .audio-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r-control); background: var(--surface); color: var(--accent); }
.audio-ref .audio-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-xs); }
.choice-grid { display: flex; flex-wrap: wrap; gap: var(--s2); }
.choice {
  min-height: 32px; display: inline-flex; align-items: center; justify-content: center; gap: var(--s1);
  padding: 0 var(--s3); border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--muted); font-size: var(--text-xs); white-space: nowrap;
}
.choice:hover { border-color: var(--line-strong); color: var(--ink); }
.choice[aria-pressed='true'], .choice[aria-selected='true'] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.choice:disabled { text-decoration: line-through; }
.ratio-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.ratio-choices .choice { padding: 0 var(--s2); }
.ratio-shape { display: inline-block; border: 1.5px solid currentColor; border-radius: var(--r-xs); }
.range-row { display: flex; align-items: center; gap: var(--s3); }
.range-row output { min-width: 48px; color: var(--ink); font-size: var(--text-sm); text-align: right; font-variant-numeric: tabular-nums; }
input[type='range'] {
  flex: 1; min-width: 0; height: 24px; margin: 0; appearance: none; background: transparent;
}
input[type='range']::-webkit-slider-runnable-track { height: 4px; border-radius: var(--r-pill); background: var(--surface-3); }
input[type='range']::-webkit-slider-thumb { width: 16px; height: 16px; margin-top: -6px; appearance: none; border: 2px solid var(--surface); border-radius: var(--r-circle); background: var(--accent); box-shadow: var(--shadow-1); }
input[type='range']::-moz-range-track { height: 4px; border-radius: var(--r-pill); background: var(--surface-3); }
input[type='range']::-moz-range-thumb { width: 12px; height: 12px; border: 2px solid var(--surface); border-radius: var(--r-circle); background: var(--accent); }
.setting-row { min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: var(--s4); }
.setting-row + .setting-row { margin-top: var(--s2); }
.setting-copy strong { display: block; font-size: var(--text-sm); line-height: 20px; font-weight: 500; }
.setting-copy small { display: block; color: var(--muted); font-size: var(--text-xs); line-height: 16px; }
.switch-button { position: relative; width: 36px; height: 20px; flex: none; border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface-3); }
.switch-button::after { content: ''; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: var(--r-circle); background: var(--surface); transform: translateX(0); transition: transform var(--cl-motion) var(--ease); }
.switch-button[aria-pressed='true'] { border-color: var(--accent); background: var(--accent); }
.switch-button[aria-pressed='true']::after { transform: translateX(16px); }
.accordion { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows var(--dur-expand) var(--ease), opacity var(--dur-expand) var(--ease); }
.accordion.is-open { grid-template-rows: 1fr; opacity: 1; }
.accordion-inner { min-height: 0; overflow: hidden; }
.accordion-content { padding-top: var(--s3); color: var(--muted); font-size: var(--text-xs); line-height: 20px; }
.material-list { display: flex; flex-direction: column; gap: var(--s2); }
.material-row { display: flex; align-items: center; gap: var(--s2); color: var(--muted); font-size: var(--text-xs); }
.material-row svg { width: 16px; height: 16px; color: var(--accent); }
.material-row strong { margin-left: auto; color: var(--ink); font-weight: 500; }
.params-footer { padding: var(--s4); border-top: 1px solid var(--line); background: var(--surface); }
.params-quote { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
.params-quote-label { color: var(--muted); font-size: var(--text-xs); }
.params-quote-value { color: var(--cl-spend); font-size: var(--text-xl); line-height: 28px; font-weight: 650; font-variant-numeric: tabular-nums; }
.params-quote-note { color: var(--muted); font-size: 10px; line-height: 14px; text-align: right; }
.params-footer .btn { width: 100%; }

/* 对话内容 */
.message { display: flex; align-items: flex-start; gap: var(--s3); min-width: 0; }
.message-user { justify-content: flex-end; }
.user-bubble { max-width: 84%; padding: var(--s3) var(--s4); border-radius: var(--r-panel) var(--r-panel) var(--r-xs) var(--r-panel); background: var(--surface-3); color: var(--ink); font-size: var(--text-md); line-height: 24px; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-body { flex: 1; min-width: 0; }
.message-meta { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s2); color: var(--muted); font-size: var(--text-xs); line-height: 16px; }
.message-meta strong { color: var(--ink); font-weight: 550; }
.message-meta .task-model { display: inline-flex; align-items: center; gap: var(--s1); padding: 2px var(--s2); border-radius: var(--r-pill); background: var(--surface-2); color: var(--muted); }
.rich-text { color: var(--ink); font-size: var(--text-md); line-height: 24px; overflow-wrap: anywhere; }
.rich-text > * + * { margin-top: var(--s3); }
.rich-text h2 { font-size: var(--text-xl); line-height: 28px; font-weight: 600; }
.rich-text h3 { margin-top: var(--s4); font-size: var(--text-lg); line-height: 24px; font-weight: 600; }
.rich-text ul { margin: 0; padding-left: var(--s5); }
.rich-text li + li { margin-top: var(--s2); }
.rich-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-object); }
.rich-table { width: 100%; min-width: 440px; border-collapse: collapse; font-size: var(--text-sm); line-height: 20px; }
.rich-table th, .rich-table td { padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.rich-table th { background: var(--surface-2); color: var(--muted); font-weight: 550; }
.rich-table tr:last-child td { border-bottom: 0; }
.process-line { display: inline-flex; align-items: center; gap: var(--s2); max-width: 100%; padding: var(--s2) var(--s3); border: 1px solid var(--line); border-radius: var(--r-object); background: var(--surface-2); color: var(--muted); font-size: var(--text-sm); line-height: 20px; }
.process-line svg { color: var(--accent); }
.result-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface); box-shadow: var(--shadow-1); }
.result-topline { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s4); }
.reference-stack { position: relative; width: 68px; height: 52px; flex: none; }
.stacked-ref { position: absolute; width: 40px; height: 48px; overflow: hidden; border: 2px solid var(--surface); border-radius: var(--r-sm); background: var(--surface-2); box-shadow: var(--shadow-1); }
.stacked-ref:nth-child(1) { left: 0; top: 2px; transform: rotate(-5deg); }
.stacked-ref:nth-child(2) { left: 20px; top: 0; transform: rotate(4deg); }
.stacked-ref svg { width: 100%; height: 100%; }
.result-prompt-wrap { flex: 1; min-width: 0; }
.result-prompt { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; color: var(--ink); font-size: 14px; line-height: 22px; overflow-wrap: anywhere; }
.result-prompt.is-expanded { display: block; }
.prompt-toggle { margin-top: var(--s1); padding: 0; background: transparent; color: var(--muted); font-size: var(--text-xs); }
.prompt-toggle:hover { color: var(--accent); }
.result-model-line { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); color: var(--muted); font-size: var(--text-xs); line-height: 16px; }
.result-media { position: relative; overflow: hidden; background: var(--surface-2); }
.result-media svg.artwork { width: 100%; height: auto; }
.image-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s1); padding: var(--s1); }
.image-grid .art-tile { position: relative; min-width: 0; overflow: hidden; border-radius: var(--r-control); background: var(--surface-2); }
.image-grid .art-tile svg { width: 100%; height: auto; }
.video-cover { position: relative; aspect-ratio: 16 / 9; }
.video-cover > svg { width: 100%; height: 100%; }
.play-button { position: absolute; inset: 0; display: grid; place-items: center; width: 100%; background: transparent; }
.play-button > span { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--r-circle); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); transition: transform var(--cl-motion) var(--ease); }
.play-button:hover > span { transform: scale(1.04); }
.play-button svg { width: 22px; height: 22px; margin-left: 2px; }
.media-label { position: absolute; left: var(--s3); bottom: var(--s3); display: inline-flex; align-items: center; min-height: 24px; padding: 0 var(--s2); border: 1px solid var(--line); border-radius: var(--r-xs); background: var(--surface); color: var(--muted); font-size: var(--text-xs); }
.result-status { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2); padding: 0 var(--s4) var(--s3); color: var(--muted); font-size: var(--text-sm); line-height: 20px; }
.result-status.success { color: var(--ink); }
.result-status.error { color: var(--error); }
.result-actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2); padding: 0 var(--s4) var(--s4); }
.failure-card { padding: var(--s4); border: 1px solid var(--error); border-radius: var(--r-panel); background: var(--error-soft); }
.failure-head { display: flex; align-items: flex-start; gap: var(--s3); }
.failure-icon { width: 32px; height: 32px; display: grid; place-items: center; flex: none; border-radius: var(--r-circle); background: var(--surface); color: var(--error); }
.failure-copy { flex: 1; min-width: 0; }
.failure-copy h3 { color: var(--error); font-size: var(--text-md); line-height: 24px; font-weight: 600; }
.failure-copy p { margin-top: var(--s1); color: var(--muted); font-size: var(--text-sm); line-height: 20px; }
.failure-card .result-actions { padding: var(--s3) 0 0 44px; }
.confirmation-card { padding: var(--s5); border: 1px solid var(--accent-line); border-radius: var(--r-panel); background: var(--surface); box-shadow: var(--shadow-1); }
.confirmation-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); }
.confirmation-head h3 { font-size: var(--text-lg); line-height: 24px; font-weight: 600; }
.confirmation-head p { margin-top: var(--s1); color: var(--muted); font-size: var(--text-xs); line-height: 16px; }
.quote-list { margin: var(--s4) 0; padding: var(--s3); border-radius: var(--r-object); background: var(--surface-2); }
.quote-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); color: var(--muted); font-size: var(--text-sm); line-height: 24px; }
.quote-row strong { color: var(--ink); font-weight: 500; text-align: right; }
.quote-total { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s4); }
.quote-total-value { color: var(--cl-spend); font-size: var(--text-2xl); line-height: 32px; font-weight: 650; }
.quote-total-note { color: var(--muted); font-size: var(--text-xs); line-height: 16px; text-align: right; }
.confirmation-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.steps-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface); }
.steps-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4); border-bottom: 1px solid var(--line); }
.steps-head h3 { font-size: var(--text-md); font-weight: 600; }
.steps-head span { color: var(--muted); font-size: var(--text-xs); }
.step-list { padding: var(--s2) var(--s4); }
.step-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: var(--s3); min-height: 64px; border-bottom: 1px solid var(--line); }
.step-row:last-child { border-bottom: 0; }
.step-mark { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: var(--r-circle); color: var(--muted); font-size: var(--text-xs); }
.step-row.done .step-mark { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.step-row.running .step-mark { border-color: var(--accent); color: var(--accent); }
.step-copy strong { display: block; font-size: 14px; line-height: 20px; font-weight: 500; }
.step-copy small { display: block; color: var(--muted); font-size: var(--text-xs); line-height: 16px; }
.step-cost { color: var(--muted); font-size: var(--text-xs); white-space: nowrap; }
.steps-total { display: flex; align-items: center; justify-content: space-between; padding: var(--s3) var(--s4); background: var(--surface-2); color: var(--muted); font-size: var(--text-xs); }
.steps-total strong { color: var(--cl-spend); font-weight: 600; }
.empty-chat { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--s8); text-align: center; }
.empty-chat h2 { margin-top: var(--s4); font-family: var(--cl-art-font); font-size: 28px; line-height: 36px; font-weight: 500; }
.empty-chat p { margin-top: var(--s2); color: var(--muted); font-size: var(--text-sm); }
.empty-chat .skill-suggestions-list { margin-top: var(--s4); }

/* 项目桌面与右侧主控 */
.project-page { --sidebar-width: 400px; height: 100%; display: flex; min-width: 0; min-height: 0; }
.project-workspace { position: relative; flex: 1; min-width: 0; min-height: 0; overflow-y: auto; padding: var(--s6); background: var(--surface-2); }
.project-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); }
.project-eyebrow { color: var(--muted); font-size: var(--text-xs); line-height: 16px; }
.project-header h1 { margin-top: var(--s1); font-size: var(--text-2xl); line-height: 32px; font-weight: 600; }
.project-header-actions { display: flex; align-items: center; gap: var(--s2); }
.workflow-strip { display: grid; grid-template-columns: repeat(5, minmax(104px, 1fr)); gap: var(--s2); margin-bottom: var(--s6); }
.workflow-node { position: relative; min-width: 0; padding: var(--s3); border: 1px solid var(--line); border-radius: var(--r-object); background: var(--surface); }
.workflow-node:not(:last-child)::after { content: ''; position: absolute; top: 50%; right: calc(-1 * var(--s2)); width: var(--s2); height: 1px; background: var(--line-strong); }
.workflow-node-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); color: var(--muted); }
.workflow-node-top svg { width: 16px; height: 16px; }
.workflow-node strong { display: block; margin-top: var(--s2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-sm); line-height: 20px; font-weight: 550; }
.workflow-node small { display: block; margin-top: var(--s1); color: var(--muted); font-size: var(--text-xs); line-height: 16px; }
.workflow-node.current { border-color: var(--accent-line); background: var(--accent-soft); }
.workflow-node.current .workflow-node-top { color: var(--accent); }
.project-board-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
.project-board-head h2 { font-size: var(--text-lg); font-weight: 600; }
.episode-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.episode-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface); text-align: left; }
.episode-card:hover { border-color: var(--line-strong); }
.episode-card-art { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-3); }
.episode-card-art svg { width: 100%; height: 100%; }
.episode-card-copy { padding: var(--s3); }
.episode-card-title { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.episode-card-title strong { font-size: 14px; line-height: 20px; font-weight: 550; }
.episode-card-title span { color: var(--muted); font-size: var(--text-xs); }
.episode-card-copy p { margin-top: var(--s2); color: var(--muted); font-size: var(--text-xs); line-height: 20px; }
.episode-card-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-top: var(--s3); color: var(--muted); font-size: var(--text-xs); }
.project-note-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--s3); margin-top: var(--s6); }
.project-note-card { padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface); }
.project-note-card h3 { font-size: var(--text-sm); font-weight: 600; }
.project-note-card p { margin-top: var(--s2); color: var(--muted); font-size: var(--text-xs); line-height: 20px; }
.master-capsule {
  position: absolute; right: var(--s6); bottom: var(--s6); z-index: 10;
  height: 44px; display: flex; align-items: center; gap: var(--s2);
  padding: 0 var(--s4); border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); font-size: 14px; font-weight: 550;
  transition: transform var(--cl-motion) var(--ease), opacity var(--dur-panel) var(--ease);
}
.master-capsule:hover { transform: translateY(var(--motion-hover-y)); border-color: var(--accent); }
.capsule-dot { width: 8px; height: 8px; border: 2px solid var(--accent-soft); border-radius: var(--r-circle); background: var(--accent); box-sizing: content-box; }
.project-master { position: relative; width: var(--sidebar-width); flex: none; min-width: 0; min-height: 0; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--surface-2); }
.project-master.entering { animation: side-panel-in var(--dur-panel) var(--ease) both; }
@keyframes side-panel-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
.sidebar-resizer { position: absolute; z-index: 8; left: -4px; top: 0; bottom: 0; width: 8px; padding: 0; background: transparent; cursor: col-resize; touch-action: none; }
.sidebar-resizer::after { content: ''; position: absolute; left: 3px; top: 50%; width: 2px; height: 48px; border-radius: var(--r-pill); background: var(--line-strong); transform: translateY(-50%); opacity: 0; transition: opacity var(--cl-motion) var(--ease); }
.sidebar-resizer:hover::after, .sidebar-resizer:focus-visible::after, .sidebar-resizer.is-dragging::after { opacity: 1; }
.master-head { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: 0 var(--s3) 0 var(--s4); border-bottom: 1px solid var(--line); background: var(--surface); }
.master-title { min-width: 0; display: flex; align-items: center; gap: var(--s2); }
.master-title-text { min-width: 0; }
.master-title strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; line-height: 20px; font-weight: 550; }
.master-title small { display: block; color: var(--muted); font-size: 10px; line-height: 14px; }
.master-head-actions { display: flex; align-items: center; gap: 0; }
.master-body { flex: 1; min-height: 0; overflow-y: auto; }
.master-empty { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--s8) var(--s6); text-align: center; }
.master-empty h2 { margin-top: var(--s4); font-family: var(--cl-art-font); font-size: 28px; line-height: 36px; font-weight: 500; }
.master-empty p { max-width: 260px; margin-top: var(--s2); color: var(--muted); font-size: var(--text-sm); line-height: 20px; }
.master-empty .skill-suggestions-list { margin-top: var(--s5); }
.master-footer { flex: none; padding: var(--s3); background: var(--surface-2); }
.project-context { display: flex; align-items: center; gap: var(--s1); margin: 0 var(--s1) var(--s2); color: var(--muted); font-size: var(--text-xs); line-height: 16px; }
.project-context svg { width: 14px; height: 14px; }
.project-conversation { display: flex; flex-direction: column; gap: var(--s4); padding: var(--s4); }
.project-conversation .user-bubble { font-size: 14px; line-height: 22px; }
.project-conversation .message { gap: var(--s2); }
.project-conversation .rich-text { font-size: 14px; line-height: 22px; }
.project-conversation .message-body { padding-top: 2px; }
.project-inline-card { padding: var(--s3); border: 1px solid var(--line); border-radius: var(--r-object); background: var(--surface); font-size: 14px; line-height: 22px; }
.side-drawer { position: absolute; inset: 0; z-index: 6; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--surface-2); animation: drawer-up var(--dur-panel) var(--ease) both; }
.side-drawer .params-scroll { background: var(--surface-2); }
.side-drawer .params-header, .side-drawer .params-footer { background: var(--surface-2); }
@keyframes drawer-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
.side-history-list { flex: 1; min-height: 0; overflow-y: auto; padding: var(--s3); }

/* 浮层、富菜单、对话框、提示 */
#popover-root { position: relative; z-index: 1000; }
.popover {
  position: fixed; z-index: 1000;
  max-height: min(520px, calc(100dvh - 32px)); overflow-y: auto;
  padding: var(--s2); border: 1px solid var(--line); border-radius: var(--r-popover);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2);
  transform-origin: bottom center;
  animation: popover-in var(--dur-mode) var(--ease) both;
}
.popover.below { transform-origin: top center; }
@keyframes popover-in { from { opacity: 0; transform: translateY(var(--motion-enter-y)); } to { opacity: 1; transform: translateY(0); } }
.popover-title { padding: var(--s2) var(--s3); color: var(--muted); font-size: var(--text-xs); line-height: 16px; font-weight: 500; }
.popover-divider { height: 1px; margin: var(--s2); background: var(--line); }
.menu-item {
  width: 100%; min-height: 40px;
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s2) var(--s3); border-radius: var(--r-object); background: transparent; color: var(--ink); text-align: left;
}
.menu-item:hover, .menu-item.is-keyboard-active { background: var(--fill-hover); }
.menu-item[aria-selected='true'], .menu-item[aria-checked='true'] { background: var(--accent-soft); }
.menu-item:disabled { text-decoration: none; }
.menu-item-icon { width: 32px; height: 32px; display: grid; place-items: center; flex: none; border-radius: var(--r-control); background: var(--surface-2); color: var(--accent); }
.menu-item-icon svg { width: 18px; height: 18px; }
.menu-item-copy { flex: 1; min-width: 0; }
.menu-item-name { display: block; font-size: 14px; line-height: 20px; font-weight: 500; overflow-wrap: anywhere; }
.menu-item-desc { display: block; margin-top: 2px; color: var(--muted); font-size: var(--text-xs); line-height: 16px; overflow-wrap: anywhere; }
.menu-item-check { width: 18px; height: 18px; flex: none; color: var(--accent); }
.menu-item.compact { min-height: 32px; padding: var(--s1) var(--s2); }
.menu-item.compact .menu-item-icon { width: 28px; height: 28px; }
.menu-item.compact .menu-item-name { font-size: var(--text-sm); }
.popover-footer { display: flex; align-items: center; justify-content: center; gap: var(--s3); margin-top: var(--s1); padding: var(--s2); border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 14px; }
.popover-param-section { padding: var(--s2) var(--s3); }
.popover-param-section + .popover-param-section { border-top: 1px solid var(--line); }
.popover-param-section h4 { margin-bottom: var(--s2); color: var(--muted); font-size: var(--text-xs); line-height: 16px; font-weight: 500; }
.popover-range { padding: var(--s3); min-width: 260px; }
.app-dialog {
  width: 440px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 48px);
  padding: 0; overflow: auto;
  border: 1px solid var(--line); border-radius: var(--r-dialog); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-3);
}
.app-dialog::backdrop { background: color-mix(in srgb, var(--ink) 32%, transparent); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s5) var(--s5) 0; }
.dialog-head h2 { font-size: var(--text-xl); line-height: 28px; font-weight: 600; }
.dialog-body { padding: var(--s4) var(--s5); color: var(--muted); font-size: var(--text-sm); line-height: 20px; }
.dialog-body p + p { margin-top: var(--s2); }
.dialog-field { display: block; margin-top: var(--s4); color: var(--ink); }
.dialog-field > span { display: block; margin-bottom: var(--s2); font-size: var(--text-xs); }
.dialog-field input {
  width: 100%; height: 44px; padding: 0 var(--s3); border: 1px solid var(--field-line); border-radius: var(--r-control); background: var(--field-bg); color: var(--ink);
}
.dialog-field input:focus { border-color: var(--focus); }
.dialog-error { margin-top: var(--s2); color: var(--error); font-size: var(--text-xs); }
.dialog-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: var(--s2); padding: 0 var(--s5) var(--s5); }
.dialog-preview { overflow: hidden; margin-top: var(--s3); border: 1px solid var(--line); border-radius: var(--r-object); }
.dialog-preview svg { width: 100%; height: auto; }
.toast-region { position: fixed; z-index: 1200; left: 50%; bottom: var(--s6); display: flex; flex-direction: column; align-items: center; gap: var(--s2); pointer-events: none; }
.toast {
  max-width: min(520px, calc(100vw - 32px));
  display: flex; align-items: center; gap: var(--s2);
  padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--r-object);
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow-2);
  font-size: var(--text-sm); line-height: 20px;
  animation: toast-in var(--dur-expand) var(--ease) both;
}
.toast svg { width: 18px; height: 18px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(var(--motion-enter-y)); } to { opacity: 1; transform: translateY(0); } }
.flip-clone { position: fixed !important; z-index: 1100 !important; margin: 0 !important; pointer-events: none !important; transform-origin: top left !important; }

/* 自绘示例画面 */
.artwork text { font-family: var(--font-ui); }
.artwork .art-label { fill: var(--muted); font-size: 12px; letter-spacing: .08em; }
.artwork .art-title-small { fill: var(--ink); font-size: 18px; font-weight: 550; }

/* 1024 档：保留完整三栏，收窄历史而非隐藏参数 */
:root[data-window='expanded'] .create-page { grid-template-columns: 184px minmax(0, 1fr) auto; }
:root[data-window='expanded'] .history-head { padding-inline: var(--s3); }
:root[data-window='expanded'] .chat-content { padding: var(--s4); }
:root[data-window='expanded'] .chat-footer { padding-inline: var(--s3); }
:root[data-window='expanded'] .chat-header { padding-inline: var(--s4); }
:root[data-window='expanded'] .chat-hint { display: none; }
:root[data-window='expanded'] .topbar { padding-inline: var(--s4); }
:root[data-window='expanded'] .project-page { --sidebar-width: 360px; }
:root[data-window='expanded'] .project-workspace { padding: var(--s4); }
:root[data-window='expanded'] .workflow-strip { grid-template-columns: repeat(5, minmax(88px, 1fr)); }
:root[data-window='expanded'] .episode-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
:root[data-window='expanded'] .project-note-grid { grid-template-columns: 1fr; }

/* 手机只保证主控任务不破版：卡片横滑，主控侧栏全屏 */
:root[data-family='mobile'] {
  --prototype-h: 96px; --topbar-h: 56px;
  --control-height-form: 44px; --control-height-toolbar: 44px; --ctl-h: 44px; --ctl-h-sm: 44px;
}
:root[data-family='mobile'] .prototype-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 32px 32px; gap: var(--s2); padding: var(--s2) var(--s3); }
:root[data-family='mobile'] .prototype-identity { grid-column: 1; grid-row: 1; }
:root[data-family='mobile'] .prototype-noop { display: none; }
:root[data-family='mobile'] .prototype-pages { grid-column: 2; grid-row: 1; }
:root[data-family='mobile'] .prototype-controls { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; }
:root[data-family='mobile'] .prototype-pages button { padding: 0 var(--s3); }
:root[data-family='mobile'] .prototype-scheme button { padding: 0 var(--s3); }
:root[data-family='mobile'] .app-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--topbar-h) minmax(0, 1fr) 64px; }
:root[data-family='mobile'] .brand { display: none; }
:root[data-family='mobile'] .topbar { grid-column: 1; grid-row: 1; padding-inline: var(--s3); }
:root[data-family='mobile'] .topbar-actions { gap: var(--s2); }
:root[data-family='mobile'] .topbar .new-page-label { display: none; }
:root[data-family='mobile'] .topbar .new-page-button { width: 36px; padding: 0; }
:root[data-family='mobile'] .credit-pill { height: 32px; }
:root[data-family='mobile'] .stage { grid-column: 1; grid-row: 2; }
:root[data-family='mobile'] .rail {
  grid-column: 1; grid-row: 3;
  flex-direction: row; align-items: stretch; gap: 0;
  padding: var(--s1) var(--s2);
  border-top: 1px solid var(--line); border-right: 0;
}
:root[data-family='mobile'] .rail-item { min-height: 56px; border-radius: var(--r-object); }
:root[data-family='mobile'] .rail-item svg { width: 20px; height: 20px; }
:root[data-family='mobile'] .rail-spacer, :root[data-family='mobile'] .rail-personal { display: none; }
:root[data-family='mobile'] .home-page { padding: var(--s6) var(--s4) var(--s10); }
:root[data-family='mobile'] .art-title { font-size: 36px; line-height: 48px; }
:root[data-family='mobile'] .home-tabs { margin-bottom: var(--s5); }
:root[data-family='mobile'] .quick-cards { display: flex; gap: var(--s3); margin-inline: calc(-1 * var(--s4)); padding-inline: var(--s4); overflow-x: auto; scroll-snap-type: x mandatory; }
:root[data-family='mobile'] .quick-card { flex: 0 0 232px; scroll-snap-align: start; }
:root[data-family='mobile'] .quick-card.wide { flex-basis: 264px; }
:root[data-family='mobile'] .home-page .composer.is-collapsed { width: 100%; }
:root[data-family='mobile'] .composer { max-height: 46dvh; padding: var(--s3) var(--s4) var(--s2); border-radius: var(--r-sidebar); }
:root[data-family='mobile'] .composer.is-collapsed { height: 64px; max-height: 64px; padding-inline: var(--s4) var(--s2); }
:root[data-family='mobile'] .composer textarea { min-height: 68px; }
:root[data-family='mobile'] .composer.is-collapsed textarea { min-height: 24px; }
:root[data-family='mobile'] .tool-btn { height: 36px; }
:root[data-family='mobile'] .send-button { width: 40px; height: 40px; }
:root[data-family='mobile'] .composer-cost small { display: none; }
:root[data-family='mobile'] .skill-suggestions-list { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding-bottom: var(--s1); }
:root[data-family='mobile'] .skill-pill { flex: none; }
:root[data-family='mobile'] .recent-projects { display: flex; gap: var(--s3); margin-inline: calc(-1 * var(--s4)); padding-inline: var(--s4); overflow-x: auto; scroll-snap-type: x mandatory; }
:root[data-family='mobile'] .project-card { flex: 0 0 260px; scroll-snap-align: start; }
:root[data-family='mobile'] .recent-episode { grid-template-columns: 36px minmax(0, 1fr) auto; gap: var(--s2); padding-inline: var(--s3); }
:root[data-family='mobile'] .episode-project { display: none; }
:root[data-family='mobile'] .create-page { display: block; }
:root[data-family='mobile'] .history-panel { display: none; }
:root[data-family='mobile'] .history-panel.is-mobile-open { position: absolute; inset: 0; z-index: 70; display: flex; width: 100%; }
:root[data-family='mobile'] .chat-column { height: 100%; }
:root[data-family='mobile'] .mobile-history-button { display: inline-grid; }
:root[data-family='mobile'] .chat-header { padding-inline: var(--s3); }
:root[data-family='mobile'] .chat-header .context-chip { display: none; }
:root[data-family='mobile'] .chat-content { padding: var(--s4) var(--s3); gap: var(--s5); }
:root[data-family='mobile'] .chat-footer { padding: var(--s2); }
:root[data-family='mobile'] .chat-hint { display: none; }
:root[data-family='mobile'] .message { gap: var(--s2); }
:root[data-family='mobile'] .master-avatar { width: 28px; height: 28px; }
:root[data-family='mobile'] .master-avatar svg { width: 20px; height: 20px; }
:root[data-family='mobile'] .user-bubble { max-width: 92%; }
:root[data-family='mobile'] .result-topline { gap: var(--s2); padding: var(--s3); }
:root[data-family='mobile'] .reference-stack { width: 56px; }
:root[data-family='mobile'] .stacked-ref { width: 36px; height: 44px; }
:root[data-family='mobile'] .stacked-ref:nth-child(2) { left: 16px; }
:root[data-family='mobile'] .result-actions { padding-inline: var(--s3); }
:root[data-family='mobile'] .result-status { padding-inline: var(--s3); }
:root[data-family='mobile'] .result-actions .btn { min-height: 36px; }
:root[data-family='mobile'] .failure-card .result-actions { padding-left: 0; }
:root[data-family='mobile'] .confirmation-card { padding: var(--s4); }
:root[data-family='mobile'] .quote-row { align-items: flex-start; }
:root[data-family='mobile'] .params-panel { position: absolute; inset: 0; z-index: 75; width: 100%; }
:root[data-family='mobile'] .step-row { grid-template-columns: 28px minmax(0, 1fr); padding-block: var(--s2); }
:root[data-family='mobile'] .step-cost { grid-column: 2; }
:root[data-family='mobile'] .project-workspace { padding: var(--s4); }
:root[data-family='mobile'] .project-header { align-items: flex-start; }
:root[data-family='mobile'] .project-header-actions .btn span { display: none; }
:root[data-family='mobile'] .project-header-actions .btn { width: 36px; padding: 0; }
:root[data-family='mobile'] .project-header h1 { font-size: var(--text-xl); line-height: 28px; }
:root[data-family='mobile'] .workflow-strip { display: flex; overflow-x: auto; margin-inline: calc(-1 * var(--s4)); padding-inline: var(--s4); }
:root[data-family='mobile'] .workflow-node { flex: 0 0 136px; }
:root[data-family='mobile'] .workflow-node::after { display: none; }
:root[data-family='mobile'] .episode-board { display: flex; overflow-x: auto; margin-inline: calc(-1 * var(--s4)); padding-inline: var(--s4); scroll-snap-type: x mandatory; }
:root[data-family='mobile'] .episode-card { flex: 0 0 260px; scroll-snap-align: start; }
:root[data-family='mobile'] .project-note-grid { grid-template-columns: 1fr; }
:root[data-family='mobile'] .project-master { position: absolute; inset: 0; z-index: 70; width: 100%; border-left: 0; }
:root[data-family='mobile'] .sidebar-resizer { display: none; }
:root[data-family='mobile'] .master-capsule { right: var(--s4); bottom: var(--s4); }
:root[data-family='mobile'] .master-empty { padding: var(--s6) var(--s4); }
:root[data-family='mobile'] .master-empty .skill-suggestions-list { flex-wrap: wrap; }
:root[data-family='mobile'] .master-footer { padding: var(--s2); }
:root[data-family='mobile'] .popover { left: var(--s3) !important; right: var(--s3); top: auto !important; bottom: var(--s3); width: auto !important; max-height: 68dvh; transform-origin: bottom center; }
:root[data-family='mobile'] .app-dialog { width: 100%; max-width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; }
:root[data-family='mobile'] .dialog-head, .dialog-body, .dialog-actions { padding-inline: var(--s4); }
:root[data-family='mobile'] .dialog-actions { margin-top: auto; }
:root[data-family='mobile'] .toast-region { bottom: calc(64px + var(--s4)); }

:root[data-motion='reduced'] *, :root[data-motion='reduced'] *::before, :root[data-motion='reduced'] *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

@media (forced-colors: active) {
  .composer:focus-within, .search-field:focus-within, .field-select:focus-visible { outline: 2px solid Highlight; }
  .choice[aria-pressed='true'], .history-item[aria-current='true'] { outline: 1px solid Highlight; }
}
