/* ==============================
   style.css - 开云中国官方网站 (KAIYUN OFFICIAL)
   风格: 渐变Banner, 圆角卡片, 毛玻璃, 响应式, 暗色模式, 滚动动画, hover动画
   ============================== */

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #1a1a2e;
  background: #ffffff;
  transition: background 0.4s ease, color 0.4s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Dark Mode (body class) --- */
body.dark-mode {
  background: #0f0f1a;
  color: #e0e0e0;
}

/* --- Container --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  line-height: 1.3;
  margin-bottom: 0.5em;
}

h2 {
  font-size: 2.2rem;
  text-align: center;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.dark-mode h2 {
  background: linear-gradient(135deg, #a8b4ff 0%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

p {
  margin-bottom: 1rem;
  color: #4a4a6a;
}

body.dark-mode p {
  color: #b0b0c8;
}

a {
  color: #667eea;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #764ba2;
}

/* --- Glassmorphism (通用毛玻璃卡片) --- */
.glassmorphism {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.35s ease;
}

body.dark-mode .glassmorphism {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.glassmorphism:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(102, 126, 234, 0.15);
}

body.dark-mode .glassmorphism:hover {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

/* --- Buttons --- */
.btn-primary,
.btn-secondary {
  display: inline-block;
  padding: 12px 32px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: pointer;
  border: none;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.35);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(102, 126, 234, 0.5);
}

.btn-secondary {
  background: transparent;
  color: #667eea;
  border: 2px solid #667eea;
}

body.dark-mode .btn-secondary {
  color: #a8b4ff;
  border-color: #a8b4ff;
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  border-color: transparent;
}

/* --- Header & Navigation --- */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.06);
  transition: background 0.4s ease, box-shadow 0.3s ease;
}

body.dark-mode header {
  background: rgba(15, 15, 26, 0.88);
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.3);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
}

.logo svg {
  display: block;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links li a {
  font-weight: 500;
  color: #1a1a2e;
  position: relative;
  padding-bottom: 4px;
}

body.dark-mode .nav-links li a {
  color: #d0d0e0;
}

.nav-links li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  transition: width 0.3s ease;
}

.nav-links li a:hover::after,
.nav-links li a:focus::after {
  width: 100%;
}

.nav-links li a:hover {
  color: #667eea;
}

body.dark-mode .nav-links li a:hover {
  color: #a8b4ff;
}

/* Nav Actions (dark mode toggle, search, menu) */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.nav-actions button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  color: #1a1a2e;
  transition: background 0.3s ease, color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.dark-mode .nav-actions button {
  color: #d0d0e0;
}

.nav-actions button:hover {
  background: rgba(102, 126, 234, 0.1);
}

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

/* --- Hero Section (渐变Banner + 轮播) --- */
.hero {
  position: relative;
  padding-top: 100px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0f4ff 0%, #e8ecf8 100%);
  overflow: hidden;
  transition: background 0.4s ease;
}

body.dark-mode .hero {
  background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 100%);
}

.hero-slider {
  position: relative;
  width: 100%;
  max-width: 1200px;
  display: flex;
  overflow: hidden;
}

.slide {
  min-width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
  transform: scale(0.98);
  position: absolute;
  top: 0;
  left: 0;
}

.slide.active {
  opacity: 1;
  transform: scale(1);
  position: relative;
  z-index: 2;
}

.hero-content {
  flex: 1;
  padding-right: 3rem;
}

