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

:root {
  --primary: #1a1a2e;
  --accent: #ffd700;
  --accent-light: #ffe44d;
  --bg: #f8f9fc;
  --surface: #ffffff;
  --text: #222;
  --text-light: #555;
  --glass-bg: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.25);
  --shadow: 0 8px 32px rgba(26, 26, 46, 0.12);
  --radius: 16px;
  --radius-sm: 8px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* ===== 暗色模式 ===== */
body.dark-mode,
body[style*="background-color: rgb(18, 18, 18)"] {
  --bg: #121212;
  --surface: #1e1e1e;
  --text: #e0e0e0;
  --text-light: #aaa;
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.12);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-light);
}

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

header nav {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
}

header nav a[aria-label="皇冠体育首页"] {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

header nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
}

header nav ul li a {
  text-decoration: none;
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  position: relative;
}

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

header nav ul li a:hover::after,
header nav ul li a.active::after {
  transform: translateX(-50%) scaleX(1);
}

header nav ul li a:hover,
header nav ul li a.active {
  background: rgba(255, 215, 0, 0.12);
  color: var(--accent);
}

header nav button {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

header nav button:hover {
  background: rgba(255, 255, 255, 0.1);
}

header nav button svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
}

/* ===== Hero / Banner 渐变 ===== */
#hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  overflow: hidden;
  padding: 60px 24px;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(255, 215, 0, 0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 50%, rgba(255, 215, 0, 0.05) 0%, transparent 60%);
  pointer-events: none;
}

#hero > div {
  position: relative;
  z-index: 1;
  max-width: 800px;
  animation: fadeInUp 1s ease forwards;
}

#hero h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 800;
  color: #fff;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  margin-bottom: 20px;
  letter-spacing: 1px;
}

#hero h1::after {
  content: '';
  display: block;
  width: 80px;
  height: 4px;
  background: var(--accent);
  margin: 16px auto 0;
  border-radius: 4px;
}

#hero p {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 32px;
  line-height: 1.8;
}

#hero a[role="button"] {
  display: inline-block;
  padding: 14px 40px;
  background: var(--accent);
  color: var(--primary);
  font-weight: 700;
  font-size: 1.05rem;
  border-radius: 50px;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  box-shadow: 0 8px 24px rgba(255, 215, 0, 0.35);
}

#hero a[role="button"]:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 32px rgba(255, 215, 0, 0.5);
  background: var(--accent-light);
}

/* ===== 通用 Section ===== */
main section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 80px 24px;
  animation: fadeInUp 0.8s ease forwards;
  opacity: 0;
}

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

/* 交错动画延迟 */
main section:nth-child(2) { animation-delay: 0.1s; }
main section:nth-child(3) { animation-delay: 0.2s; }
main section:nth-child(4) { animation-delay: 0.3s; }
main section:nth-child(5) { animation-delay: 0.4s; }
main section:nth-child(6) { animation-delay: 0.5s; }
main section:nth-child(7) { animation-delay: 0.6s; }
main section:nth-child(8) { animation-delay: 0.7s; }
main section:nth-child(9) { animation-delay: 0.8s; }
main section:nth-child(10) { animation-delay: 0.9s; }
main section:nth-child(11) { animation-delay: 1.0s; }

h2 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
  position: relative;
  display: inline-block;
}

body.dark-mode h2,
body[style*="background-color: rgb(18, 18, 18)"] h2 {
  color: var(--accent);
}

h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin-top: 8px;
  border-radius: 4px;
}

section > p {
  font-size: 1.05rem;
  color: var(--text-light);
  max-width: 720px;
  margin-bottom: 32px;
}

