/* In-page sheets are anchored right; recharge retains its existing centered modal. */
body :is([role="dialog"][aria-modal="true"], [data-workbench-layer]):not(#灵光充值弹窗):not([data-workbench-centered]) {
  position:fixed!important;
  transform:none!important;
  min-width:0!important;
  margin:0!important;
  border:0!important;
  box-shadow:none!important;
  background:var(--feishu-color-bg-0,#fff);
  overflow-y:auto;
  overscroll-behavior:contain;
  box-sizing:border-box;
}
body [data-workbench-layer]{z-index:var(--workbench-layer-z,3001)!important;outline:0;padding:28px;display:block}
body :is([role="dialog"],[data-workbench-layer])[hidden],body [role="dialog"][aria-hidden="true"]{display:none!important}
body :is(.飞书全局弹层遮罩,.销售案例入库遮罩,.API模型弹窗遮罩,.素材采集库详情遮罩,.详情遮罩,.自由配版遮罩,.模板库遮罩,.IM模板遮罩,.IM模板源选择遮罩,.IM内容数据库编辑遮罩,.日志遮罩,.课程同行内容库遮罩,.知识库详情抽屉遮罩,.内容架构详情遮罩,.cg-scrim):not(#灵光充值遮罩):not([data-workbench-centered]){padding:0!important;align-items:stretch!important;justify-content:flex-end!important}
body :is(.飞书全局弹层,.enterprise-information-dialog,.全局客服弹窗,.workbench-notice-layer,#delete-dialog,#refund-dialog,#allocation-dialog,#account-dialog){--workbench-layer-width:520px}
body :is(.素材采集库详情弹层,.内容架构详情弹层,#自由配版弹窗,#模板库弹窗,#IM模板弹窗,#IM模板源选择弹窗,.workflow-config-dialog,.skill-import-dialog){--workbench-layer-width:1100px}
body :is(.API模型参数弹窗,.API模型选择弹窗,.discovery-settings-layer){--workbench-layer-width:760px}
body :is([role="dialog"][aria-modal="true"],[data-workbench-layer]):not(#灵光充值弹窗):not([data-workbench-centered]) > :is(header,footer){border:0!important;box-shadow:none!important}
body [data-workbench-layer] > form{min-height:100%;display:flex;flex-direction:column}
body [data-workbench-layer] .dialog-actions{margin-top:auto;padding-top:24px;border:0;flex-shrink:0}
body .workbench-notice-layer p{margin:24px 0;color:var(--feishu-color-text-1,#646a73)}
body .workbench-notice-layer button{height:32px;padding:0 16px;border:0;border-radius:6px;background:var(--feishu-color-primary,#3370ff);color:#fff}
body .discovery-layer:not(.discovery-settings-layer){--workbench-layer-width:520px}
/* Channel conditions are a centered modal. Data detail sheets keep the shared right edge layout. */
body .discovery-page:has(.discovery-settings-layer[data-workbench-centered]){z-index:12000!important}
body .workbench-layer-scrim[data-workbench-centered],
html:root[data-workbench-layer-frame] body .workbench-layer-scrim[data-workbench-centered]{
  position:fixed!important;inset:0!important;width:100vw!important;max-width:none!important;height:100dvh!important;margin:0!important;
}
body .discovery-page .discovery-layer.discovery-settings-layer[data-workbench-centered],
html:root[data-workbench-layer-frame] body .discovery-page .discovery-layer.discovery-settings-layer[data-workbench-centered]{
  position:fixed!important;inset:50% auto auto 50%!important;
  transform:translate(-50%,-50%)!important;
  width:min(760px,calc(100vw - 32px))!important;
  max-width:calc(100vw - 32px)!important;
  height:auto!important;max-height:calc(100dvh - 48px)!important;
  margin:0!important;padding:0!important;
  border:1px solid var(--feishu-color-border,#e5e7eb)!important;border-radius:12px!important;
  background:var(--feishu-color-bg-0,#fff)!important;
  box-shadow:0 20px 56px rgba(31,35,41,.18)!important;
  padding:24px 28px!important;
  overflow-y:auto;overscroll-behavior:contain;
}
body .discovery-page .discovery-layer.discovery-settings-layer[data-workbench-centered] > form{min-height:0!important}
@media(max-width:600px){
  body .discovery-page .discovery-layer.discovery-settings-layer[data-workbench-centered],
  html:root[data-workbench-layer-frame] body .discovery-page .discovery-layer.discovery-settings-layer[data-workbench-centered]{width:calc(100vw - 24px)!important;max-width:calc(100vw - 24px)!important;max-height:calc(100dvh - 32px)!important}
}
@media(max-width:600px){body [data-workbench-layer]{padding:20px}}

body [data-workbench-layer-portal]{position:fixed!important;inset:0!important;z-index:3000!important;width:auto!important;height:auto!important;padding:0!important;margin:0!important;background:transparent!important;overflow:visible!important;pointer-events:none}
body [data-workbench-layer-portal] > *{pointer-events:auto}

/* content-frame-overlay-v1: cover title, padding and content as one surface. */
html:root[data-workbench-layer-frame] body :is(.workbench-layer-scrim,.飞书全局弹层遮罩,.销售案例入库遮罩,.API模型弹窗遮罩,.素材采集库详情遮罩,.详情遮罩,.自由配版遮罩,.模板库遮罩,.IM模板遮罩,.IM模板源选择遮罩,.IM内容数据库编辑遮罩,.日志遮罩,.课程同行内容库遮罩,.知识库详情抽屉遮罩,.内容架构详情遮罩,.cg-scrim,.知识库详情抽屉层):not(#灵光充值遮罩):not([data-workbench-centered]) {
  position: fixed !important;
  inset: var(--workbench-frame-top,0px) var(--workbench-frame-right,0px) var(--workbench-frame-bottom,0px) var(--workbench-frame-left,0px) !important;
  width: var(--workbench-frame-width,100vw) !important;
  height: var(--workbench-frame-height,100dvh) !important;
  min-width: 0 !important; min-height: 0 !important; max-width: none !important; max-height: none !important;
  margin: 0 !important; padding: 0 !important; transform: none !important;
  border: 0 !important; border-radius: var(--workbench-frame-radius,0px) !important;
  box-sizing: border-box !important;
}
html:root[data-workbench-layer-frame] body :is([role="dialog"][aria-modal="true"],[data-workbench-layer]):not(#灵光充值弹窗):not([data-workbench-centered]) {
  inset: var(--workbench-frame-top,0px) var(--workbench-frame-right,0px) var(--workbench-frame-bottom,0px) auto !important;
  width: min(var(--workbench-layer-width,760px),var(--workbench-frame-width,100vw)) !important;
  max-width: var(--workbench-frame-width,100vw) !important;
  height: var(--workbench-frame-height,100dvh) !important;
  max-height: var(--workbench-frame-height,100dvh) !important;
  border-radius: 0 var(--workbench-frame-radius,0px) var(--workbench-frame-radius,0px) 0 !important;
}
html:root[data-workbench-layer-frame] body .知识库详情抽屉层 { z-index: 2400 !important; }
html:root[data-workbench-layer-frame] body .素材采集库详情弹层 { --workbench-layer-width: 800px !important; }
body #IM模板源选择遮罩,
body #IM模板源选择弹窗 {
  z-index: 420 !important;
}
body #IM模板源选择弹窗 {
  z-index: 421 !important;
}

/* Keep the original responsive recharge dialog centered within its viewport scrim. */
body #灵光充值遮罩 { padding: 24px 16px; }

/* Recharge uses one uninterrupted surface; only form controls retain boundaries. */
body #灵光充值弹窗 {
  border: 0 !important;
  background: var(--feishu-color-bg-0, #fff) !important;
}
body #灵光充值弹窗 > header {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  padding: 24px 32px 12px;
}
body #灵光充值弹窗 > .飞书全局弹层内容 {
  background: transparent !important;
  padding: 16px 32px 28px;
  gap: 40px;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
}
body #灵光充值弹窗 :is(.灵光计费说明区, .灵光充值专区) {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  padding: 8px 0 0;
}
body #灵光充值弹窗 .灵光计费说明区 {
  color: var(--feishu-color-text-0, #1f2329);
}
body #灵光充值弹窗 .灵光计费说明区 :is(.灵光计费说明标题 span, .灵光收费规则 p, .灵光充值价格摘要 > span, .灵光收费说明) {
  color: var(--feishu-color-text-2, #646a73);
}
body #灵光充值弹窗 .灵光计费说明区 :is(.灵光计费说明标题 strong, .灵光收费规则 p strong, .灵光充值价格摘要 strong) {
  color: var(--feishu-color-text-0, #1f2329);
}
body #灵光充值弹窗 :is(.灵光收费规则, .灵光收费规则 p, .灵光充值价格摘要, .灵光支付操作) {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}
body #灵光充值弹窗 .灵光支付二维码 {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #fff !important;
}
@media (max-width: 860px) {
  body #灵光充值弹窗 > header { padding: 20px 24px 12px; }
  body #灵光充值弹窗 > .飞书全局弹层内容 {
    padding: 8px 24px 24px;
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
}

/* Architecture comparison has its own compact width, using the shared frame. */
body .cg-drawer {--workbench-layer-width:900px}

/* Clear-all confirmation uses a slightly raised visual center. */
body .飞书全局弹层遮罩[data-workbench-centered] {
  inset: 0;
  z-index: 460;
  padding: 24px 16px calc(24px + min(96px, 10dvh));
  box-sizing: border-box;
}
body .飞书全局弹层[data-workbench-centered] {
  max-width: 100%;
  max-height: calc(100dvh - 48px - min(96px, 10dvh));
  overflow-y: auto;
  overscroll-behavior: contain;
}
