/* ===== 全局基础样式 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #222;
  background: #fff;
  transition: background 0.3s, color 0.3s;
}

a {
  color: #1a73e8;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #1557b0;
}

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

ul {
  list-style: none;
}

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

/* ===== 头部导航 ===== */
header {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.3s, border-color 0.3s;
}

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

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1a73e8;
  background: linear-gradient(135deg, #1a73e8, #0d47a1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-menu {
  display: flex;
  gap: 25px;
  list-style: none;
}

.nav-menu a {
  color: #333;
  font-weight: 500;
  padding: 5px 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

.nav-menu a:hover {
  border-bottom-color: #1a73e8;
  color: #1a73e8;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: #333;
  padding: 0 5px;
}

/* 搜索框和暗色模式按钮 */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box {
  display: flex;
  align-items: center;
  position: relative;
}

.search-box input {
  padding: 8px 35px 8px 15px;
  border: 1px solid #ccc;
  border-radius: 20px;
  font-size: 0.9rem;
  outline: none;
  width: 180px;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #f5f5f5;
}

.search-box input:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
  background: #fff;
}

.search-box button {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  position: absolute;
  right: 8px;
  color: #888;
  transition: color 0.2s;
}

.search-box button:hover {
  color: #1a73e8;
}

.dark-mode-toggle {
  background: none;
  border: 1px solid #ccc;
  border-radius: 20px;
  padding: 5px 15px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.dark-mode-toggle:hover {
  background: #f0f0f0;
  border-color: #1a73e8;
}

/* ===== Banner 轮播 ===== */
.banner-slider {
  position: relative;
  overflow: hidden;
  height: 420px;
  background: linear-gradient(135deg, #e8f0fe, #d0e1fd);
  display: flex;
  align-items: center;
  justify-content: center;
}

.banner-slide {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  padding: 20px;
  text-align: center;
  background: linear-gradient(135deg, rgba(232, 240, 254, 0.9), rgba(208, 225, 253, 0.9));
}

.banner-slide.active {
  opacity: 1;
}

.banner-slide h2 {
  font-size: 2.8rem;
  color: #1a73e8;
  margin-bottom: 15px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.banner-slide p {
  font-size: 1.2rem;
  max-width: 600px;
  color: #555;
  line-height: 1.5;
}

/* ===== Hero 区域 ===== */
.hero {
  background: linear-gradient(135deg, #e8f0fe, #f0f4ff);
  padding: 80px 0;
  text-align: center;
  position: relative;
}

.hero h1 {
  font-size: 2.8rem;
  color: #1a73e8;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #1a73e8, #0d47a1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto 30px;
  color: #555;
}

.hero .btn {
  display: inline-block;
  background: linear-gradient(135deg, #1a73e8, #1557b0);
  color: #fff;
  padding: 14px 40px;
  border-radius: 30px;
  font-size: 1.1rem;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(26, 115, 232, 0.3);
}

.hero .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 115, 232, 0.4);
}

/* ===== 通用 Section ===== */
.section {
  padding: 60px 0;
}

.section h2 {
  font-size: 2rem;
  color: #1a73e8;
  margin-bottom: 30px;
  text-align: center;
  position: relative;
}

.section h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #1a73e8, #4dabf7);
  margin: 10px auto 0;
  border-radius: 2px;
}

/* ===== 网格布局 ===== */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 25px;
}

.grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 20px;
}

/* ===== 卡片样式（毛玻璃 + 圆角） ===== */
.card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 25px;
  transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.9);
}

.card h3 {
  color: #1a73e8;
  margin-bottom: 12px;
  font-size: 1.2rem;
}

.card p {
  color: #555;
  line-height: 1.6;
}

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

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

.faq-question {
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #333;
  padding: 5px 0;
  transition: color 0.2s;
}

.faq-question:hover {
  color: #1a73e8;
}

.faq-question::after {
  content: "+";
  font-size: 1.4rem;
  transition: transform 0.3s, content 0.3s;
  color: #1a73e8;
}

.faq-item.active .faq-question::after {
  content: "−";
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s;
  color: #555;
  margin-top: 0;
  padding: 0 15px;
  line-height: 1.6;
}

.faq-item.active .faq-answer {
  max-height: 400px;
  padding: 10px 15px;
}

