/* ============================================================
   style.css - 米兰体育官方网站入口
   风格：现代体育风，红黑主色，渐变Banner，圆角卡片，毛玻璃效果
   响应式布局，暗色模式，滚动动画，hover动画
   全部内联CSS，无外部依赖
   ============================================================ */

/* ----- 自定义属性（主题色） ----- */
:root {
  --primary: #cc0000;
  --primary-dark: #990000;
  --secondary: #1a1a2e;
  --accent: #e6b800;
  --bg-light: #f4f5f7;
  --bg-dark: #121212;
  --text-light: #2c2c2c;
  --text-dark: #e0e0e0;
  --card-bg: #ffffff;
  --card-bg-dark: #1e1e2e;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 16px 40px rgba(0, 0, 0, 0.12);
  --radius: 20px;
  --radius-sm: 12px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  --font-sans: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
}

/* ----- 全局重置与基础 ----- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ----- 暗色模式 ----- */
body.dark-mode {
  background: var(--bg-dark);
  color: var(--text-dark);
}

body.dark-mode .card {
  background: var(--card-bg-dark);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

body.dark-mode header {
  background: rgba(18, 18, 18, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.dark-mode footer {
  background: #0a0a0a;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

body.dark-mode .section-subtitle {
  color: #aaa;
}

body.dark-mode .faq-item {
  border-color: #2a2a2a;
}

body.dark-mode .search-box input {
  background: #2a2a3a;
  border-color: #3a3a4a;
  color: #fff;
}

body.dark-mode .lazy-placeholder {
  background: #2a2a3a;
  color: #666;
}

body.dark-mode .menu-toggle span {
  background: var(--text-dark);
}

body.dark-mode .dark-toggle {
  border-color: #555;
  color: var(--text-dark);
}

body.dark-mode .dark-toggle:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ----- 链接与图片 ----- */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  text-decoration: underline;
  color: var(--primary-dark);
}

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

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

/* ----- 毛玻璃效果（通用） ----- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

/* ----- 头部 Header (毛玻璃+sticky) ----- */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  transition: background var(--transition), backdrop-filter var(--transition);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.logo svg {
  width: 38px;
  height: 38px;
  filter: drop-shadow(0 2px 4px rgba(204, 0, 0, 0.3));
  transition: transform 0.4s ease;
}

.logo:hover svg {
  transform: scale(1.08) rotate(-4deg);
}

/* 导航 */
nav ul {
  list-style: none;
  display: flex;
  gap: 32px;
  align-items: center;
}

nav a {
  color: var(--text-light);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  padding-bottom: 4px;
  transition: color var(--transition);
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}

nav a:hover {
  color: var(--primary);
  text-decoration: none;
}

nav a:hover::after {
  width: 100%;
}

/* 汉堡菜单 */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.2s;
}

.menu-toggle:hover {
  background: rgba(0, 0, 0, 0.04);
}

body.dark-mode .menu-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
}

.menu-toggle span {
  width: 28px;
  height: 3px;
  background: var(--text-light);
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* 暗色模式切换按钮 */
.dark-toggle {
  background: transparent;
  border: 1.5px solid #ccc;
  border-radius: 40px;
  padding: 8px 18px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition);
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 6px;
}

.dark-toggle:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: scale(1.02);
}

/* ----- Hero 区域（渐变Banner + 毛玻璃） ----- */
.hero {
  background: linear-gradient(135deg, #cc0000 0%, #990000 45%, #1a1a2e 100%);
  color: #fff;
  padding: 120px 0 100px;
  text-align: center;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.08) 0%, transparent 60%),
              radial-gradient(circle at 80% 70%, rgba(230, 184, 0, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 3.2rem;
  font-weight: 900;
  margin-bottom: 20px;
  line-height: 1.15;
  letter-spacing: -1px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  animation: fadeInUp 0.8s ease forwards;
}

.hero p {
  font-size: 1.2rem;
  max-width: 680px;
  margin: 0 auto 36px;
  opacity: 0.92;
  line-height: 1.6;
  animation: fadeInUp 0.8s ease 0.15s forwards;
}

.hero .btn {
  display: inline-block;
  background: #fff;
  color: var(--primary);
  padding: 16px 48px;
  border-radius: 60px;
  font-weight: 700;
  font-size: 1.1rem;
  transition: all var(--transition);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  letter-spacing: 0.3px;
  animation: fadeInUp 0.8s ease 0.3s forwards;
  position: relative;
  overflow: hidden;
}

.hero .btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.hero .btn:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
  text-decoration: none;
}

