/* ============================
   中国现代教育产业 - 优化版样式
   Design by 小美
   ============================ */

:root {
  --primary-color: #1a56a5;
  --primary-light: #2e7bd9;
  --primary-dark: #0d3b7a;
  --accent-color: #ff6b35;
  --accent-light: #ff8c5a;
  --success-color: #28a745;
  --bg-primary: #f5f7fa;
  --bg-white: #ffffff;
  --text-dark: #1a1a2e;
  --text-gray: #555555;
  --text-light: #888888;
  --border-color: #e0e4ec;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --gradient-primary: linear-gradient(135deg, #1a56a5 0%, #2e7bd9 50%, #3d9ae8 100%);
  --gradient-warm: linear-gradient(135deg, #ff6b35 0%, #ff8c5a 100%);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg-primary);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ========== Header ========== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
}

.header.scrolled {
  box-shadow: var(--shadow-md);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: -0.5px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-btn {
  padding: 8px 18px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover {
  background: var(--primary-color);
  color: white;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 15px rgba(26,86,165,0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26,86,165,0.4);
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 5px;
}

.mobile-menu-btn span {
  width: 24px;
  height: 2.5px;
  background: var(--text-dark);
  border-radius: 2px;
  transition: var(--transition);
}

/* ========== Hero Section ========== */
.hero {
  margin-top: 64px;
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(-45deg, #0a1628, #0d2847, #134577, #1a56a5, #2e7bd9);
  background-size: 400% 400%;
  animation: heroGradientShift 18s ease infinite;
}

@keyframes heroGradientShift {
  0%   { background-position: 0% 50%; }
  25%  { background-position: 100% 50%; }
  50%  { background-position: 100% 0%; }
  75%  { background-position: 0% 0%; }
  100% { background-position: 0% 50%; }
}

.hero::before {
  content: '';
  position: absolute;
  top: -60%;
  left: -60%;
  width: 220%;
  height: 220%;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.07) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255,165,0,0.05) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(100,180,255,0.04) 0%, transparent 55%);
  animation: heroGlow 25s linear infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes heroGlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(100,170,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100,170,255,0.06) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px 24px;
  max-width: 800px;
}

.hero-badge {
  display: inline-block;
  padding: 6px 18px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 50px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 24px;
  animation: fadeInDown 0.8s ease-out;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  color: white;
  line-height: 1.2;
  margin-bottom: 20px;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero p {
  font-size: 18px;
  color: rgba(255,255,255,0.88);
  margin-bottom: 36px;
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s ease-out 0.6s both;
}

.btn-hero {
  padding: 14px 36px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
}

.btn-hero-white {
  background: white;
  color: var(--primary-color);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.btn-hero-white:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.btn-hero-ghost {
  background: transparent;
  color: white;
  border: 2px solid rgba(255,255,255,0.5);
}

.btn-hero-ghost:hover {
  background: rgba(255,255,255,0.1);
  border-color: white;
}

.hero-stats {
  display: flex;
  gap: 48px;
  justify-content: center;
  margin-top: 60px;
  animation: fadeInUp 0.8s ease-out 0.8s both;
}

.stat-item {
  text-align: center;
  color: white;
}

.stat-number {
  font-size: 36px;
  font-weight: 800;
  display: block;
}

.stat-label {
  font-size: 14px;
  opacity: 0.8;
}

/* ========== Slogan Banner ========== */
.slogan-banner {
  background: var(--bg-white);
  text-align: center;
  padding: 40px 24px;
}

.slogan-banner img {
  max-width: 400px;
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.slogan-text {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-color);
  margin-top: 20px;
  letter-spacing: 2px;
}

/* ========== Services Section ========== */
.services {
  padding: 80px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-tag {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(26,86,165,0.08);
  color: var(--primary-color);
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 16px;
}

.section-desc {
  font-size: 17px;
  color: var(--text-gray);
  max-width: 600px;
  margin: 0 auto;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.service-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  transition: var(--transition);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: var(--transition);
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-color);
}

.service-card:hover::before {
  opacity: 1;
}

.service-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(26,86,165,0.08) 0%, rgba(46,123,217,0.08) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  transition: var(--transition);
}

.service-card:hover .service-icon {
  background: var(--gradient-primary);
}

.service-icon img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: brightness(0) invert(0.2);
  transition: var(--transition);
}

.service-card:hover .service-icon img {
  filter: brightness(0) invert(1);
}

.service-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 10px;
}

.service-card p {
  font-size: 15px;
  color: var(--text-gray);
  line-height: 1.7;
}

/* ========== Signup CTA Section ========== */
.signup-section {
  background: var(--bg-white);
  padding: 80px 24px;
  text-align: center;
}

.signup-container {
  max-width: 900px;
  margin: 0 auto;
}

.signup-image {
  width: 100%;
  max-width: 500px;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 36px;
}

.signup-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 28px;
}