.hero-content h1 {
  font-size: 2.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, #1a1a2e 0%, #667eea 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

body.dark-mode .hero-content h1 {
  background: linear-gradient(135deg, #e0e0e0 0%, #a8b4ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-content p {
  font-size: 1.2rem;
  color: #4a4a6a;
  max-width: 540px;
  margin-bottom: 2rem;
}

body.dark-mode .hero-content p {
  color: #b0b0c8;
}

.hero-buttons {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.hero-visual {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-left: 2rem;
}

.hero-visual svg {
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 8px 24px rgba(102, 126, 234, 0.2));
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
}

/* Slider Controls */
.slider-controls {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 5;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(102, 126, 234, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
}

.dot.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  transform: scale(1.2);
  box-shadow: 0 0 12px rgba(102, 126, 234, 0.5);
}

/* --- Section Spacing & Animation (滚动动画) --- */
section {
  padding: 100px 0;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

section:nth-of-type(1) { animation-delay: 0.1s; }
section:nth-of-type(2) { animation-delay: 0.2s; }
section:nth-of-type(3) { animation-delay: 0.3s; }
section:nth-of-type(4) { animation-delay: 0.4s; }
section:nth-of-type(5) { animation-delay: 0.5s; }
section:nth-of-type(6) { animation-delay: 0.6s; }
section:nth-of-type(7) { animation-delay: 0.7s; }
section:nth-of-type(8) { animation-delay: 0.8s; }
section:nth-of-type(9) { animation-delay: 0.9s; }
section:nth-of-type(10) { animation-delay: 1.0s; }
section:nth-of-type(11) { animation-delay: 1.1s; }
section:nth-of-type(12) { animation-delay: 1.2s; }
section:nth-of-type(13) { animation-delay: 1.3s; }
section:nth-of-type(14) { animation-delay: 1.4s; }

/* --- Grid Layouts (圆角卡片 + 响应式) --- */
.about-grid,
.team-grid,
.products-grid,
.advantages-grid,
.solutions-grid,
.industries-grid,
.cases-grid,
.partners-grid,
.testimonials-grid,
.news-grid,
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

/* --- 卡片通用样式 (圆角, hover动画) --- */
.team-card,
.product-card,
.solution-card,
.case-card,
.news-card,
.article-card,
.step,
.industry-item,
.partner-logo {
  background: #ffffff;
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.35s ease;
  text-align: center;
}

body.dark-mode .team-card,
body.dark-mode .product-card,
body.dark-mode .solution-card,
body.dark-mode .case-card,
body.dark-mode .news-card,
body.dark-mode .article-card,
body.dark-mode .step,
body.dark-mode .industry-item,
body.dark-mode .partner-logo {
  background: #1c1c30;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.team-card:hover,
.product-card:hover,
.solution-card:hover,
.case-card:hover,
.news-card:hover,
.article-card:hover,
.step:hover,
.industry-item:hover,
.partner-logo:hover {
  transform: translateY(-10px);
  box-shadow: 0 16px 48px rgba(102, 126, 234, 0.12);
}

body.dark-mode .team-card:hover,
body.dark-mode .product-card:hover,
body.dark-mode .solution-card:hover,
body.dark-mode .case-card:hover,
body.dark-mode .news-card:hover,
body.dark-mode .article-card:hover,
body.dark-mode .step:hover,
body.dark-mode .industry-item:hover,
body.dark-mode .partner-logo:hover {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

/* --- Statistics Section (渐变背景) --- */
.statistics {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  padding: 80px 0;
}

body.dark-mode .statistics {
  background: linear-gradient(135deg, #4a5ebd 0%, #5a3a82 100%);
}

.statistics h2 {
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  background: none;
}

.statistics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  text-align: center;
}

.stat-item {
  padding: 1.5rem;
}

.stat-number {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  display: inline;
}

.stat-suffix {
  font-size: 1.8rem;
  font-weight: 600;
  margin-left: 4px;
}

.stat-item p {
  color: rgba(255, 255, 255, 0.85);
  margin-top: 0.5rem;
  font-size: 1.1rem;
}

/* --- FAQ --- */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  margin-bottom: 1rem;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  background: #ffffff;
  transition: box-shadow 0.3s ease;
}

body.dark-mode .faq-item {
  background: #1c1c30;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.faq-question {
  width: 100%;
  padding: 1.2rem 1.5rem;
  background: transparent;
  border: none;
  text-align: left;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #1a1a2e;
  transition: background 0.3s ease;
}

body.dark-mode .faq-question {
  color: #e0e0e0;
}

.faq-question::after {
  content: '+';
  font-size: 1.8rem;
  font-weight: 300;
  transition: transform 0.3s ease;
  color: #667eea;
}

.faq-item.active .faq-question::after {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  background: #f8f9ff;
  padding: 0 1.5rem;
}

body.dark-mode .faq-answer {
  background: #12121f;
}

.faq-item.active .faq-answer {
  max-height: 400px;
  padding: 1.2rem 1.5rem;
}

.faq-answer p {
  margin: 0;
}

/* --- How-to Steps --- */
.howto-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #ffffff;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 1rem;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

/* --- Contact Form --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.contact-info .info-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-info .info-item svg {
  flex-shrink: 0;
  color: #667eea;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 1rem 1.2rem;
  margin-bottom: 1.2rem;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  background: #ffffff;
  color: #1a1a2e;
}

body.dark-mode .contact-form input,
body.dark-mode .contact-form textarea {
  background: #1c1c30;
  border-color: #2d2d44;
  color: #e0e0e0;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
  outline: none;
}

.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

/* --- Footer --- */
footer {
  background: #0f0f1a;
  color: #d0d0e0;
  padding: 60px 0 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.footer-section h3 {
  color: #a8b4ff;
  margin-bottom: 1.2rem;
  font-size: 1.1rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.6rem;
}

.footer-section ul li a {
  color: #8a8aa0;
  transition: color 0.3s ease;
}

.footer-section ul li a:hover {
  color: #a8b4ff;
}

.footer-bottom {
  max-width: 1200px;
  margin: 2.5rem auto 0;
  padding: 1.5rem 24px 0;
  border-top: 1px solid #2a2a40;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}

.footer-links a {
  color: #8a8aa0;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: #a8b4ff;
}

.copyright,
.company-info {
  font-size: 0.85rem;
  color: #6a6a80;
}

.company-info {
  margin-top: 0.5rem;
}

/* --- Back to Top Button --- */
#backToTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(102, 126, 234, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 999;
}

#backToTop:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 36px rgba(102, 126, 234, 0.6);
}

/* --- Read More Link --- */
.read-more {
  display: inline-block;
  margin-top: 1rem;
  font-weight: 600;
  color: #667eea;
  transition: color 0.3s ease;
}

.read-more:hover {
  color: #764ba2;
  text-decoration: underline;
}

/* --- Partner Logo Hover --- */
.partner-logo {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.partner-logo:hover {
  transform: scale(1.06);
}

/* --- Testimonial Card Footer --- */
.testimonial-card footer {
  margin-top: 1.2rem;
  font-weight: 600;
  color: #667eea;
  background: none;
  padding: 0;
}

body.dark-mode .testimonial-card footer {
  color: #a8b4ff;
}

/* --- Industry Item Icon --- */
.industry-item svg {
  margin-bottom: 0.8rem;
}

/* --- Responsive (Mobile First) --- */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    padding: 1.5rem 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 24px 24px;
    gap: 1rem;
  }

  body.dark-mode .nav-links {
    background: rgba(15, 15, 26, 0.98);
  }

  .nav-links.open {
    display: flex;
  }

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

  .slide {
    flex-direction: column;
    text-align: center;
    padding: 0 16px;
  }

  .hero-content {
    padding-right: 0;
    margin-bottom: 2rem;
  }

  .hero-content h1 {
    font-size: 2rem;
  }

  .hero-content p {
    font-size: 1rem;
  }

  .hero-buttons {
    justify-content: center;
  }

  .hero-visual {
    padding-left: 0;
  }

  .hero-visual svg {
    max-width: 80%;
    height: auto;
  }

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

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

  .stat-number {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 1.8rem;
  }
}

@media (max-width: 480px) {
  .nav-container {
    padding: 10px 16px;
  }

  .hero-content h1 {
    font-size: 1.6rem;
  }

  .btn-primary,
  .btn-secondary {
    padding: 10px 24px;
    font-size: 0.9rem;
  }

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

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

/* --- Dark Mode Overrides for Specific Elements --- */
body.dark-mode .faq-question {
  background: #1c1c30;
}

body.dark-mode .faq-item.active .faq-question {
  background: #222238;
}

/* --- Smooth Scroll for Anchor Links (fallback) --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}