.hero .btn:hover::before {
  opacity: 1;
}

.hero .scroll-indicator {
  margin-top: 50px;
  font-size: 0.9rem;
  opacity: 0.6;
  animation: bounce 2.4s infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

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

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

/* ----- 通用区域 ----- */
section {
  padding: 90px 0;
}

.section-title {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 12px;
  text-align: center;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.section-subtitle {
  text-align: center;
  color: #777;
  margin-bottom: 56px;
  font-size: 1.1rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ----- 卡片通用 (圆角+阴影+hover) ----- */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  will-change: transform;
}

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

.card h3 {
  font-size: 1.3rem;
  margin-bottom: 12px;
  color: var(--primary);
  font-weight: 700;
}

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

body.dark-mode .card p {
  color: #bbb;
}

.card .icon {
  font-size: 2.4rem;
  margin-bottom: 16px;
  display: block;
  line-height: 1;
}

/* ----- 网格布局 ----- */
.grid-2 { display: grid; gap: 32px; grid-template-columns: repeat(2, 1fr); }
.grid-3 { display: grid; gap: 32px; grid-template-columns: repeat(3, 1fr); }
.grid-4 { display: grid; gap: 28px; grid-template-columns: repeat(4, 1fr); }

/* ----- About 区域 ----- */
.about-content {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
  font-size: 1.05rem;
  padding: 40px 36px;
}

/* ----- 故事 section (浅色背景) ----- */
#story {
  background: var(--bg-light);
}

body.dark-mode #story {
  background: #1a1a1a;
}

/* ----- 统计数字 (Stats) ----- */
.stats {
  background: var(--secondary);
  color: #fff;
  padding: 70px 0;
}

.stats .grid-4 {
  gap: 24px;
}

.stat-item {
  text-align: center;
  padding: 20px 12px;
  transition: transform 0.3s;
}

.stat-item:hover {
  transform: scale(1.04);
}

.stat-number {
  font-size: 3.2rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1.1;
  letter-spacing: -1px;
}

.stat-label {
  font-size: 1.05rem;
  opacity: 0.85;
  margin-top: 6px;
  font-weight: 500;
}

/* ----- 用户评价 (Testimonials) ----- */
.testimonial {
  font-style: italic;
  position: relative;
  padding-left: 24px;
  border-left: 5px solid var(--primary);
  background: var(--card-bg);
}

.testimonial .author {
  margin-top: 16px;
  font-style: normal;
  font-weight: 600;
  color: var(--primary);
}

/* ----- FAQ 手风琴 ----- */
.faq-item {
  border-bottom: 1px solid #e0e0e0;
  padding: 20px 0;
  cursor: pointer;
  transition: background 0.2s;
}

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

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

.faq-question {
  font-weight: 600;
  font-size: 1.05rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  gap: 16px;
}

.faq-question::after {
  content: '+';
  font-size: 1.6rem;
  font-weight: 300;
  transition: transform 0.35s ease, content 0.1s;
  color: var(--primary);
  line-height: 1;
}

.faq-item.active .faq-question::after {
  content: '−';
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s ease, padding 0.35s ease;
  padding-top: 0;
  color: #555;
  line-height: 1.7;
}

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

.faq-item.active .faq-answer {
  max-height: 320px;
  padding-top: 16px;
}

/* FAQ 搜索框 */
.search-box {
  display: flex;
  max-width: 520px;
  margin: 0 auto 48px;
  border-radius: 60px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.search-box input {
  flex: 1;
  padding: 14px 22px;
  border: 2px solid #e0e0e0;
  border-right: none;
  border-radius: 60px 0 0 60px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s;
  background: #fff;
}

.search-box input:focus {
  border-color: var(--primary);
}

.search-box button {
  padding: 14px 28px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 0 60px 60px 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.3s;
}

.search-box button:hover {
  background: var(--primary-dark);
}

/* ----- HowTo 步骤 ----- */
.howto-step {
  display: flex;
  gap: 24px;
  margin-bottom: 28px;
  align-items: flex-start;
  background: var(--card-bg);
  padding: 24px 28px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
}

.howto-step:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-hover);
}

body.dark-mode .howto-step {
  background: var(--card-bg-dark);
}

.step-number {
  background: var(--primary);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(204, 0, 0, 0.3);
}

/* ----- 文章卡片 (Insights) ----- */
.article-card .date {
  font-size: 0.85rem;
  color: #999;
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}

