/**
 * 碳精灵 — 全平台统一入口与弹窗样式（驾驶舱 / 企业端共用）
 */

/* 顶部栏圆形入口按钮 */
.carbon-spirit-btn,
a.carbon-spirit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
  text-decoration: none;
}
.carbon-spirit-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 16px rgba(24, 144, 255, 0.28);
}
.carbon-spirit-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
html[data-theme="dark"] .carbon-spirit-btn {
  background: #fff;
}

/* 弹窗遮罩 */
#carbonSpiritModal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(15, 35, 65, 0.45);
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: auto;
}

.cs-panel {
  width: min(560px, 96vw);
  max-height: 90vh;
  overflow: hidden;
  background: linear-gradient(180deg, #eef5ff 0%, #f8fbff 40%, #fff 100%);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(24, 80, 140, 0.22);
  display: flex;
  flex-direction: column;
}
html[data-theme="dark"] .cs-panel {
  background: linear-gradient(180deg, #0a1a32 0%, #0d2240 40%, #081628 100%);
}

.cs-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 0;
  flex-shrink: 0;
}
.cs-topbar-title { font-size: 16px; font-weight: 700; color: #1a3353; }
html[data-theme="dark"] .cs-topbar-title { color: #e2e8f0; }
.cs-topbar-close {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  font-size: 22px;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
}
.cs-topbar-close:hover { color: #64748b; }

.cs-scroll { overflow-y: auto; flex: 1; min-height: 0; padding: 0 18px 16px; }

.cs-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #dceeff 0%, #e8e4ff 55%, #f0e8ff 100%);
  border: 1px solid rgba(147, 197, 253, 0.35);
}
html[data-theme="dark"] .cs-hero {
  background: linear-gradient(135deg, rgba(30, 64, 120, 0.55) 0%, rgba(50, 40, 90, 0.45) 100%);
  border-color: rgba(56, 189, 248, 0.2);
}
.cs-hero-left { flex: 1; min-width: 0; }
.cs-hero-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cs-hero-head img { width: 28px; height: 28px; border-radius: 50%; }
.cs-hero-name { font-size: 15px; font-weight: 700; color: #1677ff; }
.cs-hero-desc { font-size: 12px; color: #425466; line-height: 1.65; }
html[data-theme="dark"] .cs-hero-desc { color: #94a3b8; }
.cs-hero-right img { width: 110px; height: 110px; object-fit: contain; display: block; }

.cs-card {
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 4px 16px rgba(24, 80, 140, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.9);
}
html[data-theme="dark"] .cs-card {
  background: rgba(8, 22, 48, 0.92);
  border-color: rgba(56, 189, 248, 0.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}
.cs-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13px;
  color: #64748b;
}
.cs-card-head strong { color: #334155; font-weight: 600; }
html[data-theme="dark"] .cs-card-head strong { color: #cbd5e1; }
.cs-refresh {
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.cs-refresh:hover { color: #1677ff; }

.cs-q-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid #f1f5f9;
}
html[data-theme="dark"] .cs-q-item { border-bottom-color: rgba(56, 189, 248, 0.1); }
.cs-q-item:last-child { border-bottom: none; }
.cs-q-type { font-size: 12px; font-weight: 600; color: #6366f1; white-space: nowrap; min-width: 36px; }
.cs-q-text { flex: 1; font-size: 13px; color: #334155; min-width: 0; }
html[data-theme="dark"] .cs-q-text { color: #cbd5e1; }
.cs-q-btn {
  padding: 4px 14px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.cs-q-btn:hover { border-color: #1677ff; color: #1677ff; }
html[data-theme="dark"] .cs-q-btn {
  background: transparent;
  border-color: rgba(56, 189, 248, 0.25);
  color: #94a3b8;
}

.cs-chat { display: none; margin-bottom: 12px; max-height: 160px; overflow-y: auto; }
.cs-bubble { display: flex; gap: 8px; margin-bottom: 10px; font-size: 12px; line-height: 1.6; }
.cs-bubble-user {
  justify-content: flex-end;
  color: #fff;
  background: linear-gradient(90deg, #1677ff, #6366f1);
  padding: 8px 12px;
  border-radius: 12px 12px 2px 12px;
  margin-left: 40px;
}
.cs-bubble-bot { align-items: flex-start; color: #334155; }
html[data-theme="dark"] .cs-bubble-bot { color: #cbd5e1; }
.cs-bubble-avatar { width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; }
.cs-bubble-text {
  background: #f1f5f9;
  padding: 8px 12px;
  border-radius: 2px 12px 12px 12px;
  flex: 1;
}
html[data-theme="dark"] .cs-bubble-text { background: rgba(15, 40, 72, 0.9); }

.cs-footer { padding: 0 18px 16px; flex-shrink: 0; }
.cs-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 24px;
  background: #fff;
  border: 2px solid transparent;
  background-clip: padding-box;
  box-shadow: 0 0 0 2px transparent, 0 2px 12px rgba(24, 80, 140, 0.08);
  position: relative;
}
.cs-input-wrap::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 26px;
  z-index: -1;
  background: linear-gradient(90deg, #60a5fa, #a78bfa, #818cf8);
}
html[data-theme="dark"] .cs-input-wrap { background: #0a1628; }
.cs-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 13px;
  background: transparent;
  color: var(--portal-text, #1a3353);
}
html[data-theme="dark"] .cs-input-wrap input { color: #e2e8f0; }
.cs-input-plus {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  border-radius: 50%;
}
.cs-input-send {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: linear-gradient(135deg, #1677ff, #6366f1);
  color: #fff;
  font-size: 16px;
  line-height: 32px;
  text-align: center;
}
.cs-disclaimer {
  margin-top: 8px;
  font-size: 10px;
  color: #94a3b8;
  text-align: center;
  line-height: 1.5;
}
