/* ===== 全局重置 & 基础 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f5f7fa;
  color: #1a1a2e;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
  scroll-behavior: smooth;
}

body.dark {
  background: #0f0f1a;
  color: #e0e0e0;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s;
}

img {
  max-width: 100%;
  display: block;
  height: auto;
}

ul, ol {
  list-style: none;
}

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

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #4a90d9;
  border-radius: 10px;
}
body.dark ::-webkit-scrollbar-thumb {
  background: #6aa0e0;
}

/* ===== Header ===== */
header {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: white;
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0,0,0,0.15);
  transition: background 0.3s;
}

body.dark header {
  background: linear-gradient(135deg, #0a0a14, #12122a);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.logo svg {
  height: 40px;
  width: auto;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

nav ul {
  display: flex;
  list-style: none;
  gap: 25px;
  align-items: center;
}

nav a {
  color: #ccc;
  font-weight: 500;
  position: relative;
  padding-bottom: 4px;
  transition: color 0.3s;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: #4a90d9;
  transition: width 0.3s;
}

nav a:hover {
  color: #4a90d9;
}

nav a:hover::after {
  width: 100%;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  padding: 5px;
  line-height: 1;
  transition: transform 0.2s;
}

.menu-toggle:hover {
  transform: scale(1.1);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 5px;
}

.search-box input {
  padding: 8px 16px;
  border-radius: 20px;
  border: none;
  background: rgba(255,255,255,0.12);
  color: white;
  outline: none;
  width: 150px;
  transition: width 0.3s, background 0.3s;
  font-size: 14px;
}

.search-box input::placeholder {
  color: rgba(255,255,255,0.5);
}

.search-box input:focus {
  width: 200px;
  background: rgba(255,255,255,0.2);
}

.search-box button {
  background: #4a90d9;
  border: none;
  color: white;
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.3s, transform 0.2s;
  line-height: 1;
}

.search-box button:hover {
  background: #3a7bc8;
  transform: scale(1.05);
}

.dark-toggle {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  margin-left: 10px;
  font-size: 16px;
  transition: background 0.3s, transform 0.2s;
  backdrop-filter: blur(4px);
}

.dark-toggle:hover {
  background: rgba(255,255,255,0.2);
  transform: scale(1.05);
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, #0f3460, #533483, #e94560);
  background-size: 300% 300%;
  animation: gradientShift 10s ease infinite;
  color: white;
  padding: 100px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 40%, rgba(255,255,255,0.05) 0%, transparent 60%);
  animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
  0% { transform: translate(0, 0); }
  100% { transform: translate(10%, 10%); }
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 3em;
  margin-bottom: 20px;
  font-weight: 800;
  text-shadow: 0 4px 20px rgba(0,0,0,0.3);
  letter-spacing: -0.5px;
}

.hero p {
  font-size: 1.25em;
  max-width: 700px;
  margin: 0 auto 35px;
  opacity: 0.9;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.hero .btn {
  background: linear-gradient(135deg, #e94560, #d63350);
  color: white;
  padding: 16px 48px;
  border-radius: 30px;
  font-size: 1.15em;
  font-weight: 600;
  display: inline-block;
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: 0 8px 25px rgba(233,69,96,0.4);
  letter-spacing: 0.5px;
}

.hero .btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 35px rgba(233,69,96,0.5);
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  background: #eef2f7;
  padding: 14px 0;
  font-size: 0.9em;
  transition: background 0.3s;
}

body.dark .breadcrumb {
  background: #1e1e2e;
}

.breadcrumb a {
  color: #4a90d9;
  transition: color 0.3s;
}

.breadcrumb a:hover {
  color: #2a6bb5;
  text-decoration: underline;
}

.breadcrumb span {
  color: #666;
}

body.dark .breadcrumb span {
  color: #aaa;
}

/* ===== Sections ===== */
section {
  padding: 70px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 45px;
}

.section-title h2 {
  font-size: 2.2em;
  position: relative;
  display: inline-block;
  font-weight: 700;
}

.section-title h2::after {
  content: '';
  display: block;
  width: 70px;
  height: 4px;
  background: linear-gradient(90deg, #4a90d9, #e94560);
  margin: 12px auto 0;
  border-radius: 2px;
}

/* ===== Card Grid ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.card {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.06);
  transition: transform 0.4s, box-shadow 0.4s, background 0.3s;
  border: 1px solid rgba(255,255,255,0.2);
  overflow: hidden;
}

body.dark .card {
  background: rgba(30,30,46,0.85);
  border-color: rgba(255,255,255,0.05);
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.12);
}

body.dark .card:hover {
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
}

.card img {
  border-radius: 14px;
  margin-bottom: 18px;
  transition: transform 0.4s;
}

.card:hover img {
  transform: scale(1.02);
}

.card h3 {
  margin-bottom: 12px;
  font-size: 1.3em;
  font-weight: 600;
}

.card p {
  color: #555;
  font-size: 0.95em;
  line-height: 1.7;
}

body.dark .card p {
  color: #bbb;
}

.btn-more {
  display: inline-block;
  margin-top: 16px;
  color: #4a90d9;
  font-weight: 600;
  transition: color 0.3s, transform 0.2s;
}

.btn-more:hover {
  color: #2a6bb5;
  transform: translateX(4px);
}

/* ===== Carousel ===== */
.carousel {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  margin: 50px 0;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.carousel-inner {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.carousel-item {
  min-width: 100%;
}

.carousel-item img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  border-radius: 24px;
}

.carousel-controls {
  position: absolute;
  top: 50%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
  padding: 0 15px;
  pointer-events: none;
}

.carousel-btn {
  background: rgba(0,0,0,0.35);
  color: white;
  border: none;
  padding: 14px 20px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 22px;
  transition: background 0.3s, transform 0.2s;
  pointer-events: auto;
  backdrop-filter: blur(4px);
}

.carousel-btn:hover {
  background: rgba(0,0,0,0.6);
  transform: scale(1.1);
}

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

.faq-item {
  border-bottom: 1px solid #ddd;
  padding: 18px 0;
  cursor: pointer;
  transition: border-color 0.3s;
}

body.dark .faq-item {
  border-color: #333;
}

.faq-question {
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.05em;
  transition: color 0.3s;
}

.faq-item:hover .faq-question {
  color: #4a90d9;
}

.faq-question span {
  transition: transform 0.3s;
  font-size: 0.9em;
}

.faq-item.active .faq-question span {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s ease, padding 0.45s ease;
  padding-top: 0;
  color: #666;
  line-height: 1.7;
}

body.dark .faq-answer {
  color: #aaa;
}

.faq-item.active .faq-answer {
  max-height: 300px;
  padding-top: 16px;
}

/* ===== Footer ===== */
footer {
  background: linear-gradient(135deg, #1a1a2e, #0f0f1a);
  color: #ccc;
  padding: 50px 0 30px;
}

body.dark footer {
  background: linear-gradient(135deg, #0a0a14, #050510);
}

footer .container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
}

footer h4 {
  color: white;
  margin-bottom: 18px;
  font-size: 1.1em;
  position: relative;
  padding-bottom: 8px;
}

footer h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 2px;
  background: #4a90d9;
}

footer p {
  margin-bottom: 8px;
  font-size: 0.9em;
}

footer a {
  color: #aaa;
  display: block;
  margin-bottom: 8px;
  transition: color 0.3s, transform 0.2s;
}

footer a:hover {
  color: #4a90d9;
  transform: translateX(3px);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 35px;
  padding-top: 22px;
  text-align: center;
  font-size: 0.85em;
  color: #888;
}

.footer-bottom p {
  margin-bottom: 6px;
}

/* ===== Back to top ===== */
.back-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: linear-gradient(135deg, #4a90d9, #3a7bc8);
  color: white;
  border: none;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  font-size: 24px;
  cursor: pointer;
  display: none;
  z-index: 99;
  box-shadow: 0 6px 20px rgba(74,144,217,0.4);
  transition: transform 0.3s, box-shadow 0.3s;
  line-height: 52px;
  text-align: center;
}

.back-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(74,144,217,0.5);
}

/* ===== Animations ===== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.count-up {
  font-size: 2.5em;
  font-weight: 700;
  color: #4a90d9;
  transition: color 0.3s;
}

/* ===== Alternating section backgrounds ===== */
section:nth-child(even) {
  background: #f0f4ff;
}

body.dark section:nth-child(even) {
  background: #14141f;
}

/* Section background override for inline style */
section[style*="background"] {
  background: #f0f4ff !important;
}

body.dark section[style*="background"] {
  background: #14141f !important;
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
  .hero h1 {
    font-size: 2.4em;
  }
  .hero p {
    font-size: 1.1em;
  }
}

@media (max-width: 768px) {
  nav ul {
    display: none;
    flex-direction: column;
    background: rgba(26,26,46,0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: absolute;
    top: 65px;
    left: 0;
    width: 100%;
    padding: 25px 20px;
    gap: 18px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    z-index: 200;
    border-radius: 0 0 20px 20px;
  }

  body.dark nav ul {
    background: rgba(10,10,20,0.98);
  }

  nav ul.show {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }

  .hero {
    padding: 70px 0 60px;
  }

  .hero h1 {
    font-size: 1.8em;
  }

  .hero p {
    font-size: 1em;
    margin-bottom: 25px;
  }

  .hero .btn {
    padding: 14px 36px;
    font-size: 1em;
  }

  .search-box input {
    width: 100px;
  }

  .search-box input:focus {
    width: 140px;
  }

  .section-title h2 {
    font-size: 1.7em;
  }

  .card-grid {
    gap: 20px;
  }

  .card {
    padding: 20px;
  }

  .carousel-item img {
    height: 250px;
  }

  footer .container {
    grid-template-columns: 1fr 1fr;
    gap: 25px;
  }

  .back-top {
    width: 44px;
    height: 44px;
    font-size: 20px;
    line-height: 44px;
    bottom: 20px;
    right: 20px;
  }
}

@media (max-width: 480px) {
  .header-inner {
    gap: 6px;
  }

  .logo svg {
    height: 32px;
  }

  .hero h1 {
    font-size: 1.5em;
  }

  .hero p {
    font-size: 0.95em;
  }

  .section-title h2 {
    font-size: 1.4em;
  }

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

  footer .container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  footer h4::after {
    left: 50%;
    transform: translateX(-50%);
  }

  .search-box input {
    width: 80px;
  }

  .search-box input:focus {
    width: 110px;
  }

  .dark-toggle {
    font-size: 14px;
    padding: 4px 10px;
  }
}

/* ===== Helper ===== */
@media (min-width: 769px) {
  .menu-toggle {
    display: none !important;
  }
}