/* ===== 球友会官网 style.css ===== */
/* 全局重置 & 基础 */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f8fafc;
  color: #1e293b;
  line-height: 1.5;
  transition: background 0.25s ease, color 0.25s ease;
  min-height: 100vh;
}

body.dark {
  background: #0f172a;
  color: #e2e8f0;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.8;
}

ul {
  list-style: none;
}

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

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

/* 容器 */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 玻璃效果 */
.glass {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 28px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05);
}

.dark .glass {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(255, 255, 255, 0.08);
}

/* 卡片 */
.card {
  background: white;
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.02);
  transition: all 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.06);
}

.dark .card {
  background: #1e293b;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.dark .card:hover {
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.5);
}

/* 按钮 */
.btn {
  display: inline-block;
  background: #0b2b5c;
  color: white;
  padding: 12px 28px;
  border-radius: 60px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
  line-height: 1.4;
  text-align: center;
}

.btn:hover {
  background: #1e4a7a;
  transform: scale(0.97);
  box-shadow: 0 8px 20px rgba(11, 43, 92, 0.25);
}

.dark .btn {
  background: #f0c040;
  color: #0b2b5c;
}

.dark .btn:hover {
  background: #facc15;
}

/* 渐变背景 */
.gradient-bg {
  background: linear-gradient(145deg, #0b2b5c 0%, #1e4a7a 100%);
}

.dark .gradient-bg {
  background: linear-gradient(145deg, #020617 0%, #0f172a 100%);
}

/* ===== 头部导航 ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 12px 0;
  transition: all 0.2s ease;
}

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

.logo svg {
  height: 44px;
  width: auto;
  display: block;
}

.nav {
  display: flex;
  gap: 28px;
  font-weight: 500;
  align-items: center;
}

.nav a {
  position: relative;
  padding: 6px 0;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav a:hover {
  color: #0b2b5c;
}

.dark .nav a:hover {
  color: #f0c040;
}

.nav a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: #f0c040;
  border-radius: 6px;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 4px;
}

.menu-toggle span {
  width: 28px;
  height: 3px;
  background: #1e293b;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.dark .menu-toggle span {
  background: #e2e8f0;
}

/* 暗黑模式开关 */
.dark-mode-switch {
  background: transparent;
  border: 1px solid #94a3b8;
  border-radius: 60px;
  width: 44px;
  height: 28px;
  display: flex;
  align-items: center;
  padding: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.dark-mode-switch .dot {
  width: 20px;
  height: 20px;
  background: #f0c040;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.dark .dark-mode-switch .dot {
  transform: translateX(16px);
  background: #facc15;
}

.dark .dark-mode-switch {
  border-color: #facc15;
}

/* ===== Hero ===== */
.hero {
  padding: 40px 0 80px;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.hero h1 {
  font-size: 3.2rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.hero p {
  font-size: 1.2rem;
  margin: 24px 0;
  color: #475569;
  max-width: 540px;
}

.dark .hero p {
  color: #cbd5e1;
}

.hero-badge {
  display: inline-block;
  background: rgba(240, 192, 64, 0.12);
  border-radius: 60px;
  padding: 6px 18px;
  font-weight: 500;
  color: #0b2b5c;
  margin-bottom: 16px;
  border: 1px solid rgba(240, 192, 64, 0.2);
  font-size: 0.9rem;
}

.dark .hero-badge {
  color: #f0c040;
  background: rgba(240, 192, 64, 0.1);
}

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

.hero-svg svg {
  width: 100%;
  max-width: 500px;
  height: auto;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.1));
  transition: transform 0.4s ease;
}

.hero-svg svg:hover {
  transform: scale(1.02);
}

/* ===== 轮播 ===== */
.carousel-section {
  padding: 30px 0;
}

.carousel {
  overflow: hidden;
  border-radius: 32px;
  position: relative;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-item {
  min-width: 100%;
  padding: 60px 40px;
  background: #eef2f6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

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

.carousel-item h2 {
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.carousel-item p {
  font-size: 1.1rem;
  color: #475569;
}

.dark .carousel-item p {
  color: #cbd5e1;
}

.carousel-indicators {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.carousel-indicators button {
  width: 12px;
  height: 12px;
  border-radius: 30px;
  border: none;
  background: #cbd5e1;
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-indicators button.active {
  background: #0b2b5c;
  width: 28px;
}

.dark .carousel-indicators button.active {
  background: #f0c040;
}

/* ===== 通用区块 ===== */
.section {
  padding: 60px 0;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 600;
  margin-bottom: 32px;
  letter-spacing: -0.01em;
  position: relative;
  display: inline-block;
}

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

.dark .section-title::after {
  background: #facc15;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

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

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

.gap-16 {
  gap: 16px;
}

.rounded-full {
  border-radius: 9999px;
}

.badge {
  background: rgba(240, 192, 64, 0.12);
  color: #0b2b5c;
  padding: 4px 14px;
  border-radius: 60px;
  font-size: 0.9rem;
  display: inline-block;
}

.dark .badge {
  color: #f0c040;
}

/* ===== 文章卡片 ===== */
.article-card {
  border-radius: 28px;
  background: white;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.article-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.dark .article-card {
  background: #1e293b;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.dark .article-card:hover {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.article-card h3 {
  margin-bottom: 8px;
  font-size: 1.15rem;
}

.article-card p {
  color: #64748b;
  font-size: 0.95rem;
}

.dark .article-card p {
  color: #94a3b8;
}

.article-card a {
  color: #0b2b5c;
  font-weight: 500;
  margin-top: auto;
}

.dark .article-card a {
  color: #f0c040;
}

/* ===== FAQ ===== */
.faq-item {
  border-bottom: 1px solid #e2e8f0;
  padding: 18px 0;
  cursor: pointer;
  transition: background 0.2s;
}

.dark .faq-item {
  border-color: #334155;
}

.faq-item:hover {
  background: rgba(0, 0, 0, 0.02);
}

.dark .faq-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

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

.faq-question span {
  transition: transform 0.3s ease;
  font-size: 1.2rem;
}

.faq-item.open .faq-question span {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, margin 0.3s ease;
  color: #475569;
  line-height: 1.6;
}

.dark .faq-answer {
  color: #cbd5e1;
}

.faq-item.open .faq-answer {
  max-height: 300px;
  margin-top: 12px;
}

/* ===== Footer ===== */
.footer {
  background: #0b2b5c;
  color: #e2e8f0;
  padding: 40px 0;
  margin-top: 40px;
  border-radius: 40px 40px 0 0;
}

.dark .footer {
  background: #020617;
}

.footer a {
  color: #cbd5e1;
  transition: color 0.2s;
}

.footer a:hover {
  color: #f0c040;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer h3,
.footer h4 {
  margin-bottom: 16px;
  font-weight: 600;
}

.footer ul li {
  margin-bottom: 8px;
}

.footer p {
  color: #94a3b8;
  line-height: 1.6;
}

/* ===== 返回顶部 ===== */
.back-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #0b2b5c;
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  border: none;
  font-size: 24px;
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

.back-top.show {
  opacity: 1;
  pointer-events: auto;
}

.back-top:hover {
  background: #1e4a7a;
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

.dark .back-top {
  background: #f0c040;
  color: #0b2b5c;
}

.dark .back-top:hover {
  background: #facc15;
}

/* ===== 滚动动画 ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== 数字动画 ===== */
.stat-number {
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1.2;
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .hero h1 {
    font-size: 2.6rem;
  }
}

@media (max-width: 768px) {
  .nav {
    display: none;
    flex-direction: column;
    background: white;
    position: absolute;
    top: 70px;
    left: 20px;
    right: 20px;
    border-radius: 40px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    gap: 16px;
    z-index: 200;
  }

  .dark .nav {
    background: #1e293b;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  }

  .nav.open {
    display: flex;
  }

  .menu-toggle {
    display: flex;
  }

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

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero p {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-svg {
    order: -1;
  }

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

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

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

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

  .section-title {
    font-size: 1.8rem;
  }

  .carousel-item {
    padding: 40px 20px;
  }

  .carousel-item h2 {
    font-size: 1.4rem;
  }

  .back-top {
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    font-size: 20px;
  }

  .header-inner {
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .hero {
    padding: 20px 0 40px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

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

  .section {
    padding: 40px 0;
  }

  .card {
    padding: 20px;
  }

  .btn {
    padding: 10px 24px;
    font-size: 0.95rem;
  }
}

/* ===== 打印样式 ===== */
@media print {
  .header,
  .back-top,
  .menu-toggle,
  .dark-mode-switch {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .card,
  .glass {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* ===== 暗色模式额外调整 ===== */
.dark .carousel-indicators button {
  background: #475569;
}

.dark .badge {
  background: rgba(240, 192, 64, 0.15);
}

.dark .article-card a:hover {
  color: #facc15;
}

/* ===== 焦点样式 ===== */
a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: 2px solid #f0c040;
  outline-offset: 2px;
}

/* ===== 选择文本 ===== */
::selection {
  background: #0b2b5c;
  color: white;
}

.dark ::selection {
  background: #f0c040;
  color: #0b2b5c;
}

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

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.dark ::-webkit-scrollbar-track {
  background: #1e293b;
}

::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 8px;
}

.dark ::-webkit-scrollbar-thumb {
  background: #475569;
}

::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

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

.hero-badge {
  animation: fadeInUp 0.6s ease forwards;
}

.hero h1 {
  animation: fadeInUp 0.8s ease forwards;
  animation-delay: 0.1s;
  opacity: 0;
}

.hero p {
  animation: fadeInUp 0.8s ease forwards;
  animation-delay: 0.2s;
  opacity: 0;
}

.hero .btn {
  animation: fadeInUp 0.8s ease forwards;
  animation-delay: 0.3s;
  opacity: 0;
}

/* 轮播自动播放指示器动画 */
.carousel-indicators button.active {
  transition: width 0.3s ease, background 0.3s ease;
}

/* 卡片悬停时内部链接增强 */
.card:hover a {
  opacity: 1;
}

/* Footer 链接悬停 */
.footer a {
  position: relative;
}

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

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

/* 安全区域 */
@supports (padding: env(safe-area-inset-bottom)) {
  .footer {
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
  }
}