/* ===== 全局重置与基础样式 ===== */
*,
*::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, "Noto Sans SC", sans-serif;
  line-height: 1.6;
  color: #333;
  background: #f8f9fa;
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

a {
  color: #2a7f2e;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #1b5e20;
}

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

ul, ol {
  list-style: none;
  padding: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; margin-bottom: 1.5rem; }
h3 { font-size: 1.5rem; margin-bottom: 0.75rem; }

p {
  margin-bottom: 1rem;
}

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

body.dark-mode a {
  color: #81c784;
}

body.dark-mode a:hover {
  color: #a5d6a7;
}

body.dark-mode header,
body.dark-mode footer,
body.dark-mode .product-card,
body.dark-mode .service-card,
body.dark-mode .case-gallery figure,
body.dark-mode .news article,
body.dark-mode .latest-articles article,
body.dark-mode .sidebar,
body.dark-mode .breadcrumb,
body.dark-mode .faq details,
body.dark-mode .howto,
body.dark-mode .author-info,
body.dark-mode .company-intro,
body.dark-mode .related,
body.dark-mode .latest-updates,
body.dark-mode .contact {
  background: #1e1e1e;
  color: #e0e0e0;
  border-color: #333;
}

body.dark-mode .btn {
  background: #388e3c;
  color: #fff;
}

body.dark-mode .btn:hover {
  background: #2e7d32;
}

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

body.dark-mode input[type="text"] {
  background: #2c2c2c;
  color: #e0e0e0;
  border: 1px solid #444;
}

/* ===== 容器 ===== */
.header-container,
main,
.footer-content,
.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== 页眉 ===== */
header {
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body.dark-mode header {
  background: rgba(30,30,30,0.95);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  flex-wrap: wrap;
}

.logo a {
  display: block;
  line-height: 0;
}

.logo img {
  width: 180px;
  height: auto;
}

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

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

nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

nav ul {
  display: flex;
  gap: 10px;
  list-style: none;
}

nav ul li a {
  padding: 8px 14px;
  border-radius: 30px;
  font-weight: 500;
  transition: background 0.3s ease, color 0.3s ease;
}

nav ul li a:hover {
  background: #e8f5e9;
  color: #1b5e20;
}

body.dark-mode nav ul li a:hover {
  background: #2e7d32;
  color: #fff;
}

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

.search-box input {
  padding: 8px 16px;
  border: 1px solid #ddd;
  border-radius: 30px;
  font-size: 0.9rem;
  outline: none;
  transition: border 0.3s ease, box-shadow 0.3s ease;
  width: 180px;
}

.search-box input:focus {
  border-color: #2a7f2e;
  box-shadow: 0 0 0 3px rgba(42,127,46,0.15);
}

.search-box button {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 5px 10px;
  transition: transform 0.2s ease;
}

.search-box button:hover {
  transform: scale(1.1);
}

/* ===== Hero Banner ===== */
.hero-banner {
  position: relative;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 0 0 40px 40px;
  margin-bottom: 40px;
  background: linear-gradient(135deg, #ff7e5f 0%, #feb47b 100%);
}

.hero-banner .hero-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #fff;
  padding: 40px 20px;
  max-width: 800px;
  animation: fadeInUp 1s ease-out;
}

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

.hero-content p {
  font-size: 1.3rem;
  margin-bottom: 2rem;
  text-shadow: 0 1px 5px rgba(0,0,0,0.2);
}

.btn {
  display: inline-block;
  padding: 14px 36px;
  background: #fff;
  color: #2a7f2e;
  font-weight: 700;
  border-radius: 50px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  text-decoration: none;
}

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

body.dark-mode .btn {
  background: #388e3c;
  color: #fff;
}

body.dark-mode .btn:hover {
  background: #2e7d32;
}

/* ===== 面包屑 ===== */
.breadcrumb {
  background: #fff;
  padding: 12px 24px;
  border-radius: 12px;
  margin-bottom: 30px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  font-size: 0.9rem;
  transition: background 0.3s ease;
}

.breadcrumb a {
  color: #2a7f2e;
}

.breadcrumb span {
  color: #888;
}

/* ===== 通用区块 ===== */
section {
  margin-bottom: 50px;
  padding: 30px 0;
}

section h2 {
  position: relative;
  display: inline-block;
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
}

section h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, #2a7f2e, #81c784);
  border-radius: 2px;
}

