/* 纳凝智工作台样式 */
/* Workbench 主页面：隐藏官网头部和主内容区，让工作台全屏 */
body[data-page="workbench"] #site-header,
body[data-page="workbench"] #site-footer,
body[data-page="workbench"] main { display: none !important; }
body[data-page="workbench"] { padding: 0 !important; margin: 0 !important; background: #F7F9FE; }

#nzwb-root {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Tab 栏 */
.nzwb-tabbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  background: #fff;
  border-bottom: 1px solid #E4E9F5;
  box-shadow: 0 1px 3px rgba(27, 35, 64, .04);
  overflow-x: auto;
  white-space: nowrap;
  flex-shrink: 0;
}
.nzwb-tabs {
  display: flex;
  gap: 2px;
  flex: 1;
  padding-top: 8px;
}
.nzwb-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 8px 10px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  background: #F7F9FE;
  color: #5A6478;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  max-width: 220px;
  transition: all .15s;
}
.nzwb-tab:hover { background: #EEF3FF; color: #2A3448; }
.nzwb-tab.active { background: #fff; border-color: #E4E9F5; border-bottom-color: #fff; color: #4169E1; font-weight: 600; }
.nzwb-tab-ico { font-size: 15px; }
.nzwb-tab-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nzwb-tab-close {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: #B7BFC0;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.nzwb-tab:hover .nzwb-tab-close { color: #5A6478; }
.nzwb-tab-close:hover { background: #E3E8F2; color: #C62828 !important; }

.nzwb-newtab {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px dashed #B7BFC0;
  border-radius: 10px;
  background: #fff;
  color: #5A6478;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  margin-left: 8px;
  transition: all .15s;
}
.nzwb-newtab:hover { border-color: #4169E1; color: #4169E1; background: #F7F9FE; }
.nzwb-newtab svg { width: 14px; height: 14px; }

/* Panes 容器 */
.nzwb-panes {
  flex: 1;
  position: relative;
  min-height: calc(100vh - 64px - 44px);
  background: #F7F9FE;
}
.nzwb-pane {
  position: absolute;
  inset: 0;
  display: none;
  overflow: hidden;
}
.nzwb-pane.active { display: block; }
.nzwb-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}

/* 空状态 */
/* 无标签页时不占位，避免首屏出现大片空白 */
.nzwb-panes:empty { display: none; }

.nzwb-empty {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: #F7F9FE;
  padding: 18px 20px 40px;
}
.nzwb-empty-inner {
  width: 100%;
  max-width: 980px;
  text-align: center;
  background: #fff;
  border: 1px solid #E4E9F5;
  border-radius: 18px;
  padding: 26px 28px 30px;
}
.nzwb-empty h2 { font-size: 21px; color: #1B2340; margin: 0 0 8px; }
.nzwb-empty p { font-size: 13px; color: #5A6478; margin: 0 0 18px; line-height: 1.65; }
.nzwb-empty .nzp-btn { padding: 11px 26px; font-size: 14px; }

.nzwb-empty-suggest {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  text-align: left;
}
.nzwb-suggest {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid #E4E9F5;
  border-radius: 12px;
  background: #F7F9FE;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all .15s;
}
.nzwb-suggest:hover { border-color: #4169E1; background: #EEF3FF; transform: translateY(-1px); }
.nzwb-suggest em { font-style: normal; font-size: 10px; color: #4169E1; }
.nzwb-suggest b { font-size: 13px; color: #1B2340; }
.nzwb-suggest span { font-size: 11px; color: #9AA3B8; }

/* Picker 弹窗 */
.nzp-picker-dialog { max-width: 960px; width: 94vw; max-height: 88vh; display: flex; flex-direction: column; }
.nzp-picker-head { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.nzp-picker-toggle { display: flex; background: #F1F3F8; border-radius: 99px; padding: 3px; gap: 2px; }
.nzp-picker-toggle button {
  border: none; background: transparent; border-radius: 99px; padding: 8px 14px;
  font-size: 13px; color: #5A6478; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 5px; transition: all .15s;
}
.nzp-picker-toggle button.active { background: #fff; color: #1B2340; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.nzwb-ico { font-size: 13px; }
.nzp-search-input {
  flex: 1; border: 1px solid #E4E9F5; border-radius: 10px; padding: 9px 14px;
  font-size: 14px; outline: none; font-family: inherit;
}
.nzp-search-input:focus { border-color: #4169E1; }

.nzp-picker-body { flex: 1; overflow-y: auto; padding-right: 6px; }
.nzwb-cat-block { margin-bottom: 20px; }
.nzwb-cat-block header {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 6px; border-bottom: 2px solid #EEF1F8; margin-bottom: 10px;
}
.nzwb-cat-block header h3 { font-size: 15px; margin: 0; }
.nzwb-cat-block header span { font-size: 12px; color: #9AA3B8; }
.nzwb-picker-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* Toast */
#nzwb-toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #1B2340; color: #fff; padding: 10px 22px; border-radius: 99px;
  font-size: 13px; opacity: 0; transition: all .25s; pointer-events: none; z-index: 9999;
  box-shadow: 0 6px 24px rgba(27, 35, 64, .2);
}
#nzwb-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* iframe 内页样式：隐藏顶部导航区，让 nz-flow 三栏撑满 */
.nzwb-embedded #site-header, .nzwb-embedded #site-footer { display: none !important; }
.nzwb-embedded main { padding: 0 !important; margin: 0 !important; }
.nzwb-embedded #nzp-search, .nzwb-embedded #nzp-domain-chip,
.nzwb-embedded #nzp-subject-chip, .nzwb-embedded #nzp-token-chip,
.nzwb-embedded .nav-actions > a:not([data-auth]) { display: none !important; }
.nzwb-embedded .nzp-chat-head { display: none; }
.nzwb-embedded .nzp-chat-box { padding: 10px; border-radius: 0; box-shadow: none; }
.nzwb-embedded .nzp-chat-container { border-radius: 0; box-shadow: none; padding: 0; }
.nzwb-embedded .section.section-mist { padding: 0 !important; background: #fff; }
.nzwb-embedded .nzp-chat-head + .nzp-chat-container { border-radius: 0; }
.nzwb-embed-wrap { width: 100%; min-height: 100vh; background: #fff; }

@media (max-width: 720px) {
  .nzwb-tab { max-width: 160px; padding: 7px 10px; font-size: 12px; }
  .nzwb-tab-name { max-width: 90px; }
  .nzp-picker-dialog { max-width: 100%; width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
  .nzp-picker-head { flex-direction: column; align-items: stretch; }
  .nzwb-empty-inner { padding: 24px 18px; }
}
