/*! HTML5 Boilerplate v9.0.1 | MIT License | https://html5boilerplate.com/ */

/* main.css 3.0.0 | MIT License | https://github.com/h5bp/main.css#readme */
/*
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

html {
  color: #222;
  font-size: 1em;
  line-height: 1.4;
  scroll-behavior: smooth;
}

/*
 * Remove text-shadow in selection highlight:
 * https://twitter.com/miketaylr/status/12228805301
 *
 * Customize the background color to match your design.
 */

::-moz-selection {
  background: #b3d4fc;
  text-shadow: none;
}

::selection {
  background: #b3d4fc;
  text-shadow: none;
}

/*
 * A better looking default horizontal rule
 */

hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid #ccc;
  margin: 1em 0;
  padding: 0;
}

/*
 * Remove the gap between audio, canvas, iframes,
 * images, videos and the bottom of their containers:
 * https://github.com/h5bp/html5-boilerplate/issues/440
 */

audio,
canvas,
iframe,
img,
svg,
video {
  vertical-align: middle;
  max-width: 100%;
}

/*
 * Remove default fieldset styles.
 */

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
  resize: vertical;
}

/* ==========================================================================
   Author's custom styles
   ========================================================================== */
:root {
  /* 品牌主色调 - 科技蓝 */
  --primary-color: #1a73e8;
  --primary-light: #e8f0fe;
  --primary-dark: #0d47a1;
  --primary-gradient: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);

  /* 辅助色 */
  --secondary-color: #ff9800;
  --secondary-light: #fff3e0;

  /* 中性色 */
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --text-light: #80868b;
  --background-color: #ffffff;
  --surface-color: #f8f9fa;
  --border-color: #dadce0;

  /* 功能色 */
  --success-color: #0f9d58;
  --warning-color: #f4b400;
  --error-color: #db4437;

  /* 尺寸系统 */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-xxl: 48px;

  /* 边框与阴影 */
  --border-radius-sm: 4px;
  --border-radius-md: 8px;
  --border-radius-lg: 16px;
  --border-radius-full: 50%;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);

  /* 过渡与动画 */
  --transition-fast: all 0.2s ease;
  --transition-standard: all 0.3s ease;
  --transition-slow: all 0.5s ease;
  --animation-delay-sm: 100ms;
  --animation-delay-md: 300ms;

  /* 字体系统 */
  --font-primary: 'Inter', 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --font-display: 'Montserrat', 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 12px;
  --font-size-sm: 14px;
  --font-size-md: 16px;
  --font-size-lg: 18px;
  --font-size-xl: 24px;
  --font-size-xxl: 32px;
  --font-size-xxxl: 48px;
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-loose: 1.8;
}

/* 全局样式重置与基础设置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-md);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background-color: var(--surface-color);
  overflow-x: hidden;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4eaf5 100%);
  background-attachment: fixed;
}

/* 容器样式 */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* 按钮样式系统 */
.btn {
  display: inline-block;
  padding: 10px 24px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: var(--transition-standard);
  border: none;
  font-size: var(--font-size-md);
}

.primary-btn {
  background: var(--primary-gradient);
  color: white;
  box-shadow: var(--shadow-md);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.secondary-btn {
  background-color: white;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.secondary-btn:hover {
  background-color: var(--primary-light);
}

.tertiary-btn {
  background-color: transparent;
  color: var(--primary-color);
}

.tertiary-btn:hover {
  background-color: var(--primary-light);
}

/* 导航栏样式 */
.site-header {
  background-color: white;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
}

.logo img {
  height: 40px;
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 24px;
}

.main-nav a {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  transition: var(--transition-standard);
  padding: 8px 0;
  position: relative;
}

.main-nav a.active {
  color: var(--primary-color);
}

.main-nav a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--primary-color);
  border-radius: 2px;
}

.main-nav a:hover:not(.active) {
  color: var(--primary-color);
}

.subscribe-btn {
  padding: 8px 20px !important;
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 101;
}