body.dark-mode section h2::after {
  background: linear-gradient(90deg, #388e3c, #81c784);
}

/* ===== 品牌介绍 ===== */
.brand-intro {
  background: #fff;
  padding: 40px;
  border-radius: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  transition: background 0.3s ease, transform 0.3s ease;
}

.brand-intro:hover {
  transform: translateY(-2px);
}

body.dark-mode .brand-intro {
  background: #1e1e1e;
}

/* ===== 产品网格 ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.product-card {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  cursor: pointer;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.product-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.product-card h3 {
  padding: 16px 20px 0;
  font-size: 1.3rem;
}

.product-card p {
  padding: 0 20px 20px;
  color: #666;
}

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

/* ===== 服务卡片 ===== */
.service-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 25px;
}

.service-card {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.9);
}

body.dark-mode .service-card {
  background: rgba(30,30,30,0.7);
  border-color: rgba(255,255,255,0.1);
}

body.dark-mode .service-card:hover {
  background: rgba(40,40,40,0.9);
}

/* ===== 优势列表 ===== */
.advantages ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.advantages li {
  background: #fff;
  padding: 20px 24px;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  transition: transform 0.3s ease, background 0.3s ease;
  font-size: 1rem;
}

.advantages li:hover {
  transform: translateY(-3px);
  background: #f1f8e9;
}

body.dark-mode .advantages li {
  background: #1e1e1e;
}

body.dark-mode .advantages li:hover {
  background: #2e7d32;
}

.advantages li strong {
  color: #2a7f2e;
}

body.dark-mode .advantages li strong {
  color: #81c784;
}

/* ===== 案例展示 ===== */
.case-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 25px;
}

