/*
 * 速办标书AI · Studio base layer
 * Loaded after legacy styles. Phase 0 only adds tokens + icon alignment;
 * shell/components are added in later phases so existing screens keep working.
 * No ID selectors: all rules are reusable by a future Vue/React shell.
 */
@import url("./tokens.css");

/* Reference body typography from biaoshu.lianqiai.cn */
body{
  font-family:var(--studio-font-ui);
  font-size:14px;
  line-height:1.5;
  color:var(--studio-ink);
  background:var(--studio-canvas);
}

/* Inline SVG sprite host */
.svg-defs{
  position:absolute;
  width:0;
  height:0;
  overflow:hidden;
}

/* One icon family: 24x24 viewBox, 1.7px monoline, currentColor */
.ico{
  width:18px;
  height:18px;
  flex:none;
  display:inline-block;
  vertical-align:-3px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.7;
  stroke-linecap:round;
  stroke-linejoin:round;
  pointer-events:none;
}
.ico-sm{width:14px;height:14px;vertical-align:-2px}
.ico-lg{width:20px;height:20px;vertical-align:-4px}

/* Existing shell hooks: align icon + label without changing layout rules */
.si{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:18px;
}
.si .ico{width:16px;height:16px}
.parse-icon .ico{width:20px;height:20px}
.fpc-icon .ico{width:16px;height:16px}
.type-tab{
  display:inline-flex;
  align-items:center;
  gap:7px;
}
.type-tab .ico{width:17px;height:17px}
.lq-ref-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.lq-ref-icon .ico{width:18px;height:18px}
.lq-img-head{
  display:flex;
  align-items:center;
  gap:6px;
}
.lq-img-head .ico{width:14px;height:14px}
.caret{
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.caret .ico{width:12px;height:12px}
.fpc-del{
  display:grid;
  place-items:center;
}
.fpc-del .ico{width:15px;height:15px}
.del{
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.del .ico{width:13px;height:13px}
.pr-check,.lq-check{
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.pr-check .ico,.lq-check .ico{width:15px;height:15px}

/* Buttons that contain icons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
}
.btn.block{display:flex;width:100%}
.btn .ico{width:15px;height:15px}
.icon-btn{
  display:grid;
  place-items:center;
}
.icon-btn .ico{width:17px;height:17px}

/* Auth checklist: replace the legacy ::before check glyph with an SVG icon */
.auth-points li:before{content:none}
.auth-points li .ico{
  position:absolute;
  left:0;
  top:4px;
  color:var(--lq-success);
}

/* Stepper done state: replace the legacy ✓ pseudo-content with a monoline mask */
.step.done .step-no::after{
  content:"";
  width:12px;
  height:12px;
  background:currentColor;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m20 6-11 11-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m20 6-11 11-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Status text that mixes an icon with a label */
.alert .ico,
.muted .ico,
.small .ico{
  margin-right:2px;
}

/* Framework-ready utility: visually hidden but screen-reader available */
.studio-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;
}

/* ==========================================================================
   Studio shell
   ========================================================================== */
.cmdbar{
  position:sticky;
  top:0;
  z-index:var(--studio-z-cmdbar);
  height:54px;
  display:flex;
  align-items:center;
  gap:14px;
  padding:0 24px;
  background:var(--studio-cmdbar-bg);
  border-bottom:0;
  box-shadow:0 1px 0 rgba(225,236,241,.72),0 14px 28px -26px rgba(22,22,42,.35);
}
.cmdbar .brand{
  display:flex;
  align-items:center;
  gap:9px;
  flex:none;
  min-width:0;
  margin-left:-8px;
}
.cmdbar .brand-mark{
  width:32px;
  height:32px;
  display:block;
  flex:none;
  object-fit:contain;
  background:transparent;
  border-radius:0;
}
.cmdbar .brand-copy{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  line-height:1.2;
}
.cmdbar .brand-copy b{
  font-size:15px;
  font-weight:750;
  letter-spacing:-.01em;
  color:var(--studio-ink);
  white-space:nowrap;
}
.cmdbar .brand-copy .brand-ai{
  color:var(--studio-brand);
  font-weight:800;
  letter-spacing:0;
}
.cmdbar .brand-copy small{
  display:inline-flex;
  align-items:center;
  margin-top:2px;
  padding:1px 6px;
  border-radius:4px;
  background:linear-gradient(90deg,var(--studio-brand-soft),#e8f9fb);
  color:var(--studio-brand-2);
  font-size:9.5px;
  line-height:1.4;
  font-weight:600;
  letter-spacing:.08em;
}
.cmdbar .doc-switch{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
  max-width:380px;
  height:30px;
  padding:0 12px;
  border:1px solid var(--studio-line);
  border-radius:15px;
  background:transparent;
  color:var(--studio-muted);
  text-align:left;
  transition:background-color var(--studio-motion-fast) var(--studio-ease),border-color var(--studio-motion-fast) var(--studio-ease);
}
.cmdbar .doc-switch:hover{
  background:var(--studio-surface-3);
  border-color:var(--studio-line-2);
}
.cmdbar .doc-switch > .ico{
  color:var(--studio-brand);
}
.doc-switch-copy{
  display:flex;
  flex-direction:column;
  min-width:0;
  line-height:1.25;
}
.doc-switch-copy small{
  display:none;
}
.doc-switch-copy b{
  font-size:14px;
  font-weight:400;
  color:var(--studio-ink);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.cmdbar-links{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  flex:0 1 auto;
  min-width:0;
  margin:0 6px;
  overflow:hidden;
}
@media (max-width:1500px){
  .cmdbar-link:nth-child(3),
  .cmdbar-link:nth-child(5){display:none}
}
.cmdbar-link{
  position:relative;
  display:inline-flex;
  align-items:center;
  gap:5px;
  height:30px;
  padding:0 12px;
  border:1px solid var(--studio-line);
  border-radius:16px;
  background:transparent;
  color:var(--studio-muted);
  font-size:14px;
  font-weight:400;
  white-space:nowrap;
}
.cmdbar-link:hover{color:var(--studio-brand)}
.msg-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:18px;
  height:18px;
  padding:0 5px;
  margin-left:4px;
  border-radius:9px;
  background:#f53f3f;
  color:#fff;
  font-size:10px;
  line-height:18px;
  font-weight:500;
}
.cmdbar .top-right{
  display:flex;
  align-items:center;
  gap:8px;
  margin-left:auto;
  flex:none;
}
.cmdbar .quota-chips{
  display:flex;
  align-items:center;
  gap:6px;
}
.cmdbar .quota-chips .chip{
  background:transparent;
  border:1px solid var(--studio-line);
  color:var(--studio-muted);
  font-size:12px;
  height:30px;
  padding:0 12px;
  border-radius:15px;
}
.cmdbar .quota-chips .chip b{
  color:var(--studio-ink);
  font-weight:600;
}
.cmdbar .recharge-btn{
  height:30px;
  padding:0 12px;
  border:1px solid var(--studio-line);
  border-radius:15px;
  background:transparent;
  color:var(--studio-muted);
  font-size:14px;
  font-weight:400;
}
.cmdbar .recharge-btn:hover{
  background:var(--studio-surface-2);
}
.cmdbar .who{
  font-size:10px;
  color:var(--studio-faint);
}
.cmdbar .avatar{
  width:28px;
  height:28px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:var(--studio-brand-soft);
  color:var(--studio-brand-2);
  font-size:11px;
  font-weight:650;
  border:1px solid var(--studio-brand-line);
}
.mobile-btn{
  display:none;
  width:32px;
  height:32px;
  place-items:center;
  border-radius:var(--studio-radius-md);
  color:var(--studio-muted);
  background:transparent;
}
.mobile-btn:hover{
  background:var(--studio-surface-2);
  color:var(--studio-ink-2);
}
.cmdbar .menu-btn{
  display:none;
  width:34px;
  height:34px;
  place-items:center;
  border-radius:var(--studio-radius-md);
  color:var(--studio-muted);
}

/* App layout */
#appView.studio-shell{
  display:grid;
  grid-template-columns:148px 260px minmax(0,1fr) 280px;
  height:calc(100vh - 54px);
  min-height:0;
  overflow:hidden;
  background:var(--studio-canvas-top-fade),var(--studio-canvas-gradient);
  transition:grid-template-columns .28s var(--studio-ease);
}

/* Icon rail */
.studio-shell .rail{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:0;
  min-width:0;
  padding:16px 0 0;
  overflow:auto;
  background:transparent;
  border-right:1px solid var(--studio-line);
  transition:width .28s var(--studio-ease);
}
.studio-shell .rail-item{
  position:relative;
  display:flex;
  flex-direction:row;
  align-items:center;
  justify-content:flex-start;
  gap:8px;
  width:132px;
  height:40px;
  margin:0 8px 4px;
  padding:10px 12px;
  border:0;
  border-radius:8px;
  background:transparent;
  color:var(--studio-ink);
  font-size:14px;
  font-weight:400;
  line-height:21px;
  text-align:left;
  transition:background-color var(--studio-motion-fast) var(--studio-ease),color var(--studio-motion-fast) var(--studio-ease);
}
.studio-shell .rail-item .si{
  width:18px;
  height:18px;
  color:var(--studio-muted);
}
.studio-shell .rail-item .si .ico{
  width:18px;
  height:18px;
}
.studio-shell .rail-item .rail-label{
  display:block;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.studio-shell .rail-item:hover{
  background:var(--studio-surface-2);
  color:var(--studio-ink);
}
.studio-shell .rail-item.active{
  background:var(--studio-surface-3);
  color:var(--studio-ink);
  font-weight:600;
}
.studio-shell .rail-item.active .si{
  color:var(--studio-ink);
}
.studio-shell .rail-item.active::before{
  display:none;
}
.studio-shell .rail-sep{
  height:1px;
  margin:8px 16px;
  background:var(--studio-line);
}
.rail-group{
  margin:0 8px 2px;
}
.rail-group-toggle{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
  width:132px;
  height:34px;
  padding:0 12px;
  border:0;
  border-radius:8px;
  background:transparent;
  color:var(--studio-muted);
  font-size:13px;
  text-align:left;
  transition:background-color var(--studio-motion-fast) var(--studio-ease),color var(--studio-motion-fast) var(--studio-ease);
}
.rail-group-toggle:hover{
  background:var(--studio-surface-2);
  color:var(--studio-ink);
}
.rail-group-toggle .si{
  width:18px;
  height:18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:var(--studio-muted);
}
.rail-group-toggle .si .ico{
  width:18px;
  height:18px;
}
.rail-group-label{
  flex:1;
  text-align:left;
}
.rail-chevron{
  color:var(--studio-faint);
  transition:transform var(--studio-motion-fast) var(--studio-ease);
}
.rail-group-toggle[aria-expanded="false"] .rail-chevron{
  transform:rotate(-90deg);
}
.rail-sub{
  display:flex;
  flex-direction:column;
  gap:2px;
  max-height:0;
  overflow:hidden;
  opacity:0;
  padding-left:14px;
  transition:max-height var(--studio-motion-base) var(--studio-ease),opacity var(--studio-motion-fast) var(--studio-ease);
}
.rail-sub.open{
  max-height:160px;
  opacity:1;
}
.rail-sub-item{
  display:flex;
  align-items:center;
  width:118px;
  height:30px;
  padding:0 10px;
  border:0;
  border-radius:6px;
  background:transparent;
  color:var(--studio-muted);
  font-size:13px;
  text-align:left;
  white-space:nowrap;
  transition:background-color var(--studio-motion-fast) var(--studio-ease),color var(--studio-motion-fast) var(--studio-ease);
}
.rail-sub-item:hover{
  background:var(--studio-surface-2);
  color:var(--studio-ink);
}
.rail-sub-item.active{
  background:var(--studio-surface-3);
  color:var(--studio-ink);
  font-weight:600;
}
.rail-foot{
  margin-top:auto;
  padding:10px 8px 8px;
  border-top:1px solid var(--studio-line);
  display:flex;
  flex-direction:column;
  gap:2px;
}
.rail-foot-link,
.rail-collapse{
  display:flex;
  align-items:center;
  gap:6px;
  width:132px;
  height:30px;
  padding:0 10px;
  border:0;
  border-radius:6px;
  background:transparent;
  color:var(--studio-muted);
  font-size:13px;
  text-align:left;
}
.rail-foot-link:hover,
.rail-collapse:hover{
  background:var(--studio-surface-2);
  color:var(--studio-ink);
}
.rail-collapse .ico{
  transform:rotate(90deg);
  color:var(--studio-faint);
}
.rail.collapsed .rail-collapse .ico{
  transform:rotate(-90deg);
}
/* Collapsed rail: 64px icon-only, reference-style */
#appView.studio-shell.rail-collapsed{
  grid-template-columns:64px 260px minmax(0,1fr) 280px;
}
.studio-shell .rail.collapsed{
  width:64px;
}
.studio-shell .rail.collapsed .rail-item,
.studio-shell .rail.collapsed .rail-group-toggle,
.studio-shell .rail.collapsed .rail-foot-link,
.studio-shell .rail.collapsed .rail-collapse{
  width:48px;
  margin-left:8px;
  margin-right:8px;
  padding:0;
  justify-content:center;
}
.studio-shell .rail.collapsed .rail-label,
.studio-shell .rail.collapsed .rail-group-label,
.studio-shell .rail.collapsed .rail-chevron,
.studio-shell .rail.collapsed .rail-sub,
.studio-shell .rail.collapsed .rail-foot-link,
.studio-shell .rail.collapsed .rail-collapse span{
  display:none;
}
.studio-shell .rail.collapsed .rail-group{
  display:none;
}
.studio-shell .rail.collapsed .rail-sep{
  margin:8px 14px;
}

/* Context pane */
.studio-shell .context{
  display:flex;
  flex-direction:column;
  min-width:0;
  height:100%;
  overflow:auto;
  background:#fff;
  border-right:1px solid var(--studio-line);
}
.context-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
  padding:12px 14px;
  border-bottom:1px solid var(--studio-line);
}
.context-head h2{
  font-size:12px;
  font-weight:650;
  color:var(--studio-ink);
}
.context-head p{
  margin-top:2px;
  font-size:9.5px;
  color:var(--studio-faint);
}
.context-head .icon-btn{
  width:26px;
  height:26px;
  color:var(--studio-faint);
}
.context-doc{
  padding:12px 14px;
  border-bottom:1px solid var(--studio-line);
}
.context-doc b{
  display:block;
  font-size:12px;
  font-weight:600;
  line-height:1.5;
  color:var(--studio-ink);
  overflow-wrap:anywhere;
}
.context-tags{
  display:flex;
  flex-wrap:wrap;
  gap:4px;
  margin-top:7px;
}
.tiny-tag{
  display:inline-flex;
  align-items:center;
  height:19px;
  padding:0 5px;
  border:1px solid var(--studio-line);
  border-radius:3px;
  background:var(--studio-surface-2);
  color:var(--studio-muted);
  font-size:9px;
  white-space:nowrap;
}
.context-tabs{
  display:flex;
  gap:2px;
  padding:8px 10px 0;
  border-bottom:1px solid var(--studio-line);
}
.context-tab{
  height:26px;
  padding:0 8px;
  border-radius:var(--studio-radius-sm) var(--studio-radius-sm) 0 0;
  color:var(--studio-muted);
  font-size:10px;
}
.context-tab:hover{
  background:var(--studio-surface-2);
}
.context-tab[aria-pressed="true"]{
  background:var(--studio-brand-soft);
  color:var(--studio-brand);
  font-weight:500;
  border-radius:6px;
  box-shadow:none;
}
.context-tree{
  flex:1;
  min-height:0;
  overflow:auto;
  padding:8px;
}
.context-empty{
  padding:18px 10px;
  color:var(--studio-faint);
  font-size:10.5px;
  line-height:1.65;
  text-align:center;
}
.context-label{
  margin:0 0 6px;
  padding:0 2px;
  font-size:9px;
  font-weight:600;
  color:var(--studio-faint);
  letter-spacing:.06em;
}
.context-node{
  display:flex;
  align-items:center;
  gap:7px;
  width:100%;
  min-height:31px;
  padding:5px 8px;
  border-radius:var(--studio-radius-sm);
  color:var(--studio-ink-2);
  font-size:11px;
  text-align:left;
}
.context-node .ico{
  width:14px;
  height:14px;
  color:var(--studio-faint);
}
.context-node .context-name{
  flex:1;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.context-node .context-state{
  width:6px;
  height:6px;
  flex:none;
  border-radius:50%;
  background:var(--studio-line-2);
}
.context-node .context-state.done{background:var(--studio-success)}
.context-node .context-state.running{background:var(--studio-running)}
.context-node[data-level="2"]{padding-left:18px}
.context-node[data-level="3"]{padding-left:28px}
.context-node:hover{background:var(--studio-surface-2)}
.context-node.active{
  background:var(--studio-brand-soft);
  color:var(--studio-brand-2);
  font-weight:600;
}
.context-node.active .ico{color:var(--studio-brand)}
.studio-shell .side-docs{
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:12px 14px;
  border-top:1px solid var(--studio-line);
  flex:none;
}
.studio-shell .side-docs .btn{
  height:30px;
  font-size:11px;
}
.studio-shell .doc-list{
  list-style:none;
  margin:0;
  padding:0;
  max-height:180px;
  overflow:auto;
}
.studio-shell .doc-list li{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
  padding:8px 10px;
  border-radius:6px;
  color:var(--studio-ink);
  font-size:13px;
  cursor:pointer;
}
.studio-shell .doc-list li:hover{background:var(--studio-surface-2)}
.studio-shell .doc-list li.active{
  background:var(--studio-brand-tint);
  color:var(--studio-brand);
  font-weight:500;
}
.studio-shell .doc-list li.empty{
  color:var(--studio-faint);
  font-size:10px;
  cursor:default;
}
.studio-shell .doc-list .doc-name{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.studio-shell .doc-list .del{
  color:var(--studio-faint);
}
.studio-shell .side-foot{
  margin-top:auto;
  padding:12px 14px;
  border-top:1px solid var(--studio-line);
  background:var(--studio-surface-2);
}
.studio-shell .side-foot .side-title{
  margin:0 0 5px;
  font-size:9px;
  font-weight:600;
  color:var(--studio-faint);
  letter-spacing:.06em;
  text-transform:none;
}
.studio-shell .quota-box{
  font-size:10px;
  line-height:1.65;
  color:var(--studio-muted);
  margin-bottom:6px;
}
.studio-shell .quota-box b{color:var(--studio-ink-2)}
.studio-shell .side-links{
  display:flex;
  gap:10px;
  font-size:9.5px;
  color:var(--studio-faint);
  margin:4px 0;
}
.studio-shell .upgrade-btn{
  width:100%;
  height:28px;
  margin-top:5px;
  border:1px solid var(--studio-line-2);
  border-radius:var(--studio-radius-md);
  background:#fff;
  color:var(--studio-muted);
  font-size:10px;
}
.studio-shell .upgrade-btn:hover{background:var(--studio-surface-2)}

/* Stage */
.studio-shell .stage{
  display:flex;
  flex-direction:column;
  min-width:0;
  min-height:0;
  height:100%;
  overflow:hidden;
  background:transparent;
}
.stage-head{
  flex:none;
  width:calc(100% - 48px - 2 * var(--stage-gutter, 0px));
  max-width:var(--studio-content-width, 1120px);
  margin:0 auto;
  padding:20px 0 0;
}
.stage-head .doc-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  max-width:none;
  margin:0 0 10px;
  padding:0;
  border:0;
}
.doc-head-copy{min-width:0}
.view-kicker{
  display:flex;
  align-items:center;
  gap:6px;
  margin:0 0 4px;
  color:var(--studio-brand);
  font-size:12px;
  font-weight:600;
  letter-spacing:.02em;
}
.stage-head #docTitle{
  margin:0;
  font-size:18px;
  line-height:1.4;
  font-weight:600;
  letter-spacing:0;
  color:var(--studio-ink);
  overflow-wrap:anywhere;
}
.stage-head .doc-meta{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
  margin-top:7px;
}
.stage-head .doc-meta .tag{
  display:inline-flex;
  align-items:center;
  height:24px;
  padding:0 8px;
  border:1px solid var(--studio-line);
  border-radius:4px;
  background:#fff;
  color:var(--studio-muted);
  font-size:12px;
  white-space:nowrap;
}
.stage-head .doc-meta .tag b{color:var(--studio-ink-2);font-weight:600}
.stage-head .doc-actions{
  display:flex;
  align-items:center;
  gap:6px;
  flex:none;
  padding-top:2px;
}

/* Stage chips */
.studio-shell .stepper{
  display:flex;
  align-items:center;
  max-width:none;
  justify-content:center;
  gap:0;
  margin:0 0 8px;
  padding:10px 16px;
  border:0;
  border-radius:8px;
  background:#fff;
  overflow-x:auto;
  overflow-y:hidden;
  position:static;
}
.studio-shell .stepper .step{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  flex:1;
  min-width:0;
  height:28px;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  color:var(--studio-muted);
  font-family:var(--studio-font-ui);
  font-size:16px;
  line-height:1.2;
  white-space:nowrap;
  transition:color var(--studio-motion-fast) var(--studio-ease);
}
.studio-shell .stepper .step::after{
  content:"";
  flex:none;
  width:clamp(18px,3.2vw,80px);
  height:1px;
  margin:0 8px;
  background:var(--studio-line);
}
.studio-shell .stepper .step:last-of-type::after{display:none}
.studio-shell .stepper .step:hover{background:transparent;color:var(--studio-ink-2)}
.studio-shell .stepper .step.active{
  background:transparent;
  color:var(--studio-ink);
  font-weight:600;
}
.studio-shell .stepper .step-no{
  width:28px;
  height:28px;
  display:grid;
  place-items:center;
  border:2px solid var(--studio-line);
  border-radius:50%;
  background:#fff;
  color:var(--studio-muted);
  font-size:12px;
  font-weight:600;
  font-variant-numeric:tabular-nums;
}
.studio-shell .stepper .step.active .step-no{
  background:var(--studio-brand);
  border-color:var(--studio-brand);
  color:#fff;
}
.studio-shell .stepper .step.done .step-no{
  background:var(--studio-brand);
  border-color:var(--studio-brand);
  color:#fff;
  font-size:0;
}
.studio-shell .stepper .step.done .step-no::after{
  content:"";
  width:10px;
  height:10px;
  background:currentColor;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m20 6-11 11-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m20 6-11 11-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Stage scroll + panels */
.stage-scroll{
  flex:1;
  min-height:0;
  overflow:auto;
  padding:20px 24px 40px;
  scrollbar-gutter:stable both-edges;
  scroll-behavior:smooth;
}
.studio-shell .stage .panel{
  display:block;
  width:100%;
  max-width:var(--studio-content-width, 1120px);
  margin:0 auto;
  padding:24px;
  border:1px solid rgba(229,232,237,.7);
  border-radius:12px;
  background:#fff;
  box-shadow:0 1px 2px rgba(16,24,40,.04),0 1px 3px rgba(16,24,40,.06);
  animation:none;
}
/* Settings page carries its own white card */
.studio-shell .stage #panel0{
  max-width:var(--studio-content-width, 1120px);
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
}
.studio-shell .stage .panel.panel-anim{animation:none}
.studio-shell .wizard-footer{
  position:static;
  flex:none;
  width:calc(100% - 48px);
  max-width:1264px;
  margin:0 auto 10px;
  padding:10px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  background:#fff;
  border:1px solid var(--studio-line);
  border-radius:8px;
  box-shadow:none;
}
.studio-shell .wizard-footer .btn{
  height:30px;
  font-size:11px;
}
.studio-shell .wizard-hint{
  flex:1;
  text-align:center;
  font-size:10.5px;
  color:var(--studio-faint);
}

/* Inspector */
.studio-shell .inspector{
  display:flex;
  flex-direction:column;
  min-width:0;
  height:100%;
  overflow:auto;
  background:#fff;
  border-left:1px solid var(--studio-line);
}
.inspector-head{
  position:sticky;
  top:0;
  z-index:2;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
  padding:12px 14px;
  border-bottom:1px solid var(--studio-line);
  background:#fff;
}
.inspector-head h2{
  font-size:12px;
  font-weight:650;
  color:var(--studio-ink);
}
.inspector-head p{
  margin-top:2px;
  font-size:9.5px;
  color:var(--studio-faint);
}
.inspector-head .icon-btn{
  width:26px;
  height:26px;
  color:var(--studio-faint);
}
.inspector-body{padding:0}
.inspector-block{
  padding:12px 14px;
  border-bottom:1px solid var(--studio-line);
}
.inspector-block:last-child{border-bottom:0}
.inspector-block h3{
  display:flex;
  align-items:center;
  gap:6px;
  margin:0 0 8px;
  color:var(--studio-muted);
  font-size:10px;
  font-weight:600;
  letter-spacing:.03em;
}
.inspector-kv{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:5px 10px;
  font-size:10px;
  color:var(--studio-muted);
}
.inspector-kv b{
  color:var(--studio-ink-2);
  font-weight:600;
  text-align:right;
  font-variant-numeric:tabular-nums;
  overflow-wrap:anywhere;
}
.inspector-note{
  padding:8px 9px;
  border:1px solid var(--studio-line);
  border-radius:var(--studio-radius-sm);
  background:var(--studio-surface-2);
  color:var(--studio-muted);
  font-size:9.5px;
  line-height:1.6;
}
.inspector-note + .inspector-note{margin-top:6px}
.inspector-progress{
  height:4px;
  margin-top:7px;
  border-radius:2px;
  background:var(--studio-surface-3);
  overflow:hidden;
}
.inspector-progress i{
  display:block;
  height:100%;
  border-radius:2px;
  background:var(--studio-brand);
  transition:width var(--studio-motion-base) var(--studio-ease);
}
.inspector-list{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.inspector-item{
  padding:7px 8px;
  border:1px solid var(--studio-line);
  border-radius:var(--studio-radius-sm);
  background:var(--studio-surface-2);
}
.inspector-item b{
  display:block;
  color:var(--studio-ink-2);
  font-size:9.5px;
  font-weight:600;
  line-height:1.45;
}
.inspector-item small{
  display:block;
  margin-top:2px;
  color:var(--studio-faint);
  font-size:8.5px;
}
.inspector-actions{
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:12px 14px;
}
.inspector-actions .btn{width:100%;height:30px;font-size:10.5px}
.inspector-empty{
  padding:22px 14px;
  color:var(--studio-faint);
  font-size:10.5px;
  line-height:1.65;
  text-align:center;
}

@media (min-width:1600px){
  #inspectorClose{display:none}
}
@media (min-width:1280px){
  #contextClose{display:none}
}

/* Drawer scrim */
.drawer-scrim{
  display:none;
  position:fixed;
  inset:54px 0 0;
  z-index:var(--studio-z-scrim);
  background:rgba(26,31,43,.28);
  opacity:0;
  pointer-events:none;
  transition:opacity var(--studio-motion-base) var(--studio-ease);
}
.drawer-scrim.show{
  opacity:1;
  pointer-events:auto;
}

/* ==========================================================================
   Legacy panel content, restyled into the Studio visual language
   ========================================================================== */
.studio-shell .panel-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin:0 0 14px;
  padding:0;
  border:0;
}
.studio-shell .panel-head h2{
  margin:0 0 3px;
  font-size:16px;
  font-weight:650;
  line-height:1.35;
  color:var(--studio-ink);
}
.studio-shell .panel-head p,
.studio-shell .panel-head .muted{
  margin:0;
  color:var(--studio-muted);
  font-size:11px;
  line-height:1.6;
}
.studio-shell .panel-head .row{
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
}
.studio-shell .section-title{
  margin:18px 0 8px;
  font-size:14px;
  font-weight:650;
  color:var(--studio-ink);
}
.studio-shell .card,
.studio-shell .kpi,
.studio-shell .list,
.studio-shell .rules-box,
.studio-shell .parse-card,
.studio-shell .lq-ref-card,
.studio-shell .lq-img-card,
.studio-shell .skill-card,
.studio-shell .basis-card,
.studio-shell .interp,
.studio-shell .toolbar,
.studio-shell .tree-table,
.studio-shell .chapter-pane,
.studio-shell .write-main,
.studio-shell .export-grid{
  background:#fff;
  border:1px solid var(--studio-line);
  border-radius:var(--studio-radius-lg);
  box-shadow:var(--studio-shadow-control);
}
.studio-shell .card{
  padding:16px;
}
.studio-shell .card h3{
  margin:0 0 8px;
  font-size:13px;
  font-weight:650;
  color:var(--studio-ink);
}
.studio-shell .muted{color:var(--studio-muted)}
.studio-shell .small{font-size:11px}
.studio-shell .btn{
  height:32px;
  padding:0 16px;
  border:1px solid var(--studio-line);
  border-radius:8px;
  background:#fff;
  color:var(--studio-ink);
  font-size:14px;
  font-weight:400;
  box-shadow:none;
  gap:6px;
  transition:background-color var(--studio-motion-fast) var(--studio-ease),border-color var(--studio-motion-fast) var(--studio-ease),transform .1s var(--studio-ease);
}
.studio-shell .btn:hover{
  background:var(--studio-surface-2);
  border-color:var(--studio-line-3);
  box-shadow:none;
}
.studio-shell .btn:active{transform:translateY(1px)}
.studio-shell .btn.primary{
  background:var(--studio-brand);
  border-color:var(--studio-brand);
  color:#fff;
  border-radius:8px;
  padding:0 16px;
  font-weight:400;
}
.studio-shell .btn.primary:hover{
  background:var(--studio-brand-2);
  border-color:var(--studio-brand-2);
}
.studio-shell .btn.ghost{
  background:transparent;
  border-color:transparent;
}
.studio-shell .btn.ghost:hover{background:var(--studio-surface-2)}
.studio-shell .btn.sm{height:30px;padding:0 12px;font-size:13px}
.studio-shell .btn.xs{height:26px;padding:0 10px;font-size:12px;border-radius:4px}
.studio-shell .btn.block{width:100%}
.studio-shell .btn.demo{
  background:var(--studio-brand-soft);
  border-color:var(--studio-brand-line);
  color:var(--studio-brand-2);
}
.studio-shell .btn:disabled{
  opacity:.5;
  cursor:not-allowed;
  transform:none;
}
.studio-shell input,
.studio-shell select,
.studio-shell textarea{
  height:32px;
  padding:0 10px;
  border:1px solid var(--studio-line);
  border-radius:4px;
  background:#fff;
  color:var(--studio-ink);
  font-size:14px;
  margin-top:0;
  transition:border-color var(--studio-motion-fast) var(--studio-ease),box-shadow var(--studio-motion-fast) var(--studio-ease);
}
.studio-shell textarea{height:auto;min-height:90px;padding:8px 9px;line-height:1.7}
.studio-shell input:hover,
.studio-shell select:hover,
.studio-shell textarea:hover{border-color:var(--studio-line-3)}
.studio-shell input:focus,
.studio-shell select:focus,
.studio-shell textarea:focus{
  outline:2px solid var(--studio-brand-soft);
  border-color:var(--studio-brand);
}
.studio-shell label{
  display:block;
  margin-bottom:10px;
  color:var(--studio-ink-2);
  font-size:11px;
}
.studio-shell label.inline{
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin:0;
}
.studio-shell label.inline input,
.studio-shell label.inline select{
  width:auto;
  height:30px;
}
.studio-shell label.check{
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin:0;
}

/* Dashboard / KPI */
.studio-shell .kpi-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:0;
  margin:0 0 14px;
  overflow:hidden;
  background:#fff;
  border:1px solid var(--studio-line);
  border-radius:var(--studio-radius-lg);
  box-shadow:var(--studio-shadow-control);
}
.studio-shell .kpi{
  min-width:0;
  padding:12px 16px;
  border:0;
  border-left:1px solid var(--studio-line);
  border-radius:0;
  box-shadow:none;
}
.studio-shell .kpi:first-child{border-left:0}
.studio-shell .kpi-label{
  color:var(--studio-faint);
  font-size:9.5px;
}
.studio-shell .kpi-value{
  margin-top:2px;
  color:var(--studio-ink);
  font-size:22px;
  font-weight:650;
  letter-spacing:-.01em;
  font-variant-numeric:tabular-nums;
}
.studio-shell .kpi-sub{
  margin-top:1px;
  color:var(--studio-muted);
  font-size:9.5px;
}
.studio-shell .dash-grid{
  display:grid;
  grid-template-columns:minmax(0,1.35fr) minmax(0,.85fr);
  gap:14px;
  align-items:start;
}
.studio-shell .tbl{font-size:10.5px}
.studio-shell .tbl th{
  padding:14px 16px;
  border-bottom:1px solid var(--studio-line);
  background:var(--studio-canvas-2);
  color:var(--studio-muted);
  font-size:13px;
  font-weight:600;
  white-space:nowrap;
}
.studio-shell .tbl td{
  padding:14px 16px;
  border-bottom:1px solid var(--studio-line);
  color:var(--studio-ink);
  font-size:14px;
  vertical-align:middle;
}
.studio-shell .tbl tr:last-child td{border-bottom:0}
.studio-shell .tbl th:last-child,
.studio-shell .tbl td:last-child{text-align:right}

/* Alerts, chips, tags */
.studio-shell .alert{
  padding:9px 11px;
  border:1px solid var(--studio-line);
  border-radius:var(--studio-radius-md);
  background:#fff;
  color:var(--studio-ink-2);
  font-size:11px;
  line-height:1.65;
}
.studio-shell .alert.info{background:var(--studio-brand-soft);border-color:var(--studio-brand-line);color:var(--studio-brand-2)}
.studio-shell .alert.ok{background:var(--studio-success-soft);border-color:#c9edd5;color:var(--studio-success)}
.studio-shell .alert.warn{background:var(--studio-warning-soft);border-color:#efce8f;color:var(--studio-warning)}
.studio-shell .alert.danger{background:var(--studio-danger-soft);border-color:#eab1ac;color:var(--studio-danger)}
.studio-shell .chips{display:flex;flex-wrap:wrap;gap:5px}
.studio-shell .chip{
  display:inline-flex;
  align-items:center;
  height:22px;
  padding:0 7px;
  border:1px solid var(--studio-line);
  border-radius:4px;
  background:var(--studio-surface-2);
  color:var(--studio-muted);
  font-size:10px;
  white-space:nowrap;
}
.studio-shell .chip b{color:var(--studio-ink-2);font-weight:600;margin-left:4px}
.studio-shell .tag{
  display:inline-flex;
  align-items:center;
  height:20px;
  padding:0 6px;
  border:1px solid var(--studio-line);
  border-radius:4px;
  background:var(--studio-surface-2);
  color:var(--studio-muted);
  font-size:9.5px;
  white-space:nowrap;
}
.studio-shell .empty-state{
  padding:34px 20px;
  border:1px dashed var(--studio-line-2);
  border-radius:var(--studio-radius-lg);
  background:var(--studio-paper-muted);
  color:var(--studio-muted);
  text-align:center;
  font-size:11px;
  line-height:1.65;
}
.studio-shell .empty-state b{color:var(--studio-ink-2);font-size:12px}

/* Parse screen */
.studio-shell .parse-choices{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  margin-top:0;
}
.studio-shell .parse-card{
  display:flex;
  gap:10px;
  padding:18px 16px;
  min-height:0;
  border-color:transparent;
  background:var(--studio-surface-2);
  transition:border-color var(--studio-motion-fast) var(--studio-ease),background-color var(--studio-motion-fast) var(--studio-ease);
}
.studio-shell .parse-card:hover{
  transform:none;
  border-color:var(--studio-line);
  box-shadow:none;
  background:var(--studio-surface-2);
}
.studio-shell .parse-icon{
  width:36px;
  height:36px;
  flex:none;
  display:grid;
  place-items:center;
  border:1px solid var(--studio-line);
  border-radius:var(--studio-radius-lg);
  background:var(--studio-surface-2);
  color:var(--studio-brand);
  font-size:18px;
}
.studio-shell .parse-body b{font-size:13px;font-weight:650;color:var(--studio-ink)}
.studio-shell .parse-body p{font-size:11px;line-height:1.65;color:var(--studio-muted)}
.studio-shell .parse-body .small{font-size:10px;color:var(--studio-faint)}
.studio-shell .lq-section{margin-top:20px}
.studio-shell .lq-sec-title{font-size:13px;font-weight:650;color:var(--studio-ink);margin-bottom:8px}
.studio-shell .lq-sec-title i{color:var(--studio-danger)}
.studio-shell .lq-sec-title em{font-size:10.5px;color:var(--studio-muted);font-style:normal;font-weight:400;line-height:1.6}
.studio-shell .type-tabs{display:flex;flex-wrap:wrap;gap:6px}
.studio-shell .type-tab{
  height:32px;
  padding:0 11px;
  border:1px solid var(--studio-line-2);
  border-radius:var(--studio-radius-md);
  background:#fff;
  color:var(--studio-ink-2);
  font-size:11px;
}
.studio-shell .type-tab:hover{background:var(--studio-surface-2);border-color:var(--studio-line-3)}
.studio-shell .type-tab.active{
  background:#333333;
  border-color:#333333;
  color:#ffffff;
  font-weight:500;
}
.studio-shell .lq-two{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.studio-shell .lq-ref-card{
  display:flex;
  gap:10px;
  padding:18px 16px;
  cursor:pointer;
  border-color:transparent;
  background:var(--studio-surface-2);
  transition:border-color var(--studio-motion-fast) var(--studio-ease),background-color var(--studio-motion-fast) var(--studio-ease);
}
.studio-shell .lq-ref-card:hover{
  transform:none;
  border-color:var(--studio-line);
  background:var(--studio-surface-2);
  box-shadow:none;
}
.studio-shell .lq-ref-icon{
  width:32px;
  height:32px;
  flex:none;
  display:grid;
  place-items:center;
  border:1px solid var(--studio-line);
  border-radius:var(--studio-radius-md);
  background:var(--studio-surface-2);
  color:var(--studio-brand);
}
.studio-shell .lq-ref-card b{font-size:12px;font-weight:600;color:var(--studio-ink)}
.studio-shell .lq-ref-card p{margin:2px 0 0;font-size:10.5px;line-height:1.6;color:var(--studio-muted)}
.studio-shell .lq-img-sources{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.studio-shell .lq-img-card{
  padding:18px 16px;
  border-radius:var(--studio-radius-lg);
  border-color:transparent;
  background:var(--studio-surface-2);
  transition:border-color var(--studio-motion-fast) var(--studio-ease),background-color var(--studio-motion-fast) var(--studio-ease);
}
.studio-shell .lq-img-card:hover{transform:none;box-shadow:none;border-color:var(--studio-line);background:var(--studio-surface-2)}
.studio-shell .lq-img-card.active{
  border-color:var(--studio-brand-line);
  background:var(--studio-brand-soft);
}
.studio-shell .lq-img-card p{font-size:10px;line-height:1.55;color:var(--studio-muted);margin:4px 0 8px}
.studio-shell .lq-img-head{font-size:11.5px;font-weight:600;color:var(--studio-ink)}
.studio-shell .lq-thumbs{display:flex;gap:4px}
.studio-shell .lq-thumbs i{
  display:block;
  width:28px;
  height:20px;
  border-radius:3px;
  background:linear-gradient(135deg,#eef1f6,#dde3ec);
  border:1px solid var(--studio-line);
}
.studio-shell .lq-check{
  position:absolute;
  top:9px;
  right:9px;
  width:17px;
  height:17px;
  border:1px solid var(--studio-line-2);
  border-radius:50%;
  background:#fff;
  color:transparent;
}
.studio-shell .lq-img-card.active .lq-check{
  background:var(--studio-brand);
  border-color:var(--studio-brand);
  color:#fff;
}
.studio-shell .parse-result-editor{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  margin:16px 0;
}
.studio-shell .pr-head{
  margin-bottom:7px;
  color:var(--studio-ink);
  font-size:12px;
  font-weight:650;
}
.studio-shell .pr-head i{color:var(--studio-danger);font-style:normal}
.studio-shell .pr-box{
  height:340px;
  overflow:auto;
  padding:15px 16px;
  border:1px solid var(--studio-line);
  border-radius:var(--studio-radius-lg);
  background:var(--studio-paper);
  color:var(--studio-ink-2);
  font-family:var(--studio-font-serif);
  font-size:12.5px;
  line-height:1.9;
  outline:none;
}
.studio-shell .pr-box:focus{
  border-color:var(--studio-brand);
  box-shadow:0 0 0 2px var(--studio-brand-soft);
}
.studio-shell .pr-box h3{font-family:var(--studio-font-ui);font-size:13px;font-weight:650}
.studio-shell .pr-box h4{font-family:var(--studio-font-ui);font-size:12px;font-weight:650}
.studio-shell .full-report{
  margin-top:12px;
  padding-top:10px;
  border-top:1px solid var(--studio-line);
}
.studio-shell .full-report summary{
  color:var(--studio-brand);
  font-size:11px;
  cursor:pointer;
}
.studio-shell .full-report-body{display:flex;flex-direction:column;gap:12px;margin-top:10px}
.studio-shell .kv-row{
  display:grid;
  grid-template-columns:84px minmax(0,1fr);
  gap:10px;
  padding:6px 0;
  border-bottom:1px solid var(--studio-line);
  font-size:11px;
}
.studio-shell .kv-row span{color:var(--studio-muted)}
.studio-shell .kv-row b{font-weight:500;color:var(--studio-ink);text-align:left;overflow-wrap:anywhere}
.studio-shell .req{font-size:11px;line-height:1.65;padding:6px 0;border-bottom:1px solid var(--studio-line)}
.studio-shell .interp{padding:14px}
.studio-shell .interp h3{font-size:12px}
.studio-shell .interp h4{font-size:11px;margin-top:10px}
.studio-shell .interp ul{padding-left:16px;margin:5px 0 8px}
.studio-shell .interp li{font-size:10.5px;line-height:1.65;color:var(--studio-ink-2)}

/* Catalog */
.studio-shell .toolbar{
  display:flex;
  align-items:center;
  gap:7px;
  flex-wrap:wrap;
  margin:0 0 12px;
  padding:9px 11px;
  font-size:10.5px;
}
.studio-shell .tree-table{
  overflow:hidden;
  background:#fff;
  border:1px solid var(--studio-line);
  border-radius:var(--studio-radius-lg);
}
.studio-shell .tree-head,
.studio-shell .tree-row{
  display:grid;
  grid-template-columns:minmax(180px,1fr) minmax(230px,1.35fr) 96px 66px 176px;
  gap:8px;
  align-items:center;
  padding:12px 16px;
}
.studio-shell .tree-head{
  background:var(--studio-canvas-2);
  border-bottom:1px solid var(--studio-line);
  color:var(--studio-muted);
  font-size:13px;
  font-weight:600;
}
.studio-shell .tree-row{
  border-bottom:1px solid var(--studio-line);
  color:var(--studio-ink);
  font-size:14px;
}
.studio-shell .tree-row:last-child{border-bottom:0}
.studio-shell .tree-row:hover{background:var(--studio-surface-2)}
.studio-shell .tree-row.lv1{background:rgba(238,250,252,.62);font-weight:600;color:var(--studio-ink)}
.studio-shell .tree-title{display:flex;align-items:center;gap:6px;min-width:0;line-height:1.5}
.studio-shell .tree-title b{font-weight:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.studio-shell .tree-idea{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:0;
  overflow:hidden;
  color:var(--studio-ink-2);
  font-size:12.5px;
  line-height:1.55;
  white-space:normal;
}
.studio-shell .idea-copy{
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
  overflow-wrap:anywhere;
}
.studio-shell .score-ref{
  display:block;
  align-self:flex-start;
  max-width:100%;
  padding:2px 6px;
  border:1px solid var(--studio-brand-line);
  border-radius:4px;
  background:var(--studio-brand-soft);
  color:var(--studio-brand-2);
  font-size:10.5px;
  line-height:1.4;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.studio-shell .tree-page{font-family:var(--studio-font-mono);font-size:11px;color:var(--studio-ink)}
.studio-shell .tree-ops{display:flex;gap:3px;justify-content:flex-end}
.studio-shell .options{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 10px}
.studio-shell .option-card{
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 8px;
  border:1px solid var(--studio-brand-line);
  border-radius:var(--studio-radius-sm);
  background:var(--studio-brand-soft);
  color:var(--studio-brand-2);
  font-size:10px;
}
.studio-shell .basis-panel{display:grid;grid-template-columns:1.15fr .85fr 1.2fr;gap:10px;margin:0 0 12px}
.studio-shell .basis-card{padding:11px 12px;border-radius:var(--studio-radius-lg)}
.studio-shell .basis-card h4{font-size:10.5px;margin:0 0 5px}
.studio-shell .basis-card p{font-size:10px;line-height:1.6}

/* Writing */
.studio-shell .write-grid{
  display:grid;
  grid-template-columns:280px minmax(0,1fr);
  gap:12px;
  align-items:start;
}
.studio-shell .chapter-pane,
.studio-shell .write-main{
  overflow:hidden;
  background:#fff;
  border:1px solid var(--studio-line);
  border-radius:var(--studio-radius-lg);
}
.studio-shell .pane-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:9px 12px;
  border-bottom:1px solid var(--studio-line);
  background:var(--studio-surface-2);
  color:var(--studio-ink-2);
  font-size:10px;
  font-weight:600;
}
.studio-shell .chapter-items{max-height:calc(100vh - 330px);overflow:auto;padding:6px}
.studio-shell .chapter-items li{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
  padding:6px 7px;
  border-radius:var(--studio-radius-sm);
  color:var(--studio-ink-2);
  font-size:10.5px;
  line-height:1.45;
}
.studio-shell .chapter-items li:hover{background:var(--studio-surface-2)}
.studio-shell .chapter-items li.active{background:var(--studio-brand-soft);color:var(--studio-brand-2);font-weight:600}
.studio-shell .chapter-items li.parent{color:var(--studio-muted)}
.studio-shell .ch-words{font-family:var(--studio-font-mono);font-size:8.5px;color:var(--studio-faint)}
.studio-shell .stream-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:8px 12px;
  border-bottom:1px solid var(--studio-line);
  background:var(--studio-surface-2);
  font-size:10px;
}
.studio-shell .stream-content{
  display:block;
  width:100%;
  max-height:calc(100vh - 390px);
  min-height:320px;
  margin:0;
  padding:20px 24px;
  overflow:auto;
  background:var(--studio-paper);
  color:var(--studio-ink);
  font-family:var(--studio-font-serif);
  font-size:14px;
  line-height:1.95;
  white-space:pre-wrap;
  word-break:break-word;
}
.studio-shell .job-box{padding:8px 12px 0;background:var(--studio-surface-2)}
.studio-shell .job-line{font-size:10px;padding:4px 0}
.studio-shell .bar{height:4px;border-radius:2px;background:var(--studio-surface-3)}
.studio-shell .bar i{background:var(--studio-brand)}
.studio-shell .pill{font-size:10.5px;height:21px;padding:0 8px;border-radius:4px;line-height:21px;font-weight:500}
.studio-shell .pill.DONE{background:var(--studio-success-soft);color:var(--studio-success)}
.studio-shell .pill.RUNNING{background:var(--studio-running-soft);color:var(--studio-running)}
.studio-shell .pill.PENDING{background:var(--studio-surface-2);color:var(--studio-ink-2)}
.studio-shell .pill.PAUSED{background:var(--studio-warning-soft);color:var(--studio-warning)}
.studio-shell .pill.FAILED,
.studio-shell .pill.CANCELLED{background:var(--studio-danger-soft);color:var(--studio-danger)}

/* Sealed */
.studio-shell .rules-box{
  margin-bottom:12px;
  padding:10px 12px;
}
.studio-shell .rules-box summary{font-size:14px;color:var(--studio-ink)}
.studio-shell .rule-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px 12px;margin:10px 0}
.studio-shell .issue{
  border:1px solid var(--studio-line);
  border-radius:8px;
  padding:12px 14px;
  background:#fff;
  box-shadow:none;
}
.studio-shell .issue.sev-P0,
.studio-shell .issue.sev-A,
.studio-shell .issue.sev-B{border-left:1px solid var(--studio-line)}
.studio-shell .issue-head{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-size:13px}
.studio-shell .issue-head .btn{margin-left:auto}
.studio-shell .numbering-preview{
  border:1px solid var(--studio-line);
  border-radius:var(--studio-radius-sm);
  background:var(--studio-surface-2);
  padding:8px 10px;
}

/* Export */
.studio-shell .export-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px 12px;
  margin:0 0 12px;
  padding:12px;
}
.studio-shell .export-grid label{margin:0}
.studio-shell .table-density-row{grid-column:1/-1;display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding-top:8px;border-top:1px solid var(--studio-line)}
.studio-shell .table-density .btn.active{
  border-color:var(--studio-brand-line);
  background:var(--studio-brand-soft);
  color:var(--studio-brand-2);
}

/* Knowledge, images, skills */
.studio-shell .kb-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
/* Reference /pictures: CSS multi-column masonry, 220px columns */
.studio-shell .image-grid{
  columns:220px;
  column-gap:16px;
  display:block;
  margin-top:10px;
}
.studio-shell .image-card{
  break-inside:avoid;
  margin:0 0 16px;
  border:1px solid #e5e5e5;
  border-radius:12px;
  overflow:hidden;
  background:#fff;
  transition:box-shadow .25s,border-color .25s;
}
.studio-shell .image-card:hover{
  border-color:#d5d9e1;
  box-shadow:0 4px 12px rgba(0,0,0,.08);
}
.studio-shell .image-card .img-box{
  height:auto;
  aspect-ratio:1/1;
  background:#f0f0f0;
  overflow:hidden;
}
.studio-shell .image-card img{
  transition:transform .3s;
}
.studio-shell .image-card:hover img{
  transform:scale(1.05);
}
/* Reference /pictures search: 52px gray pill */
.studio-shell #imgQuery,
.studio-shell #kbQuery,
.studio-shell #hdbQuery,
.studio-shell #corpusQuery{
  height:38px;
  padding:0 16px;
  border:1px solid transparent;
  border-radius:999px;
  background:#f0f0f0;
}
.studio-shell #imgQuery:focus,
.studio-shell #kbQuery:focus,
.studio-shell #hdbQuery:focus,
.studio-shell #corpusQuery:focus{
  border-color:var(--studio-brand);
  background:#fff;
}
/* Reference /write/knowledgeBase: white cards, dashed upload areas, list rows */
.studio-shell #panel6 .card{
  border-color:var(--studio-line-faint);
  border-radius:12px;
  box-shadow:0 1px 3px rgba(0,0,0,.04);
}
.studio-shell #panel6 .card h3{
  font-size:16px;
  font-weight:600;
}
.studio-shell #panel6 .file-btn{
  height:36px;
  padding:0 18px;
  border-color:var(--studio-brand);
  border-radius:20px;
  background:var(--studio-brand);
  color:#fff;
  font-size:14px;
}
.studio-shell #panel6 .file-btn:hover{
  border-color:var(--studio-brand-2);
  background:var(--studio-brand-2);
}
.studio-shell .list-row{
  padding:14px 16px;
  border-bottom:1px solid var(--studio-line);
  color:var(--studio-ink);
  font-size:14px;
}
.studio-shell .list-row:last-child{border-bottom:0}
.studio-shell .empty-state{
  padding:80px 24px;
  gap:12px;
  border:0;
  background:transparent;
  color:#94a3b8;
  font-size:13px;
}
.studio-shell .empty-state b{
  color:var(--studio-muted);
  font-size:14px;
  font-weight:400;
}

