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

:root {
  --brand: #0b1a2e;
  --brand-light: #1a3b5c;
  --accent: #f0c040;
  --accent2: #d9a520;
  --glass: rgba(255, 255, 255, 0.08);
  --radius: 20px;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  --bg-card: #ffffff;
  --text: #1e1e2a;
  --text-light: #4a4a5a;
  --bg-dark: #0f172a;
  --card-dark: #1e293b;
  --text-dark: #e2e8f0;
  --hero-gradient-1: #0b1a2e;
  --hero-gradient-2: #1a3b5c;
  --section-bg: #f5f7fc;
  --section-bg-alt: #eef2f9;
  --header-bg: rgba(11, 26, 46, 0.85);
  --header-border: rgba(255, 255, 255, 0.05);
  --footer-bg: #0b1a2e;
  --footer-text: #cbd5e1;
  --footer-link: #94a3b8;
  --stat-bg: rgba(255, 255, 255, 0.9);
  --transition-speed: 0.3s;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--section-bg);
  color: var(--text);
  transition: background var(--transition-speed), color var(--transition-speed);
  scroll-behavior: smooth;
  line-height: 1.6;
}

body.dark {
  background: #0b1120;
  color: var(--text-dark);
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* 玻璃效果通用类 */
.glass {
  background: var(--glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 通用卡片 */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
  padding: 28px 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.dark .card {
  background: var(--card-dark);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

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

/* 按钮通用 */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #0b1a2e;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 40px;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.btn:hover {
  background: #e6b14a;
  transform: scale(1.02);
}

/* 布局辅助 */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

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

/* 标题通用 */
.section-title {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 40px;
  letter-spacing: -0.01em;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--accent);
  margin-top: 8px;
  border-radius: 4px;
}

/* 网格系统 */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

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

/* ===== 头部 ===== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--header-border);
}

body.dark header {
  background: rgba(15, 23, 42, 0.9);
}

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

.logo svg {
  width: 140px;
  height: 40px;
  display: block;
}

.nav-menu {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav-menu a {
  color: #eef2f6;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
  border-bottom-color: var(--accent);
  color: #ffffff;
}

.dark-toggle {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 6px 14px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s ease;
}

.dark-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.8rem;
  cursor: pointer;
}

@media (max-width: 900px) {
  .nav-menu {
    display: none;
    width: 100%;
    flex-direction: column;
    background: rgba(11, 26, 46, 0.98);
    padding: 20px 0;
    margin-top: 12px;
    gap: 16px;
  }

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

  .mobile-toggle {
    display: block;
  }

  .header-inner {
    padding: 10px 0;
  }
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(145deg, var(--hero-gradient-1) 0%, var(--hero-gradient-2) 100%);
  padding: 80px 0 100px;
  color: white;
  text-align: center;
  border-radius: 0 0 60px 60px;
  position: relative;
  overflow: hidden;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  max-width: 900px;
  margin: 0 auto 20px;
  line-height: 1.2;
}

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

.hero .btn {
  font-size: 1.1rem;
}

.hero .glow {
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(240, 192, 64, 0.15), transparent 70%);
  top: -100px;
  right: -100px;
  pointer-events: none;
}

/* 数字动画占位 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 24px;
  margin-top: -40px;
  position: relative;
  z-index: 5;
}

.stat-item {
  text-align: center;
  padding: 20px 12px;
  background: var(--stat-bg);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 28px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

body.dark .stat-item {
  background: #1e293b;
}

.stat-number {
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--brand-light);
}

body.dark .stat-number {
  color: var(--accent);
}

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

/* ===== 新闻卡片 ===== */
.news-card {
  padding: 20px;
}

.news-card h3 {
  font-size: 1.25rem;
  margin-bottom: 6px;
  line-height: 1.3;
}

.news-card .meta {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 10px;
}

.news-card a {
  color: var(--accent2);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.news-card a:hover {
  color: var(--accent);
}

/* ===== FAQ ===== */
.faq-item {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 18px 0;
  cursor: pointer;
  transition: background 0.2s ease;
}

body.dark .faq-item {
  border-color: rgba(255, 255, 255, 0.08);
}

.faq-question {
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.05rem;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.2s ease;
  color: var(--text-light);
  font-size: 0.95rem;
}

.faq-item.open .faq-answer {
  max-height: 240px;
  padding-top: 12px;
}

.faq-icon {
  transition: transform 0.3s ease;
  font-size: 1.3rem;
  line-height: 1;
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
}

/* ===== 页脚 ===== */
footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 48px 0 24px;
  margin-top: 40px;
}

body.dark footer {
  background: #020617;
}

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

.footer-grid h4 {
  color: #eef2f6;
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.footer-grid a {
  color: var(--footer-link);
  text-decoration: none;
  display: block;
  margin: 6px 0;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-grid a:hover {
  color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 20px;
  margin-top: 32px;
  text-align: center;
  font-size: 0.85rem;
}

/* ===== 滚动动画 ===== */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

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

/* ===== 轮播基础 ===== */
.carousel {
  overflow: hidden;
  position: relative;
}

.carousel-track {
  display: flex;
  transition: transform 0.4s ease;
}

.carousel-item {
  min-width: 100%;
  padding: 0 8px;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.3);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 40px;
  cursor: pointer;
  font-size: 1.4rem;
  z-index: 5;
  transition: background 0.2s ease;
}

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

.carousel-btn.prev {
  left: 0;
}

.carousel-btn.next {
  right: 0;
}

/* 轮播自适应 */
@media (max-width: 768px) {
  .carousel-btn {
    padding: 8px 12px;
    font-size: 1.2rem;
  }
}

/* ===== 深色模式下的额外适配 ===== */
body.dark .hero {
  background: linear-gradient(145deg, #0f172a 0%, #1e293b 100%);
}

body.dark .hero .glow {
  background: radial-gradient(circle, rgba(240, 192, 64, 0.1), transparent 70%);
}

body.dark .section-title::after {
  background: var(--accent2);
}

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

/* ===== 响应式微调 ===== */
@media (max-width: 600px) {
  .container {
    padding: 0 16px;
  }

  .card {
    padding: 20px 16px;
  }

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

  section {
    padding: 50px 0;
  }

  .section-title {
    font-size: 1.6rem;
    margin-bottom: 30px;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    gap: 16px;
  }
}

/* ===== 额外细节 ===== */
/* 品牌介绍列表 */
.card ul {
  list-style: none;
  padding-left: 0;
}

.card ul li {
  padding: 4px 0;
}

/* 产品中心卡片图标 */
.card h3 {
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.card p {
  font-size: 0.95rem;
  line-height: 1.6;
}

/* FAQ 列表在深色模式下的微调 */
body.dark .faq-item {
  background: transparent;
}

/* 联系区域 */
#contact .card h3 {
  margin-top: 0;
  margin-bottom: 8px;
}

#contact .card p {
  margin-bottom: 12px;
}

/* 案例轮播卡片 */
#cases .carousel-item.card {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-style: italic;
}

/* 搜索框（动态添加） */
.header-inner input[type="text"] {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 40px;
  padding: 6px 16px;
  color: white;
  width: 140px;
  font-size: 0.9rem;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.header-inner input[type="text"]::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.header-inner input[type="text"]:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--accent);
}

/* 返回顶部按钮（动态添加） */
body > button:last-child {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #0b1a2e;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 40px;
  cursor: pointer;
  z-index: 99;
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

body > button:last-child:hover {
  opacity: 1;
  transform: scale(1.05);
}

body.dark > button:last-child {
  background: #1e293b;
}

/* HowTo 区域样式 */
#howto .card h3 {
  margin-top: 16px;
  margin-bottom: 6px;
  font-size: 1.1rem;
  color: var(--brand-light);
}

body.dark #howto .card h3 {
  color: var(--accent);
}

#howto .card ol {
  padding-left: 20px;
  margin: 8px 0;
}

#howto .card ol li {
  margin: 4px 0;
}

/* 表格与列表样式（通用） */
.card ul, .card ol {
  margin: 8px 0;
}

/* 确保所有链接点击无跳转（内联已处理） */
a[href="#"] {
  cursor: default;
}

/* 打印样式忽略 */
@media print {
  header, footer, .carousel-btn, .dark-toggle, .mobile-toggle, .faq-icon, .btn {
    display: none !important;
  }
  .hero {
    background: none !important;
    color: #000 !important;
  }
  .card {
    box-shadow: none !important;
    border: 1px solid #ddd;
  }
}