/* ========== 重置样式 ========== */
* {
  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, sans-serif;
  line-height: 1.6;
  color: #111827;
  background-color: #f9fafb;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a {
  text-decoration: none;
  color: inherit;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

ul,
ol {
  list-style: none;
}

/* ========== 通用工具类 ========== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

.hidden {
  display: none !important;
}

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

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fade-in {
  animation: fadeIn 0.8s ease-out forwards;
}

.animate-delay-100 {
  animation-delay: 0.1s;
  opacity: 0;
}

.animate-delay-200 {
  animation-delay: 0.2s;
  opacity: 0;
}

.animate-delay-300 {
  animation-delay: 0.3s;
  opacity: 0;
}

.animate-delay-400 {
  animation-delay: 0.4s;
  opacity: 0;
}

/* ========== 导航栏样式 ========== */
nav {
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 50;
}

nav .nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

nav .logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

nav .logo img {
  height: 40px;
}

nav .nav-desktop {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex: 1;
}

@media (min-width: 1024px) {
  nav .nav-desktop {
    display: flex;
  }
}

nav .nav-link {
  color: #374151;
  font-weight: 500;
  transition: color 0.2s;
}

nav .nav-link:hover {
  color: #111827;
}

nav .nav-link.active {
  color: #88619a;
  font-weight: 700;
}

nav .dropdown {
  position: relative;
}

nav .dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #374151;
  font-weight: 500;
  transition: color 0.2s;
}

nav .dropdown-trigger:hover {
  color: #111827;
}

nav .dropdown-trigger svg {
  width: 16px;
  height: 16px;
}

nav [data-dropdown] {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 0.5rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
  padding: 1.5rem;
  z-index: 50;
  width: 680px;
}

nav .dropdown-category {
  margin-bottom: 1.5rem;
}

nav .dropdown-category:last-child {
  margin-bottom: 0;
}

nav .dropdown-category-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

nav .dropdown-category-title {
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
  color: white;
}

nav .dropdown-category-desc {
  font-size: 0.75rem;
  color: #6b7280;
  flex: 1;
}

nav .dropdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

nav .dropdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.5rem;
  border-radius: 0.5rem;
  transition: all 0.2s;
  text-align: center;
  min-height: 70px;
}

nav .dropdown-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

nav .dropdown-item .code {
  font-weight: 700;
  font-size: 0.875rem;
  color: white;
  display: block;
  margin-bottom: 0.25rem;
}

nav .dropdown-item .title {
  color: white;
  font-size: 0.75rem;
  display: block;
  opacity: 0.95;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

[data-dropdown]:not(.hidden) {
  animation: dropdownFadeIn 0.2s ease-out forwards;
}

nav .btn-test {
  background: #88619a;
  color: white;
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.875rem;
  transition: all 0.3s;
  margin-left: auto;
}

nav .btn-test:hover {
  background: #6d4d7d;
  box-shadow: 0 4px 12px rgba(136, 97, 154, 0.3);
}

/* 汉堡菜单 */
nav .burger {
  display: block;
  color: #374151;
  font-size: 1.5rem;
  padding: 0.25rem;
}

@media (min-width: 1024px) {
  nav .burger {
    display: none;
  }
}

/* 移动端菜单 */
.mobile-menu {
  background: white;
  border-top: 1px solid #e5e7eb;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  z-index: 40;
}

.mobile-menu.open {
  max-height: calc(100vh - 64px);
  overflow-y: auto;
}

@media (min-width: 1024px) {
  .mobile-menu {
    display: none;
  }
}

.mobile-menu-content {
  padding: 0.5rem 1rem;
}

.mobile-menu-item {
  display: block;
  padding: 0.75rem 0;
  color: #374151;
  font-weight: 500;
  border-bottom: 1px solid #f3f4f6;
}

.mobile-menu-item.active {
  color: #88619a;
  font-weight: 700;
}

.mobile-menu-link {
  display: block;
  padding: 0.75rem 0;
  color: #374151;
  font-weight: 500;
  border-bottom: 1px solid #f3f4f6;
}

/* ========== 页脚样式 ========== */
footer {
  background: white;
  border-top: 1px solid #e5e7eb;
  margin-top: auto;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 768px) {
  .footer-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

.footer-section h4 {
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
}

.footer-section p {
  color: #6b7280;
  font-size: 0.875rem;
  line-height: 1.75;
}

.footer-section a {
  color: #3b82f6;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-section a:hover {
  color: #2563eb;
}

.footer-copyright {
  color: #9ca3af;
  font-size: 0.75rem;
  margin-top: 0.75rem;
}

.footer-qr-codes {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}

@media (min-width: 768px) {
  .footer-qr-codes {
    justify-content: flex-end;
  }
}

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

.footer-qr-item img {
  width: 96px;
  height: 96px;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin: 0 auto;
  object-fit: cover;
}

.footer-qr-item p {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 0.5rem;
}