/* Reference /write/assetLibrary: 240px min cards, radius 14 */
.studio-shell .skill-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:16px}
.studio-shell .skill-card{
  padding:16px;
  gap:8px;
  border:1px solid var(--studio-line);
  border-radius:14px;
  background:#fff;
  transition:transform .2s ease,box-shadow .2s ease,border-color .15s ease;
}
.studio-shell .skill-card:hover{
  transform:translateY(-2px);
  border-color:var(--studio-brand);
  box-shadow:0 10px 28px -12px rgba(2,96,249,.32);
}
/* Reference card hover: subtle lift + tinted shadow */
.studio-shell .parse-card,
.studio-shell .lq-ref-card,
.studio-shell .lq-img-card,
.studio-shell .skill-card{
  transition:transform .2s ease,box-shadow .2s ease,background-color .15s ease,border-color .15s ease;
}
.studio-shell .parse-card:hover,
.studio-shell .lq-ref-card:hover,
.studio-shell .lq-img-card:hover,
.studio-shell .skill-card:hover{
  transform:translateY(-2px);
  box-shadow:0 10px 24px -18px rgba(37,99,235,.35);
}
.studio-shell .skill-card p{font-size:10px;line-height:1.6;color:var(--studio-muted)}

/* Modal and work overlay */
.studio-shell ~ .modal-mask,
.modal-mask{
  background:rgba(26,31,43,.34);
}
.modal{
  border:1px solid var(--studio-line);
  border-radius:var(--studio-radius-lg);
  background:#fff;
  box-shadow:var(--studio-shadow-popover);
}
.modal-head{padding:13px 16px;border-bottom:1px solid var(--studio-line)}
.modal-head h3{font-size:14px;font-weight:650}
.modal-body{padding:14px 16px}
.modal-foot{padding:11px 16px;border-top:1px solid var(--studio-line);gap:6px}
.work-overlay{background:rgba(26,31,43,.34)}
.work-card{
  width:min(420px,calc(100vw - 32px));
  padding:22px;
  border:1px solid var(--studio-line);
  border-radius:var(--studio-radius-lg);
  background:#fff;
  box-shadow:var(--studio-shadow-popover);
}
.work-card h3{font-size:14px}
.work-spinner{align-items:center}

