/* 全局重置 & 设计系统 */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: #f8f9fc;
  color: #1e293b;
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* 暗色模式 */
.dark {
  background: #0b1120;
  color: #e2e8f0;
}

.dark a {
  color: #94a3b8;
}

/* 标题 */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.2;
}

h1 {
  font-size: 2.2rem;
}

h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  border-left: 4px solid #f5c542;
  padding-left: 0.75rem;
  transition: border-color 0.3s;
}

.dark h2 {
  border-color: #f5c542;
}

/* 链接 */
a {
  color: #1e3a8a;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #f5c542;
}

/* Header / 导航 */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.5);
  transition: background 0.3s, border-color 0.3s;
}

.dark header {
  background: rgba(11, 17, 32, 0.85);
  border-bottom-color: rgba(30, 41, 59, 0.5);
}

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

.nav-brand a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.2rem;
  color: #0b1120;
  transition: color 0.3s;
}

.dark .nav-brand a {
  color: #f1f5f9;
}

.nav-brand a:hover {
  color: #f5c542;
}

.brand-text {
  letter-spacing: 1px;
}

.nav-menu {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-menu a {
  padding: 0.25rem 0;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
  position: relative;
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #f5c542;
  transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
  width: 100%;
}

.nav-menu a.active,
.nav-menu a:hover {
  color: #f5c542;
}

.nav-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

#darkModeToggle,
#mobileMenuBtn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: inherit;
  transition: transform 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

#darkModeToggle:hover,
#mobileMenuBtn:hover {
  transform: scale(1.1);
  color: #f5c542;
}

#mobileMenuBtn {
  display: none;
}

/* 移动端导航 */
@media (max-width: 768px) {
  .nav-menu {
    display: none;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    padding: 1rem 1.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 16px 16px;
    transition: all 0.3s ease;
  }

  .dark .nav-menu {
    background: rgba(15, 23, 42, 0.98);
  }

  .nav-menu.open {
    display: flex;
    animation: slideDown 0.3s ease;
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  #mobileMenuBtn {
    display: block;
  }
}

/* 主内容 */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

/* Hero 区域 - 渐变Banner */
#hero {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 3rem 0;
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(135deg, #0b1120 0%, #1a2332 50%, #2a3a4f 100%);
  padding: 2.5rem;
  margin: -1rem -1.5rem 0;
  min-height: 400px;
}

.dark #hero {
  background: linear-gradient(135deg, #0a0f1f 0%, #141e30 50%, #1f2d42 100%);
}

#hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(245, 197, 66, 0.08) 0%, transparent 60%);
  animation: heroGlow 8s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes heroGlow {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(5%, 5%);
  }
}

.hero-content {
  flex: 1 1 400px;
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.8s ease;
}

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

.hero-content h1 {
  font-size: 2.8rem;
  margin-bottom: 1rem;
  color: #ffffff;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  line-height: 1.2;
}

.hero-content p {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 500px;
  margin-bottom: 1.5rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
  padding: 0.85rem 2.2rem;
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-block;
  font-size: 1rem;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, #f5c542, #f0b830);
  color: #0b1120;
  box-shadow: 0 4px 15px rgba(245, 197, 66, 0.4);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(245, 197, 66, 0.5);
  opacity: 1;
}

.btn-secondary {
  border: 2px solid rgba(245, 197, 66, 0.7);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.btn-secondary:hover {
  background: rgba(245, 197, 66, 0.15);
  border-color: #f5c542;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(245, 197, 66, 0.2);
}

.hero-visual {
  flex: 1 1 300px;
  text-align: center;
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-visual svg {
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 30px rgba(245, 197, 66, 0.2));
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* 响应式 Hero */
@media (max-width: 768px) {
  #hero {
    padding: 2rem 1.5rem;
    margin: -1rem -1.5rem 0;
    flex-direction: column;
    text-align: center;
  }

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

  .hero-content p {
    margin: 0 auto 1.5rem;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-visual svg {
    max-width: 280px;
  }
}

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

  .btn-primary,
  .btn-secondary {
    padding: 0.7rem 1.5rem;
    font-size: 0.9rem;
  }
}

/* 通用 Section 样式 */
section {
  scroll-margin-top: 80px;
  animation: sectionIn 0.6s ease both;
}

@keyframes sectionIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* About 区域 */
#about {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 24px;
  padding: 2.5rem;
  border: 1px solid rgba(226, 232, 240, 0.4);
  transition: background 0.3s, border-color 0.3s;
}

