:root {
  --primary: #3B82F6;
  --primary-glow: rgba(59, 130, 246, 0.25);
  --primary-light: #EFF6FF;
  --teal: #0D9488;
  --teal-light: #F0FDFA;
  --emerald: #10B981;
  --emerald-light: #ECFDF5;
  --amber: #F59E0B;
  --rose: #F43F5E;
  --coral-red: #EF4444;
  --bg-gradient: linear-gradient(135deg, #F0FDF4 0%, #F8FAFC 50%, #EFF6FF 100%);
  --card-bg: rgba(255, 255, 255, 0.88);
  --card-border: rgba(226, 232, 240, 0.85);
  --text-main: #1E293B;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.12);
  --font-sans: 'Outfit', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* 顶部导航条 */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--card-border);
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #10B981, #3B82F6);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.logo-icon {
  font-size: 22px;
  z-index: 2;
}

.logo-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  background: inherit;
  filter: blur(8px);
  opacity: 0.6;
  animation: logo-glow 3s ease-in-out infinite alternate;
}

@keyframes logo-glow {
  0% { transform: scale(0.95); opacity: 0.4; }
  100% { transform: scale(1.15); opacity: 0.8; }
}

.brand-text h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.brand-text h1 span {
  font-size: 15px;
  font-weight: 400;
  color: var(--primary);
  margin-left: 4px;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.nav-badges {
  display: flex;
  align-items: center;
  gap: 12px;
}

.platform-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: #166534;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22C55E;
  box-shadow: 0 0 8px #22C55E;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

.aip-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--primary-light);
  border: 1px solid #BFDBFE;
  border-radius: 20px;
  font-size: 12px;
  color: #1E40AF;
}

.badge-tag {
  font-weight: 700;
}

.badge-mode {
  opacity: 0.85;
}

/* 导航选项卡 */
.nav-tabs {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 28px 10px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--primary);
  background: rgba(59, 130, 246, 0.06);
}

.tab-btn.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 600;
}

/* 主容器 */
.main-content {
  flex: 1;
  max-width: 1380px;
  width: 100%;
  margin: 24px auto;
  padding: 0 28px;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 视图 1: 伴聊与倾听 */
.chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  height: calc(100vh - 190px);
  min-height: 600px;
}

.chat-container {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.6);
}

.agent-avatar-wrap {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3B82F6, #60A5FA);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.agent-info h3 {
  font-size: 16px;
  font-weight: 700;
}

.agent-info p {
  font-size: 12px;
  color: var(--text-muted);
}

.chat-actions {
  margin-left: auto;
}

.clean-chat-btn {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}

.clean-chat-btn:hover {
  background: #F1F5F9;
  color: var(--text-main);
}

/* 消息流 */
.chat-messages {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.message-row {
  display: flex;
  gap: 14px;
  max-width: 82%;
}

.message-row.assistant {
  align-self: flex-start;
}

.message-row.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #E0E7FF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.message-row.user .msg-avatar {
  background: #E2E8F0;
}

.msg-content-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.msg-bubble {
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 14.5px;
  line-height: 1.65;
  box-shadow: var(--shadow-sm);
}

.message-row.assistant .msg-bubble {
  background: #FFFFFF;
  border: 1px solid var(--card-border);
  color: var(--text-main);
  border-top-left-radius: 4px;
}