/* ==========================================================================
   My bid documents (reference /write/myBidDoc)
   ========================================================================== */
.mydocs-page{width:100%}
.mydocs-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin:0 0 16px;
}
.mydocs-head h2{
  margin:0;
  color:var(--studio-ink);
  font-size:16px;
  font-weight:600;
  line-height:24px;
}
.mydocs-head p{
  margin:3px 0 0;
  color:var(--studio-muted);
  font-size:12px;
}
.mydocs-card{
  width:100%;
  overflow-x:auto;
  border:1px solid var(--studio-line);
  border-radius:12px;
  background:#fff;
}
.mydocs-table{
  width:100%;
  min-width:860px;
  border-collapse:collapse;
  table-layout:fixed;
}
.mydocs-table th{
  height:50px;
  padding:14px 16px;
  border-bottom:1px solid var(--studio-line);
  background:var(--studio-canvas-2);
  color:var(--studio-muted);
  font-size:13px;
  font-weight:600;
  text-align:left;
  white-space:nowrap;
}
.mydocs-table td{
  padding:14px 16px;
  border-bottom:1px solid var(--studio-line);
  color:var(--studio-ink);
  font-size:14px;
  vertical-align:middle;
}
.mydocs-table tr:last-child td{border-bottom:0}
.mydocs-table tbody tr:hover td{background:var(--studio-canvas-2)}
.mydocs-name{
  max-width:100%;
  padding:0;
  border:0;
  background:transparent;
  color:var(--studio-ink);
  font-size:14px;
  font-weight:500;
  text-align:left;
  cursor:pointer;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.mydocs-name:hover{color:var(--studio-brand)}
.mydocs-ops{display:flex;align-items:center;justify-content:flex-end;gap:6px}
.mydocs-card .empty-state{border:0;border-radius:0}
.mydocs-card .empty-state[hidden]{display:none}

/* ==========================================================================
   Settings page (reference /write/bidDocStyle)
   ========================================================================== */
.settings-page{
  width:100%;
  max-width:var(--studio-content-width, 1120px);
  margin:8px auto 0;
  padding:24px;
  background:#fff;
  border:1px solid rgba(229,232,237,.6);
  border-radius:8px;
  padding-bottom:24px;
}
.settings-overview{
  margin:0 0 18px;
  background:#fff;
  border:1px solid var(--studio-line);
  border-radius:8px;
}
.settings-overview>summary{
  padding:12px 16px;
  cursor:pointer;
  color:var(--studio-ink-2);
  font-size:13px;
  font-weight:600;
  list-style:none;
}
.settings-overview>summary::-webkit-details-marker{display:none}
.settings-overview>summary::after{
  content:"展开";
  float:right;
  color:var(--studio-brand);
  font-size:12px;
  font-weight:400;
}
.settings-overview[open]>summary::after{content:"收起"}
.settings-overview .dash{padding:0 16px 16px}
.settings-head{display:none}
.settings-head p{
  margin:4px 0 0;
  color:var(--studio-muted);
  font-size:12px;
  line-height:1.65;
}
.settings-block{margin:28px 0 0}
.settings-block:first-of-type{margin-top:0}
.settings-block-head{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin:0 0 14px;
}
.settings-block-head h3{
  display:flex;
  align-items:center;
  gap:3px;
  margin:0;
  color:var(--studio-ink);
  font-size:16px;
  font-weight:600;
  line-height:25px;
}
.settings-block-head h3 i{
  color:var(--studio-danger);
  font-style:normal;
}
.settings-block-head p{
  margin:0;
  color:var(--studio-muted);
  font-size:12px;
  line-height:1.5;
}
.settings-block-head p b{color:var(--studio-ink);font-weight:600}
.settings-advanced{
  margin-left:auto;
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:2px 6px;
  border:0;
  border-radius:4px;
  background:transparent;
  color:var(--studio-brand);
  font-size:12px;
  white-space:nowrap;
}
.settings-advanced:hover{background:var(--studio-brand-soft)}
.settings-counter{
  margin-left:auto;
  color:var(--studio-faint);
  font-size:12px;
}
.settings-counter b{color:var(--studio-muted);font-weight:500}
.settings-input{
  width:100%;
  height:48px;
  padding:0 16px;
  border:1px solid transparent;
  border-radius:8px;
  background:var(--studio-canvas);
  color:var(--studio-ink);
  font-size:14px;
  transition:border-color var(--studio-motion-fast) var(--studio-ease),background-color var(--studio-motion-fast) var(--studio-ease);
}
.settings-input::placeholder{color:var(--studio-faint)}
.settings-input:hover{background:#f1f3f6}
.settings-input:focus{
  outline:2px solid var(--studio-brand-soft);
  border-color:var(--studio-brand);
  background:#fff;
}
/* Page slider — ported from 标小信 /dashboard/writing/info:
   14px pill track, 4px white tick dots, 32px white grip thumb with a
   value bubble, 13px non-linear scale, and a 46px-tall invisible hit band
   (`-top-4 -bottom-4 inset-x-0` in the reference) so the whole area is
   clickable / draggable. */
.page-range{
  position:relative;
  height:104px;
  margin-top:20px;
  padding:0;
  --page-accent:var(--studio-brand);
}
.page-track{
  position:absolute;
  left:0;
  right:0;
  top:8px;
  height:46px;
  border-radius:999px;
  background:transparent;
  overflow:visible;
  cursor:pointer;
}
.page-track::before{
  content:"";
  position:absolute;
  left:0;
  right:0;
  top:50%;
  height:14px;
  transform:translateY(-50%);
  border-radius:999px;
  background:#e3ecfa;
}
.page-fill{
  position:absolute;
  left:0;
  top:50%;
  width:33.3333%;
  height:14px;
  transform:translateY(-50%);
  border-radius:999px;
  background:var(--page-accent);
  pointer-events:none;
  transition:width var(--studio-motion-fast) linear,background-color .2s ease;
}
.page-dots{
  position:absolute;
  left:0;
  right:0;
  top:29px;
  height:4px;
  pointer-events:none;
}
.page-dot{
  position:absolute;
  top:0;
  width:4px;
  height:4px;
  border-radius:50%;
  background:#fff;
  opacity:.85;
  transform:translateX(-50%);
  transition:opacity .15s ease;
}
.page-dot:first-child,
.page-dot:last-child{display:none}
.page-dot.active{opacity:1}
.page-thumb{
  position:absolute;
  top:15px;
  left:33.3333%;
  width:32px;
  height:32px;
  margin-left:-16px;
  display:grid;
  place-items:center;
  border:1px solid #eef1f6;
  border-radius:50%;
  background:#fff;
  box-shadow:0 2px 10px rgba(15,23,42,.16);
  cursor:grab;
  z-index:4;
  touch-action:none;
  transition:transform .16s ease,left var(--studio-motion-fast) linear,box-shadow .16s ease;
}
.page-thumb span{
  width:2px;
  height:14px;
  border-radius:2px;
  background:#cbd5e1;
  box-shadow:4px 0 0 #cbd5e1;
}
.page-thumb:hover{
  transform:scale(1.06);
  box-shadow:0 4px 14px rgba(15,23,42,.2);
}
.page-thumb:active{cursor:grabbing;transform:scale(1)}
.page-thumb:focus-visible{outline:2px solid var(--studio-brand);outline-offset:3px}
.page-bubble{
  position:absolute;
  top:-12px;
  left:33.3333%;
  transform:translateX(-50%);
  min-width:44px;
  height:28px;
  padding:0 10px;
  border-radius:8px;
  background:var(--page-accent);
  color:#fff;
  font-size:14px;
  font-weight:700;
  line-height:28px;
  text-align:center;
  pointer-events:none;
  z-index:6;
  box-shadow:0 6px 14px -6px rgba(15,23,42,.35);
  transition:left var(--studio-motion-fast) linear,background-color .2s ease;
}
.page-arrow{
  position:absolute;
  top:16px;
  left:33.3333%;
  margin-left:-6px;
  width:0;
  height:0;
  border-left:6px solid transparent;
  border-right:6px solid transparent;
  border-top:6px solid var(--page-accent);
  pointer-events:none;
  z-index:6;
  transition:left var(--studio-motion-fast) linear,border-color .2s ease;
}
.page-ticks{
  position:absolute;
  left:0;
  right:0;
  top:66px;
  height:18px;
  color:#8b93a7;
  font-size:13px;
  line-height:18px;
  pointer-events:none;
}
.page-tick{
  position:absolute;
  transform:translateX(-50%);
  white-space:nowrap;
  font-weight:500;
}
@media (max-width:600px){
  .page-tick{font-size:10px}
  .page-tick:nth-child(even){display:none}
}
.bid-method-group{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
.bid-method-card{
  display:flex;
  align-items:flex-start;
  gap:10px;
  min-height:60px;
  padding:10px 16px;
  border:1px solid var(--studio-line);
  border-radius:10px;
  background:#fff;
  text-align:left;
  transition:border-color var(--studio-motion-fast) var(--studio-ease),background-color var(--studio-motion-fast) var(--studio-ease);
}
.bid-method-card:hover{border-color:var(--studio-brand-line)}
.bid-method-card.active{
  border-color:var(--studio-brand);
  background:var(--studio-brand-soft);
}
.bid-radio{
  width:16px;
  height:16px;
  flex:none;
  margin-top:2px;
  border:1px solid var(--studio-line-3);
  border-radius:50%;
  background:#fff;
  position:relative;
}
.bid-method-card.active .bid-radio{
  border-color:var(--studio-brand);
}
.bid-method-card.active .bid-radio::after{
  content:"";
  position:absolute;
  inset:3px;
  border-radius:50%;
  background:var(--studio-brand);
}
.bid-method-copy{display:flex;flex-direction:column;gap:2px;min-width:0}
.bid-method-copy b{color:var(--studio-ink);font-size:14px;font-weight:600}
.bid-method-copy small{color:var(--studio-muted);font-size:12px;line-height:1.5}
.model-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}
.model-card{
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:3px;
  min-height:76px;
  padding:12px 16px;
  border:1px solid var(--studio-line);
  border-radius:8px;
  background:#fff;
  text-align:left;
  transition:border-color var(--studio-motion-fast) var(--studio-ease),background-color var(--studio-motion-fast) var(--studio-ease);
}
.model-card:hover{border-color:var(--studio-brand-line)}
.model-card.active{
  border-color:var(--studio-brand);
  background:var(--studio-brand-soft);
}
.model-card b{color:var(--studio-ink);font-size:14px;font-weight:600;line-height:1.4}
.model-card small{color:var(--studio-muted);font-size:12px;line-height:1.5}
.style-card-grid{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:12px;
}
.style-card{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-height:148px;
  padding:6px;
  border:1px solid var(--studio-line);
  border-radius:8px;
  background:#fff;
  text-align:left;
  transition:border-color var(--studio-motion-fast) var(--studio-ease),background-color var(--studio-motion-fast) var(--studio-ease);
}
.style-card:hover{border-color:var(--studio-brand-line)}
.style-card.active{border-color:var(--studio-brand);background:var(--studio-brand-soft)}
.style-card b{color:var(--studio-ink-2);font-size:12px;font-weight:500;line-height:1.4}
.style-card.active b{color:var(--studio-brand)}
.style-preview{
  display:flex;
  flex-direction:column;
  gap:4px;
  height:106px;
  padding:10px;
  border-radius:5px;
  background:var(--studio-canvas);
}
.style-preview i{
  display:block;
  height:4px;
  border-radius:2px;
  background:var(--studio-line-3);
}
.style-preview i:nth-child(2){width:86%}
.style-preview i:nth-child(3){width:68%}
.style-preview i.bold{height:7px;background:#b9c0cb}
.style-preview i.block{height:14px;background:var(--studio-line)}
.style-preview i.indent{margin-left:14px;width:70%}
.style-preview.add-preview{
  align-items:center;
  justify-content:center;
  color:var(--studio-faint);
  font-size:22px;
  line-height:1;
  background:var(--studio-canvas-2);
}
.layout-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}
.layout-card{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-height:206px;
  padding:8px;
  border:1px solid var(--studio-line);
  border-radius:8px;
  background:#fff;
  text-align:left;
  transition:border-color var(--studio-motion-fast) var(--studio-ease),background-color var(--studio-motion-fast) var(--studio-ease);
}
.layout-card:hover{border-color:var(--studio-brand-line)}
.layout-card.active{border-color:var(--studio-brand);background:var(--studio-brand-soft)}
.layout-card b{color:var(--studio-ink-2);font-size:12px;font-weight:500;line-height:1.4}
.layout-card.active b{color:var(--studio-brand)}
.layout-preview{
  display:flex;
  flex-direction:column;
  gap:4px;
  height:160px;
  padding:14px;
  border-radius:5px;
  background:var(--studio-canvas);
}
.layout-preview i{
  display:block;
  height:4px;
  border-radius:2px;
  background:var(--studio-line-3);
}
.layout-preview i:nth-child(2){width:88%}
.layout-preview i:nth-child(3){width:72%}
.layout-preview i.line-title{height:8px;width:52%;background:#b9c0cb;margin-bottom:3px}
.layout-preview i.pic{height:26px;border-radius:3px;background:linear-gradient(135deg,#dfe3ea,#eef0f4)}
.layout-preview i.pic.small{height:18px}
.layout-preview i.chart{height:22px;background:linear-gradient(90deg,var(--studio-brand-line),var(--studio-brand-100) 40%,var(--studio-line) 40%,var(--studio-line) 60%,var(--studio-brand-line) 60%)}
.layout-preview i.chart.small{height:14px}
.config-row{
  display:flex;
  flex-wrap:wrap;
  gap:28px 36px;
}
.config-group{min-width:220px;flex:1 1 260px}
.config-title{
  display:flex;
  align-items:center;
  gap:4px;
  margin:0 0 8px;
  color:var(--studio-ink);
  font-size:14px;
  font-weight:600;
  line-height:20px;
}
.config-title .settings-advanced{margin-left:2px}
.style-pills{display:flex;flex-wrap:wrap;gap:8px}
.style-pill{
  display:inline-flex;
  align-items:center;
  gap:4px;
  height:28px;
  padding:0 8px;
  border:1px solid var(--studio-line);
  border-radius:8px;
  background:#fff;
  color:var(--studio-ink-2);
  font-size:12px;
  white-space:nowrap;
  transition:border-color var(--studio-motion-fast) var(--studio-ease),background-color var(--studio-motion-fast) var(--studio-ease),color var(--studio-motion-fast) var(--studio-ease);
}
.style-pill:hover{border-color:var(--studio-brand-line)}
.style-pill.active{
  border-color:var(--studio-brand);
  background:var(--studio-brand-soft);
  color:var(--studio-brand);
}
.settings-footer{
  position:static;
  display:flex;
  justify-content:center;
  gap:24px;
  margin:36px 0 0;
  padding:20px 0 4px;
  border-top:1px solid var(--studio-line);
  background:#fff;
}
.settings-footer .btn{min-width:120px;height:42px;border-radius:55px}
.settings-footer .btn.primary{
  min-width:180px;
  height:42px;
  border-radius:55px;
  font-size:16px;
  font-weight:600;
}
.settings-footer .btn:disabled{
  background:#d5d9e1;
  border-color:#d5d9e1;
  color:#fff;
}

@media (max-width:1080px){
  .style-card-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
  .model-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:760px){
  .settings-page{padding:4px 0 88px}
  .bid-method-group{grid-template-columns:1fr}
  .style-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .layout-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .model-grid{grid-template-columns:1fr}
  .config-row{gap:20px}
  .settings-footer .btn{flex:1;min-width:0}
}

/* Reference 14px UI rhythm */
.studio-shell .context-head h2,
.inspector-head h2{font-size:14px;font-weight:600}
.context-head p{font-size:12px}
.studio-shell .context-doc{
  margin:12px 14px;
  padding:12px;
  border:1px solid var(--studio-line);
  border-radius:8px;
  background:var(--studio-canvas-2);
}
.context-doc-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
}
.context-doc b{font-size:14px;font-weight:600;line-height:1.5}
.context-state-pill{
  display:inline-flex;
  align-items:center;
  height:20px;
  padding:0 7px;
  border-radius:999px;
  background:var(--studio-brand-soft);
  color:var(--studio-brand);
  font-size:10px;
  font-weight:500;
  white-space:nowrap;
}
.tiny-tag{font-size:11px;height:22px}
.context-progress{
  height:4px;
  margin-top:10px;
  border-radius:2px;
  background:var(--studio-line);
  overflow:hidden;
}
.context-progress i{
  display:block;
  height:100%;
  border-radius:2px;
  background:var(--studio-brand);
  transition:width var(--studio-motion-base) var(--studio-ease);
}
.context-progress-meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-top:4px;
  color:var(--studio-muted);
  font-size:11px;
}
.context-progress-meta b{color:var(--studio-ink);font-weight:600;font-variant-numeric:tabular-nums}
.context-tab{font-size:13px;height:30px}
.context-tree-wrap{
  flex:1;
  min-height:0;
  display:flex;
  flex-direction:column;
}
.context-section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:10px 14px 6px;
  color:var(--studio-muted);
  font-size:11px;
  font-weight:600;
}
.context-section-head b{
  color:var(--studio-faint);
  font-weight:500;
  font-variant-numeric:tabular-nums;
}
.context-tree{
  flex:1;
  min-height:0;
  overflow:auto;
  padding:0 8px 12px;
}
.context-node{font-size:13px;min-height:34px;border-radius:6px}
.context-label{font-size:11px}
.inspector-head p{font-size:11px}
.inspector-block h3{font-size:12px}
.inspector-kv{font-size:12px}
.inspector-note{font-size:11px}
.inspector-item b{font-size:11px}
.inspector-item small{font-size:10px}
.studio-shell .panel-head h2{font-size:16px}
.studio-shell .panel-head p{font-size:12px}
.studio-shell .parse-body b{font-size:14px}
.studio-shell .parse-body p{font-size:12px}
.studio-shell .tree-row{font-size:12px}
.studio-shell .tree-head{font-size:11px}
.studio-shell .chapter-items li{font-size:12px}
.studio-shell .kpi-label{font-size:12px}
.studio-shell .tbl{font-size:12px}

/* Auth page aligned with the reference login card */
.auth-kicker{color:var(--studio-brand)}
.auth-art h1 em{color:var(--studio-brand)}
.auth-card{
  border:1px solid var(--studio-line);
  border-radius:8px;
  box-shadow:none;
  background:#fff;
}
.auth-card .btn{border-radius:4px}
.auth-card .btn.primary{
  background:var(--studio-brand);
  border-color:var(--studio-brand);
  border-radius:3px;
  font-weight:600;
}
.auth-card input{
  border-color:var(--studio-line);
  border-radius:4px;
  font-size:14px;
}

/* Modals live outside #appView; apply the reference form rhythm there too */
#modalRoot .btn{
  height:32px;
  border-radius:4px;
  font-size:14px;
}
#modalRoot .btn.primary{
  background:var(--studio-brand);
  border-color:var(--studio-brand);
  border-radius:3px;
  font-weight:600;
}
#modalRoot input,
#modalRoot select,
#modalRoot textarea{
  height:32px;
  padding:0 10px;
  border:1px solid var(--studio-line);
  border-radius:4px;
  font-size:14px;
}