.dark #about {
  background: rgba(30, 41, 59, 0.5);
  border-color: rgba(51, 65, 85, 0.4);
}

#about > p {
  font-size: 1.05rem;
  max-width: 800px;
  margin-bottom: 2rem;
}

.entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.entity-grid article {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
  border: 1px solid rgba(226, 232, 240, 0.3);
}

.dark .entity-grid article {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(51, 65, 85, 0.3);
}

.entity-grid article:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  border-color: rgba(245, 197, 66, 0.3);
}

.entity-grid h3 {
  margin-bottom: 0.5rem;
  color: #f5c542;
}

/* 卡片网格 (Products) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 2rem 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  transition: all 0.4s ease;
  border: 1px solid rgba(226, 232, 240, 0.3);
  position: relative;
  overflow: hidden;
}

.dark .card {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(51, 65, 85, 0.3);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #f5c542, #f0b830, #f5c542);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.card:hover::before {
  transform: scaleX(1);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
  border-color: rgba(245, 197, 66, 0.2);
}

.card h3 {
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  color: #f5c542;
}

.card p {
  color: inherit;
  opacity: 0.8;
}

/* Services */
#services {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 24px;
  padding: 2.5rem;
  border: 1px solid rgba(226, 232, 240, 0.3);
}

.dark #services {
  background: rgba(30, 41, 59, 0.4);
  border-color: rgba(51, 65, 85, 0.3);
}

.service-list {
  display: grid;
  gap: 0.75rem;
  list-style: none;
}

.service-list li {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 1rem 1.5rem;
  border-radius: 14px;
  transition: all 0.3s ease;
  border: 1px solid rgba(226, 232, 240, 0.2);
  display: flex;
  align-items: center;
}

.dark .service-list li {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(51, 65, 85, 0.2);
}

.service-list li:hover {
  transform: translateX(8px);
  background: rgba(245, 197, 66, 0.08);
  border-color: rgba(245, 197, 66, 0.2);
}

.service-list li strong {
  color: #f5c542;
  margin-right: 0.5rem;
}

/* Resources / Knowledge Hub */
.article-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.article-list article {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  border: 1px solid rgba(226, 232, 240, 0.2);
  cursor: pointer;
}

.dark .article-list article {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(51, 65, 85, 0.2);
}

.article-list article:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
  border-color: rgba(245, 197, 66, 0.2);
}

.article-list h4 {
  color: #f5c542;
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

/* FAQ (手风琴) */
#faq {
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 24px;
  padding: 2.5rem;
  border: 1px solid rgba(226, 232, 240, 0.2);
}

.dark #faq {
  background: rgba(30, 41, 59, 0.3);
  border-color: rgba(51, 65, 85, 0.2);
}

.faq-list details {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  margin-bottom: 0.5rem;
  border-radius: 14px;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.dark .faq-list details {
  background: rgba(30, 41, 59, 0.7);
}

.faq-list details:hover {
  border-color: rgba(245, 197, 66, 0.2);
  background: rgba(245, 197, 66, 0.03);
}

.faq-list details[open] {
  background: rgba(245, 197, 66, 0.05);
  border-color: rgba(245, 197, 66, 0.15);
}

.faq-list summary {
  font-weight: 600;
  padding: 0.25rem 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: color 0.2s;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: '+';
  font-size: 1.2rem;
  transition: transform 0.3s ease;
  color: #f5c542;
}

.faq-list details[open] summary::after {
  content: '−';
  transform: rotate(180deg);
}

.faq-list details p {
  padding: 0.75rem 0 0.25rem;
  opacity: 0.85;
}

/* HowTo 区域 */
#howto {
  background: linear-gradient(135deg, rgba(245, 197, 66, 0.05), rgba(245, 197, 66, 0.02));
  border-radius: 24px;
  padding: 2.5rem;
  border: 1px solid rgba(245, 197, 66, 0.1);
}

