@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

:root {
  --primary-color: #0B3D91;
  --secondary-color: #007AFF;
  --accent-color: #FF6B00;
  --dark-color: #333333;
  --light-color: #F5F5F5;
}

/* ========== 全局 ========== */
html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans SC', sans-serif;
  color: var(--dark-color);
  background-color: white;
  overflow-x: hidden;
}

/* ========== 滚动进度条 ========== */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), #4facfe);
  z-index: 10000;
  transition: width 0.1s linear;
}

/* ========== 回到顶部 ========== */
#back-to-top {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  z-index: 999;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.35s ease;
}
#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.25);
}

/* ========== 导航 ========== */
.text-gradient {
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.bg-gradient {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.nav-link {
  position: relative;
  transition: color 0.3s;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-color);
  transition: width 0.3s;
}
.nav-link:hover::after,
.nav-link.active::after { width: 100%; }

/* ========== Hero ========== */
.hero-section {
  height: 100vh;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0a1628 0%, #0B3D91 40%, #1a5276 70%, #007AFF 100%);
}

#hero-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-section .container {
  position: relative;
  z-index: 2;
}

.hero-content {
  text-align: center;
}
.hero-content h1 { color: white; text-shadow: 0 2px 20px rgba(0,0,0,0.3); }
.hero-content p { color: rgba(255,255,255,0.85); }

/* Hero 浮动统计卡片 */
.stat-float {
  animation: float 6s ease-in-out infinite;
}
.stat-float:nth-child(2) { animation-delay: 2s; }
.stat-float:nth-child(3) { animation-delay: 4s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Hero 按钮脉冲 */
.btn-pulse {
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.4); }
  70% { box-shadow: 0 0 0 15px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

/* ========== 数字计数器 ========== */
[data-count] {
  transition: all 0.3s;
}
[data-count].counting {
  color: var(--primary-color);
}

/* ========== 滚动淡入动画 ========== */
.fade-in, .fade-up, .fade-left, .fade-right {
  opacity: 0;
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.fade-up {
  transform: translateY(40px);
}
.fade-left {
  transform: translateX(-30px);
}
.fade-right {
  transform: translateX(30px);
}
.fade-in.visible,
.fade-up.visible,
.fade-left.visible,
.fade-right.visible {
  opacity: 1;
  transform: translate(0);
}

/* 错开延迟 */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }

/* ========== 3D 悬浮卡片 ========== */
.tilt-card {
  transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
  transform-style: preserve-3d;
  position: relative;
  overflow: hidden;
}
.card-glare {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* ========== 标题 ========== */
.section-title {
  position: relative;
  display: inline-block;
  margin-bottom: 2rem;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--accent-color);
}

/* ========== 卡片 ========== */
.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
}

.team-card img {
  transition: transform 0.5s ease;
}
.team-card:hover img { transform: scale(1.05); }

.social-icon {
  transition: transform 0.3s ease, color 0.3s ease;
}
.social-icon:hover {
  transform: translateY(-5px);
  color: var(--accent-color);
}

/* ========== 时间线 ========== */
.timeline-item {
  position: relative;
  padding-left: 30px;
  margin-bottom: 30px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent-color);
}
.timeline-item::after {
  content: '';
  position: absolute;
  left: 5px; top: 12px;
  width: 2px;
  height: calc(100% + 18px);
  background: #e5e7eb;
}
.timeline-item:last-child::after { display: none; }

/* ========== 服务图标 ========== */
.service-icon {
  transition: all 0.3s ease;
}
.service-card:hover .service-icon {
  transform: scale(1.1) rotate(-5deg);
}

/* ========== 通知条 ========== */
#notification-ticker {
  overflow: hidden;
  position: relative;
  height: 40px;
}
.ticker-item {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.5s ease;
}
.ticker-item.active {
  opacity: 1;
  transform: translateY(0);
}

/* ========== 客服机器人 ========== */
.chatbot-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
}
.chatbot-button {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  z-index: 1001;
  position: relative;
}
.chatbot-button:hover {
  transform: scale(1.1);
}
.chatbot-button::after {
  content: '';
  position: absolute;
  width: 12px; height: 12px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid white;
  top: 4px; right: 4px;
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; transform: scale(0.8); }
}

.chatbot-panel {
  position: absolute;
  bottom: 75px;
  right: 0;
  width: 350px;
  height: 450px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.chatbot-header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 14px 16px;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chatbot-messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
}
.chatbot-messages::-webkit-scrollbar { width: 4px; }
.chatbot-messages::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

.message {
  margin-bottom: 12px;
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.5;
  animation: msgIn 0.3s ease;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.bot-message {
  background: #f1f5f9;
  border-bottom-left-radius: 4px;
  margin-right: auto;
}
.user-message {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border-bottom-right-radius: 4px;
  margin-left: auto;
}
.chatbot-input {
  display: flex;
  padding: 10px;
  border-top: 1px solid #e5e7eb;
  background: #fafafa;
}
.chatbot-input input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  margin-right: 8px;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.3s;
}
.chatbot-input input:focus { border-color: var(--secondary-color); }
.chatbot-input button {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px; height: 40px;
  cursor: pointer;
  transition: all 0.3s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chatbot-input button:hover { opacity: 0.9; }

.quick-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.quick-question {
  background: #f1f5f9;
  padding: 6px 12px;
  border-radius: 14px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.quick-question:hover {
  background: #e2e8f0;
  border-color: var(--secondary-color);
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .hero-content h1 { font-size: 2rem; }
  .chatbot-panel {
    width: 290px;
    height: 400px;
    right: -10px;
  }
  #back-to-top { bottom: 85px; right: 16px; }
}

@media (max-width: 640px) {
  .hero-content h1 { font-size: 1.6rem; }
  .chatbot-panel {
    width: 270px;
    height: 380px;
  }
}
