/* Shared surface and action contract. Business modules own content and layout. */
:root {
  --workbench-component-gap: 12px;
  --workbench-component-padding: 20px;
  --workbench-component-action-height: 36px;
  --workbench-component-primary-height: 36px;
  --workbench-component-radius: var(--feishu-border-radius-medium,8px);
}
body :is(.discovery-panel,.discovery-empty,.discovery-chart-empty,.discovery-row) {
  background:var(--workbench-surface-panel,#fff);
  color:var(--workbench-text-primary,#1f2329);
  border:0;
  border-radius:var(--workbench-component-radius);
  box-shadow:none;
  padding:var(--workbench-component-padding);
}
body :is(.discovery-panel,.discovery-row){margin-bottom:var(--workbench-component-gap)}
body .discovery-card {
  border:0;
  border-radius:var(--workbench-component-radius);
  background:var(--workbench-surface-panel,#fff)!important;
  color:var(--workbench-text-primary,#1f2329);
  box-shadow:none;
}
body :is(.discovery-card,.discovery-row)[aria-pressed=true] {
  background:var(--workbench-brand-primary-soft,#eef4ff)!important;
  box-shadow:inset 0 0 0 2px var(--workbench-brand-primary,#1664ff);
}
body :is(.discovery-page,.feishu-component-scope,[data-workbench-layer],.飞书全局弹层) button:not(.discovery-card):not(.discovery-row):not([role=option]) {
  min-height:var(--workbench-component-action-height);
  border-radius:var(--feishu-border-radius-small,6px);
  font-family:inherit;
  line-height:20px;
  box-shadow:none;
  touch-action:manipulation;
}
body :is(.discovery-page,.feishu-component-scope) button:not(.primary):not(.primary-button):not(.discovery-card):not(.discovery-row):not([role=option]) {
  background:var(--workbench-surface-muted,rgba(31,35,41,.05));
  color:var(--workbench-text-primary,#1f2329);
}
body :is(.discovery-page,.feishu-component-scope) button:not(.primary):not(.primary-button):not(.discovery-card):not(.discovery-row):hover:not(:disabled) {background:var(--feishu-color-fill-1)}
body :is(.discovery-page,.feishu-component-scope) button:not(.primary):not(.primary-button):not(.discovery-card):not(.discovery-row):active:not(:disabled) {background:var(--feishu-color-fill-2)}
body :is(.discovery-page,.feishu-component-scope,[data-workbench-layer],.飞书全局弹层) :is(button.primary,button.primary-button,.飞书弹层确认按钮) {
  --workbench-component-action-height:var(--workbench-component-primary-height);
  min-height:var(--workbench-component-primary-height);
  background:var(--workbench-brand-primary,#1664ff);
  color:#fff;
  border-color:transparent;
}
body :is(.discovery-page,.feishu-component-scope) button:not(.primary):not(.primary-button):not(.discovery-card):not(.discovery-row):not([role=option])[aria-pressed=true] {
  background:var(--workbench-brand-primary-soft,#eef4ff);
  color:var(--workbench-brand-primary,#1664ff);
  font-weight:600;
}
body :is(.discovery-page,.feishu-component-scope,[data-workbench-layer],.飞书全局弹层) :is(button.primary,button.primary-button,.飞书弹层确认按钮):hover:not(:disabled){background:var(--workbench-brand-primary-hover,#4b8cff)}
body :is(.discovery-page,.feishu-component-scope,[data-workbench-layer],.飞书全局弹层) :is(button.primary,button.primary-button,.飞书弹层确认按钮):active:not(:disabled){background:var(--workbench-brand-primary-active,#0f54d8)}
body :is(.discovery-page,.feishu-component-scope) button:disabled {color:var(--feishu-color-disabled-text,#bbbfc4);cursor:not-allowed;opacity:1}
body :is(.discovery-page,.feishu-component-scope) :is(button.primary,button.primary-button):disabled {background:var(--feishu-color-primary-disabled,#bacefd);color:#fff}
body :is(.discovery-page,.feishu-component-scope,[data-workbench-layer],.飞书全局弹层) :is(button,a,input,textarea):focus-visible {outline:2px solid var(--workbench-brand-primary,#1664ff);outline-offset:2px}
body .discovery-layer-scrim {background:var(--feishu-color-overlay-bg,rgba(31,35,41,.22))}
body :is(.discovery-actions,.dialog-actions,.飞书全局弹层 footer,.discovery-configuration-form footer) {gap:var(--workbench-component-gap);flex-wrap:wrap}
body :is(.discovery-layer-close,[data-workbench-layer] button[aria-label="关闭弹层"]) {
  width:var(--workbench-component-action-height);
  height:var(--workbench-component-action-height);
  flex-shrink:0;
}
@media(max-width:600px) {
  :root {--workbench-component-padding:16px;--workbench-component-action-height:44px;--workbench-component-primary-height:48px}
  body :is(.discovery-page,.feishu-component-scope,[data-workbench-layer],.飞书全局弹层) button:not(.discovery-card):not(.discovery-row):not([role=option]) {font-size:14px}
  body :is(.discovery-toolbar,.discovery-layer,.feishu-component-scope) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]),.IM飞书选择器按钮) {min-height:44px;font-size:16px}
  body .discovery-toolbar {gap:8px}
  body .discovery-toolbar .IM飞书选择器 {flex:1;min-width:120px;width:auto}
  body .discovery-actions>button {flex:1 1 120px}
  body .discovery-layer-close {top:8px;right:8px}
  body :is(.discovery-configuration-form,.discovery-layer:not(.discovery-settings-layer)) {padding:var(--workbench-component-padding)}
  body .discovery-configuration-form header {padding-right:44px}
  body .discovery-configuration-form footer {bottom:-16px;padding:12px 0 calc(12px + env(safe-area-inset-bottom));background:var(--workbench-surface-panel,#fff)}
  body .discovery-configuration-form footer button {flex:1 1 100px}
  body .discovery-configuration-form fieldset {margin:20px 0}
  body :is(.飞书全局弹层,[data-workbench-layer]) :is(footer,.dialog-actions) button {min-height:44px}
}

/* Narrow screens use the whole content width for every business sheet. */
@media(max-width:760px) {
  html:root[data-workbench-layer-frame] body :is([role="dialog"][aria-modal="true"],[data-workbench-layer]):not(#灵光充值弹窗):not([data-workbench-centered]) {
    inset:56px 0 0!important;width:100vw!important;max-width:100vw!important;height:calc(100dvh - 56px)!important;max-height:calc(100dvh - 56px)!important;border-radius:0!important;
  }
  html:root[data-workbench-layer-frame] body .workbench-layer-scrim {inset:56px 0 0!important;width:100vw!important;height:calc(100dvh - 56px)!important}
  html:root body[data-mobile-view="browse"] main {left:0!important;right:0!important;top:56px!important;margin-left:0!important;padding-left:0!important;width:100%!important;min-width:0!important}
  body[data-mobile-view="browse"] .discovery-page {height:calc(100dvh - 56px);overflow:auto;padding:12px}
}