.dark #howto {
  background: linear-gradient(135deg, rgba(245, 197, 66, 0.03), transparent);
}

.howto-steps {
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.howto-steps li {
  counter-increment: step;
  padding: 1rem 1.25rem 1rem 3rem;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 14px;
  position: relative;
  transition: all 0.3s ease;
  border: 1px solid rgba(226, 232, 240, 0.2);
}

.dark .howto-steps li {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(51, 65, 85, 0.2);
}

.howto-steps li::before {
  content: counter(step);
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  background: #f5c542;
  color: #0b1120;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.howto-steps li:hover {
  transform: translateX(5px);
  border-color: rgba(245, 197, 66, 0.2);
}

/* Contact */
#contact {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 24px;
  padding: 2.5rem;
  border: 1px solid rgba(226, 232, 240, 0.2);
}

.dark #contact {
  background: rgba(30, 41, 59, 0.4);
  border-color: rgba(51, 65, 85, 0.2);
}

address p {
  margin: 0.5rem 0;
  font-style: normal;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

address p::before {
  content: '•';
  color: #f5c542;
  font-weight: bold;
}

/* Footer */
footer {
  background: #0b1120;
  color: #94a3b8;
  padding: 2.5rem 1.5rem;
  text-align: center;
  margin-top: 2rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  list-style: none;
  flex-wrap: wrap;
}

.footer-links a {
  color: #94a3b8;
  transition: color 0.2s;
  position: relative;
}

.footer-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: #f5c542;
  transition: width 0.3s;
}

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

.footer-links a:hover::after {
  width: 100%;
}

/* 返回顶部按钮 */
#backToTop {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f5c542, #f0b830);
  color: #0b1120;
  border: none;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(245, 197, 66, 0.4);
  z-index: 99;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
}

#backToTop.show {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

#backToTop:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 30px rgba(245, 197, 66, 0.5);
}

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

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

/* 响应式全局 */
@media (max-width: 768px) {
  main {
    padding: 1.5rem 1rem;
    gap: 2.5rem;
  }

  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  #about,
  #services,
  #faq,
  #howto,
  #contact {
    padding: 1.5rem;
  }

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

  .article-list {
    grid-template-columns: 1fr;
  }

  .service-list li {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  nav {
    padding: 0.5rem 1rem;
  }

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

  .btn-primary,
  .btn-secondary {
    padding: 0.65rem 1.2rem;
    font-size: 0.85rem;
  }

  .footer-links {
    gap: 1rem;
  }
}

/* 暗色模式微调 */
.dark .card,
.dark .entity-grid article,
.dark .article-list article,
.dark .faq-list details,
.dark .howto-steps li,
.dark .service-list li {
  border-color: rgba(51, 65, 85, 0.3);
}

/* 性能优化：减少重排 */
.card,
.entity-grid article,
.article-list article,
.faq-list details,
.howto-steps li {
  will-change: transform;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(245, 197, 66, 0.3);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(245, 197, 66, 0.5);
}

/* 选中文字颜色 */
::selection {
  background: rgba(245, 197, 66, 0.3);
  color: #0b1120;
}

/* 焦点样式 */
:focus-visible {
  outline: 2px solid #f5c542;
  outline-offset: 2px;
}

/* 按钮点击反馈 */
.btn-primary:active,
.btn-secondary:active {
  transform: scale(0.97);
}

/* 暗色模式过渡 */
.dark * {
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}