/* Reset & Base */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #1a3a5c;
  --primary-light: #2a5a8c;
  --accent: #e67e22;
  --accent-light: #f39c12;
  --bg: #f0f4f8;
  --card-bg: rgba(255, 255, 255, 0.75);
  --text: #1a1a2e;
  --text-light: #555;
  --border: rgba(0, 0, 0, 0.08);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  --radius: 16px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

[data-theme="dark"],
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #3a7bd5;
    --primary-light: #5a9cf5;
    --accent: #f1c40f;
    --accent-light: #f9e154;
    --bg: #0d1117;
    --card-bg: rgba(30, 40, 60, 0.75);
    --text: #e6edf3;
    --text-light: #8b949e;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  }
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

/* 渐变背景装饰 */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 20%, rgba(26, 58, 92, 0.06) 0%, transparent 50%),
              radial-gradient(circle at 70% 80%, rgba(230, 126, 34, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* 导航 */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

[data-theme="dark"] header,
@media (prefers-color-scheme: dark) {
  header {
    background: rgba(13, 17, 23, 0.7);
  }
}

nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

nav a[title] {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

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

nav ul li a {
  text-decoration: none;
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: background var(--transition), color var(--transition);
  position: relative;
}

nav ul li a::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: width var(--transition);
}

nav ul li a:hover {
  background: rgba(230, 126, 34, 0.1);
  color: var(--accent);
}

nav ul li a:hover::after {
  width: 60%;
}

nav button {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: background var(--transition), transform var(--transition);
  color: var(--text);
}

nav button:hover {
  background: rgba(0, 0, 0, 0.05);
  transform: scale(1.1);
}

/* 首屏渐变Banner */
section:first-of-type {
  background: linear-gradient(135deg, #1a3a5c 0%, #2a5a8c 40%, #e67e22 100%);
  color: #fff;
  padding: 4rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-radius: 0 0 var(--radius) var(--radius);
}

section:first-of-type::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 50%);
  pointer-events: none;
}

section:first-of-type h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 1rem;
  text-shadow: 0 2px 20px rgba(0,0,0,0.2);
  position: relative;
  z-index: 1;
}

section:first-of-type p {
  font-size: clamp(1rem, 2vw, 1.25rem);
  max-width: 700px;
  margin: 0 auto 2rem;
  opacity: 0.9;
  line-height: 1.8;
  position: relative;
  z-index: 1;
}

section:first-of-type div svg {
  max-width: 800px;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  display: block;
  margin: 0 auto;
}

/* 通用section */
section {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 2rem 1.5rem;
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.4s ease, opacity 0.4s ease, background var(--transition);
  opacity: 0;
  transform: translateY(30px);
  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: 1.0s; }
section:nth-child(12) { animation-delay: 1.1s; }
section:nth-child(13) { animation-delay: 1.2s; }

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

section h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 1.5rem;
  color: var(--primary);
  position: relative;
  display: inline-block;
}

section h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 2px;
  margin-top: 0.5rem;
}

/* 圆角卡片通用 */
article {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

article:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}

article h3 {
  color: var(--primary-light);
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
}

article p {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* 产品卡片网格 */
#products > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

#products article {
  text-align: center;
  padding: 2rem 1.5rem;
}

#products article svg {
  display: block;
  margin: 1rem auto 0;
  border-radius: 12px;
  transition: transform 0.3s ease;
}

#products article:hover svg {
  transform: scale(1.05);
}

/* 解决方案、案例、新闻卡片 */
#solutions,
#cases,
#news {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

#solutions article,
#cases article,
#news article {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#solutions article:hover,
#cases article:hover,
#news article:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}

#news article a {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}

#news article a:hover {
  color: var(--accent-light);
  text-decoration: underline;
}

/* 客户评价 */
blockquote {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 4px solid var(--accent);
  padding: 1.25rem 1.5rem;
  margin: 1rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text);
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

blockquote:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* FAQ */
#faq details {
  background: var(--card-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  margin-bottom: 0.75rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--border);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

#faq details:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

#faq details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--primary);
  padding: 0.25rem 0;
  transition: color 0.2s;
}

#faq details summary:hover {
  color: var(--accent);
}

#faq details p {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* HowTo 列表 */
section:has(h3) ul,
section:has(h3) ol {
  padding-left: 1.5rem;
  margin: 0.75rem 0;
}

section:has(h3) li {
  margin-bottom: 0.5rem;
  color: var(--text-light);
}

section:has(h3) h3 {
  color: var(--primary-light);
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

/* 联系信息 */
#contact p {
  margin-bottom: 0.5rem;
  color: var(--text-light);
}

/* 网站地图 & 友情链接 */
section:has(ul) ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

section:has(ul) ul li a {
  color: var(--primary-light);
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

section:has(ul) ul li a:hover {
  background: rgba(230, 126, 34, 0.1);
  color: var(--accent);
}

/* 页脚 */
footer {
  background: var(--primary);
  color: rgba(255,255,255,0.85);
  text-align: center;
  padding: 2rem 1.5rem;
  margin-top: 3rem;
  border-radius: var(--radius) var(--radius) 0 0;
}

footer p {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

/* 响应式 */
@media (max-width: 768px) {
  nav {
    flex-wrap: wrap;
    justify-content: center;
    padding: 0.5rem 1rem;
  }

  nav ul {
    justify-content: center;
    gap: 0.15rem;
  }

  nav ul li a {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
  }

  section:first-of-type {
    padding: 2.5rem 1rem;
  }

  section {
    margin: 1rem 0.75rem;
    padding: 1.5rem 1rem;
    border-radius: 12px;
  }

  #products > div,
  #solutions,
  #cases,
  #news {
    grid-template-columns: 1fr;
  }

  article {
    padding: 1.25rem;
  }

  blockquote {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  nav ul {
    gap: 0;
  }

  nav ul li a {
    font-size: 0.75rem;
    padding: 0.3rem 0.5rem;
  }

  section:first-of-type h1 {
    font-size: 1.6rem;
  }

  section h2 {
    font-size: 1.3rem;
  }
}

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

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}