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

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

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

a {
  color: inherit;
  text-decoration: none;
}

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

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

/* 头部 */
header {
  background: linear-gradient(135deg, #1a73e8 0%, #6c63ff 100%);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

body.dark header {
  background: linear-gradient(135deg, #0d47a1 0%, #3a2d7a 100%);
}

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

.logo {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.logo span {
  color: #ffd700;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

nav a {
  color: #fff;
  font-weight: 500;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: 0.3s;
}

nav a:hover, nav a.active {
  border-bottom-color: #ffd700;
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  background: none;
  border: none;
  padding: 5px;
}

.hamburger span {
  width: 28px;
  height: 3px;
  background: #fff;
  margin: 4px 0;
  border-radius: 2px;
  transition: 0.3s;
}

.search-box {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.2);
  border-radius: 25px;
  padding: 0.3rem 1rem;
}

.search-box input {
  background: none;
  border: none;
  color: #fff;
  outline: none;
  padding: 0.3rem;
  width: 140px;
}

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

.search-box button {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 1.1rem;
}

.theme-toggle {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  padding: 0.5rem 0.8rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 1rem;
  transition: 0.3s;
}

/* Hero区域 - 渐变Banner */
.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 4rem 0;
  text-align: center;
  color: #fff;
  border-radius: 0 0 3rem 3rem;
  margin-bottom: 2rem;
}

body.dark .hero {
  background: linear-gradient(135deg, #2a2a5a 0%, #1a1a3a 100%);
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  text-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.hero p {
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto 2rem;
  opacity: 0.9;
}

.hero .btn {
  display: inline-block;
  padding: 0.8rem 2.5rem;
  background: #ffd700;
  color: #1a1a2e;
  border-radius: 30px;
  font-weight: 700;
  font-size: 1.1rem;
  transition: 0.3s;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

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

/* 面包屑 */
.breadcrumb {
  padding: 1rem 0;
  font-size: 0.9rem;
  color: #666;
}

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

.breadcrumb a {
  color: #1a73e8;
}

body.dark .breadcrumb a {
  color: #82b1ff;
}

/* 通用段落 */
.section {
  padding: 3rem 0;
}

.section-title {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: #1a73e8;
  margin: 0.5rem auto;
  border-radius: 2px;
}

body.dark .section-title::after {
  background: #82b1ff;
}

/* 卡片网格 - 圆角卡片 + hover动画 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.card {
  background: #fff;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  transition: 0.3s;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
}

body.dark .card {
  background: rgba(30,30,60,0.8);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

.card h3 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.card p {
  color: #555;
}

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

.card img {
  border-radius: 12px;
  margin-bottom: 1rem;
}

/* 毛玻璃效果 */
.glass {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  padding: 2rem;
  border: 1px solid rgba(255,255,255,0.3);
}

body.dark .glass {
  background: rgba(20,20,40,0.7);
  border-color: rgba(255,255,255,0.1);
}

/* 文章列表 */
.article-list article {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #e0e0e0;
}

body.dark .article-list article {
  border-color: #333;
}

.article-list h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.article-list .meta {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 0.8rem;
}

/* FAQ */
.faq-item {
  margin-bottom: 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
}

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

.faq-question {
  background: #f1f3f5;
  padding: 1rem 1.5rem;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: 0.3s;
}

body.dark .faq-question {
  background: #1e1e3a;
}

.faq-question:hover {
  background: #e0e4e8;
}

body.dark .faq-question:hover {
  background: #2a2a4a;
}

.faq-answer {
  padding: 1rem 1.5rem;
  display: none;
}

.faq-answer.active {
  display: block;
}

/* HowTo */
.howto-steps {
  counter-reset: step;
}

.howto-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 12px;
}

body.dark .howto-step {
  background: #1a1a2e;
}

.howto-step::before {
  counter-increment: step;
  content: counter(step);
  background: #1a73e8;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

/* 推荐网格 */
.recommend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.recommend-item {
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
  transition: 0.3s;
}

body.dark .recommend-item {
  background: #1e1e3a;
}

.recommend-item:hover {
  transform: scale(1.02);
}

/* 页脚 */
footer {
  background: #1a1a2e;
  color: #ccc;
  padding: 3rem 0;
  margin-top: 3rem;
}

body.dark footer {
  background: #0a0a14;
}

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

.footer-grid h4 {
  color: #fff;
  margin-bottom: 1rem;
}

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

.footer-grid li {
  margin-bottom: 0.5rem;
}

.footer-grid a {
  color: #aaa;
  transition: 0.3s;
}

.footer-grid a:hover {
  color: #ffd700;
}

.footer-bottom {
  border-top: 1px solid #333;
  margin-top: 2rem;
  padding-top: 2rem;
  text-align: center;
  font-size: 0.85rem;
}

/* 返回顶部按钮 */
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  transition: 0.3s;
}

.scroll-top:hover {
  background: #1557b0;
  transform: translateY(-3px);
}

/* 滚动动画（默认透明，通过IntersectionObserver添加类） */
.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* 响应式 - 手机自适应 */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  nav ul {
    display: none;
    flex-direction: column;
    width: 100%;
    background: rgba(0,0,0,0.2);
    padding: 1rem;
    border-radius: 12px;
    margin-top: 1rem;
  }

  nav ul.open {
    display: flex;
  }

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

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

  .header-inner {
    gap: 0.5rem;
  }

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

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

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