.article-card .read-more {
  color: var(--primary);
  font-weight: 600;
  display: inline-block;
  margin-top: 12px;
  transition: gap 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.article-card .read-more:hover {
  gap: 10px;
  text-decoration: none;
}

/* ----- 联系信息 ----- */
.contact-info p {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.contact-info strong {
  min-width: 80px;
  display: inline-block;
}

/* ----- 页脚 Footer ----- */
footer {
  background: #1a1a2e;
  color: #ccc;
  padding: 60px 0 30px;
}

footer a {
  color: #aaa;
  transition: color 0.3s;
}

footer a:hover {
  color: #fff;
  text-decoration: none;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 36px;
}

.footer-grid h4 {
  color: #fff;
  margin-bottom: 18px;
  font-size: 1.1rem;
  font-weight: 700;
}

.footer-grid ul {
  list-style: none;
}

.footer-grid li {
  margin-bottom: 10px;
}

.copyright {
  text-align: center;
  border-top: 1px solid #2a2a3a;
  padding-top: 28px;
  font-size: 0.9rem;
  opacity: 0.8;
}

/* ----- 返回顶部按钮 ----- */
.back-to-top {
  position: fixed;
  bottom: 36px;
  right: 36px;
  width: 52px;
  height: 52px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.6rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s, visibility 0.4s, transform 0.3s, box-shadow 0.3s;
  z-index: 999;
  box-shadow: 0 6px 24px rgba(204, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 12px 36px rgba(204, 0, 0, 0.45);
}

/* ----- 懒加载占位 ----- */
.lazy-placeholder {
  background: #e0e0e0;
  border-radius: 12px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 0.9rem;
}

/* ============================================================
   响应式设计
   ============================================================ */

/* 平板 < 992px */
@media (max-width: 992px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

/* 手机 < 768px */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  .hero {
    padding: 90px 0 70px;
  }

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

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

  .hero .btn {
    padding: 14px 36px;
    font-size: 1rem;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
    gap: 24px;
  }

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

  .section-subtitle {
    font-size: 0.95rem;
    margin-bottom: 36px;
  }

  /* 汉堡菜单显示 */
  .menu-toggle {
    display: flex;
  }

  nav ul {
    display: none;
    flex-direction: column;
    background: var(--card-bg);
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    padding: 24px 20px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
    gap: 18px;
    border-radius: 0 0 20px 20px;
    z-index: 100;
  }

  body.dark-mode nav ul {
    background: var(--card-bg-dark);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  }

  nav ul.open {
    display: flex;
  }

  nav a {
    font-size: 1rem;
    padding: 8px 0;
  }

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

  .stat-number {
    font-size: 2.4rem;
  }

  .howto-step {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 46px;
    height: 46px;
    font-size: 1.3rem;
  }

  .search-box {
    flex-direction: column;
    border-radius: 20px;
    overflow: hidden;
  }

  .search-box input {
    border-radius: 20px 20px 0 0;
    border-right: 2px solid #e0e0e0;
    border-bottom: none;
  }

  .search-box button {
    border-radius: 0 0 20px 20px;
    padding: 14px;
  }

  .card {
    padding: 24px 20px;
  }
}

/* 小手机 < 480px */
@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.7rem;
  }

  .logo {
    font-size: 1.2rem;
  }

  .logo svg {
    width: 30px;
    height: 30px;
  }

  .dark-toggle {
    padding: 6px 14px;
    font-size: 0.8rem;
  }
}

/* ============================================================
   滚动动画 (Intersection Observer 配合)
   默认隐藏，当进入视口时显示 (由JS添加类 .animate-in)
   ============================================================ */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* 针对不同方向 */
.animate-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.animate-left.animate-in {
  opacity: 1;
  transform: translateX(0);
}

.animate-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.animate-right.animate-in {
  opacity: 1;
  transform: translateX(0);
}

.animate-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-scale.animate-in {
  opacity: 1;
  transform: scale(1);
}

/* ============================================================
   附加辅助类
   ============================================================ */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.p-relative { position: relative; }
.overflow-hidden { overflow: hidden; }

/* 渐变分隔线装饰 */
.gradient-divider {
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--secondary));
  width: 80px;
  margin: 16px auto;
  border-radius: 4px;
}

/* 标签徽章 */
.badge {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 4px 14px;
  border-radius: 40px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ============================================================
   打印样式 (可选)
   ============================================================ */
@media print {
  header, footer, .back-to-top, .menu-toggle, .dark-toggle, .search-box {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}