/* ===== 教程步骤 ===== */
.howto-step {
  background: rgba(240, 244, 255, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border-left: 4px solid #1a73e8;
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 0 12px 12px 0;
  transition: transform 0.2s, box-shadow 0.2s;
}

.howto-step:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.howto-step h4 {
  color: #1a73e8;
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.howto-step p {
  color: #555;
  line-height: 1.6;
}

/* ===== 文章卡片 ===== */
.article-card {
  border-bottom: 1px solid #eee;
  padding: 20px 0;
  transition: padding-left 0.2s;
}

.article-card:last-child {
  border-bottom: none;
}

.article-card:hover {
  padding-left: 10px;
}

.article-card h3 {
  margin-bottom: 6px;
  color: #1a73e8;
  font-size: 1.1rem;
}

.article-card .meta {
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.article-card p {
  color: #555;
  line-height: 1.6;
}

.article-card a {
  color: #1a73e8;
  font-weight: 500;
}

.article-card a:hover {
  text-decoration: underline;
}

/* ===== 联系信息 ===== */
.contact-info p {
  margin: 6px 0;
  color: #555;
}

.contact-info strong {
  color: #333;
}

/* ===== 页脚 ===== */
footer {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: #ccc;
  padding: 40px 0;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

.footer-grid h4 {
  color: #fff;
  margin-bottom: 15px;
  font-size: 1rem;
  position: relative;
  padding-bottom: 8px;
}

.footer-grid h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 2px;
  background: #1a73e8;
}

.footer-grid a {
  color: #aaa;
  display: block;
  margin: 5px 0;
  transition: color 0.2s, padding-left 0.2s;
}

.footer-grid a:hover {
  color: #fff;
  padding-left: 5px;
}

.copyright {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid #444;
  margin-top: 30px;
  color: #888;
  font-size: 0.9rem;
}

.copyright a {
  color: #aaa;
  transition: color 0.2s;
}

.copyright a:hover {
  color: #fff;
}

/* ===== 返回顶部按钮 ===== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: linear-gradient(135deg, #1a73e8, #1557b0);
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s, box-shadow 0.3s;
  border: none;
  z-index: 99;
  box-shadow: 0 4px 15px rgba(26, 115, 232, 0.3);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(26, 115, 232, 0.4);
}

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

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

/* ===== 暗色模式 ===== */
body.dark-mode {
  background: #1a1a2e;
  color: #e0e0e0;
}

body.dark-mode header {
  background: #1a1a2e;
  border-bottom-color: #333;
}

body.dark-mode .logo {
  background: linear-gradient(135deg, #4dabf7, #1a73e8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.dark-mode .nav-menu a {
  color: #e0e0e0;
}

body.dark-mode .nav-menu a:hover {
  border-bottom-color: #4dabf7;
  color: #4dabf7;
}

body.dark-mode .menu-toggle {
  color: #e0e0e0;
}

body.dark-mode .search-box input {
  background: #2a2a3e;
  border-color: #444;
  color: #e0e0e0;
}

body.dark-mode .search-box input:focus {
  border-color: #4dabf7;
  background: #333;
}

body.dark-mode .search-box button {
  color: #aaa;
}

body.dark-mode .dark-mode-toggle {
  border-color: #555;
  color: #e0e0e0;
}

body.dark-mode .dark-mode-toggle:hover {
  background: #2a2a3e;
}

body.dark-mode .banner-slider {
  background: linear-gradient(135deg, #16213e, #1a1a2e);
}

body.dark-mode .banner-slide {
  background: linear-gradient(135deg, rgba(22, 33, 62, 0.9), rgba(26, 26, 46, 0.9));
}

body.dark-mode .banner-slide h2 {
  color: #4dabf7;
}

body.dark-mode .banner-slide p {
  color: #bbb;
}

body.dark-mode .hero {
  background: linear-gradient(135deg, #16213e, #1a1a2e);
}

body.dark-mode .hero h1 {
  background: linear-gradient(135deg, #4dabf7, #1a73e8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

body.dark-mode .section h2 {
  color: #4dabf7;
}

body.dark-mode .section h2::after {
  background: linear-gradient(90deg, #4dabf7, #1a73e8);
}

body.dark-mode .card {
  background: rgba(22, 33, 62, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .card:hover {
  background: rgba(22, 33, 62, 0.9);
}

body.dark-mode .card h3 {
  color: #4dabf7;
}

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

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

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

body.dark-mode .faq-question::after {
  color: #4dabf7;
}

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

body.dark-mode .howto-step {
  background: rgba(22, 33, 62, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border-left-color: #4dabf7;
}

body.dark-mode .howto-step h4 {
  color: #4dabf7;
}

body.dark-mode .howto-step p {
  color: #ccc;
}

body.dark-mode .article-card {
  border-bottom-color: #333;
}

body.dark-mode .article-card h3 {
  color: #4dabf7;
}

body.dark-mode .article-card .meta {
  color: #999;
}

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

body.dark-mode .contact-info p {
  color: #ccc;
}

body.dark-mode .contact-info strong {
  color: #e0e0e0;
}

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

body.dark-mode .back-to-top {
  background: linear-gradient(135deg, #4dabf7, #1a73e8);
}

/* ===== 响应式布局 ===== */
@media (max-width: 992px) {
  .grid-4 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .header-inner {
    position: relative;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 12px 12px;
    z-index: 100;
  }

  body.dark-mode .nav-menu {
    background: #1a1a2e;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  }

  .nav-menu.active {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }

  .header-actions {
    gap: 5px;
  }

  .search-box input {
    width: 120px;
    padding: 6px 30px 6px 10px;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 50px 0;
  }

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

  .banner-slider {
    height: 280px;
  }

  .banner-slide h2 {
    font-size: 1.8rem;
  }

  .banner-slide p {
    font-size: 1rem;
  }

  .section {
    padding: 40px 0;
  }

  .section h2 {
    font-size: 1.6rem;
  }

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

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  .header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

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

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

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

  .banner-slider {
    height: 220px;
  }

  .banner-slide h2 {
    font-size: 1.4rem;
  }
}

/* ===== 额外效果：选中高亮 ===== */
::selection {
  background: #1a73e8;
  color: #fff;
}

body.dark-mode ::selection {
  background: #4dabf7;
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f0f0f0;
}

body.dark-mode ::-webkit-scrollbar-track {
  background: #2a2a3e;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

body.dark-mode ::-webkit-scrollbar-thumb {
  background: #555;
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
  background: #777;
}