/* Reference modal geometry */
.modal{
  border-radius:16px;
  box-shadow:var(--studio-shadow-popover);
}
.modal-mask{background:rgba(16,24,40,.45)}
.modal-head{padding:18px 24px 14px;border-bottom:1px solid var(--studio-line)}
.modal-head h3{font-size:18px;font-weight:600}
.modal-body{padding:16px 24px}
.modal-foot{padding:12px 24px 20px;border-top:1px solid var(--studio-line)}
.work-card{
  width:min(440px,calc(100vw - 32px));
  padding:24px;
  border-radius:16px;
  border:1px solid var(--studio-line);
  background:#fff;
  box-shadow:var(--studio-shadow-popover);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width:1599px){
  #appView.studio-shell{
    grid-template-columns:148px 260px minmax(0,1fr);
  }
  #appView.studio-shell.rail-collapsed{
    grid-template-columns:64px 260px minmax(0,1fr);
  }
  .cmdbar-links{display:none}
  .studio-shell .rail-item{height:40px}
  .studio-shell .inspector{
    position:fixed;
    top:54px;
    right:0;
    z-index:var(--studio-z-drawer);
    width:300px;
    height:calc(100vh - 54px);
    transform:translateX(100%);
    transition:transform var(--studio-motion-base) var(--studio-ease);
    box-shadow:-16px 0 40px rgba(26,31,43,.12);
  }
  .studio-shell .inspector.open{transform:none}
  #inspectorToggle{display:grid}
  .drawer-scrim{display:block}
}
@media (max-width:1279px){
  #appView.studio-shell{
    grid-template-columns:148px minmax(0,1fr);
  }
  #appView.studio-shell.rail-collapsed{
    grid-template-columns:64px minmax(0,1fr);
  }
  .studio-shell .context{
    position:fixed;
    left:148px;
    top:54px;
    z-index:var(--studio-z-drawer);
    width:280px;
    height:calc(100vh - 54px);
    transform:translateX(-110%);
    transition:transform var(--studio-motion-base) var(--studio-ease);
    box-shadow:16px 0 40px rgba(26,31,43,.12);
  }
  .studio-shell .context.open{transform:none}
  #appView.studio-shell.rail-collapsed .context{left:64px}
  #contextToggle{display:grid}
  .stage-head{width:calc(100% - 40px - 2 * var(--stage-gutter, 0px));padding:16px 0 0}
  .stage-scroll{padding:12px 20px 24px}
  .studio-shell .wizard-footer{width:calc(100% - 40px)}
  .studio-shell .dash-grid{grid-template-columns:1fr}
  .studio-shell .parse-result-editor{grid-template-columns:1fr}
  .studio-shell .basis-panel{grid-template-columns:1fr}
  .studio-shell .lq-img-sources{grid-template-columns:1fr}
}
@media (max-width:760px){
  .cmdbar{gap:8px;padding:0 12px}
  .cmdbar .brand-copy small{display:none}
  .cmdbar .doc-switch{max-width:44vw}
  .cmdbar .quota-chips,
  .cmdbar .who{display:none}
  #appView.studio-shell{
    grid-template-columns:minmax(0,1fr);
  }
  #appView.studio-shell.rail-collapsed{
    grid-template-columns:minmax(0,1fr);
  }
  .studio-shell .rail{
    position:fixed;
    left:0;
    top:54px;
    z-index:var(--studio-z-drawer);
    width:148px;
    height:calc(100vh - 54px);
    transform:translateX(-110%);
    transition:transform var(--studio-motion-base) var(--studio-ease);
    box-shadow:16px 0 40px rgba(26,31,43,.12);
  }
  .studio-shell .rail.open{transform:none}
  #menuBtn{display:grid}
  .studio-shell .context{
    left:148px;
    width:min(280px,calc(100vw - 148px));
  }
  #appView.studio-shell.rail-collapsed .context{
    left:64px;
    width:min(280px,calc(100vw - 64px));
  }
  .stage-head{width:calc(100% - 28px - 2 * var(--stage-gutter, 0px));padding:12px 0 0}
  .stage-head #docTitle{font-size:18px}
  .stage-head .doc-actions .btn{padding:0 8px}
  .stage-scroll{padding:10px 14px 20px}
  .studio-shell .stepper{overflow-x:auto;padding-bottom:4px}
  .studio-shell .stepper .step{height:34px;padding:0 10px;font-size:13px}
  .studio-shell .wizard-footer{width:calc(100% - 28px);margin-bottom:8px}
  .studio-shell .wizard-hint{display:none}
  .studio-shell .parse-choices,
  .studio-shell .lq-two,
  .studio-shell .write-grid,
  .studio-shell .kb-grid,
  .studio-shell .dash-grid{grid-template-columns:1fr}
  .studio-shell .kpi-grid{grid-template-columns:1fr 1fr}
  .studio-shell .kpi:nth-child(3){border-left:0}
  .studio-shell .kpi:nth-child(n+3){border-top:1px solid var(--studio-line)}
  .studio-shell .export-grid{grid-template-columns:1fr 1fr}
  .studio-shell .skill-grid{grid-template-columns:1fr 1fr}
  .studio-shell .tree-table{overflow-x:auto}
  .studio-shell .tree-head,
  .studio-shell .tree-row{min-width:720px}
  .studio-shell .inspector{width:min(320px,100vw)}
  .studio-shell .chapter-items{max-height:none}
  .studio-shell .stream-content{max-height:none;padding:18px 20px}
}
@media (max-width:480px){
  .cmdbar .doc-switch{display:none}
  .studio-shell .kpi-grid{grid-template-columns:1fr}
  .studio-shell .kpi{border-left:0;border-top:1px solid var(--studio-line)}
  .studio-shell .kpi:first-child{border-top:0}
  .studio-shell .export-grid,
  .studio-shell .skill-grid{grid-template-columns:1fr}
  .studio-shell .stage-head .doc-actions{display:none}
}

