/* 应用骨架：顶栏、首页、向导、工作台三栏、目录树、抽屉、命令面板、引导气泡 */

/* ───────── 顶栏（首页、监控、设置共用） ───────── */
.topbar {
  position: sticky; top: 0; z-index: 30; flex: none;
  display: flex; align-items: center; gap: 16px; min-height: var(--topbar-h); padding: 0 24px;
  background: var(--glass); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font: 600 var(--fs-lg)/1 var(--font-read); }
.brand__name { font: 600 var(--fs-lg)/1 var(--font-read); letter-spacing: .04em; }
.topnav { display: flex; gap: 4px; margin-left: 8px; }
.topnav__a { position: relative; height: 32px; padding: 0 12px; display: inline-flex; align-items: center; border-radius: var(--r-sm); color: var(--ink-2); font-size: var(--fs-md); text-decoration: none; transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.topnav__a:hover { background: var(--hover-2); color: var(--ink); text-decoration: none; }
.topnav__a[aria-current="page"] { color: var(--ink); font-weight: 500; }
.topnav__a[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -12px; height: 2px; background: var(--accent); border-radius: 1px; }
.agydot { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--note); padding: 0 8px; text-decoration: none; border-radius: 6px; }
.agydot:hover { color: var(--ink); }
.wstop__pal .kbd { margin-left: 4px; }

