/* ===== 全局 ===== */
:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --bg: #f0f2f5;
  --text: #1f2937;
  --text-secondary: #6b7280;
  --shadow-md: 0 4px 12px rgba(0,0,0,.12);
  --header-h: 60px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ===== 顶部品牌栏 ===== */
/* 关键：pointer-events:none 让点击穿透下去给扣子聊天框 */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-md);
  z-index: 50;                 /* 低于扣子聊天框（默认 1000），不挡聊天框 */
  pointer-events: none;        /* 整条品牌栏不接收鼠标事件，点击穿透 */
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  height: 100%;
  max-width: 900px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {
  width: 38px; height: 38px;
  background: rgba(255,255,255,.2);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 19px;
}
.brand-title { font-size: 17px; font-weight: 600; line-height: 1.2; }
.brand-sub { font-size: 11px; opacity: .85; margin-top: 2px; }

/* ===== 启动卡片（聊天框未弹出时的引导） ===== */
.boot {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, #e8f0fe 0%, #f0f2f5 100%);
  z-index: 40;                 /* 低于聊天框，聊天框出现后会盖住 */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.boot-card {
  background: #fff;
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 8px 32px rgba(26,115,232,.15);
  max-width: 340px;
  width: 100%;
  text-align: center;
}
.boot-logo {
  width: 56px; height: 56px;
  background: var(--primary);
  color: #fff;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 26px;
  margin: 0 auto 16px;
}
.boot-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.boot-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
}
.boot-dots {
  margin: 18px 0 22px;
  height: 12px;
}
.boot-dots span {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--primary);
  border-radius: 50%;
  margin: 0 4px;
  animation: blink 1.4s infinite both;
}
.boot-dots span:nth-child(1) { animation-delay: 0s; }
.boot-dots span:nth-child(2) { animation-delay: .2s; }
.boot-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink {
  0%, 80%, 100% { opacity: .25; transform: scale(.8); }
  40% { opacity: 1; transform: scale(1.15); }
}
.boot-btn {
  display: block;
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 12px 0;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.boot-btn:hover { background: var(--primary-dark); }
.boot-btn:active { transform: scale(.98); }
.boot-tip {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 14px;
  line-height: 1.5;
}

/* ===== 响应式 ===== */
@media (max-width: 480px) {
  .header-inner { padding: 0 12px; }
  .brand-title { font-size: 15px; }
  .brand-sub { display: none; }
  .boot-card { padding: 24px 20px; }
}

/* ===== 聊天框大小切换按钮（右上角） ===== */
.size-toggle {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 1100;               /* 高于聊天框，确保始终可点 */
  background: rgba(0, 0, 0, .55);
  color: #fff;
  border: none;
  border-radius: 18px;
  padding: 6px 14px 6px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  transition: background .2s, transform .15s;
  pointer-events: auto;        /* 独立可点击，不受 header pointer-events:none 影响 */
}
.size-toggle:hover { background: rgba(0,0,0,.75); }
.size-toggle:active { transform: scale(.96); }
.size-toggle-icon {
  font-size: 15px;
  line-height: 1;
}
.size-toggle-text {
  line-height: 1;
}

/* ===== 全屏模式：撑大扣子浮窗（只改尺寸 / 位置，不动 position） ===== */
/* JS 给 SDK 浮窗最外层 fixed 容器加上 .__coze-bot-fixed-root 后生效 */
body.chat-fullscreen .__coze-bot-fixed-root {
  width: calc(100vw - 16px) !important;
  height: calc(100vh - 76px) !important;
  max-width: none !important;
  max-height: none !important;
  top: 68px !important;
  left: 8px !important;
  right: 8px !important;
  bottom: 8px !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 32px rgba(0,0,0,.18) !important;
}

/* 小屏适配：手机上去掉品牌栏留空，浮窗顶到边 */
@media (max-width: 600px) {
  body.chat-fullscreen .__coze-bot-fixed-root {
    width: 100vw !important;
    height: calc(100vh - 60px) !important;
    top: 60px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    border-radius: 0 !important;
  }
  .size-toggle {
    top: 10px;
    right: 8px;
    padding: 5px 10px;
    font-size: 12px;
  }
}
