/* 重置默认样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Microsoft YaHei", "Heiti SC", "PingFang SC", sans-serif;
  transition: all 0.3s ease; /* 全局过渡动画 */
}

/* 核心：页面主体偏移，避免被顶部固定的导航+标题+对话框遮挡 */
body {
  color: #333;
  background-color: #f8f9fa;
  line-height: 1.6;
  padding-top: 316px; /* 导航80px + 标题60px + 对话框176px，刚好避开固定区域 */
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
}

/* 1. 导航栏（顶部固定，第一层） */
.header {
  width: 100%;
  height: 80px;
  background-color: rgba(255, 255, 255, 0.95); /* 半透明背景 */
  backdrop-filter: blur(8px); /* 毛玻璃效果 */
  box-shadow: 0 2px 15px rgba(0,0,0,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 50px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999; /* 最高层级，不被遮挡 */
}

.logo {
  font-size: 26px;
  font-weight: 700;
  color: #2f54eb;
  background: linear-gradient(90deg, #2f54eb, #4066ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent; /* 文字渐变 */
}

.nav-menu ul {
  display: flex;
  gap: 40px;
}

.nav-menu a {
  font-size: 16px;
  font-weight: 500;
  color: #444;
  position: relative;
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: #2f54eb;
  transition: width 0.3s ease;
}

.nav-menu a:hover {
  color: #2f54eb;
}

.nav-menu a:hover::after {
  width: 100%;
}

.contact-btn {
  width: 120px;
  height: 42px;
  background: linear-gradient(90deg, #2f54eb, #4066ff);
  color: #fff;
  border-radius: 21px;
  font-size: 16px;
  font-weight: 500;
  box-shadow: 0 4px 15px rgba(47,84,235,0.2);
}

.contact-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(47,84,235,0.3);
}

/* 2. 盛利康智能AI官网 标题区（顶部固定，第二层） */
.ai-title-section {
  width: 100%;
  padding: 15px 0;
  margin-top: 80px; /* 贴合导航栏下方 */
  background-color: #fff;
  text-align: center; /* 标题文字居中 */
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9998; /* 次高层级 */
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.ai-main-title {
  font-size: 32px;
  font-weight: 700;
  color: #222;
  background: linear-gradient(90deg, #2f54eb, #3366ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 1px; /* 字间距，更舒展 */
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 3. AI对话框【核心：顶部固定+缩小框装+居中】 */
.ai-chat-fixed {
  width: 800px; /* 缩小固定宽度，大屏不拉伸 */
  max-width: 90%; /* 小屏自适应，不超出屏幕 */
  background-color: #fff;
  box-shadow: 0 6px 25px rgba(0,0,0,0.1); /* 加深阴影，强化框装感 */
  padding: 0 25px;
  border: 1px solid #e0e7ff; /* 浅蓝边框，立体视觉 */
  border-radius: 12px;
  position: fixed;
  top: 140px; /* 导航80px + 标题60px，贴合标题区下方 */
  left: 50%; /* 水平居中 */
  transform: translateX(-50%); /* 水平居中偏移 */
  z-index: 9997; /* 第三层级，确保顶部固定不遮挡 */
}

/* 对话框头部（无图标，间距优化） */
.chat-header {
  height: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f0f5ff;
  width: 100%;
  padding: 0 5px;
}

.chat-header h3 {
  color: #2f54eb;
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.chat-controls {
  display: flex;
  gap: 12px;
}

.chat-controls button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  background-color: #f5f7fa;
}

.chat-controls button:hover {
  background-color: #e8f0fe;
  color: #2f54eb;
  transform: scale(1.05);
}

/* 消息区（缩小适配，框装内间距） */
.chat-messages {
  width: 100%;
  height: 220px; /* 消息区高度，可按需调整 */
  padding: 15px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  background-color: #f9fafc;
  border-radius: 8px;
  margin: 12px 0;
}

/* 消息气泡美化（比例适配缩小的对话框） */
.message {
  max-width: 80%; /* 适配窄对话框，提高气泡占比 */
  padding: 12px 18px;
  border-radius: 18px;
  line-height: 1.6;
  font-size: 14px;
  word-wrap: break-word;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.user-message {
  align-self: flex-end;
  background: linear-gradient(90deg, #2f54eb, #4066ff);
  color: #fff;
  border-top-right-radius: 6px;
  border-bottom-right-radius: 18px;
  border-bottom-left-radius: 18px;
  border-top-left-radius: 18px;
}
.ai-message {
  align-self: flex-start;
  background: linear-gradient(90deg, #e8f0fe, #f0f5ff);
  color: #333;
  border-top-left-radius: 6px;
  border-bottom-right-radius: 18px;
  border-bottom-left-radius: 18px;
  border-top-right-radius: 18px;
}

/* 输入区（适配缩小的对话框，间距优化） */
.chat-input {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 5px;
  width: 100%;
}

.chat-input input {
  flex: 1;
  height: 46px;
  padding: 0 22px;
  border: 1px solid #e0e7ff;
  border-radius: 23px;
  font-size: 14px;
  outline: none;
  background-color: #f9fafc;
}

.chat-input input:focus {
  border-color: #2f54eb;
  box-shadow: 0 0 0 3px rgba(47,84,235,0.1);
  background-color: #fff;
}

.chat-input input::placeholder {
  color: #999;
  font-size: 14px;
}

/* 发送按钮美化（比例适配） */
.send-btn {
  width: 46px;
  height: 46px;
  background: linear-gradient(90deg, #2f54eb, #4066ff);
  color: #fff;
  border-radius: 50%;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(47,84,235,0.2);
}

.send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(47,84,235,0.3);
}

/* 最小化样式（适配顶部固定+缩小框装） */
.ai-chat-fixed.mini {
  height: 56px;
  overflow: hidden;
  border-radius: 12px;
  width: 800px;
  max-width: 90%;
}

.ai-chat-fixed.mini .chat-messages,
.ai-chat-fixed.mini .chat-input {
  display: none !important;
}

/* Banner区（页面主体，可正常滚动，与固定区无重叠） */
.banner {
  width: 100%;
  height: 600px;
  background-image: url('https://picsum.photos/id/180/1920/1080'); /* 可替换自己的背景图 */
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  position: relative;
}

.banner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(47,84,235,0.7), rgba(17,55,166,0.7));
}

.banner-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  padding: 0 20px;
}

.banner-content h1 {
  font-size: 52px;
  margin-bottom: 24px;
  font-weight: 700;
  text-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.banner-content p {
  font-size: 22px;
  margin-bottom: 48px;
  opacity: 0.95;
  text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.banner-btn {
  width: 190px;
  height: 54px;
  background-color: #fff;
  color: #2f54eb;
  font-size: 18px;
  font-weight: 600;
  border-radius: 27px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.banner-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
  color: #1d39c4;
}

/* 核心内容区（页面主体，可正常滚动，居中） */
.content {
  width: 100%;
  padding: 100px 20px;
  max-width: 1400px;
  margin: 0 auto;
}

.content-title {
  text-align: center;
  margin-bottom: 80px;
}

.content-title h2 {
  font-size: 38px;
  margin-bottom: 20px;
  color: #222;
  font-weight: 700;
}

.content-title p {
  font-size: 18px;
  color: #666;
  max-width: 600px;
  margin: 0 auto;
}

.service-cards {
  display: flex;
  justify-content: center;
  gap: 50px;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
}

.card {
  flex: 1;
  min-width: 280px;
  max-width: 350px;
  background-color: #fff;
  padding: 50px 30px;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.05);
  text-align: center;
}

.card:hover {
  transform: translateY(-12px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

.card-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #e8f0fe, #f0f5ff);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 30px;
}

.card-icon i {
  font-size: 40px;
  color: #2f54eb;
}

.card h3 {
  font-size: 24px;
  margin-bottom: 20px;
  color: #222;
  font-weight: 600;
}

.card p {
  font-size: 16px;
  color: #666;
  line-height: 1.8;
}

/* 底部（页面主体，可正常滚动，居中） */
.footer {
  width: 100%;
  background-color: #222;
  color: #fff;
  padding: 80px 20px 40px;
  margin-top: 50px;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 35px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.footer-logo {
  font-size: 30px;
  font-weight: 700;
  color: #2f54eb;
  background: linear-gradient(90deg, #4066ff, #2f54eb);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.footer-contact {
  display: flex;
  gap: 60px;
  font-size: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-contact p {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-contact i {
  font-size: 18px;
  color: #4066ff;
}

.copyright {
  font-size: 14px;
  opacity: 0.6;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  width: 100%;
  text-align: center;
}

/* 移动端适配【核心：顶部固定+缩小框装同步适配】 */
@media (max-width: 768px) {
  /* 移动端主体偏移值调整，适配小屏固定区高度 */
  body {
    padding-top: 260px; /* 导航70px + 标题50px + 对话框140px */
  }
  /* 导航栏移动端 */
  .header {
    padding: 0 20px;
    height: 70px;
    justify-content: space-between;
  }
  .nav-menu {
    display: none;
  }
  .logo {
    font-size: 22px;
  }
  .contact-btn {
    width: 100px;
    height: 38px;
    font-size: 14px;
  }
  /* 标题区移动端 */
  .ai-title-section {
    padding: 10px 0;
    margin-top: 70px;
  }
  .ai-main-title {
    font-size: 24px;
    letter-spacing: 0.5px;
  }
  /* AI对话框移动端：顶部固定+缩小适配 */
  .ai-chat-fixed {
    width: 95%; /* 小屏占比提高，更适配 */
    top: 120px; /* 导航70px + 标题50px，适配小屏高度 */
    padding: 0 15px;
    border-radius: 8px;
  }
  .chat-header {
    height: 50px;
  }
  .chat-header h3 {
    font-size: 16px;
  }
  .chat-controls button {
    width: 34px;
    height: 34px;
  }
  .chat-messages {
    height: 160px; /* 小屏消息区高度缩小 */
    padding: 12px 15px;
    margin: 8px 0;
  }
  .message {
    max-width: 85%;
    padding: 10px 16px;
    font-size: 13px;
  }
  .chat-input {
    height: 56px;
    padding: 8px 5px;
  }
  .chat-input input {
    height: 40px;
    padding: 0 18px;
    font-size: 13px;
  }
  .send-btn {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
  /* 最小化样式移动端适配 */
  .ai-chat-fixed.mini {
    height: 50px;
    width: 95%;
  }
  /* Banner区移动端 */
  .banner {
    height: 450px;
  }
  .banner-content h1 {
    font-size: 38px;
  }
  .banner-content p {
    font-size: 18px;
  }
  /* 内容区+底部移动端 */
  .content {
    padding: 80px 20px;
    max-width: 100%;
  }
  .content-title h2 {
    font-size: 32px;
  }
  .service-cards {
    gap: 30px;
    max-width: 100%;
  }
  .card {
    padding: 40px 20px;
    max-width: 100%;
  }
  .footer {
    padding: 60px 20px 30px;
  }
  .footer-contact {
    gap: 30px;
    max-width: 100%;
  }
  .footer-logo {
    font-size: 24px;
  }
}

/* 超小屏适配（手机竖屏） */
@media (max-width: 480px) {
  body {
    padding-top: 230px; /* 进一步缩小主体偏移 */
  }
  .ai-main-title {
    font-size: 20px;
  }
  .ai-chat-fixed {
    top: 100px;
  }
  .chat-messages {
    height: 140px;
  }
  .banner-content h1 {
    font-size: 28px;
  }
  .banner-btn {
    width: 160px;
    height: 48px;
    font-size: 16px;
  }
}