.mobile-menu-btn span {
  width: 30px;
  height: 3px;
  background-color: var(--text-primary);
  border-radius: 3px;
  transition: var(--transition-standard);
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* 英雄区域样式 */
.hero-section {
  padding: var(--spacing-xxl) 0;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4eaf5 100%);
  position: relative;
  overflow: hidden;
}

.hero-section .container {
  display: flex;
  align-items: center;
  position: relative;
  z-index: 2;
}

.hero-content {
  flex: 1;
  padding-right: var(--spacing-xl);
}

.hero-content h1 {
  font-family: var(--font-display);
  font-size: var(--font-size-xxxl);
  line-height: var(--line-height-tight);
  margin-bottom: var(--spacing-lg);
  color: var(--text-primary);
}

.hero-subtitle {
  font-size: var(--font-size-xl);
  color: var(--text-secondary);
  margin-bottom: var(--spacing-xl);
  max-width: 600px;
}

.cta-buttons {
  display: flex;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
  flex-wrap: wrap;
}

.scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-light);
  font-size: var(--font-size-sm);
  animation: bounce 2s infinite;
}

.scroll-icon {
  width: 24px;
  height: 24px;
  border: 2px solid var(--text-light);
  border-radius: 50%;
  margin-top: var(--spacing-sm);
  position: relative;
}

.scroll-icon::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 8px;
  width: 4px;
  height: 4px;
  background-color: var(--text-light);
  border-radius: 50%;
  animation: scroll-down 1.5s infinite;
}

.hero-image {
  flex: 1;
  display: flex;
  justify-content: center;
}

.hero-image img {
  width: 100%;
  max-width: 500px;
  height: auto;
  animation: float 6s ease-in-out infinite;
}

/* 关于区域样式 */
.about-section {
  padding: var(--spacing-xxl) 0;
  background-color: white;
}

/* 特色区块样式 */
.features-section {
  padding: var(--spacing-xxl) 0;
  background-color: var(--surface-color);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-xl);
  margin-top: var(--spacing-xl);
}

.feature-card {
  padding: var(--spacing-xl);
  background-color: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  text-align: center;
  transition: var(--transition-standard);
  height: 100%;
  display: flex;
  flex-direction: column;
}

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

.feature-icon {
  font-size: 3.5rem;
  margin-bottom: var(--spacing-lg);
  color: var(--primary-color);
  background: var(--primary-light);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
}

.feature-card h3 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--spacing-md);
}

.feature-card p {
  color: var(--text-secondary);
  line-height: var(--line-height-loose);
  flex-grow: 1;
}

/* 内容区块通用样式 */
.section-header {
  text-align: center;
  margin-bottom: var(--spacing-xxl);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--font-size-xxl);
  margin-bottom: var(--spacing-md);
}

.section-description {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto;
}

.about-content {
  display: flex;
  align-items: center;
  gap: var(--spacing-xxl);
}

.about-text {
  flex: 1;
}

.about-text p {
  margin-bottom: var(--spacing-lg);
  font-size: var(--font-size-lg);
}

.features-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
  margin-top: var(--spacing-xl);
}

.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--spacing-md);
}

.about-visual {
  flex: 1;
  display: flex;
  justify-content: center;
}

.about-visual img {
  width: 100%;
  max-width: 400px;
  height: auto;
}

/* 动画效果定义 */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
  40% {transform: translateY(-10px);}
  60% {transform: translateY(-5px);}
}

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

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

@keyframes pulse {
  0% {transform: scale(1);}
  50% {transform: scale(1.05);}
  100% {transform: scale(1);}
}

@keyframes scroll-down {
  0% {transform: translateY(0); opacity: 1;}
  100% {transform: translateY(8px); opacity: 0;}
}

/* 文章卡片动画 */
.article-card {
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
  background-color: white;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  position: relative;
}

.article-card:nth-child(1) {animation-delay: 100ms;}
.article-card:nth-child(2) {animation-delay: 200ms;}
.article-card:nth-child(3) {animation-delay: 300ms;}
.article-card:nth-child(4) {animation-delay: 400ms;}
.article-card:nth-child(5) {animation-delay: 500ms;}
.article-card:nth-child(6) {animation-delay: 600ms;}