/* Respect reduced motion for shell transitions */
@media (prefers-reduced-motion:reduce){
  .stage-scroll{scroll-behavior:auto}
  .studio-shell .inspector,
  .studio-shell .context,
  .studio-shell .rail,
  .drawer-scrim{transition-duration:.12s}
}

/* Reference bid review page */
/* Card shell: sampled from biaoshu.lianqiai.cn /aitool/bidReview (.list-card) */
.studio-shell #wspParse .br-page{display:block;padding:0}

/* Card head: 20px 24px 12px, 16px/24px 600 title */
.studio-shell #wspParse .br-card-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding:20px 24px 12px;
}
.studio-shell #wspParse .br-card-title{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.studio-shell #wspParse .br-card-icon{
  width:32px;
  height:32px;
  flex:none;
  display:grid;
  place-items:center;
  border-radius:8px;
  background:var(--studio-brand-soft);
  color:var(--studio-brand);
}
.studio-shell #wspParse .br-card-icon .ico{width:18px;height:18px}
.studio-shell #wspParse .br-card-title h2{
  margin:0;
  font-size:16px;
  line-height:24px;
  font-weight:600;
  color:var(--studio-ink);
}
.studio-shell #wspParse .br-card-title p{
  margin:2px 0 0;
  font-size:12px;
  line-height:18px;
  color:var(--studio-muted);
}
.studio-shell #wspParse .br-badge{
  display:inline-flex;
  align-items:center;
  gap:5px;
  height:26px;
  padding:0 10px;
  border:1px solid var(--studio-line);
  border-radius:999px;
  background:#fff;
  font-size:12px;
  color:var(--studio-muted);
  white-space:nowrap;
}
.studio-shell #wspParse .br-badge .ico{width:13px;height:13px;color:var(--studio-brand)}
.studio-shell #wspParse .br-card-body{padding:8px 24px 24px}

/* Upload / parse zone: white bordered choice cards, 8px radius */
.studio-shell #wspParse .br-upload{padding-top:4px}
.studio-shell #wspParse .br-sec-head{
  display:flex;
  align-items:baseline;
  flex-wrap:wrap;
  gap:8px;
  margin:0 0 10px;
}
.studio-shell #wspParse .br-sec-title{
  font-size:16px;
  line-height:24px;
  font-weight:600;
  color:var(--studio-ink);
}
.studio-shell #wspParse .br-sec-title i{
  margin-left:4px;
  color:var(--studio-danger);
  font-style:normal;
}
.studio-shell #wspParse .br-sec-head em{
  font-size:12px;
  line-height:18px;
  color:var(--studio-muted);
  font-style:normal;
}
.studio-shell #wspParse .parse-choices{grid-template-columns:1fr 1fr;gap:16px}
.studio-shell #wspParse .parse-card{
  align-items:center;
  gap:14px;
  min-height:84px;
  padding:16px 15px;
  border:1px solid var(--studio-line);
  border-radius:8px;
  background:#fff;
  box-shadow:none;
}
.studio-shell #wspParse .parse-card:hover{
  background:#fff;
  border-color:var(--studio-brand);
  box-shadow:none;
}
.studio-shell #wspParse .parse-icon{
  width:40px;
  height:40px;
  flex:none;
  border:0;
  border-radius:8px;
  background:var(--studio-brand-soft);
  color:var(--studio-brand);
}
.studio-shell #wspParse .parse-icon .ico{width:20px;height:20px}
.studio-shell #wspParse .parse-body b{display:block;font-size:14px;line-height:21px;font-weight:600;color:var(--studio-ink)}
.studio-shell #wspParse .parse-body p{margin:2px 0 0;font-size:12px;line-height:18px;color:var(--studio-muted)}
.studio-shell #wspParse .parse-body .small{font-size:12px;line-height:18px;color:var(--studio-muted)}
.studio-shell #wspParse .parse-body .row{margin-top:10px}
.studio-shell #wspParse .file-btn,
.studio-shell #wspParse #pasteInfoBtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:30px;
  padding:0 12px;
  border-radius:8px;
  font-size:12px;
}
.studio-shell #wspParse .file-btn{
  border:1px solid var(--studio-brand);
  background:var(--studio-brand);
  color:#fff;
}
.studio-shell #wspParse .file-btn:hover{background:var(--studio-brand-2);border-color:var(--studio-brand-2)}

/* 1px section rules with 24px rhythm */
.studio-shell #wspParse .br-line{height:1px;background:var(--studio-line);margin:24px 0}

/* Form sections: 16px/24px section titles */
.studio-shell #wspParse .br-form-block{margin-top:0}
.studio-shell #wspParse .br-form-block .lq-sec-title{
  display:flex;
  align-items:baseline;
  flex-wrap:wrap;
  gap:8px;
  margin:0 0 10px;
  font-size:16px;
  line-height:24px;
  font-weight:600;
  color:var(--studio-ink);
}
.studio-shell #wspParse .br-form-block .lq-sec-title i{margin-left:0}
.studio-shell #wspParse .br-form-block .lq-sec-title em{
  font-size:12px;
  line-height:18px;
  color:var(--studio-muted);
  font-weight:400;
}
.studio-shell #wspParse .br-form-block .lq-sec-title a{
  margin-left:4px;
  color:var(--studio-brand);
  font-size:12px;
}

/* Type tabs: 40px pill cards, active 2px brand border + soft fill */
.studio-shell #wspParse .type-tabs{gap:20px}
.studio-shell #wspParse .type-tab{
  height:40px;
  padding:0 14px;
  border:1px solid var(--studio-line);
  border-radius:8px;
  background:#fff;
  color:var(--studio-ink);
  font-size:14px;
}
.studio-shell #wspParse .type-tab:hover{
  background:var(--studio-brand-soft);
  border-color:var(--studio-brand-line);
}
.studio-shell #wspParse button.type-tab.active{
  padding:0 13px;
  border:2px solid var(--studio-brand);
  background:var(--studio-brand-soft);
  color:var(--studio-brand);
  font-weight:500;
}
.studio-shell #wspParse button.type-tab.active .ico{
  color:var(--studio-brand);
}

/* Reference material cards */
.studio-shell #wspParse .lq-two{gap:16px}
.studio-shell #wspParse .lq-ref-card{
  align-items:center;
  gap:14px;
  min-height:84px;
  padding:16px 15px;
  border:1px solid var(--studio-line);
  border-radius:8px;
  background:#fff;
}
.studio-shell #wspParse .lq-ref-card:hover{
  background:#fff;
  border-color:var(--studio-brand);
  box-shadow:none;
}
.studio-shell #wspParse .lq-ref-icon{
  width:40px;
  height:40px;
  flex:none;
  border:0;
  border-radius:8px;
  background:var(--studio-brand-soft);
  color:var(--studio-brand);
}
.studio-shell #wspParse .lq-ref-card b{font-size:14px;line-height:21px;font-weight:600;color:var(--studio-ink)}
.studio-shell #wspParse .lq-ref-card p{margin:2px 0 0;font-size:12px;line-height:18px;color:var(--studio-muted)}

/* Image source cards */
.studio-shell #wspParse .lq-img-sources{gap:16px}
.studio-shell #wspParse .lq-img-card{
  padding:14px 15px;
  border:1px solid var(--studio-line);
  border-radius:8px;
  background:#fff;
}
.studio-shell #wspParse .lq-img-card:hover{
  background:#fff;
  border-color:var(--studio-brand-line);
  box-shadow:none;
}
.studio-shell #wspParse .lq-img-card.active{
  border-color:var(--studio-brand);
  background:var(--studio-brand-soft);
  box-shadow:inset 0 0 0 1px var(--studio-brand);
}
.studio-shell #wspParse .lq-img-head{font-size:14px;line-height:21px;font-weight:600;color:var(--studio-ink)}
.studio-shell #wspParse .lq-img-card.active .lq-img-head{color:var(--studio-brand)}
.studio-shell #wspParse .lq-img-card p{font-size:12px;line-height:18px;color:var(--studio-muted)}
.studio-shell #wspParse .lq-check{top:12px;right:12px;width:18px;height:18px}

/* Upload progress row */
.studio-shell #wspParse #tenderFileCard{
  margin-top:16px;
  padding:14px 16px 12px;
  border:1px solid var(--studio-line);
  border-radius:8px;
  background:#fff;
}
.studio-shell #wspParse #tenderFileCard .fpc-icon{
  width:34px;
  height:34px;
  border-radius:8px;
  background:var(--studio-brand-soft);
  color:var(--studio-brand);
}
.studio-shell #wspParse .fpc-info b{font-size:14px;line-height:21px;font-weight:600;color:var(--studio-ink)}
.studio-shell #wspParse .fpc-info span{font-size:12px;line-height:18px;color:var(--studio-muted)}
.studio-shell #wspParse .fpc-state{font-size:12px;padding:3px 10px;border-radius:999px}
.studio-shell #wspParse .fpc-status{font-size:12px;color:var(--studio-muted)}
.studio-shell #wspParse #tenderFileCard.done{border-color:var(--studio-line)}
.studio-shell #wspParse #tenderFileCard.done .fpc-state{color:var(--studio-success);background:var(--studio-success-soft)}
.studio-shell #wspParse #tenderFileCard.fail .fpc-state{color:var(--studio-danger);background:var(--studio-danger-soft)}

/* Result area: section head + two-column project overview / scoring */
.studio-shell #wspParse .br-result{margin-top:0}
.studio-shell #wspParse .br-result-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
  padding-bottom:12px;
  border-bottom:1px solid var(--studio-line);
}
.studio-shell #wspParse .br-result-head .br-sec-title{display:flex;align-items:baseline;flex-wrap:wrap;gap:8px}
.studio-shell #wspParse .br-result-head .br-sec-title em{
  font-size:12px;
  line-height:18px;
  color:var(--studio-muted);
  font-style:normal;
  font-weight:400;
}
.studio-shell #wspParse .br-result-note{
  display:inline-flex;
  align-items:center;
  gap:5px;
  height:26px;
  padding:0 10px;
  border-radius:999px;
  background:var(--studio-success-soft);
  color:var(--studio-success);
  font-size:12px;
  white-space:nowrap;
}
.studio-shell #wspParse .br-result-note .ico{width:13px;height:13px}

/* Empty record state: centered, 80px 24px */
.studio-shell #wspParse #analysisResult .empty-state{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:12px;
  padding:80px 24px;
  border:0;
  border-radius:0;
  background:#fff;
}
.studio-shell #wspParse #analysisResult .empty-state b{font-size:14px;line-height:22px;font-weight:600;color:var(--studio-ink)}
.studio-shell #wspParse #analysisResult .empty-state span{font-size:12px;line-height:18px;color:var(--studio-muted)}

/* Two-column result editors: white bordered boxes, 8px radius */
.studio-shell #wspParse .parse-result-editor{grid-template-columns:1fr 1fr;gap:16px;margin:0 0 16px}
.studio-shell #wspParse .pr-head{margin-bottom:8px;font-size:14px;line-height:21px;font-weight:600;color:var(--studio-ink)}
.studio-shell #wspParse .pr-check{
  top:0;
  right:0;
  width:22px;
  height:22px;
  border-radius:50%;
  background:var(--studio-success-soft);
  color:var(--studio-success);
}
.studio-shell #wspParse .pr-box{
  height:340px;
  padding:16px;
  border:1px solid var(--studio-line);
  border-radius:8px;
  background:#fff;
  font-size:13px;
  line-height:1.9;
}
.studio-shell #wspParse .pr-box:focus{border-color:var(--studio-brand);box-shadow:0 0 0 2px var(--studio-brand-soft)}
.studio-shell #wspParse .full-report{margin-top:16px;padding-top:16px;border-top:1px solid var(--studio-line)}
.studio-shell #wspParse .full-report summary{font-size:13px;color:var(--studio-brand);cursor:pointer}
.studio-shell #wspParse .full-report-body .card{border:1px solid var(--studio-line);border-radius:8px;background:#fff}
.studio-shell #wspParse .full-report .tbl th{
  padding:14px 16px;
  border-bottom:1px solid var(--studio-line);
  background:var(--studio-canvas);
  color:var(--studio-muted);
  font-size:13px;
  font-weight:600;
}
.studio-shell #wspParse .full-report .tbl td{padding:12px 16px;font-size:13px;border-bottom:1px solid var(--studio-line)}