/* ===== 卡片通用 ===== */
section ul, section ol {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

section li, section article {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

section li:hover, section article:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(26, 26, 46, 0.18);
}

body.dark-mode section li:hover,
body[style*="background-color: rgb(18, 18, 18)"] section li:hover {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

section li h3, section article h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

body.dark-mode section li h3,
body[style*="background-color: rgb(18, 18, 18)"] section li h3 {
  color: var(--accent);
}

section li p, section article p {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ===== 毛玻璃卡片 (用于部分卡片) ===== */
section.glass li {
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

/* ===== 评价块 ===== */
blockquote {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px 28px;
  border-left: 4px solid var(--accent);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  font-style: italic;
  transition: transform var(--transition);
}

blockquote:hover {
  transform: translateX(6px);
}

blockquote p {
  color: var(--text-light);
  font-size: 1rem;
}

/* ===== FAQ ===== */
#faq dl {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#faq dt button {
  width: 100%;
  text-align: left;
  padding: 16px 20px;
  background: var(--surface);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: background var(--transition), color var(--transition);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#faq dt button::after {
  content: '▾';
  font-size: 0.8rem;
  transition: transform var(--transition);
  color: var(--accent);
}

#faq dt button[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

#faq dt button:hover {
  background: rgba(255, 215, 0, 0.06);
  color: var(--accent);
}

#faq dd {
  padding: 12px 20px 16px;
  color: var(--text-light);
  font-size: 0.95rem;
  border-left: 3px solid var(--accent);
  margin-left: 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--surface);
}

/* ===== HowTo ===== */
#howto ol {
  counter-reset: step;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#howto ol li {
  counter-increment: step;
  padding: 16px 20px 16px 56px;
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform var(--transition);
}

#howto ol li:hover {
  transform: translateX(6px);
}

#howto ol li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: var(--primary);
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

#howto ol li strong {
  color: var(--primary);
}

body.dark-mode #howto ol li strong,
body[style*="background-color: rgb(18, 18, 18)"] #howto ol li strong {
  color: var(--accent);
}

/* ===== 联系方式 ===== */
address p {
  margin-bottom: 8px;
}

address a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

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

/* ===== 文章列表 (insights) ===== */
#insights article {
  padding: 20px 24px;
}

#insights article h3 a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

body.dark-mode #insights article h3 a,
body[style*="background-color: rgb(18, 18, 18)"] #insights article h3 a {
  color: var(--accent);
}

#insights article h3 a:hover {
  color: var(--accent);
}

/* ===== Footer ===== */
footer {
  background: var(--primary);
  color: rgba(255, 255, 255, 0.8);
  padding: 40px 24px 24px;
  text-align: center;
}

footer nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  margin-bottom: 20px;
}

footer nav ul li a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition);
}

footer nav ul li a:hover {
  color: var(--accent);
}

footer p {
  font-size: 0.85rem;
  opacity: 0.7;
}

/* ===== 搜索弹窗 ===== */
#searchModal > div {
  animation: fadeInUp 0.4s ease;
}

#searchModal label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--primary);
}

#searchModal input[type="search"]:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
}

/* ===== 返回顶部 ===== */
#backToTop {
  transition: opacity var(--transition), transform var(--transition);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  z-index: 100;
}

#backToTop:hover {
  transform: scale(1.1);
  background: var(--accent);
  color: var(--primary);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  header nav {
    padding: 0 16px;
    gap: 12px;
    height: 56px;
  }

  header nav ul {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: rgba(26, 26, 46, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 16px;
    gap: 4px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
    z-index: 998;
  }

  header nav ul li a {
    padding: 12px 16px;
    width: 100%;
  }

  header nav button:last-child {
    display: flex;
  }

  main section {
    padding: 48px 16px;
  }

  section ul, section ol {
    grid-template-columns: 1fr;
  }

  #hero {
    min-height: 60vh;
    padding: 40px 16px;
  }

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

  #searchModal > div {
    margin: 60px 16px;
    padding: 16px;
  }

  footer nav ul {
    gap: 4px 16px;
  }
}

@media (max-width: 480px) {
  header nav ul li a {
    font-size: 0.9rem;
    padding: 10px 12px;
  }

  #hero h1 {
    font-size: 1.5rem;
  }

  #hero a[role="button"] {
    padding: 12px 28px;
    font-size: 0.95rem;
  }
}

/* ===== 桌面端显示菜单按钮 ===== */
@media (min-width: 769px) {
  header nav button:last-child {
    display: none;
  }
}

/* ===== 滚动高亮 ===== */
nav a.active {
  color: var(--accent) !important;
  background: rgba(255, 215, 0, 0.12);
}

/* ===== 计数器样式 (备用) ===== */
.counter {
  font-weight: 800;
  color: var(--accent);
  font-size: 1.2em;
}

/* ===== 通用链接 ===== */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-light);
}

/* ===== 选中状态 ===== */
::selection {
  background: var(--accent);
  color: var(--primary);
}