/* 知艺托管 Agent 页：隐藏 Key 门禁与顶栏，全屏体验 */

body.agent-bifang-host #agent-key-screen,
body.agent-bifang-host .agent-standalone-topbar {
  display: none !important;
}

.agent-bifang-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 6px 12px;
  background: var(--surface, #fff);
  border-bottom: 1px solid var(--border, #ddd);
  box-sizing: border-box;
}

.agent-bifang-home-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-sm, 6px);
  font-size: 13px;
  font-weight: 500;
  color: var(--text, #222);
  text-decoration: none;
  background: transparent;
  border: 1px solid var(--border, #ddd);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.agent-bifang-home-link:hover {
  background: var(--bg, #f5f5f5);
  border-color: var(--text-secondary, #999);
}

.agent-bifang-beta-tag {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-secondary, #888);
}

body.agent-bifang-host #agent-status-bar {
  display: none !important;
}

/* 用户端隐藏「模型输出」原始 JSON（保留对话气泡、规划卡片与生成图） */
body.agent-bifang-host .agent-model-io-output {
  display: none !important;
}

body.agent-bifang-host .agent-bifang-model-hint {
  margin: 2px 0 8px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary, #666);
}

body.agent-bifang-host .agent-standalone-main {
  padding: 44px 12px 12px;
  flex: 1;
  min-height: 0;
}

body.agent-bifang-host #panel-experience.experience-agent-active .agent-layout {
  min-height: 100vh;
}

body.agent-bifang-host .agent-chat-panel {
  min-height: calc(100vh - 56px);
  max-height: calc(100vh - 48px);
}

/* 风格选择弹窗：对齐功能中心展示（画类切换 + 缩略图卡片 + 已选摘要） */
body.agent-bifang-host #agent-style-preview {
  display: none !important;
}

body.agent-bifang-host .agent-style-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 28px;
  margin: 0 0 12px;
}

body.agent-bifang-host .agent-style-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg, #f5f5f5);
  font-size: 12px;
  color: var(--text-secondary, #666);
}

body.agent-bifang-host .agent-style-hint {
  font-size: 12px;
  color: var(--text-secondary, #888);
}

body.agent-bifang-host .agent-style-cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

body.agent-bifang-host .agent-style-cat-chip {
  padding: 6px 12px;
  border: 1px solid var(--border, #ddd);
  border-radius: 999px;
  background: var(--bg, #fff);
  font-size: 12px;
  cursor: pointer;
}

body.agent-bifang-host .agent-style-cat-chip.is-active {
  border-color: var(--text, #222);
  background: var(--bg, #f0f0f0);
}

body.agent-bifang-host .agent-style-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  max-height: min(52vh, 480px);
  overflow-y: auto;
  margin: 10px 0;
  padding: 2px;
}

body.agent-bifang-host .agent-style-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border, #ddd);
  border-radius: 12px;
  background: var(--surface, #fff);
  cursor: pointer;
  font-size: 13px;
}

body.agent-bifang-host .agent-style-option.has-thumb {
  flex-direction: column;
  align-items: stretch;
  padding: 8px;
  gap: 6px;
}

body.agent-bifang-host .agent-style-option-thumb {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg, #f5f5f5);
  aspect-ratio: 1;
  position: relative;
}

body.agent-bifang-host .agent-style-option-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

body.agent-bifang-host .agent-style-thumb-more-btn {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 4px 6px;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 10px;
  line-height: 1.2;
  cursor: pointer;
}

body.agent-bifang-host .agent-style-thumb-more-btn:hover {
  background: rgba(0, 0, 0, 0.72);
}

body.agent-bifang-host .agent-style-option-name {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

body.agent-bifang-host .agent-style-option.has-thumb .agent-style-option-name {
  text-align: center;
  font-size: 12px;
}

body.agent-bifang-host .agent-style-option.is-selected {
  border-color: var(--text, #222);
  background: var(--bg, #f5f5f5);
  box-shadow: inset 0 0 0 1px var(--text, #222);
}

body.agent-bifang-host .agent-style-option:focus-visible {
  outline: 2px solid var(--text, #222);
  outline-offset: 2px;
}

body.agent-bifang-host .lightbox {
  z-index: 12000;
}

@media (max-width: 960px) {
  body.agent-bifang-host #panel-experience.experience-agent-active .agent-layout {
    min-height: 100vh;
  }
}

.agent-bifang-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg, #f5f5f5);
}

.agent-bifang-overlay.hidden {
  display: none;
}

.agent-bifang-loading-text {
  margin: 0;
  font-size: 15px;
  color: var(--text-secondary, #666);
}

.agent-bifang-error-card {
  width: min(440px, 100%);
  padding: 28px 24px;
  border-radius: var(--radius-lg, 12px);
  border: 1px solid var(--border, #ddd);
  background: var(--surface, #fff);
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, 0.06));
}

.agent-bifang-error-title {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 600;
}

.agent-bifang-error-text {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--danger, #c62828);
}

.agent-bifang-error-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary, #666);
}

.invite-gate-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.invite-gate-modal.hidden {
  display: none;
}

.invite-gate-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.invite-gate-card {
  position: relative;
  width: min(420px, 100%);
  padding: 28px 24px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18);
}

.invite-gate-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
}

.invite-gate-desc {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary, #666);
}

.invite-gate-error {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--danger, #c62828);
}

.invite-gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.invite-gate-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border, #ddd);
  border-radius: 10px;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.invite-gate-submit {
  width: 100%;
}