.shell { min-height: 100vh; }
.page { max-width: 1200px; margin: 0 auto; padding: 32px 24px 80px; }
.sheet { max-width: 960px; margin: 0 auto; padding: 32px 24px 80px; display: flex; flex-direction: column; gap: 16px; }
.sheet > .view-head { margin-bottom: 8px; }
.view-head { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.view-title { font: 600 var(--fs-2xl)/1.3 var(--font-read); }
.sec-title { font: 600 var(--fs-lg)/1.4 var(--font-ui); margin-bottom: 12px; display: flex; align-items: baseline; gap: 8px; }
.card--pad > .sec-title:first-child { margin-top: 0; }

/* ───────── 首页 ───────── */
.home__hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 32px; }
.home__hello { font: 600 clamp(26px, 4vw, 34px)/1.25 var(--font-read); letter-spacing: .02em; }
.home__sub { margin-top: 8px; color: var(--note); font-size: var(--fs-lg); }
.home__cta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.pfilter { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.pfilter__search { width: 220px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.pgrid__empty { grid-column: 1 / -1; }

.pcard { position: relative; display: flex; flex-direction: column; overflow: hidden; color: var(--ink); text-decoration: none; }
.pcard:hover { text-decoration: none; }
.pcard--sk { padding: 20px; gap: 12px; display: flex; flex-direction: column; }
.pcard__band { height: 6px; background: var(--nc); flex: none; }
.pcard__body { display: flex; gap: 16px; align-items: center; padding: 20px 20px 16px; }
.pcard__main { flex: 1; min-width: 0; }
.pcard__title { font: 600 var(--fs-xl)/1.35 var(--font-read); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard__tags { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.pcard__state { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--note); }
.pcard__next { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: var(--fs-md); }
.pcard__next .ic { color: var(--accent); }
.pcard__ai { display: flex; align-items: center; gap: 8px; padding: 8px 20px 12px; color: var(--run); font-size: var(--fs-sm); margin-top: -4px; }
.pcard.is-live { border-color: color-mix(in srgb, var(--run) 50%, var(--line)); animation: glow 2.4s ease-in-out infinite; }
/* 卡片右下角「⋯」：删除 / 从列表移走（按钮不能放进 <a> 里，所以卡片外面包一层） */
.pcard-wrap { position: relative; display: flex; flex-direction: column; min-width: 0; }
.pcard-wrap > .pcard { flex: 1; }
.pcard-wrap > .pcard .pcard__next { padding-right: 52px; }
.pcard__more { position: absolute; right: 10px; bottom: 8px; color: var(--note); opacity: .55; transition: opacity var(--t-fast, .15s) var(--ease, ease); }
.pcard-wrap:hover .pcard__more, .pcard__more:focus-visible, .pcard__more[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .pcard__more { opacity: 1; } }
.trash-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.trash-row:last-of-type { border-bottom: 0; }
.trash-row__main { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* ───────── 新建向导 ───────── */
.wiz { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; background: var(--bg); opacity: 0; transition: opacity var(--t-mid) var(--ease); }
.wiz.is-in { opacity: 1; }
.wiz__top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 12px 24px; min-height: var(--topbar-h); }
.wiz__top > .btn { justify-self: end; }
.wiz__brand { font: 600 var(--fs-lg)/1 var(--font-read); letter-spacing: .04em; }
.wiz__body { flex: 1; overflow-y: auto; padding: 24px; }
.wiz__stage { max-width: 760px; margin: 0 auto; overflow-x: hidden; }
.wiz__foot { border-top: 1px solid var(--line); padding: 16px 24px; background: var(--paper); }
.wiz__foot-in { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.wiz__step.from-right { animation: slideR var(--t-mid) var(--ease); }
.wiz__step.from-left { animation: slideL var(--t-mid) var(--ease); }
@keyframes slideR { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes slideL { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
.wstep__h { font: 600 clamp(24px, 4vw, 32px)/1.3 var(--font-read); margin: 24px 0 8px; }
.wstep__p { color: var(--note); font-size: var(--fs-lg); margin-bottom: 32px; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.opt { position: relative; text-align: left; padding: 24px; border-radius: var(--r-lg); border: 2px solid var(--line); background: var(--panel); display: flex; flex-direction: column; gap: 8px; transition: border-color var(--t-mid) var(--ease), background var(--t-mid) var(--ease), box-shadow var(--t-mid) var(--ease), transform var(--t-fast) var(--ease); }
.opt:hover { border-color: var(--line-2); box-shadow: var(--sh-2); transform: translateY(-2px); }
.opt:active { transform: translateY(0); }
.opt.is-on { border-color: var(--accent); background: var(--accent-soft); }
.opt__ic { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 8px; }
.opt.is-on .opt__ic { background: var(--accent); color: var(--accent-ink); }
.opt__title { font: 600 var(--fs-xl)/1.3 var(--font-read); }
.opt__text { color: var(--ink-2); line-height: 1.7; }
.opt__check { position: absolute; top: 16px; right: 16px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); opacity: 0; transform: scale(.6); transition: opacity var(--t-mid) var(--ease), transform var(--t-mid) var(--ease); }
.opt.is-on .opt__check { opacity: 1; transform: none; }
.wiz__idea { font: 400 var(--fs-lg)/1.8 var(--font-read); min-height: 112px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 24px; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 40px 24px; border: 2px dashed var(--line-2); border-radius: var(--r-lg); background: var(--panel); color: var(--ink-2); cursor: pointer; transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.drop:hover, .drop.is-over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.drop__t { font-size: var(--fs-lg); font-weight: 500; color: var(--ink); }
.drop__s { font-size: var(--fs-sm); color: var(--note); }
.wiz__result { margin: 20px 0; display: flex; flex-direction: column; gap: 12px; }
.upload-prog { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); }
.preview-sum { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: var(--fs-lg); }
.preview-sum .ic { color: var(--ok); }
.preview-tbl { max-height: 288px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); }
.preview-lines { color: var(--ink-2); font-size: var(--fs-sm); max-width: 420px; overflow-wrap: anywhere; }
.eg { padding: 16px; border-radius: var(--r-md); background: var(--hover); }
.eg__t { font-size: var(--fs-sm); color: var(--ink-2); margin-bottom: 8px; }
.eg__pre { margin: 0; font-size: var(--fs-sm); line-height: 1.7; white-space: pre-wrap; }
.wiz__auth { margin-top: 24px; padding: 16px; border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--panel); }
.sum { display: grid; grid-template-columns: 96px 1fr; gap: 12px 16px; padding: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.sum dt { color: var(--note); }
.sum dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* ───────── 工作台 ───────── */
.ws-shell { display: flex; flex-direction: column; height: 100vh; }
.wstop { gap: 12px; padding: 0 16px; flex-wrap: nowrap; }
.wstop__menu { display: none; }
.wstop__title { font: 600 var(--fs-lg)/1.2 var(--font-read); max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; min-width: 0; }
.wstop__more { display: none; }
.wstop__next { max-width: 280px; }
.wstop__next-p { flex: none; }
.wstop__next-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.runchip { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-radius: 14px; background: var(--run-bg); color: var(--run); font-size: var(--fs-sm); text-decoration: none; max-width: 440px; transition: filter var(--t-fast) var(--ease); }
.runchip:hover { text-decoration: none; filter: brightness(.96); }
.runchip__t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.runchip__p { white-space: nowrap; font-variant-numeric: tabular-nums; opacity: .85; }
.runchip__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: color-mix(in srgb, var(--run) 18%, transparent); }
.runchip__bar i { display: block; height: 100%; background: var(--run); transition: width var(--t-slow, .5s) var(--ease); }

/* 五步流程条 */
.flow { display: flex; align-items: center; gap: 0; margin: 0 8px; flex: none; }
.flow__step { display: flex; align-items: center; }
.flow__step + .flow__step::before { content: ""; width: 20px; height: 2px; background: var(--line-2); margin: 0 4px; border-radius: 1px; }
.flow__step.is-done + .flow__step::before, .flow__step.is-current::before { background: var(--accent); opacity: .5; }
.flow__btn { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px; border-radius: 16px; color: var(--note); font-size: var(--fs-sm); transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.flow__btn:hover { background: var(--hover-2); color: var(--ink); }
.flow__btn:active { background: var(--line); }
.flow__dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: var(--fs-xs); font-weight: 600; border: 1.5px solid var(--line-2); background: var(--panel); color: var(--muted); }
.flow__dot .ic { font-size: 12px; }
.flow__step.is-done .flow__dot { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.flow__step.is-current .flow__dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.flow__step.is-current .flow__label { color: var(--ink); font-weight: 600; }
.flow__step.is-done .flow__label { color: var(--ink-2); }

.ws { position: relative; flex: 1; min-height: 0; display: flex; }
.left { flex: none; width: var(--left-w); overflow: hidden; background: var(--bg); border-right: 1px solid var(--line); transition: width var(--t-mid) var(--ease); }
.ws.is-left-collapsed .left { width: 48px; }
.resizer { position: relative; flex: none; width: 6px; margin-left: -3px; margin-right: -3px; cursor: col-resize; z-index: 6; touch-action: none; }
.resizer::after { content: ""; position: absolute; left: 2px; top: 0; bottom: 0; width: 2px; background: transparent; transition: background var(--t-fast) var(--ease); }
.resizer:hover::after, .resizer:focus-visible::after, body.is-resizing .resizer::after { background: var(--accent); }
.resizer:focus-visible { box-shadow: none; }
body.is-resizing { cursor: col-resize; user-select: none; }
body.is-resizing .left, body.is-resizing .right { transition: none; }

/* 目录树 */
.tree { height: 100%; overflow-y: auto; padding: 12px 8px 40px; }
.tsec { margin-bottom: 16px; }
.tsec__head { padding: 4px 12px 4px; }
.tsec__title { font-size: var(--fs-xs); color: var(--muted); letter-spacing: .1em; }
.tsec__toggle { display: flex; align-items: center; gap: 4px; width: 100%; margin-left: -4px; font-size: var(--fs-xs); color: var(--muted); letter-spacing: .1em; }
.tsec__toggle:hover { color: var(--ink); }
.tsec__toggle .ic { transition: transform var(--t-fast) var(--ease); }
.tsec__toggle[aria-expanded="true"] .ic { transform: rotate(90deg); }
.tsec__n { margin-left: auto; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.tsec__list { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.titem { position: relative; display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: var(--r-sm); color: var(--ink-2); font-size: var(--fs-md); text-decoration: none; transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.titem:hover { background: var(--hover-2); color: var(--ink); text-decoration: none; }
.titem:active { background: var(--line); }
.titem .ic { color: var(--muted); }
.titem__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.titem__n { font-size: var(--fs-xs); color: var(--note); font-variant-numeric: tabular-nums; white-space: nowrap; }
.titem.is-empty { color: var(--muted); }
.titem.is-empty .ic { opacity: .6; }
.titem.is-active { background: var(--hover-2); color: var(--ink); font-weight: 500; }
.titem.is-active .ic { color: var(--accent); }
.titem.is-active::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.tdot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.tdot--hard { background: var(--bad); }
.tdot--soft { background: var(--warn); }
.tpend { flex: none; padding: 0 5px; border-radius: 999px; font-size: 11px; line-height: 16px; color: var(--ok); background: var(--ok-bg); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); }

.rail { height: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 0; }
.rail__btn { width: 36px; height: 36px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--ink-2); transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.rail__btn:hover { background: var(--hover-2); color: var(--ink); text-decoration: none; }
.rail__btn:active { background: var(--line); }
.rail__btn.is-active { color: var(--accent); background: var(--accent-soft); }
.left .tree { overflow-x: hidden; }
.ws.is-left-collapsed .left, .ws.is-left-collapsed .tree { overflow: visible; }

/* 中栏：一张纸 */
.ws-main { position: relative; flex: 1; min-width: 0; display: flex; overflow: hidden; }
.center { flex: 1; min-width: 0; overflow-y: auto; padding: 24px 24px 96px; }
.center:focus { box-shadow: none; }
.paper {
  box-sizing: border-box; width: 100%; margin: 0 auto; min-height: 60vh;
  font-size: var(--read-size);
  max-width: calc(var(--read-measure) + 96px);
  padding: 40px 48px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-1);
}
.paper > * { font-size: var(--fs-md); }
.paper > .script, .paper > .doc { font-size: var(--read-size); }
.paper--wide { max-width: 1040px; }
.paper--bare { max-width: none; min-height: 0; padding: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; font-size: var(--fs-md); }
.paper--bare > * { font-size: inherit; }
.center:has(> .paper--bare) { padding: 0 0 64px; }
.src-cardcol { max-height: calc(100vh - var(--topbar-h) - 48px) !important; }
.wstop__ai.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* 抽屉 */
.drawer-host { position: absolute; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.drawer { position: absolute; pointer-events: auto; display: flex; flex-direction: column; background: var(--panel); box-shadow: var(--sh-3); transition: transform var(--t-slow) var(--ease); }
.drawer--right { top: 0; bottom: 0; right: 0; width: 380px; max-width: 100%; border-left: 1px solid var(--line); transform: translateX(104%); }
.drawer--bottom { left: 0; right: 0; bottom: 0; height: 44%; min-height: 220px; border-top: 1px solid var(--line); transform: translateY(104%); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.drawer.is-open { transform: none; }
.drawer__head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer__head h2 { flex: 1; font: 600 var(--fs-lg)/1.4 var(--font-ui); }
.drawer__body { flex: 1; overflow-y: auto; padding: 16px 20px 24px; }
.drawer__foot { padding: 12px 20px 16px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; }

/* 右栏：AI 助手自己管宽度和开合（css/chat.css） */

.ws-scrim { display: none; }

/* ───────── 命令面板 ───────── */
.pal-back { position: fixed; inset: 0; z-index: 150; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: var(--scrim); opacity: 0; transition: opacity var(--t-fast) var(--ease); }
.pal-back.is-in { opacity: 1; }
.pal { width: 100%; max-width: 640px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-3); overflow: hidden; transform: translateY(-4px); transition: transform var(--t-mid) var(--ease); }
.pal-back.is-in .pal { transform: none; }
.pal__bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.pal__input { flex: 1; min-width: 0; height: 32px; border: 0; background: transparent; color: var(--ink); font-size: var(--fs-lg); outline: none; }
.pal__input::placeholder { color: var(--muted); }
.pal__list { max-height: min(50vh, 420px); overflow-y: auto; padding: 8px; }
.pal__group { padding: 8px 12px 4px; font-size: var(--fs-xs); color: var(--muted); letter-spacing: .1em; }
.pal__item { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: var(--r-sm); cursor: pointer; color: var(--ink-2); }
.pal__item .ic { color: var(--muted); }
.pal__item.is-active { background: var(--accent-soft); color: var(--ink); }
.pal__item.is-active .ic { color: var(--accent); }
.pal__label { font-weight: 500; color: var(--ink); white-space: nowrap; }
.pal__grp { font-size: var(--fs-xs); color: var(--muted); }
.pal__hint { margin-left: auto; min-width: 0; font-size: var(--fs-xs); color: var(--note); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal__none { padding: 24px; text-align: center; color: var(--note); }
.pal__foot { display: flex; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--note); }

/* ───────── 引导气泡 ───────── */
.tour { width: 300px; max-width: calc(100vw - 16px); padding: 16px; z-index: 160; border-color: var(--accent); }
.tour__title { font: 600 var(--fs-lg)/1.4 var(--font-read); }
.tour__text { margin: 8px 0 16px; color: var(--ink-2); line-height: 1.7; }
.tour__foot { display: flex; align-items: center; gap: 8px; }
.tour__n { font-size: var(--fs-xs); color: var(--note); }
.tour-hl { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-md); }

/* ───────── 窄屏 ───────── */
@media (max-width: 1180px) {
  .flow__step:not(.is-current) .flow__label { display: none; }
  .flow__btn { padding: 0 4px; }
  .flow__step.is-current .flow__btn { padding: 0 12px 0 4px; }
}
@media (max-width: 1100px) {
}
@media (max-width: 899px) {
  .wstop__pal .kbd, .wstop__pal > .ic + .kbd { display: none; }
  .wstop__more { display: inline-flex; }
}
@media (max-width: 759px) {
  .topbar { padding: 0 16px; gap: 8px; }
  .topnav { margin-left: 0; }
  .topnav__a { padding: 0 8px; }
  .agydot span:last-child { display: none; }
  .brand__name { display: none; }
  .page, .sheet { padding: 24px 16px 64px; }
  .pfilter__search { width: 100%; }
  .pgrid { grid-template-columns: 1fr; }
  .opts { grid-template-columns: 1fr; }
  .wiz__top, .wiz__body, .wiz__foot { padding-left: 16px; padding-right: 16px; }
  .sum { grid-template-columns: 72px 1fr; padding: 16px; }
  .modal__head { padding: 16px 16px 8px; } .modal__body { padding: 4px 16px 16px; } .modal__foot { padding: 8px 16px 16px; }

  .wstop { flex-wrap: wrap; height: auto; padding: 8px 16px; row-gap: 8px; }
  .wstop__menu { display: inline-flex; order: 1; }
  .wstop__back { order: 2; padding: 0 8px; }
  .wstop__back span:not(.ic) { display: none; }
  .wstop__title { order: 3; flex: 1; max-width: none; }
  .wstop__more { order: 4; }
  .wstop::after { content: ""; order: 4; flex-basis: 100%; height: 0; }
  .wstop__pal { display: none; }
  .wstop__ai-l { display: none; }
  .wstop__ai { order: 4; width: 32px; padding: 0; }
  .wstop > .spacer { display: none; }
  .flow { order: 5; margin: 0; }
  .flow__step + .flow__step::before { display: none; }
  .flow__step:not(.is-current) { display: none; }
  .runchip { order: 6; max-width: 120px; }
  .wstop__next { order: 7; flex: 1; max-width: none; }
  .wstop__next-p { display: none; }
  .left { position: fixed; z-index: 70; top: 0; bottom: 0; left: 0; width: min(86vw, 320px); background: var(--panel); transform: translateX(-104%); transition: transform var(--t-slow) var(--ease); border-right: 1px solid var(--line); overflow: hidden; }
  .ws.is-left-open .left { transform: none; box-shadow: var(--sh-3); }
  .ws.is-left-collapsed .left { width: min(86vw, 320px); }
  .ws-scrim { display: block; position: fixed; inset: 0; z-index: 65; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity var(--t-mid) var(--ease); }
  .ws.is-left-open .ws-scrim { opacity: 1; pointer-events: auto; }
  .center { padding: 12px 0 64px; }
  .paper { padding: 24px 16px; border-radius: 0; border-left: 0; border-right: 0; min-height: 70vh; }
  .paper--bare { padding: 0; min-height: 0; }
  .drawer--right { width: 100%; }
  .toast-host { right: 16px; bottom: 16px; }
  .view-title { font-size: 22px; }
  .view-head .view-title { flex: 1 1 100%; order: -1; }
}

/* ───────── 多部对标剧：向导里的选择块、左栏每部一个小组 ───────── */
.sblocks { display: flex; flex-direction: column; gap: 16px; }
.sblock { padding: 20px 24px; }
.sblock__head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.sblock__title { font: 600 var(--fs-lg)/1.4 var(--font-read); }
.drop--compact { padding: 24px 16px; }
.sblock-add { margin-top: 16px; width: 100%; height: 44px; border-style: dashed; color: var(--ink-2); }
.sblock-add:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.modal .sblock { box-shadow: none; padding: 16px 20px; }
.tsec__name { flex: 1; min-width: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: 0; font-size: var(--fs-sm); color: var(--ink-2); font-weight: 500; }
.tsec--src { margin-bottom: 12px; }
.tsec--src .tsec__toggle { gap: 8px; }
.tsec--src .tsec__toggle .sdot { margin-left: 2px; }
.tsub { margin-top: 4px; padding-left: 8px; }
.tsec__toggle--sub .tsec__name { color: var(--note); font-weight: 400; font-size: var(--fs-xs); }
.titem--add { width: 100%; text-align: left; border: 1px dashed var(--line-2); color: var(--note); }
.titem--add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.titem--add .ic { color: inherit; }
.titem--add.is-disabled { opacity: .6; cursor: help; }
.titem--add.is-disabled:hover { border-color: var(--line-2); color: var(--note); background: transparent; }

/* ───────── 中栏「AI 正在做……」等待条（2026-11-30 作者：中间也要有等待动画，全局都是这样） ─────────
   有任务在跑才出来，贴在中栏顶上不随页面滚走；有总数的任务是真进度条，没有总数的一道光来回走。 */
.workbar {
  position: sticky; top: 0; z-index: 6; box-sizing: border-box;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  width: 100%; max-width: 1040px; margin: 0 auto 16px; padding: 10px 14px 12px;
  border: 1px solid color-mix(in srgb, var(--run) 28%, var(--line)); border-radius: var(--r-md);
  background: color-mix(in srgb, var(--run-bg) 88%, var(--paper)); color: var(--ink-2);
  box-shadow: var(--sh-1); overflow: hidden;
  animation: workbar-in var(--t-slow) var(--ease) both;
}
.workbar[hidden] { display: none; }
.center:has(> .paper--bare) > .workbar { margin: 12px auto 12px; width: calc(100% - 24px); }
.workbar__anim { display: inline-flex; gap: 4px; flex: none; }
.workbar__anim i { width: 6px; height: 6px; border-radius: 50%; background: var(--run); animation: workbar-dot 1.2s ease-in-out infinite; }
.workbar__anim i:nth-child(2) { animation-delay: .15s; }
.workbar__anim i:nth-child(3) { animation-delay: .3s; }
.workbar__body { flex: 1 1 260px; min-width: 0; font-size: var(--fs-sm); line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workbar__k { color: var(--run); font-weight: 600; margin-right: 6px; }
.workbar__t { color: var(--ink); font-weight: 500; }
.workbar__s { color: var(--ink-2); }
.workbar__p { flex: none; font-size: var(--fs-xs); color: var(--note); font-variant-numeric: tabular-nums; }
.workbar__p:empty { display: none; }
.workbar__btn { flex: none; }
.workbar__track { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: color-mix(in srgb, var(--run) 12%, transparent); }
.workbar__track i { display: block; height: 100%; width: 0; background: var(--run); border-radius: 0 3px 3px 0; transition: width var(--t-slow) var(--ease); }
.workbar.is-indeterminate .workbar__track i { width: 30%; border-radius: 3px; animation: workbar-sweep 1.6s ease-in-out infinite; }
@keyframes workbar-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes workbar-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@keyframes workbar-sweep { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }

/* 空状态里的「AI 正在做……」：中栏 .ai-busy 时才亮出来；要叫 AI 动手的按钮先灰掉（点了也会被拦） */
.busyline { display: none; align-items: flex-start; gap: 10px; max-width: 440px; margin: 4px auto 0; padding: 10px 14px;
  border-radius: var(--r-md); background: color-mix(in srgb, var(--run-bg) 80%, var(--paper)); text-align: left; }
.ai-busy .busyline { display: flex; animation: workbar-in var(--t-slow) var(--ease) both; }
.busyline__anim { display: inline-flex; gap: 4px; padding-top: 7px; flex: none; }
.busyline__anim i { width: 5px; height: 5px; border-radius: 50%; background: var(--run); animation: workbar-dot 1.2s ease-in-out infinite; }
.busyline__anim i:nth-child(2) { animation-delay: .15s; }
.busyline__anim i:nth-child(3) { animation-delay: .3s; }
.busyline__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.busyline__t { font-size: var(--fs-sm); color: var(--ink); font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.busyline__s { font-size: var(--fs-xs); color: var(--note); line-height: 1.5; }
.ai-busy .empty__ic, .ai-busy .src-empty-mark { animation: busy-breathe 1.8s ease-in-out infinite; }
.ai-busy [data-ai] { opacity: .45; pointer-events: none; filter: saturate(.6); }
@keyframes busy-breathe { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 22%, transparent); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 0%, transparent); } }

@media (prefers-reduced-motion: reduce) {
  .workbar, .ai-busy .busyline { animation: none; }
  .workbar__anim i, .busyline__anim i, .ai-busy .empty__ic, .ai-busy .src-empty-mark { animation: none; }
  .workbar.is-indeterminate .workbar__track i { animation: none; width: 100%; opacity: .5; }
}