/* Parsed state: the upload module stays visible; results render below it */

@media (max-width:900px){
  .studio-shell #wspParse .br-card-head{flex-direction:column;align-items:flex-start;padding:16px 16px 10px}
  .studio-shell #wspParse .br-card-body{padding:8px 16px 20px}
  .studio-shell #wspParse .parse-choices,
  .studio-shell #wspParse .lq-two,
  .studio-shell #wspParse .lq-img-sources,
  .studio-shell #wspParse .parse-result-editor{grid-template-columns:1fr}
  .studio-shell #wspParse .type-tabs{gap:10px}
  .studio-shell #wspParse .lq-img-card{margin-top:0}
}

/* ==========================================================================
   Three-module density pass: catalog / writing / export
   ========================================================================== */
.studio-shell #wizardFooter{display:none!important}

.panel-head-actions{
  display:flex;
  align-items:flex-end;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
}
.catalog-config{
  display:flex;
  align-items:flex-end;
  gap:8px;
}
.catalog-config label{
  margin:0;
  color:var(--studio-muted);
  font-size:11px;
}
.catalog-config input{
  width:72px;
  height:30px;
}
.catalog-config select{
  width:64px;
  height:30px;
}
.catalog-meta{
  display:flex;
  align-items:center;
  gap:16px;
  margin:-2px 0 10px;
  color:var(--studio-muted);
  font-size:11px;
}
.catalog-meta .btn{
  margin-left:auto;
  height:30px;
  font-size:12px;
}
.catalog-meta .btn .ico{
  transition:transform .15s ease;
}
.catalog-meta .btn[aria-expanded="true"] .ico{
  transform:rotate(180deg);
}
.catalog-tools{
  margin:0 0 12px;
  padding:10px;
  border:1px solid var(--studio-line);
  border-radius:8px;
  background:var(--studio-canvas-2);
}
.catalog-tools[hidden]{display:none}
.catalog-tool-row{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.catalog-tool-row .select{min-width:190px;height:30px}
.catalog-tool-row label.inline{
  margin:0;
  color:var(--studio-muted);
  font-size:11px;
}
.catalog-tool-row label.inline input{width:110px;height:30px}
#catalogToolsBtn .ico{transition:transform .15s ease}
#catalogToolsBtn[aria-expanded="true"] .ico{transform:rotate(180deg)}

.action-wrap{position:relative;display:inline-flex}
.action-menu{
  position:absolute;
  right:0;
  top:calc(100% + 6px);
  z-index:30;
  min-width:190px;
  padding:6px;
  border:1px solid var(--studio-line);
  border-radius:8px;
  background:#fff;
  box-shadow:0 10px 30px rgba(16,24,40,.14),0 2px 8px rgba(16,24,40,.06);
  display:flex;
  flex-direction:column;
  gap:2px;
}
.action-menu[hidden]{display:none}
.action-menu .btn{
  width:100%;
  height:32px;
  padding:0 10px;
  justify-content:flex-start;
  border:0;
  border-radius:6px;
  background:transparent;
  color:var(--studio-ink);
  font-size:13px;
}
.action-menu .btn:hover{background:#f6f6f6}
.menu-sep{height:1px;margin:4px 2px;background:var(--studio-line)}
.menu-label{padding:5px 10px 2px;color:var(--studio-muted);font-size:11px}
.action-menu .table-density{padding:2px 8px 4px;flex-wrap:wrap}
.stream-actions{
  display:flex;
  align-items:center;
  gap:4px;
  flex-wrap:wrap;
}
.stream-actions .action-menu .btn{height:30px}

.export-layout{display:flex;flex-direction:column;gap:12px}
.export-basic{
  padding:16px 18px;
  border:1px solid var(--studio-line);
  border-radius:12px;
  background:#fff;
}
.export-basic-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
}
.export-basic-head h3{
  margin:0;
  color:var(--studio-ink);
  font-size:14px;
  font-weight:600;
}
.export-basic-head span{color:var(--studio-muted);font-size:11px}
.export-basic-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-top:12px;
}
.export-checks{
  grid-column:1/-1;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px 18px;
  padding-top:10px;
  border-top:1px solid var(--studio-line);
}
.export-advanced{
  overflow:hidden;
  border:1px solid var(--studio-line);
  border-radius:12px;
  background:#fff;
}
.export-advanced>summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:14px 18px;
  color:var(--studio-ink);
  font-size:14px;
  font-weight:600;
  cursor:pointer;
  list-style:none;
}
.export-advanced>summary::-webkit-details-marker{display:none}
.export-advanced>summary .ico{color:var(--studio-faint);transition:transform .15s ease}
.export-advanced[open]>summary .ico{transform:rotate(180deg)}
.export-advanced .export-grid{
  margin:0;
  border:0;
  border-top:1px solid var(--studio-line);
  border-radius:0;
  box-shadow:none;
}
@media (max-width:760px){
  .panel-head-actions{justify-content:flex-start}
  .catalog-config{width:100%}
  .catalog-meta{flex-direction:column;align-items:flex-start;gap:2px}
  .export-basic-grid{grid-template-columns:1fr}
  .action-menu{right:auto;left:0}
}

/* Context expand / catalog locate */
.context-head-actions{
  display:flex;
  align-items:center;
  gap:2px;
}
#contextExpandBtn .ico{transition:transform .2s var(--studio-ease)}
#contextExpandBtn[aria-expanded="true"] .ico{transform:rotate(180deg)}
.context-mode-badge{
  display:inline-flex;
  align-items:center;
  height:18px;
  padding:0 6px;
  border-radius:999px;
  background:var(--studio-brand-soft);
  color:var(--studio-brand);
  font-size:9px;
  font-weight:500;
  white-space:nowrap;
}
.context-mode-badge[hidden]{display:none}
#appView.studio-shell{transition:grid-template-columns .2s var(--studio-ease)}
#appView.studio-shell.context-expanded{
  grid-template-columns:148px 320px minmax(0,1fr) 280px;
}
#appView.studio-shell.rail-collapsed.context-expanded{
  grid-template-columns:64px 320px minmax(0,1fr) 280px;
}
.studio-shell .tree-row.catalog-row-located{
  background:var(--studio-brand-soft);
  box-shadow:inset 2px 0 0 var(--studio-brand);
  transition:background-color .2s ease;
}
@media (max-width:1599px){
  #appView.studio-shell.context-expanded{
    grid-template-columns:148px 320px minmax(0,1fr);
  }
  #appView.studio-shell.rail-collapsed.context-expanded{
    grid-template-columns:64px 320px minmax(0,1fr);
  }
}
@media (max-width:1279px){
  #appView.studio-shell.context-expanded{grid-template-columns:148px minmax(0,1fr)}
  #appView.studio-shell.rail-collapsed.context-expanded{grid-template-columns:64px minmax(0,1fr)}
  .studio-shell .context.expanded{width:340px}
}
@media (max-width:760px){
  #appView.studio-shell.context-expanded{grid-template-columns:minmax(0,1fr)}
  #appView.studio-shell.rail-collapsed.context-expanded{grid-template-columns:minmax(0,1fr)}
  .studio-shell .context.expanded{width:min(340px,calc(100vw - 148px))}
  #appView.studio-shell.rail-collapsed .context.expanded{width:min(340px,calc(100vw - 64px))}
}
@media (prefers-reduced-motion:reduce){
  #appView.studio-shell{transition-duration:.12s}
}

/* Context tabs + chapter tree */
.studio-shell .context-tabs{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:4px;
  padding:8px 14px 0;
  border-bottom:1px solid var(--studio-line);
  background:#fff;
}
.studio-shell .context-tab{
  position:relative;
  height:36px;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  color:var(--studio-muted);
  font-size:13px;
  font-weight:400;
  appearance:none;
}
.studio-shell .context-tab:hover{
  background:var(--studio-canvas-2);
  color:var(--studio-ink);
}
.studio-shell .context-tab[aria-pressed="true"]{
  background:transparent;
  color:var(--studio-brand);
  font-weight:500;
}
.studio-shell .context-tab[aria-pressed="true"]::after{
  content:"";
  position:absolute;
  left:50%;
  bottom:-1px;
  width:24px;
  height:2px;
  border-radius:2px;
  background:var(--studio-brand);
  transform:translateX(-50%);
}
.context-tree-tools{
  display:flex;
  align-items:center;
  gap:6px;
  height:32px;
  margin:0 14px 8px;
  padding:0 10px;
  border:1px solid var(--studio-line);
  border-radius:999px;
  background:var(--studio-canvas-2);
  color:var(--studio-faint);
}
.context-tree-tools .ico{color:var(--studio-faint)}
.context-tree-tools input{
  flex:1;
  min-width:0;
  height:28px;
  padding:0;
  border:0;
  background:transparent;
  color:var(--studio-ink);
  font-size:12px;
  box-shadow:none;
}
.context-tree-tools input:focus{outline:none}
.context-tree-tools input::placeholder{color:var(--studio-faint)}
.studio-shell .context-tree{
  flex:1;
  min-height:0;
  margin:0 14px 12px;
  padding:4px;
  border:1px solid var(--studio-line);
  border-radius:8px;
  background:var(--studio-canvas-2);
  overflow:auto;
}
.studio-shell .context-node{
  display:flex;
  align-items:center;
  gap:7px;
  width:100%;
  min-height:34px;
  padding:6px 8px;
  border:0;
  border-radius:6px;
  background:transparent;
  color:var(--studio-ink);
  font-size:13px;
  text-align:left;
}
.studio-shell .context-node:hover{
  background:#fff;
  color:var(--studio-brand);
}
.studio-shell .context-node.active{
  background:#fff;
  color:var(--studio-brand);
  font-weight:600;
  box-shadow:inset 2px 0 0 var(--studio-brand),0 1px 2px rgba(16,24,40,.04);
}
.studio-shell .context-node .context-state{
  width:6px;
  height:6px;
  flex:none;
  border-radius:50%;
  background:var(--studio-line-3);
  box-shadow:0 0 0 3px rgba(201,214,234,.25);
}
.studio-shell .context-node .context-state.done{
  background:#177a4b;
  box-shadow:0 0 0 3px rgba(23,122,75,.12);
}
.studio-shell .context-node .context-state.running{
  background:var(--studio-brand);
  box-shadow:0 0 0 3px rgba(2,96,249,.12);
}
.context-word-count{
  flex:none;
  margin-left:auto;
  color:var(--studio-faint);
  font-size:10px;
  font-variant-numeric:tabular-nums;
}
.studio-shell .context-node.active .context-word-count{color:var(--studio-brand)}
.studio-shell .context-node[hidden]{display:none}
.studio-shell .context-empty{
  padding:22px 10px;
  color:var(--studio-faint);
  font-size:11px;
  line-height:1.65;
  text-align:center;
}

/* ==========================================================================
   Reference sidebar / topbar interaction pass
   ========================================================================== */
.cmdbar .top-right{gap:6px}
.cmdbar .who{display:none}
.cmdbar-tools{
  display:flex;
  align-items:center;
  gap:4px;
  flex:none;
}
.cmdbar-icon-btn{
  position:relative;
  width:32px;
  height:32px;
  display:grid;
  place-items:center;
  border:1px solid transparent;
  border-radius:8px;
  background:transparent;
  color:var(--studio-muted);
  transition:background-color var(--studio-motion-fast) var(--studio-ease),color var(--studio-motion-fast) var(--studio-ease),border-color var(--studio-motion-fast) var(--studio-ease);
}
.cmdbar-icon-btn:hover{
  background:var(--studio-brand-soft);
  border-color:var(--studio-brand-line);
  color:var(--studio-brand);
}
.cmdbar-icon-btn:focus-visible{
  outline:2px solid var(--studio-focus-ring);
  outline-offset:2px;
}
.cmdbar-icon-btn .ico{width:20px;height:20px}
.cmdbar-icon-btn .msg-badge{
  position:absolute;
  top:-4px;
  right:-4px;
  min-width:16px;
  height:16px;
  margin:0;
  padding:0 4px;
  font-size:9px;
  line-height:16px;
  border:2px solid #fff;
}
.cmdbar-more-menu{
  min-width:176px;
}
.cmdbar-more-menu .btn{
  justify-content:flex-start;
  gap:8px;
}
.cmdbar-more-menu .btn .ico{color:var(--studio-muted)}

.rail-top{
  padding:0 8px 8px;
  flex:none;
}
.rail-toggle{
  display:flex;
  align-items:center;
  gap:6px;
  width:132px;
  height:32px;
  padding:0 10px;
  border:0;
  border-radius:6px;
  background:transparent;
  color:var(--studio-muted);
  font-size:12px;
  text-align:left;
  transition:background-color var(--studio-motion-fast) var(--studio-ease),color var(--studio-motion-fast) var(--studio-ease);
}
.rail-toggle:hover{
  background:var(--studio-brand-soft);
  color:var(--studio-brand);
}
.rail-toggle .ico{
  width:14px;
  height:14px;
  transform:rotate(90deg);
  transition:transform .2s var(--studio-ease);
}
.rail.collapsed .rail-top{
  padding:0 8px 6px;
}
.rail.collapsed .rail-toggle{
  width:48px;
  margin:0;
  padding:0;
  justify-content:center;
}
.rail.collapsed .rail-toggle span{display:none}
.rail.collapsed .rail-toggle .ico{transform:rotate(-90deg)}
.studio-shell .rail-item .si,
.studio-shell .rail-item .si .ico{
  width:20px;
  height:20px;
}
.studio-shell .rail-item.active{
  background:var(--studio-brand-tint);
  color:var(--studio-brand-700);
}
.studio-shell .rail-item.active .si{color:var(--studio-brand)}
.studio-shell .rail-item:hover{
  background:var(--studio-brand-soft);
  color:var(--studio-brand-700);
}
.studio-shell .rail-item:hover .si{color:var(--studio-brand)}
.studio-shell .rail-sub-item.active{
  background:var(--studio-brand-tint);
  color:var(--studio-brand-700);
}
.studio-shell .rail-group-toggle:hover{
  background:var(--studio-brand-soft);
  color:var(--studio-brand-700);
}
@media (max-width:760px){
  .cmdbar-tools{gap:2px}
  .cmdbar-icon-btn{width:30px;height:30px}
  .cmdbar-more-menu{right:0;left:auto}
}

/* Document-structure context is only visible during catalog editing (step 2). */
#appView.studio-shell:not(.context-active){
  grid-template-columns:148px minmax(0,1fr) 280px;
}
#appView.studio-shell.rail-collapsed:not(.context-active){
  grid-template-columns:64px minmax(0,1fr) 280px;
}
#appView.studio-shell:not(.context-active) .context{
  display:none;
}
@media (max-width:1599px){
  #appView.studio-shell:not(.context-active){
    grid-template-columns:148px minmax(0,1fr);
  }
  #appView.studio-shell.rail-collapsed:not(.context-active){
    grid-template-columns:64px minmax(0,1fr);
  }
}
@media (max-width:1279px){
  #appView.studio-shell:not(.context-active){
    grid-template-columns:148px minmax(0,1fr);
  }
  #appView.studio-shell.rail-collapsed:not(.context-active){
    grid-template-columns:64px minmax(0,1fr);
  }
}
@media (max-width:760px){
  #appView.studio-shell:not(.context-active),
  #appView.studio-shell.rail-collapsed:not(.context-active){
    grid-template-columns:minmax(0,1fr);
  }
}


/* ==========================================================================
   Step actions: one save + one next action on every wizard page
   ========================================================================== */