.case-gallery figure {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.case-gallery figure:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.case-gallery img {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

.case-gallery figcaption {
  padding: 15px 20px;
  font-weight: 600;
  text-align: center;
  color: #333;
}

body.dark-mode .case-gallery figcaption {
  color: #e0e0e0;
}

/* ===== 新闻 & 文章 ===== */
.news article,
.latest-articles article {
  background: #fff;
  padding: 24px;
  margin-bottom: 20px;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  transition: transform 0.3s ease, background 0.3s ease;
}

.news article:hover,
.latest-articles article:hover {
  transform: translateX(5px);
  background: #f9fbe7;
}

body.dark-mode .news article:hover,
body.dark-mode .latest-articles article:hover {
  background: #2e7d32;
}

.news time,
.latest-articles time {
  font-size: 0.85rem;
  color: #888;
  display: block;
  margin-top: 10px;
}

body.dark-mode .news time,
body.dark-mode .latest-articles time {
  color: #aaa;
}

/* ===== 热门推荐 ===== */
.hot-recommend ul,
.related ul,
.latest-updates ul,
.sidebar ul {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hot-recommend li,
.related li,
.latest-updates li,
.sidebar li {
  background: #fff;
  padding: 10px 20px;
  border-radius: 30px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: transform 0.3s ease, background 0.3s ease;
}

.hot-recommend li:hover,
.related li:hover,
.latest-updates li:hover,
.sidebar li:hover {
  transform: translateY(-2px);
  background: #e8f5e9;
}

body.dark-mode .hot-recommend li,
body.dark-mode .related li,
body.dark-mode .latest-updates li,
body.dark-mode .sidebar li {
  background: #1e1e1e;
}

body.dark-mode .hot-recommend li:hover,
body.dark-mode .related li:hover,
body.dark-mode .latest-updates li:hover,
body.dark-mode .sidebar li:hover {
  background: #2e7d32;
}

/* ===== FAQ ===== */
.faq details {
  background: #fff;
  border-radius: 14px;
  margin-bottom: 12px;
  padding: 16px 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: background 0.3s ease, transform 0.2s ease;
  cursor: pointer;
}

.faq details:hover {
  transform: translateX(3px);
}

.faq summary {
  font-weight: 600;
  font-size: 1.05rem;
  outline: none;
  cursor: pointer;
  padding: 4px 0;
}

.faq details[open] summary {
  color: #2a7f2e;
}

body.dark-mode .faq details[open] summary {
  color: #81c784;
}

.faq details p {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eee;
  color: #555;
}

body.dark-mode .faq details p {
  color: #aaa;
  border-color: #333;
}

/* ===== HowTo ===== */
.howto {
  background: #fff;
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.howto ol {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
}

.howto ol li {
  counter-increment: step;
  padding: 12px 0 12px 40px;
  position: relative;
  font-size: 1rem;
  border-bottom: 1px solid #f0f0f0;
}

.howto ol li:last-child {
  border-bottom: none;
}

.howto ol li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, #2a7f2e, #66bb6a);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

body.dark-mode .howto ol li {
  border-color: #333;
}

/* ===== 联系 & 作者 ===== */
.contact,
.author-info,
.company-intro {
  background: #fff;
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  margin-bottom: 30px;
}

.contact address {
  font-style: normal;
  line-height: 2;
}

/* ===== 侧边栏 ===== */
.sidebar {
  background: #fff;
  padding: 24px;
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  margin-bottom: 30px;
}

.sidebar ul {
  flex-direction: column;
  gap: 8px;
}

.sidebar li {
  width: 100%;
  text-align: center;
}

/* ===== 页脚 ===== */
footer {
  background: #1b1b1b;
  color: #ccc;
  padding: 40px 0 20px;
  margin-top: 50px;
}

body.dark-mode footer {
  background: #0a0a0a;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid #333;
}

.footer-content h3 {
  color: #fff;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

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

.footer-contact p {
  margin-bottom: 6px;
  color: #aaa;
}

.footer-qr {
  text-align: center;
}

.footer-qr img {
  margin: 10px auto;
  border-radius: 8px;
  background: #fff;
  padding: 5px;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  font-size: 0.85rem;
  color: #888;
}

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

/* ===== 返回顶部 ===== */
#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #2a7f2e, #66bb6a);
  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;
  z-index: 999;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#back-to-top:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* ===== 动画 ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 滚动入场动画（通用） */
section {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
}

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

/* ===== 响应式 ===== */
@media (max-width: 992px) {
  .header-container {
    flex-direction: row;
    align-items: center;
  }

  nav {
    flex-direction: column;
    width: 100%;
    display: none;
    padding-top: 10px;
  }

  nav.active {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }

  nav ul {
    flex-direction: column;
    width: 100%;
    gap: 5px;
  }

  nav ul li a {
    display: block;
    text-align: center;
    padding: 12px;
    border-radius: 8px;
  }

  .search-box {
    width: 100%;
    margin-top: 10px;
  }

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

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

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

  .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  .hero-banner {
    min-height: 350px;
    border-radius: 0 0 24px 24px;
  }

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

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

  .btn {
    padding: 12px 28px;
    font-size: 0.9rem;
  }

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

  .service-cards {
    grid-template-columns: 1fr;
  }

  .case-gallery {
    grid-template-columns: 1fr;
  }

  .advantages ul {
    grid-template-columns: 1fr;
  }

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

  .footer-links ul {
    align-items: center;
  }

  .breadcrumb {
    font-size: 0.8rem;
    padding: 10px 16px;
  }

  section {
    padding: 20px 0;
  }

  .brand-intro,
  .contact,
  .author-info,
  .company-intro,
  .howto {
    padding: 20px;
  }

  #back-to-top {
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 1.6rem;
  }

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

  .btn {
    padding: 10px 22px;
    font-size: 0.85rem;
  }

  .product-card h3 {
    font-size: 1.1rem;
  }

  .footer-content {
    gap: 20px;
  }
}