/* 特性项动画 */
.feature-item {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}

.features-list .feature-item:nth-child(1) {animation-delay: 100ms;}
.features-list .feature-item:nth-child(2) {animation-delay: 200ms;}
.features-list .feature-item:nth-child(3) {animation-delay: 300ms;}

/* 悬停动画效果 */
.card-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* 按钮动画 */
.animate-pulse {
  animation: pulse 2s infinite;
}

/* 滚动显示动画 */
.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* 关注区块样式增强 */
.subscribe-section {
  text-align: center;
  padding: var(--spacing-xxl) 0;
  background: var(--primary-gradient);
  color: white;
}

.subscribe-content {
  max-width: 800px;
  margin: 0 auto;
}

.qrcode-container {
  margin: var(--spacing-xl) 0;
}

.qrcode-container img {
  width: 200px;
  height: 200px;
  border: 5px solid white;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-lg);
  margin-bottom: var(--spacing-md);
}

.benefits-list {
  text-align: left;
  margin: var(--spacing-lg) auto;
  max-width: 400px;
  list-style: none;
}

.benefits-list li {
  margin-bottom: var(--spacing-sm);
  font-size: var(--font-size-lg);
}

/* 回到顶部按钮样式 */
.back-to-top-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  border: none;
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top-btn.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top-btn:hover {
  background-color: var(--primary-dark);
  transform: scale(1.05);
}

/* 特色栏目链接样式 */
.feature-link {
  display: inline-block;
  margin-top: var(--spacing-md);
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s ease;
}

.feature-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* 特色栏目文字优化 */
.features-section .feature-card p {
  margin-bottom: var(--spacing-md);
  line-height: 1.6;
}

/* 内容区块优化 */
section {
  margin-bottom: var(--spacing-xxl);
  padding: var(--spacing-xxl) 0;
  border-radius: var(--border-radius-lg);
  background-color: white;
  box-shadow: var(--shadow-md);
}

/* 分类筛选按钮样式 */
.category-filter {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.filter-btn {
  background-color: var(--surface-color);
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition-standard);
  color: var(--text-secondary);
}

.filter-btn.active {
  background-color: var(--primary-color);
  color: white;
}

.filter-btn:hover:not(.active) {
  background-color: var(--primary-light);
  color: var(--primary-color);
}

/* 响应式设计 - 多断点适配 */
@media (max-width: 1024px) {
  .features-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* 基础样式调整 */
  :root {
    --font-size-xxxl: 32px;
    --font-size-xxl: 24px;
    --font-size-xl: 20px;
    --font-size-lg: 16px;
    --spacing-xl: 24px;
    --spacing-xxl: 32px;
  }

  /* 导航栏调整 */
  .main-nav {
    display: none;
  }

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

  .subscribe-btn {
    display: none;
  }

  /* 英雄区域调整 */
  .hero-section .container {
    flex-direction: column;
    text-align: center;
  }

  .hero-content {
    padding-right: 0;
    margin-bottom: var(--spacing-xl);
  }

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

  /* 关于区域调整 */
  .about-content {
    flex-direction: column-reverse;
    gap: var(--spacing-xl);
  }

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

  /* 文章区域调整 */
  .articles-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  /* 移动端菜单样式 */
  .main-nav.active {
    display: block;
  }

  .main-nav ul {
    flex-direction: column;
    gap: var(--spacing-md);
  }

  .main-nav a {
    display: block;
    padding: var(--spacing-sm) 0;
  }

  /* 卡片组件调整 */
  .dashboard-card {
    padding: var(--spacing-md);
  }

  /* 按钮适配 */
  .btn {
    padding: 8px 16px;
    font-size: var(--font-size-sm);
  }
}

@media (max-width: 480px) {
  .features-list {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: var(--font-size-xl);
  }

  .hero-content h1 {
    font-size: var(--font-size-xxl);
  }

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

  .btn {
    width: 100%;
    max-width: 280px;
  }
}