.step-actions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  margin:28px 0 0;
  padding:18px 0 2px;
  border-top:1px solid var(--studio-line);
  background:transparent;
}
.settings-footer.step-actions{
  margin-top:32px;
  padding:20px 0 4px;
}
.studio-shell #wspParse .step-actions{
  margin:0;
  padding:16px 24px;
  background:linear-gradient(180deg,#fff 0%,#fbfcff 100%);
}
.step-actions-meta{
  display:flex;
  align-items:center;
  min-width:0;
}
.step-save-state{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  line-height:1.5;
  color:var(--studio-muted);
  transition:color var(--studio-motion-fast) var(--studio-ease);
}
.step-state-dot{
  width:6px;
  height:6px;
  flex:none;
  border-radius:50%;
  background:var(--studio-brand);
  box-shadow:0 0 0 3px var(--studio-brand-soft);
  transition:background var(--studio-motion-fast) var(--studio-ease), box-shadow var(--studio-motion-fast) var(--studio-ease);
}
.step-actions[data-state="saved"] .step-save-state{color:#067647}
.step-actions[data-state="saved"] .step-state-dot{background:#12b76a;box-shadow:0 0 0 3px #ecfdf3}
.step-actions[data-state="error"] .step-save-state{color:#b42318}
.step-actions[data-state="error"] .step-state-dot{background:#f04438;box-shadow:0 0 0 3px #fef3f2}
.step-actions-buttons{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  flex:none;
}
.step-actions .btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  width:132px;
  min-width:132px;
  height:40px;
  padding:0 12px;
  border-radius:8px;
  font-size:14px;
  font-weight:600;
  position:relative;
  overflow:hidden;
  transition:transform var(--studio-motion-fast) var(--studio-ease), box-shadow var(--studio-motion-fast) var(--studio-ease), background var(--studio-motion-fast) var(--studio-ease), border-color var(--studio-motion-fast) var(--studio-ease), color var(--studio-motion-fast) var(--studio-ease);
}
.step-actions .btn .ico{
  width:15px;
  height:15px;
  transition:transform var(--studio-motion-fast) var(--studio-ease);
}
.step-actions .btn:hover{transform:translateY(-1px)}
.step-actions .btn:active{transform:translateY(0) scale(.985)}
.step-actions .btn:focus-visible{
  outline:0;
  box-shadow:0 0 0 3px var(--studio-focus-ring);
}
.step-actions .btn.primary{
  width:132px;
  min-width:132px;
  height:40px;
  padding:0 12px;
  border-radius:8px;
  font-size:14px;
  box-shadow:0 8px 18px -14px rgba(47,111,235,.7);
}
.step-actions .btn.primary:hover{
  box-shadow:0 10px 22px -14px rgba(47,111,235,.8);
}
.step-action-next .ico{opacity:.9}
.step-action-next:hover .ico{transform:translateX(2px)}
.step-action-save .ico{color:var(--studio-brand)}
.step-action-save:hover{background:var(--studio-brand-soft);border-color:var(--studio-brand-line)}
.step-action-save[data-state="saving"]{cursor:progress}
.step-action-save[data-state="saving"] .ico{display:none}
.step-action-save[data-state="saving"]::before{
  content:"";
  width:13px;
  height:13px;
  border:2px solid currentColor;
  border-right-color:transparent;
  border-radius:50%;
  animation:stepSpin .7s linear infinite;
}
.step-action-save[data-state="saved"]{
  color:#067647;
  border-color:#abefc6;
  background:#ecfdf3;
}
.step-action-save[data-state="saved"] .ico{color:#12b76a}
.step-action-save[data-state="error"]{
  color:#b42318;
  border-color:#fecdca;
  background:#fef3f2;
}
.step-action-save[data-state="error"] .ico{color:#f04438}
.step-btn-ripple{
  position:absolute;
  width:14px;
  height:14px;
  border-radius:50%;
  background:currentColor;
  opacity:.18;
  transform:translate(-50%,-50%) scale(0);
  pointer-events:none;
  animation:stepRipple .5s cubic-bezier(.22,1,.36,1) forwards;
}
@keyframes stepSpin{to{transform:rotate(360deg)}}
@keyframes stepRipple{to{transform:translate(-50%,-50%) scale(9);opacity:0}}
.step-actions .btn.is-pressed{animation:stepPress .22s var(--studio-ease)}

/* Direction-aware page swap. View Transitions snapshot the stage as one
   surface, so the DOM swap never depends on JS timers. */
#stageScroll{view-transition-name:studio-stage}
::view-transition-group(studio-stage){
  animation-duration:.28s;
  animation-timing-function:cubic-bezier(.22,1,.36,1);
}
:root::view-transition-old(studio-stage),
:root::view-transition-new(studio-stage){
  animation-duration:.24s;
  animation-timing-function:cubic-bezier(.22,1,.36,1);
  mix-blend-mode:normal;
}
:root[data-step-dir="forward"]::view-transition-old(studio-stage){animation-name:studioStageOutForward}
:root[data-step-dir="forward"]::view-transition-new(studio-stage){animation-name:studioStageInForward}
:root[data-step-dir="back"]::view-transition-old(studio-stage){animation-name:studioStageOutBack}
:root[data-step-dir="back"]::view-transition-new(studio-stage){animation-name:studioStageInBack}
@keyframes studioStageOutForward{to{opacity:0;transform:translateX(-18px)}}
@keyframes studioStageInForward{from{opacity:0;transform:translateX(20px)}}
@keyframes studioStageOutBack{to{opacity:0;transform:translateX(18px)}}
@keyframes studioStageInBack{from{opacity:0;transform:translateX(-20px)}}

/* No View Transitions: animate only the incoming panel. */
.studio-shell .stage .panel.step-enter-forward{animation:studioPanelInForward .26s cubic-bezier(.22,1,.36,1) both}
.studio-shell .stage .panel.step-enter-back{animation:studioPanelInBack .26s cubic-bezier(.22,1,.36,1) both}
@keyframes studioPanelInForward{from{opacity:0;transform:translateX(16px)}}
@keyframes studioPanelInBack{from{opacity:0;transform:translateX(-16px)}}

@media (prefers-reduced-motion: reduce){
  :root[data-step-dir]::view-transition-old(studio-stage){
    animation-name:studioStageFadeOut;
    animation-duration:.12s;
  }
  :root[data-step-dir]::view-transition-new(studio-stage){
    animation-name:studioStageFadeIn;
    animation-duration:.12s;
  }
  @keyframes studioStageFadeOut{to{opacity:0}}
  @keyframes studioStageFadeIn{from{opacity:0}}
}
.studio-shell .stepper .step-no{
  transition:background var(--studio-motion-fast) var(--studio-ease), border-color var(--studio-motion-fast) var(--studio-ease), color var(--studio-motion-fast) var(--studio-ease), transform var(--studio-motion-fast) var(--studio-ease), box-shadow var(--studio-motion-fast) var(--studio-ease);
}
.studio-shell .stepper .step.active .step-no{
  transform:scale(1.06);
  box-shadow:0 0 0 4px var(--studio-brand-soft);
}
@keyframes stepPress{
  0%{transform:scale(.985)}
  55%{transform:scale(.97)}
  100%{transform:scale(.985)}
}
@media (max-width:1279px){
  .studio-shell #wspParse .step-actions{padding:16px 20px}
}
@media (max-width:760px){
  .step-actions,
  .settings-footer.step-actions{
    gap:12px;
    margin-top:22px;
    padding-top:14px;
  }
  .studio-shell #wspParse .step-actions{padding:14px 16px}
  .step-actions-meta{display:none}
  .step-actions-buttons{width:100%}
  .step-actions .btn{
    flex:1;
    width:auto;
    min-width:0;
  }
  .step-actions .btn.primary{
    width:auto;
    min-width:0;
    font-size:14px;
  }
}

/* ==========================================================================
   Theme finish: lime-mint canvas, navy ink, azure actions
   ========================================================================== */
body{
  background:var(--studio-canvas-gradient);
}

/* Keep the workspace canvas continuous across the rail and stage. */
#appView.studio-shell{
  transition:grid-template-columns .28s var(--studio-ease);
}

/* Rail collapse: width, labels and groups animate together. */
.studio-shell .rail-item,
.rail-group-toggle,
.rail-toggle,
.rail-sub-item{
  transition:width .28s var(--studio-ease), margin .28s var(--studio-ease), padding .28s var(--studio-ease), gap .24s var(--studio-ease), background-color var(--studio-motion-fast) var(--studio-ease), color var(--studio-motion-fast) var(--studio-ease);
}
.studio-shell .rail-label,
.rail-group-label,
.rail-toggle span{
  max-width:120px;
  transition:max-width .26s var(--studio-ease), opacity .18s var(--studio-ease), transform .24s var(--studio-ease);
}
.studio-shell .rail.collapsed .rail-label,
.studio-shell .rail.collapsed .rail-toggle span{
  display:block;
  max-width:0;
  opacity:0;
  transform:translateX(-6px);
  pointer-events:none;
}
.rail-group{
  max-height:220px;
  overflow:hidden;
  opacity:1;
  transition:max-height .28s var(--studio-ease), opacity .18s var(--studio-ease), margin .28s var(--studio-ease), transform .24s var(--studio-ease);
}
.studio-shell .rail.collapsed .rail-group{
  display:block;
  max-height:0;
  opacity:0;
  margin-top:0;
  margin-bottom:0;
  transform:translateX(-6px);
  pointer-events:none;
}
.studio-shell .rail.collapsed .rail-group-label,
.studio-shell .rail.collapsed .rail-chevron{
  display:none;
}
.rail-foot{transition:opacity .18s var(--studio-ease)}
.studio-shell .rail.collapsed .rail-foot{
  opacity:0;
  pointer-events:none;
}

/* Inspector: always toggleable; docked collapse at desktop widths. */
#inspectorToggle{display:grid}
@media (min-width:1600px){
  .studio-shell .inspector{
    width:100%;
    transition:opacity .18s var(--studio-ease), transform .28s var(--studio-ease), border-color .2s var(--studio-ease);
  }
  #appView.studio-shell.inspector-collapsed{
    --studio-content-width:1320px;
    grid-template-columns:148px 260px minmax(0,1fr) 0px;
  }
  #appView.studio-shell.rail-collapsed.inspector-collapsed{
    grid-template-columns:64px 260px minmax(0,1fr) 0px;
  }
  #appView.studio-shell.inspector-collapsed:not(.context-active){
    grid-template-columns:148px minmax(0,1fr) 0px;
  }
  #appView.studio-shell.rail-collapsed.inspector-collapsed:not(.context-active){
    grid-template-columns:64px minmax(0,1fr) 0px;
  }
  #appView.studio-shell.context-expanded.inspector-collapsed{
    grid-template-columns:148px 320px minmax(0,1fr) 0px;
  }
  #appView.studio-shell.rail-collapsed.context-expanded.inspector-collapsed{
    grid-template-columns:64px 320px minmax(0,1fr) 0px;
  }
  #appView.studio-shell.inspector-collapsed .inspector{
    opacity:0;
    overflow:hidden;
    border-left-color:transparent;
    pointer-events:none;
  }
  #appView.studio-shell.inspector-collapsed .inspector-head,
  #appView.studio-shell.inspector-collapsed .inspector-body{display:none}
}
@media (max-width:760px){
  .studio-shell .rail{background:var(--studio-canvas)}
}
@media (min-width:761px){
  .studio-shell .rail.collapsed{width:100%}
}
.studio-shell .rail.collapsed .rail-item,
.studio-shell .rail.collapsed .rail-toggle,
.studio-shell .rail.collapsed .rail-group-toggle{gap:0}
/* Legacy .workspace capped the stage at 1440px; the studio grid owns width now. */
.studio-shell .stage{max-width:none}
.rail-toggle span{overflow:hidden;white-space:nowrap}
.mobile-btn[aria-expanded="true"]{
  background:var(--studio-brand-soft);
  color:var(--studio-brand);
}
@media (prefers-reduced-motion:reduce){
  #appView.studio-shell{transition-duration:.12s}
}

/* Content reflows with the docked inspector instead of leaving the stage at one width. */
.stage-head,
.studio-shell .stage .panel,
.settings-page{
  transition:max-width .28s var(--studio-ease);
}
@media (min-width:1600px){
  #appView.studio-shell:not(.inspector-collapsed) .inspector-head,
  #appView.studio-shell:not(.inspector-collapsed) .inspector-body{
    animation:inspectorPanelIn .22s var(--studio-ease) both;
  }
}
@keyframes inspectorPanelIn{from{opacity:0}}

/* Catalog basis: three readable summary cards */
.studio-shell .basis-panel{
  grid-template-columns:1.05fr 1fr 1.2fr;
  gap:10px;
  margin:0 0 12px;
}
.studio-shell .basis-card{
  padding:11px 13px;
  border-radius:9px;
  background:#fff;
  border:1px solid var(--studio-line);
  box-shadow:0 1px 2px rgba(22,22,42,.03);
}
.studio-shell .basis-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin:0 0 7px;
}
.studio-shell .basis-card h4{
  margin:0;
  font-size:13px;
  line-height:1.4;
  font-weight:600;
  letter-spacing:0;
  color:var(--studio-ink);
}
.studio-shell .basis-count{
  display:inline-flex;
  align-items:center;
  height:19px;
  padding:0 6px;
  border-radius:999px;
  background:var(--studio-brand-soft);
  color:var(--studio-brand-2);
  font-size:10px;
  font-weight:500;
  white-space:nowrap;
}
.studio-shell .basis-name{
  margin:0 0 5px;
  font-size:12.5px;
  line-height:1.45;
  font-weight:600;
  color:var(--studio-ink);
  overflow-wrap:anywhere;
}
.studio-shell .basis-rows{display:flex;flex-direction:column;gap:4px}
.studio-shell .basis-row{
  display:grid;
  grid-template-columns:52px minmax(0,1fr);
  gap:8px;
  align-items:start;
}
.studio-shell .basis-label{
  font-size:10.5px;
  line-height:1.5;
  color:var(--studio-faint);
}
.studio-shell .basis-value{
  font-size:12px;
  line-height:1.5;
  font-weight:500;
  color:var(--studio-ink-2);
  overflow-wrap:anywhere;
}
.studio-shell .basis-list{display:flex;flex-direction:column;gap:5px}
.studio-shell .basis-item{
  display:grid;
  grid-template-columns:18px minmax(0,1fr) auto;
  gap:6px;
  align-items:start;
}
.studio-shell .basis-index{
  padding-top:1px;
  font-family:var(--studio-font-mono);
  font-size:9px;
  line-height:1.6;
  color:var(--studio-faint);
}
.studio-shell .basis-text{
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
  font-size:11.5px;
  line-height:1.5;
  color:var(--studio-ink-2);
  overflow-wrap:anywhere;
}
.studio-shell .basis-score{
  padding:1px 5px;
  border-radius:4px;
  background:var(--studio-brand-soft);
  color:var(--studio-brand-2);
  font-size:9.5px;
  line-height:1.4;
  white-space:nowrap;
}
.studio-shell .basis-focus{
  margin-top:8px;
  padding-top:8px;
  border-top:1px dashed var(--studio-line);
}
.studio-shell .basis-focus .basis-label{display:block;margin-bottom:6px}
.studio-shell .basis-card .chips{gap:6px}
.studio-shell .basis-card .chip{
  max-width:100%;
  height:22px;
  padding:0 7px;
  overflow:hidden;
  text-overflow:ellipsis;
  border-color:var(--studio-line);
  background:var(--studio-surface-2);
  color:var(--studio-ink-2);
  font-size:10.5px;
}
.studio-shell .basis-empty{
  font-size:11.5px;
  line-height:1.6;
  color:var(--studio-faint);
}
.studio-shell .basis-more{
  margin-top:5px;
  font-size:10.5px;
  color:var(--studio-muted);
}
@media (max-width:1279px){
  .studio-shell .basis-panel{grid-template-columns:1fr}
}
.studio-shell .basis-note{
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
  margin:0 0 6px;
  font-size:11.5px;
  line-height:1.55;
  color:var(--studio-muted);
  overflow-wrap:anywhere;
}
.studio-shell .basis-note + .basis-rows{margin-top:2px}

/* Writing page: job card readability + slim scrollbars */
.studio-shell .job-box{
  padding:12px 16px;
  background:transparent;
}
.studio-shell .job-box:empty{display:none}
.studio-shell .job-card{
  padding:12px 14px;
  border:1px solid var(--studio-line);
  border-radius:10px;
  background:#fff;
  box-shadow:0 1px 2px rgba(22,22,42,.03);
}
.studio-shell .job-line{
  margin:0;
  padding:0;
  font-size:12px;
}
.studio-shell .job-line + .job-line{
  margin-top:11px;
  padding-top:11px;
  border-top:1px dashed var(--studio-line);
}
.studio-shell .job-top{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:8px;
}
.studio-shell .job-type{
  font-size:12.5px;
  line-height:1.5;
  font-weight:500;
  color:var(--studio-ink);
}
.studio-shell .job-count{
  margin-left:auto;
  font-size:11px;
  line-height:1.5;
  color:var(--studio-muted);
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}
.studio-shell .job-top .btn.xs{
  height:22px;
  padding:0 8px;
  font-size:10.5px;
}
.studio-shell .job-line .bar{
  height:6px;
  border-radius:999px;
  overflow:hidden;
  background:var(--studio-line);
}
.studio-shell .job-line .bar i{
  display:block;
  height:100%;
  border-radius:inherit;
  background:linear-gradient(90deg,var(--studio-brand),#56b4ff);
  transition:width .3s var(--studio-ease);
}
.studio-shell .job-meta{
  margin-top:10px;
  padding-top:9px;
  border-top:1px dashed var(--studio-line);
  font-size:11.5px;
  line-height:1.6;
  color:var(--studio-muted);
}
.studio-shell .chapter-items li{
  gap:8px;
  padding:7px 8px;
  font-size:11.5px;
}
.studio-shell .chapter-items .pill{
  height:22px;
  padding:0 7px;
  line-height:22px;
  font-size:11px;
}
.studio-shell .ch-words{
  font-size:10px;
  color:var(--studio-muted);
}
.studio-shell .pane-head,
.studio-shell .stream-bar{
  padding:10px 12px;
  font-size:11.5px;
}

/* Scrollbar skin lives in /studio/visual-refresh.css (loaded last). */
.studio-shell .chapter-items,
.studio-shell .stream-content{scrollbar-gutter:stable}
.studio-shell .chapter-items .ch-name{
  flex:1;
  min-width:0;
}

/* ==========================================================================
   Global main-content typography: page title → block title → label/value
   ========================================================================== */
.studio-shell .panel-head h2,
.studio-shell .mydocs-head h2{
  margin:0 0 4px;
  color:var(--studio-ink);
  font-size:var(--studio-type-page-title);
  line-height:1.35;
  font-weight:var(--studio-weight-title);
  letter-spacing:-.01em;
}
.studio-shell .panel-head p,
.studio-shell .panel-head .muted,
.mydocs-head p{
  color:var(--studio-muted);
  font-size:var(--studio-type-page-sub);
  line-height:1.65;
}
.studio-shell #wspParse .br-card-title h2{
  color:var(--studio-ink);
  font-size:var(--studio-type-card-title);
  line-height:1.4;
  font-weight:var(--studio-weight-title);
  letter-spacing:-.01em;
}
.studio-shell #wspParse .br-card-title p{
  color:var(--studio-muted);
  font-size:var(--studio-type-page-sub);
  line-height:1.6;
}

/* Page 0: settings blocks */
.studio-shell .settings-block-head{
  padding-bottom:10px;
  border-bottom:1px solid var(--studio-line);
  margin-bottom:14px;
}
.studio-shell .settings-block-head h3{
  color:var(--studio-ink);
  font-size:var(--studio-type-block-title);
  line-height:1.5;
  font-weight:var(--studio-weight-block);
}
.studio-shell .settings-block-head p{
  color:var(--studio-muted);
  font-size:var(--studio-type-page-sub);
  line-height:1.6;
}