.message-row.user .msg-bubble {
  background: linear-gradient(135deg, #2563EB, #3B82F6);
  color: #FFFFFF;
  border-top-right-radius: 4px;
}

.msg-time {
  font-size: 11px;
  color: var(--text-light);
  padding: 0 4px;
}

.message-row.user .msg-time {
  text-align: right;
}

/* 智能体协同追踪条 */
.inter-agent-tracker {
  margin: 0 24px 8px;
  padding: 8px 14px;
  background: #F8FAFC;
  border: 1px dashed #93C5FD;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #1E40AF;
  animation: pulse-tracker 2s infinite ease-in-out;
}

@keyframes pulse-tracker {
  0%, 100% { background: #F8FAFC; }
  50% { background: #EFF6FF; }
}

.tracker-icon {
  font-size: 14px;
}

/* 快速建议 */
.quick-prompts {
  padding: 8px 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  border-top: 1px solid rgba(226, 232, 240, 0.5);
  background: rgba(255, 255, 255, 0.4);
}

.quick-title {
  font-size: 12px;
  color: var(--text-light);
  white-space: nowrap;
}

.prompt-chip {
  padding: 5px 12px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  font-size: 12.5px;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.prompt-chip:hover {
  border-color: #93C5FD;
  color: var(--primary);
  background: #EFF6FF;
}

/* 输入区 */
.chat-input-area {
  padding: 16px 24px;
  border-top: 1px solid var(--card-border);
  display: flex;
  gap: 12px;
  align-items: flex-end;
  background: #FFFFFF;
}

.chat-input-area textarea {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #CBD5E1;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  resize: none;
  outline: none;
  transition: border-color 0.2s ease;
}

.chat-input-area textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.send-btn {
  padding: 12px 20px;
  background: linear-gradient(135deg, #2563EB, #3B82F6);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--primary-glow);
}

/* 侧边栏卡片 */
.chat-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.sidebar-card h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.agent-mini-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mini-agent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.mini-agent-item:hover {
  border-color: #BFDBFE;
  background: #F8FAFC;
}

.agent-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.agent-dot.green {
  background: #10B981;
  box-shadow: 0 0 6px #10B981;
}

.mini-agent-info strong {
  display: block;
  font-size: 13.5px;
  color: var(--text-main);
}

.mini-agent-info span {
  font-size: 11.5px;
  color: var(--text-muted);
}

.tips-card p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.tips-card ul {
  padding-left: 18px;
  font-size: 12.5px;
  color: #475569;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 视图 2: 心理测评舱 */
.assessment-container {
  max-width: 860px;
  margin: 0 auto;
}

.section-intro {
  text-align: center;
  margin-bottom: 28px;
}

.section-intro h2 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
}

.section-intro p {
  font-size: 14px;
  color: var(--text-muted);
}

.scale-selector {
  display: inline-flex;
  gap: 8px;
  margin-top: 18px;
  background: #E2E8F0;
  padding: 4px;
  border-radius: 30px;
}

.scale-tab-btn {
  padding: 8px 20px;
  border: none;
  border-radius: 24px;
  background: transparent;
  font-size: 13.5px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
}

.scale-tab-btn.active {
  background: #FFFFFF;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.scale-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
}

.scale-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 24px;
}

.scale-header h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.scale-header p {
  font-size: 13px;
  color: var(--text-muted);
}

.scale-progress {
  text-align: right;
  min-width: 140px;
}

.scale-progress span {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: #E2E8F0;
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #3B82F6, #10B981);
  transition: width 0.3s ease;
}

.questions-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.question-block {
  padding: 18px 20px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease;
}

.question-block.answered {
  border-color: #93C5FD;
  background: #F8FAFC;
}

.q-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.q-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.options-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.opt-btn {
  padding: 10px 12px;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.opt-btn:hover {
  background: #EFF6FF;
  border-color: #93C5FD;
}

.opt-btn.selected {
  background: #2563EB;
  color: #FFFFFF;
  border-color: #2563EB;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.scale-submit-area {
  margin-top: 32px;
  text-align: center;
}

.submit-scale-btn {
  padding: 14px 36px;
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  border: none;
  border-radius: 30px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
  transition: all 0.2s ease;
}

.submit-scale-btn:disabled {
  background: #CBD5E1;
  box-shadow: none;
  cursor: not-allowed;
}

.submit-scale-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

/* 测评报告展示 */
.report-card {
  margin-top: 28px;
  background: #FFFFFF;
  border: 2px solid #93C5FD;
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.report-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid #E2E8F0;
}

.report-icon {
  font-size: 30px;
}

.report-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.score-display {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 24px;
}

.score-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--primary-light);
  border: 4px solid var(--primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.score-num {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.score-unit {
  font-size: 12px;
  color: var(--text-muted);
}

.score-tag {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 13.5px;
  font-weight: 700;
  color: #FFFFFF;
  background: #10B981;
  margin-bottom: 10px;
}

.score-suggestion {
  font-size: 14px;
  color: #475569;
  line-height: 1.7;
}

.report-actions {
  display: flex;
  gap: 14px;
  justify-content: flex-end;
}

.primary-btn, .secondary-btn {
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.primary-btn {
  background: var(--primary);
  color: #FFFFFF;
  border: none;
}

.secondary-btn {
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #CBD5E1;
}

/* 视图 3: 4-7-8 正念呼吸空间 */
.breathing-container {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.breathing-stage {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.breathing-circle-wrap {
  position: relative;
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.breathing-ring-outer {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px dashed rgba(59, 130, 246, 0.4);
  animation: spin 30s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

.breathing-circle {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, #60A5FA, #2563EB);
  box-shadow: 0 0 35px rgba(59, 130, 246, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  transition: transform 0.5s ease-out, background 0.5s ease;
}

.breathing-phase-text {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.breathing-timer {
  font-size: 38px;
  font-weight: 800;
}

.guidance-instruction {
  font-size: 15px;
  color: var(--text-main);
  max-width: 500px;
  line-height: 1.8;
  margin-bottom: 12px;
}

.breathing-progress-info {
  font-size: 13px;
  color: var(--text-muted);
}

.b-control-btn {
  padding: 12px 36px;
  border-radius: 30px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.b-control-btn.start {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

.b-control-btn.stop {
  background: #EF4444;
  color: #FFFFFF;
}

/* 视图 4: CBT 思维重塑 */
.cbt-container {
  max-width: 860px;
  margin: 0 auto;
}

.cbt-editor-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.cbt-input-group label {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 10px;
}

.cbt-input-group textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #CBD5E1;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  outline: none;
}

.submit-cbt-btn {
  margin-top: 18px;
  padding: 12px 28px;
  background: linear-gradient(135deg, #4F46E5, #3B82F6);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.submit-cbt-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.cbt-result-card {
  background: #FFFFFF;
  border: 1px solid #BFDBFE;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
}

.cbt-result-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #E2E8F0;
}

.cbt-icon {
  font-size: 24px;
}

.cbt-result-body {
  font-size: 14.5px;
  line-height: 1.85;
  color: #334155;
  white-space: pre-wrap;
}

/* 视图 5: 智能体互联监控大屏 */
.monitor-container {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.monitor-top-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.metric-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-label {
  font-size: 13px;
  color: var(--text-muted);
}

.metric-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.metric-value.green {
  color: #10B981;
}

.metric-sub {
  font-size: 11.5px;
  color: var(--text-light);
}

.topology-section h3, .logs-section h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}

.topology-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.agent-node-card {
  background: #FFFFFF;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
}

.agent-node-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #93C5FD;
}

.node-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.node-role-badge {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.role-leader { background: #DBEAFE; color: #1E40AF; }
.role-partner { background: #DCFCE7; color: #166534; }
.role-guard { background: #FEE2E2; color: #991B1B; }

.node-title {
  font-size: 15px;
  font-weight: 700;
}

.node-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.node-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill-tag {
  padding: 2px 8px;
  background: #F1F5F9;
  border-radius: 6px;
  font-size: 11px;
  color: #475569;
}

.node-endpoint {
  font-size: 11px;
  color: var(--text-light);
  font-family: monospace;
  background: #F8FAFC;
  padding: 4px 8px;
  border-radius: 4px;
}

/* 审计日志流 */
.logs-section {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.logs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.logs-hint {
  font-size: 12px;
  color: var(--text-light);
}

.logs-stream-container {
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: monospace;
}

.log-item {
  padding: 10px 14px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.log-item.crisis {
  border-left-color: #EF4444;
  background: #FEF2F2;
}

.log-time { color: var(--text-light); min-width: 130px; }
.log-route { font-weight: 700; color: #1E40AF; min-width: 220px; }
.log-method { color: #059669; }
.log-duration { color: var(--amber); font-weight: 600; min-width: 60px; text-align: right; }

/* 危机模态框 */
.crisis-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.crisis-modal-overlay.active {
  display: flex;
  animation: fadeIn 0.25s ease;
}

.crisis-modal-card {
  background: #FFFFFF;
  border: 2px solid #EF4444;
  border-radius: var(--radius-lg);
  max-width: 640px;
  width: 100%;
  padding: 32px;
  box-shadow: 0 25px 50px rgba(239, 68, 68, 0.25);
  position: relative;
}

.crisis-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.alert-pulse {
  font-size: 32px;
  animation: pulse-dot 1.5s infinite;
}

.crisis-modal-header h2 {
  font-size: 20px;
  color: #991B1B;
  font-weight: 700;
}

.crisis-sub {
  font-size: 13px;
  color: #DC2626;
  margin-top: 4px;
}

.close-crisis-btn {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 24px;
  color: #94A3B8;
  cursor: pointer;
}

.crisis-warm-words {
  font-size: 14px;
  color: #475569;
  line-height: 1.7;
  margin-bottom: 20px;
}

.hotline-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.hotline-card {
  padding: 12px 16px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hotline-card strong {
  display: block;
  font-size: 14px;
  color: #991B1B;
}

.hotline-card span {
  font-size: 12px;
  color: #B91C1C;
}

.hotline-phone {
  font-size: 16px;
  font-weight: 800;
  color: #DC2626;
}

.crisis-actions {
  display: flex;
  gap: 14px;
}

.action-call-btn {
  flex: 1;
  padding: 12px;
  background: #DC2626;
  color: #FFFFFF;
  text-align: center;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4);
}

.action-calm-btn {
  padding: 12px 20px;
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #CBD5E1;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

/* 响应式适配 */
@media (max-width: 960px) {
  .chat-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .chat-sidebar {
    order: 2;
  }
  .monitor-top-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .topology-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .options-group {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .monitor-top-metrics, .topology-grid, .options-group {
    grid-template-columns: 1fr;
  }
}

/* ========================================================
   大模型服务商与 API 动态设置模态框样式
   ======================================================== */

.settings-nav-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(79, 70, 229, 0.25);
  color: #4338CA;
  padding: 8px 14px;
  border-radius: var(--radius-full, 9999px);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.08);
}

.settings-nav-btn:hover {
  background: #EEF2FF;
  border-color: #6366F1;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.settings-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.settings-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.settings-modal-card {
  background: #FFFFFF;
  border-radius: 20px;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(226, 232, 240, 0.8);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPopIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPopIn {
  from { transform: scale(0.94) translateY(12px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.settings-modal-header {
  padding: 20px 24px;
  background: linear-gradient(135deg, #F8FAFC 0%, #EEF2FF 100%);
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-header-icon {
  font-size: 26px;
  background: #FFFFFF;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.12);
}

.settings-modal-header h2 {
  font-size: 17px;
  font-weight: 700;
  color: #1E293B;
  margin: 0 0 4px 0;
}

.settings-sub {
  font-size: 12px;
  color: #64748B;
  margin: 0;
  line-height: 1.4;
}

.close-settings-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #94A3B8;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
}

.close-settings-btn:hover {
  background: #E2E8F0;
  color: #334155;
}

.settings-modal-body {
  padding: 22px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
}

.label-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.label-subtip {
  font-size: 11.5px;
  font-weight: 400;
  color: #94A3B8;
}

.provider-badge {
  background: #E0E7FF;
  color: #4338CA;
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
}

.form-select, .form-input {
  width: 100%;
  padding: 10px 14px;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-radius: 10px;
  font-size: 13.5px;
  color: #1E293B;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.form-select:focus, .form-input:focus {
  background: #FFFFFF;
  border-color: #6366F1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.input-password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.eye-toggle-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.eye-toggle-btn:hover {
  opacity: 1;
}

.key-status-tag {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 600;
}

.key-status-tag.status-configured {
  background: #D1FAE5;
  color: #065F46;
}

.key-status-tag.status-none {
  background: #FEF3C7;
  color: #92400E;
}

.form-field-hint {
  font-size: 11.5px;
  color: #64748B;
  margin: 2px 0 0 2px;
}

.auto-fetch-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
  color: #FFFFFF;
  border: none;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}

.auto-fetch-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.35);
}

.spinning {
  display: inline-block;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.custom-model-box {
  margin-top: 6px;
}

.test-result-box {
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  border: 1px solid transparent;
  transition: all 0.3s ease;
}

.test-result-box.testing {
  background: #FEF3C7;
  border-color: #FCD34D;
  color: #92400E;
}

.test-result-box.success {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #065F46;
}

.test-result-box.error {
  background: #FFF1F2;
  border-color: #FECDD3;
  color: #9F1239;
}

.test-result-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  margin-bottom: 4px;
}

.test-result-detail {
  font-size: 12px;
  opacity: 0.9;
  line-height: 1.4;
  word-break: break-all;
}

.settings-modal-footer {
  padding: 16px 24px;
  background: #F8FAFC;
  border-top: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-cancel {
  background: transparent;
  border: 1px solid #CBD5E1;
  color: #64748B;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cancel:hover {
  background: #F1F5F9;
  color: #334155;
}

.footer-actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-test {
  background: #FFFFFF;
  border: 1px solid #6366F1;
  color: #4F46E5;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-test:hover {
  background: #EEF2FF;
}

.btn-save {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  border: none;
  color: #FFFFFF;
  padding: 9px 20px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btn-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}


[hidden]{display:none!important}
.app-notice{padding:12px 18px;margin:0 0 16px;border:1px solid #e4c68a;border-radius:10px;background:#fff9ed;color:#62451e;line-height:1.6}
.consent-row{display:flex!important;gap:9px;align-items:flex-start;font-size:14px;margin:16px 0;line-height:1.7}
.consent-row input{width:auto!important;margin-top:6px}
.trace-detail{white-space:normal;font-size:12px;margin-top:12px;color:#526274;overflow-wrap:anywhere}
.trace-detail p{white-space:pre-wrap;padding:6px 0}
.log-item{white-space:pre-wrap;overflow-wrap:anywhere;display:block!important}
.cbt-input-group textarea{width:100%;padding:12px;border:1px solid #d9e1e8;border-radius:8px;margin:8px 0 16px;resize:vertical}
.cbt-result-body{white-space:pre-wrap;overflow-wrap:anywhere}
.breathing-controls select,#cbtFeedback{padding:8px;border:1px solid #d9e1e8;border-radius:8px}
.trace-timeline{margin-top:14px;padding:14px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:12px;color:#334155}
.trace-row{display:grid;grid-template-columns:minmax(160px,1fr) minmax(100px,1.4fr);align-items:center;gap:16px;margin:12px 0 3px}
.trace-step-label strong{display:block;font-size:13px;font-weight:600}
.trace-step-label span{display:block;font-size:11px;color:#64748b;margin-top:2px}
.trace-track{height:9px;border-radius:5px;background:#e2e8f0;overflow:hidden}
.trace-bar{height:100%;min-width:2px;border-radius:5px;background:#3b82f6}
.trace-bar.model{background:#8b5cf6}.trace-bar.local,.trace-bar.internal{background:#94a3b8}.trace-bar.discovery{background:#0d9488}.trace-bar.failed{background:#e11d48}
.trace-identifiers{color:#64748b;font-size:10px;overflow-wrap:anywhere;line-height:1.6}
.trace-child{margin:10px 0 10px 12px}.trace-child>summary{font-size:12px}
.summary-container{max-width:850px;margin:0 auto;padding:0 0 32px}
.summary-controls{display:flex;align-items:center;gap:20px;flex-wrap:wrap;margin:24px 0}
.summary-controls label{display:flex;align-items:center;gap:8px;font-size:14px;color:#475569}
.summary-sheet{background:#fff;border:1px solid #e2e8f0;border-radius:18px;padding:40px;box-shadow:var(--shadow-sm)}
.summary-sheet h2{font-size:24px;color:#1e293b}.summary-date{color:#94a3b8;font-size:13px;margin:7px 0 28px}
.summary-sheet section{margin:24px 0}.summary-sheet h3{font-size:14px;color:#0d9488;margin-bottom:8px}
.summary-sheet section p{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.9;color:#334155;font-size:16px}
.summary-actions{display:flex;gap:12px;justify-content:flex-end;margin-top:18px}.summary-empty{color:#64748b;padding:20px 0}
.breathing-feedback{margin:22px auto;max-width:720px}.breathing-feedback h3{font-size:17px;margin-bottom:10px}
.breathing-feedback>p{font-size:14px;color:#64748b;margin-bottom:16px}.breathing-feedback>label{font-size:14px}
.breathing-feedback>select{padding:10px;border:1px solid #cbd5e1;border-radius:9px;margin:0 12px 12px}
@media(max-width:640px){
  .nav-container{display:grid;grid-template-columns:auto minmax(0,1fr);gap:12px;padding:14px 16px}
  .brand{grid-column:1/-1}.brand-logo{flex-shrink:0}.platform-badge{white-space:nowrap;padding:6px 10px}
  .settings-nav-btn{min-width:0;justify-content:center;padding:8px 10px}
  .settings-nav-btn span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .nav-tabs{padding:0 16px 10px}.tab-btn{flex-shrink:0}.main-content{padding:0 16px}
  .trace-row{grid-template-columns:1fr;gap:6px}.summary-sheet{padding:24px}.summary-controls{gap:14px}.summary-actions{justify-content:flex-start}
}
@media print{
  body{background:white;display:block}.navbar,.summary-controls,.summary-actions,.section-intro,#appNotice{display:none!important}
  .main-content{padding:0!important;max-width:none!important}.tab-pane{display:none!important}#pane-summary{display:block!important}
  .summary-container{max-width:none}.summary-sheet{border:0;box-shadow:none;padding:0}.summary-sheet section{break-inside:avoid}
}
/* Owner entry */
.management-footer { text-align: center; padding: 20px; font-size: 13px; }
.management-footer a { color: #64748b; text-decoration: none; }