/* ========== News Section ========== */
.news {
  padding: 80px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 28px;
}

.news-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.news-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.news-image {
  width: 100%;
  height: 220px;
  overflow: hidden;
}

.news-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.news-card:hover .news-image img {
  transform: scale(1.05);
}

.news-body {
  padding: 24px;
}

.news-date {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 8px;
}

.news-body h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 10px;
  line-height: 1.4;
}

.news-body p {
  font-size: 14px;
  color: var(--text-gray);
  line-height: 1.7;
}

.news-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  margin-top: 16px;
  transition: var(--transition);
}

.news-link:hover {
  gap: 10px;
}

/* ========== About / Footer ========== */
.footer {
  background: var(--text-dark);
  color: white;
  padding: 80px 24px 40px;
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 48px;
  margin-bottom: 60px;
}

.footer-col h4 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 20px;
  color: white;
}

.footer-col a {
  display: block;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 0;
  transition: var(--transition);
}

.footer-col a:hover {
  color: white;
  padding-left: 6px;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 32px;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.45);
}

.footer-slogan {
  font-size: 18px;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  margin-bottom: 12px;
  letter-spacing: 3px;
}

/* ========== AI Chatbot ========== */
.ai-chat-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--gradient-primary);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(26,86,165,0.4), 0 0 0 0 rgba(26,86,165,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  animation: pulse-ring 2s infinite;
}

.ai-chat-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 30px rgba(26,86,165,0.5);
}

.ai-chat-btn svg {
  width: 30px;
  height: 30px;
  fill: white;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 4px 24px rgba(26,86,165,0.4), 0 0 0 0 rgba(26,86,165,0.3); }
  70% { box-shadow: 0 4px 24px rgba(26,86,165,0.4), 0 0 0 12px rgba(26,86,165,0); }
  100% { box-shadow: 0 4px 24px rgba(26,86,165,0.4), 0 0 0 0 rgba(26,86,165,0); }
}

.chat-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  z-index: 998;
  width: 380px;
  height: 520px;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 48px rgba(0,0,0,0.18);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease-out;
  border: 1px solid var(--border-color);
}

.chat-window.active {
  display: flex;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-header {
  background: var(--gradient-primary);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.chat-header-info h4 {
  color: white;
  font-size: 15px;
  font-weight: 600;
}

.chat-header-info span {
  color: rgba(255,255,255,0.7);
  font-size: 12px;
}

.chat-close {
  background: rgba(255,255,255,0.2);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  transition: var(--transition);
}

.chat-close:hover {
  background: rgba(255,255,255,0.3);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.message {
  max-width: 85%;
  animation: messageIn 0.3s ease-out;
}

@keyframes messageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.message.bot {
  align-self: flex-start;
}

.message.user {
  align-self: flex-end;
}

.message-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
}

.message.bot .message-bubble {
  background: var(--bg-primary);
  color: var(--text-dark);
  border-bottom-left-radius: 4px;
}

.message.user .message-bubble {
  background: var(--gradient-primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.message-time {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 4px;
  padding: 0 4px;
}

.message.user .message-time {
  text-align: right;
  color: rgba(255,255,255,0.6);
}

.typing-indicator {
  display: flex;
  gap: 5px;
  padding: 12px 16px;
  background: var(--bg-primary);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-light);
  animation: typingBounce 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.chat-input-area {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  background: var(--bg-white);
}

.chat-input-area input {
  flex: 1;
  padding: 12px 18px;
  border: 1.5px solid var(--border-color);
  border-radius: 25px;
  outline: none;
  font-size: 14px;
  transition: var(--transition);
  font-family: inherit;
}

.chat-input-area input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(26,86,165,0.08);
}

.chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gradient-primary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.chat-send-btn:hover {
  transform: scale(1.05);
}

.chat-send-btn svg {
  width: 20px;
  height: 20px;
  fill: white;
}

.chat-quick-replies {
  padding: 12px 20px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-reply {
  padding: 6px 14px;
  border: 1px solid var(--primary-color);
  border-radius: 20px;
  background: transparent;
  color: var(--primary-color);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.quick-reply:hover {
  background: var(--primary-color);
  color: white;
}

/* ========== Animations ========== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .header {
    padding: 0 16px;
  }

  .header-btn span {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .hero {
    min-height: auto;
    padding: 80px 20px 60px;
  }

  .hero-stats {
    gap: 24px;
    flex-wrap: wrap;
  }

  .stat-number {
    font-size: 28px;
  }

  .services, .news {
    padding: 60px 16px;
  }

  .news-grid {
    grid-template-columns: 1fr;
  }

  .chat-window {
    right: 12px;
    left: 12px;
    width: auto;
    height: calc(100vh - 140px);
    bottom: 90px;
  }

  .ai-chat-btn {
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
  }

  .signup-buttons {
    flex-direction: column;
    align-items: center;
  }
}