/* Page 1: interpretation form sections */
.studio-shell #wspParse .br-sec-head{
  padding-bottom:10px;
  border-bottom:1px solid var(--studio-line);
  margin-bottom:12px;
}
.studio-shell #wspParse .br-sec-title,
.studio-shell #wspParse .br-form-block .lq-sec-title{
  font-size:var(--studio-type-block-title);
  line-height:1.5;
  font-weight:var(--studio-weight-block);
}
.studio-shell #wspParse .br-form-block .lq-sec-title{
  padding-bottom:10px;
  border-bottom:1px solid var(--studio-line);
  margin-bottom:12px;
}
.studio-shell #wspParse .br-sec-head em,
.studio-shell #wspParse .br-form-block .lq-sec-title em,
.studio-shell #wspParse .br-result-head .br-sec-title em{
  font-size:var(--studio-type-page-sub);
  line-height:1.6;
  font-weight:400;
}
.studio-shell #wspParse .br-result-head .br-sec-title{
  font-size:var(--studio-type-block-title);
  line-height:1.5;
  font-weight:var(--studio-weight-block);
}

/* Generic content cards, lists and details blocks */
.studio-shell .section-title{
  margin:20px 0 12px;
  padding-bottom:8px;
  border-bottom:1px solid var(--studio-line);
  color:var(--studio-ink);
  font-size:var(--studio-type-block-title);
  line-height:1.5;
  font-weight:var(--studio-weight-block);
}
.studio-shell .card h3{
  padding-bottom:8px;
  border-bottom:1px solid var(--studio-line);
  margin:0 0 12px;
  color:var(--studio-ink);
  font-size:var(--studio-type-block-title);
  line-height:1.5;
  font-weight:var(--studio-weight-block);
}
.studio-shell #panel6 .card h3{
  font-size:var(--studio-type-block-title);
  font-weight:var(--studio-weight-block);
}
.studio-shell .rules-box summary,
.studio-shell .export-advanced>summary{
  color:var(--studio-ink);
  font-size:var(--studio-type-block-title);
  line-height:1.5;
  font-weight:var(--studio-weight-block);
}
.studio-shell .rules-box summary{
  padding-bottom:10px;
  border-bottom:1px solid var(--studio-line);
  margin-bottom:10px;
}

/* Page 5: export blocks */
.studio-shell .export-basic-head{
  padding-bottom:10px;
  border-bottom:1px solid var(--studio-line);
  margin-bottom:12px;
}
.studio-shell .export-basic-head h3{
  color:var(--studio-ink);
  font-size:var(--studio-type-block-title);
  line-height:1.5;
  font-weight:var(--studio-weight-block);
}
.studio-shell .export-basic-head span{
  color:var(--studio-muted);
  font-size:var(--studio-type-meta);
  line-height:1.5;
}

/* Compact summary cards keep a lighter title to avoid too many rules */
.studio-shell .basis-card h4,
.studio-shell .basis-card .basis-head h4{
  font-size:13px;
  line-height:1.4;
  font-weight:var(--studio-weight-block);
}

/* Labels and tabular content follow the same scale */
.studio-shell .settings-page label,
.studio-shell .export-grid label,
.studio-shell .export-basic-grid label,
.studio-shell .catalog-config label{
  color:var(--studio-muted);
  font-size:var(--studio-type-label);
  font-weight:500;
}
.studio-shell .tbl th{
  color:var(--studio-muted);
  font-size:var(--studio-type-label);
  font-weight:600;
}
.studio-shell .tbl td{
  color:var(--studio-ink-2);
  font-size:var(--studio-type-body);
  line-height:1.6;
}

/* Cmdbar document switcher */
.cmdbar .doc-switch-wrap{
  position:relative;
  display:flex;
  min-width:0;
  max-width:380px;
  flex:0 1 auto;
}
.cmdbar .doc-switch-wrap .doc-switch{
  width:100%;
  max-width:100%;
}
.doc-switch-menu{
  position:absolute;
  top:calc(100% + 12px);
  left:0;
  z-index:var(--studio-z-popover);
  width:360px;
  max-width:min(360px,calc(100vw - 32px));
  max-height:360px;
  overflow:auto;
  padding:6px;
  border:1px solid var(--studio-line);
  border-radius:10px;
  background:#fff;
  box-shadow:var(--studio-shadow-popover);
  scrollbar-width:thin;
  scrollbar-color:#c2d8df transparent;
}
.doc-switch-menu[hidden]{display:none}
.doc-switch-menu-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:6px 8px 7px;
  color:var(--studio-muted);
  font-size:10.5px;
  font-weight:600;
  letter-spacing:.02em;
}
.doc-switch-menu-head b{
  color:var(--studio-faint);
  font-size:10px;
  font-weight:500;
}
.doc-switch-item{
  display:flex;
  align-items:center;
  gap:8px;
  width:100%;
  padding:8px;
  border:0;
  border-radius:6px;
  background:transparent;
  text-align:left;
  cursor:pointer;
  transition:background .15s var(--studio-ease);
}
.doc-switch-item:hover{background:var(--studio-surface-2)}
.doc-switch-item.active{background:var(--studio-brand-soft)}
.doc-switch-item-copy{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:1px;
}
.doc-switch-item-copy b{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--studio-ink);
  font-size:12.5px;
  line-height:1.5;
  font-weight:500;
}
.doc-switch-item-copy small{
  display:block;
  color:var(--studio-muted);
  font-size:10.5px;
  line-height:1.5;
}
.doc-switch-item .ico{
  flex:none;
  color:var(--studio-brand);
}
.doc-switch-empty{
  padding:16px 8px;
  color:var(--studio-faint);
  font-size:11.5px;
  text-align:center;
}
.doc-switch-new{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  width:100%;
  margin-top:4px;
  padding:8px;
  border:0;
  border-top:1px solid var(--studio-line);
  background:transparent;
  color:var(--studio-brand-2);
  font-size:11.5px;
  font-weight:500;
  cursor:pointer;
}
.doc-switch-new:hover{background:var(--studio-brand-soft)}
@media (max-width:760px){
  .cmdbar .doc-switch-wrap{display:none}
}
/* Project overview summary: keep it secondary but above the 10px floor. */
.studio-shell .basis-card .basis-note{
  font-size:13px;
  line-height:1.6;
  -webkit-line-clamp:2;
  color:var(--studio-muted);
}

/* Step gating: previous steps stay reachable, future steps unlock in order */
.studio-shell .stepper .step.locked{
  opacity:.46;
  cursor:not-allowed;
}
.studio-shell .stepper .step.locked .step-no{
  background:var(--studio-surface-2);
  border-color:var(--studio-line);
  color:var(--studio-faint);
  box-shadow:none;
}
.studio-shell .stepper .step.locked:hover{
  color:var(--studio-muted);
}
.studio-shell .rail-item.locked{
  opacity:.46;
  cursor:not-allowed;
}
.studio-shell .rail-item.locked:hover{
  background:transparent;
  color:var(--studio-ink);
}

/* ==========================================================================
   Legacy overlay styles are disabled: web/studio/overlay.css owns the modal
   visuals and web/studio/visual-refresh.css owns the toast.
   ========================================================================== */
@media not all {
#modalRoot .modal-mask{
  background:rgba(16,24,40,.44);
  -webkit-backdrop-filter:blur(5px);
  backdrop-filter:blur(5px);
  animation:studioModalMaskIn 200ms cubic-bezier(.22,1,.36,1);
}
#modalRoot .modal{
  animation:studioModalPanelIn 220ms cubic-bezier(.22,1,.36,1);
  transform-origin:50% 50%;
  box-shadow:0 28px 64px -24px rgba(16,24,40,.38),0 10px 24px -16px rgba(16,24,40,.22);
}
#modalRoot.is-closing .modal-mask{
  animation:studioModalMaskOut 180ms cubic-bezier(.22,1,.36,1) forwards;
  pointer-events:none;
}
#modalRoot.is-closing .modal{
  animation:studioModalPanelOut 180ms cubic-bezier(.22,1,.36,1) forwards;
  pointer-events:none;
}
@keyframes studioModalMaskIn{
  from{opacity:0}
  to{opacity:1}
}
@keyframes studioModalPanelIn{
  from{opacity:0;transform:translateY(8px) scale(.985)}
  to{opacity:1;transform:translateY(0) scale(1)}
}
@keyframes studioModalMaskOut{
  from{opacity:1}
  to{opacity:0}
}
@keyframes studioModalPanelOut{
  from{opacity:1;transform:translateY(0) scale(1)}
  to{opacity:0;transform:translateY(6px) scale(.988)}
}
}

/* The writing stepper belongs to the 标书写作 workspace only. */
#appView.studio-shell:not(.writing-stepper) #stepper{
  display:none;
}

/* Standalone workspaces (my bids / knowledge / gallery / skills) own their
   page heading inside the panel. Hide the document header there so an
   unselected document never leaves "选择或新建一份标书" above them. */
#appView.studio-shell:not(.writing-active) .stage-head{
  padding-top:0;
}
#appView.studio-shell:not(.writing-active) .stage-head .doc-head{
  display:none;
}

/* ==========================================================================
   Panel 6 (企业知识库) control alignment
   Scoped to #panel6 so no other workspace page is affected.
   Root causes fixed here:
   1. `.studio-shell label{display:block}` outranks `.btn`/`.file-btn`,
      so upload labels were laid out as text blocks (top-left text, extra
      bottom margin, row height 46px instead of a 36px control).
   2. Toolbar buttons were 30px/26px while the search inputs were 38px and
      the selects 32px, producing uneven rows.
   3. Icon buttons and text buttons used different line boxes; the fix pins
      a 14px icon and a 13px line-height inside one shared 36px flex centre
      line so icon and text share the same visual centre.
   ========================================================================== */
#panel6{
  --p6-control-h:36px;
  --p6-control-radius:8px;
}
.studio-shell #panel6 .panel-head .row,
.studio-shell #panel6 .row{
  gap:8px;
}

/* Upload labels: keep the native <label>+hidden input upload behaviour,
   but lay the label out as a real flex control instead of a text block. */
.studio-shell #panel6 label.file-btn,
.studio-shell #panel6 .file-btn.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  height:var(--p6-control-h);
  min-height:var(--p6-control-h);
  margin:0;
  padding:0 16px;
  border-radius:var(--p6-control-radius);
  font-size:13px;
  line-height:1;
  white-space:nowrap;
  text-align:center;
  vertical-align:middle;
  cursor:pointer;
}

/* Toolbar buttons in #panel6 rows: one height, padding, gap and type scale. */
.studio-shell #panel6 .row > .btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  height:var(--p6-control-h);
  min-height:var(--p6-control-h);
  margin:0;
  padding:0 14px;
  border-radius:var(--p6-control-radius);
  font-size:13px;
  line-height:1;
  text-align:center;
  white-space:nowrap;
  vertical-align:middle;
}
.studio-shell #panel6 .row > .btn.sm,
.studio-shell #panel6 .row > .btn.xs{
  height:var(--p6-control-h);
  min-height:var(--p6-control-h);
  padding:0 14px;
  border-radius:var(--p6-control-radius);
  font-size:13px;
  line-height:1;
}

/* Preserve the original upload pill shape while keeping the shared height.
   The extra `.row >` + element specificity is needed to outrank
   `.studio-shell #panel6 .row > .btn.sm`. */
.studio-shell #panel6 .row > label.file-btn.btn,
.studio-shell #panel6 .row > .file-btn.btn.sm{
  padding:0 18px;
  border-radius:20px;
}

/* Icons participate in the same flex centre line as the label. */
.studio-shell #panel6 .btn > .ico,
.studio-shell #panel6 .file-btn > .ico{
  flex:0 0 auto;
  width:14px;
  height:14px;
  margin:0;
  vertical-align:middle;
}

/* Inputs and selects sharing a row with those buttons use the same height. */
.studio-shell #panel6 .row > input:not([type="file"]),
.studio-shell #panel6 .row > select{
  width:auto;
  height:var(--p6-control-h);
  min-height:var(--p6-control-h);
  margin:0;
  padding:0 14px;
  font-size:13px;
  line-height:1;
}
.studio-shell #panel6 .row > input:not([type="file"]){
  flex:1 1 160px;
  min-width:0;
}
.studio-shell #panel6 .row > select{
  flex:0 0 auto;
}
/* Keep the search pills visually round while matching the new height. */
.studio-shell #panel6 #kbQuery,
.studio-shell #panel6 #hdbQuery,
.studio-shell #panel6 #corpusQuery,
.studio-shell #panel6 #imgQuery{
  padding:0 16px;
  border-radius:999px;
}

/* Knowledge workspace tabs */
.studio-shell .kb-tabs{
  display:flex;
  align-items:center;
  gap:4px;
  margin:0 0 18px;
  padding:0 0 1px;
  border-bottom:1px solid var(--studio-line);
}
.studio-shell .kb-tab{
  position:relative;
  height:34px;
  padding:0 12px;
  border:0;
  border-radius:6px 6px 0 0;
  background:transparent;
  color:var(--studio-muted);
  font-size:12.5px;
  font-weight:500;
  cursor:pointer;
  transition:color .16s var(--studio-ease),background-color .16s var(--studio-ease);
}
.studio-shell .kb-tab:hover{background:var(--studio-surface-2);color:var(--studio-ink)}
.studio-shell .kb-tab.active{color:var(--studio-ink);font-weight:600}
.studio-shell .kb-tab.active::after{
  content:"";
  position:absolute;
  left:10px;
  right:10px;
  bottom:-1px;
  height:2px;
  border-radius:2px;
  background:var(--studio-brand);
}
.studio-shell .kb-tab-panel{display:none}
.studio-shell .kb-tab-panel.is-active{display:block}
.studio-shell .kb-tab-panel .card + .card{margin-top:14px}

/* Private gallery workspace */
.studio-shell #panel9 .panel-head .row,
.studio-shell #panel9 .row{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.studio-shell #panel9 .row > .btn,
.studio-shell #panel9 label.file-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  height:36px;
  margin:0;
  padding:0 14px;
  border-radius:8px;
  font-size:12.5px;
  line-height:1;
  white-space:nowrap;
}
.studio-shell #panel9 label.file-btn{
  padding:0 18px;
  border-radius:20px;
  background:var(--studio-brand);
  border-color:var(--studio-brand);
  color:#fff;
}
.studio-shell #panel9 label.file-btn:hover{
  background:var(--studio-brand-2);
  border-color:var(--studio-brand-2);
}
.studio-shell #panel9 .row > input:not([type="file"]),
.studio-shell #panel9 .row > select{
  height:36px;
  font-size:12.5px;
}
.studio-shell #panel9 #imgQuery{
  flex:1;
  min-width:180px;
}
.studio-shell #panel9 .card{margin-top:0}

/* Reference footer: previous / next pills, sampled from lianqiai infoFill */
.studio-shell .step-actions,
.studio-shell .settings-footer.step-actions{
  display:flex;
  align-items:center;
  justify-content:center;
  margin:26px 0 0;
  padding:18px 0 8px;
  border-top:0;
  background:transparent;
}
.studio-shell #wspParse .step-actions{
  margin:0;
  padding:18px 24px 10px;
  border-top:1px solid var(--studio-line);
  background:#fff;
}
.studio-shell .step-actions-buttons{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:24px;
  flex:none;
}
.studio-shell .step-prev,
.studio-shell .step-next{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  width:180px;
  height:42px;
  padding:10px 32px;
  border-radius:55px;
  font-family:var(--studio-font-ui);
  font-size:16px;
  line-height:22px;
  white-space:nowrap;
  box-shadow:0 5px 10px rgba(0,0,0,.1);
  transition:background-color .16s var(--studio-ease),border-color .16s var(--studio-ease),color .16s var(--studio-ease),box-shadow .16s var(--studio-ease),transform .16s var(--studio-ease);
}
.studio-shell .step-prev{
  border:1px solid #0260f9;
  background:#fff;
  color:#0260f9;
  font-weight:400;
  cursor:pointer;
}
.studio-shell .step-prev:hover:not(:disabled){
  background:#eef4ff;
}
.studio-shell .step-prev:active:not(:disabled){
  transform:translateY(1px);
}
.studio-shell .step-prev:disabled{
  border-color:#d5d9e1;
  background:#f5f6f8;
  color:#a8aeb8;
  box-shadow:none;
  cursor:not-allowed;
}
.studio-shell .step-prev-ico{
  width:22px;
  height:22px;
  flex:none;
  transform:rotate(180deg);
}
.studio-shell .step-next{
  border:1px solid #0260f9;
  background:#0260f9;
  color:#fff;
  font-weight:600;
  cursor:pointer;
}
.studio-shell .step-next:hover:not(:disabled):not(.disable-next-btn){
  border-color:#0257df;
  background:#0257df;
}
.studio-shell .step-next:active:not(:disabled):not(.disable-next-btn){
  transform:translateY(1px);
}
.studio-shell .step-next:disabled,
.studio-shell .step-next.disable-next-btn{
  border-color:#d5d9e1;
  background:#d5d9e1;
  color:#fff;
  box-shadow:0 5px 10px rgba(0,0,0,.1);
  cursor:not-allowed;
}
.studio-shell .step-next-wrap{
  position:relative;
  display:inline-flex;
  flex:none;
}
.studio-shell .step-tip{
  position:absolute;
  left:50%;
  bottom:calc(100% + 10px);
  transform:translateX(-50%);
  padding:5px 14px;
  border-radius:8px;
  background:#fff;
  color:#1d222a;
  font-size:14px;
  line-height:21px;
  white-space:nowrap;
  box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);
  z-index:24;
  pointer-events:none;
}
.studio-shell .step-tip[hidden]{display:none}
.studio-shell .step-tip::after{
  content:"";
  position:absolute;
  left:50%;
  bottom:-5px;
  width:9px;
  height:9px;
  background:#fff;
  transform:translateX(-50%) rotate(45deg);
  box-shadow:2px 2px 4px rgba(0,0,0,.04);
}
.studio-shell .step-prev.is-pressed,
.studio-shell .step-next.is-pressed{
  transform:scale(.985);
}
@media (max-width:760px){
  .studio-shell .step-actions,
  .studio-shell .settings-footer.step-actions{
    padding:16px 0 8px;
  }
  .studio-shell .step-actions-buttons{
    width:100%;
    gap:12px;
  }
  .studio-shell .step-prev,
  .studio-shell .step-next{
    flex:1;
    width:auto;
    min-width:0;
    padding:10px 12px;
  }
  .studio-shell .step-prev-ico{width:18px;height:18px}
  .studio-shell .step-tip{white-space:normal;width:max-content;max-width:70vw;text-align:center}
}
