:root {
  --primary-color: #a855f7;  /* Purple-500 */
  --secondary-color: #22d3ee; /* Cyan-400 */
  --accent-color: #ec4899;   /* Pink-500 */
  --bg-dark: #030712;        /* Gray-950 */
  --card-bg: rgba(17, 24, 39, 0.4);
  --glass-border: rgba(255, 255, 255, 0.12);
  --text-main: #f9fafb;
  --text-secondary: #9ca3af;
  --neon-glow: 0 0 20px rgba(168, 85, 247, 0.3);
  --transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

/* 文字渐变特效 (ReactBits 风格) */
.text-gradient {
  background: linear-gradient(90deg, #a855f7 0%, #818cf8 50%, #22d3ee 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

/* 页面标题专用渐变 (字数少时使用) */
.header h1.text-gradient {
  background: linear-gradient(90deg, #a855f7 0%, #818cf8 50%, #22d3ee 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  /* ReactBits 风格的动态底色渐变 */
  background-image:
    radial-gradient(circle at 0% 0%, rgba(168, 85, 247, 0.15) 0%, transparent 35%),
    radial-gradient(circle at 100% 100%, rgba(34, 211, 238, 0.15) 0%, transparent 35%),
    radial-gradient(circle at 50% 50%, rgba(17, 24, 39, 1) 0%, rgba(3, 7, 18, 1) 100%);
  background-attachment: fixed;
}

/* 添加一个微妙的网格背景，类似 ReactBits 的设计 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: -1;
}

.layout {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* 背景装饰层 */
.bg-decoration {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.glow-sphere {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.15) 0%, transparent 70%);
  filter: blur(80px);
  animation: float-glow 20s infinite alternate;
}

@keyframes float-glow {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
  100% { transform: translate(-45%, -55%) scale(1.2); opacity: 0.8; }
}

/* 侧边栏样式微调 */
.sidebar {
  width: 260px;
  background: rgba(3, 7, 18, 0.5); /* 降低透明度，透出背景 */
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
  position: fixed;
  height: 100vh;
  padding: 40px 16px;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.logo {
  padding: 0 20px 48px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  text-transform: uppercase;
}

.logo i {
  width: 24px;
  height: 24px;
  color: var(--primary-color);
  filter: drop-shadow(0 0 8px rgba(114, 46, 209, 0.5));
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  padding: 12px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 500;
  font-size: 15px;
  border-radius: 12px;
  transition: var(--transition);
  flex-direction: row; /* PC端保持横向 */
}

.nav-icon {
  width: 18px;
  height: 18px;
  stroke-width: 2.5px;
  opacity: 0.7;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  color: #fff;
  background: rgba(114, 46, 209, 0.15);
  box-shadow: inset 0 0 0 1px rgba(114, 46, 209, 0.3);
}

.nav-item.active .nav-icon {
  color: var(--primary-color);
  opacity: 1;
}

/* Main Content */
.main {
  margin-left: 280px;
  flex: 1;
  padding: 60px 80px;
  max-width: 1600px;
}

.header {
  margin-bottom: 48px;
}

.header h1 {
  font-size: 42px;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -1px;
}

.header p {
  color: var(--text-secondary);
  font-size: 18px;
}

/* 统一小标题样式 - 带左侧装饰线 */
.section-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.section-badge-line {
  display: block;
  width: 40px;
  height: 2px;
  background: linear-gradient(to right, var(--primary-color), transparent);
}

.section-badge-text {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Card Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 32px;
}

.card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 32px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* 模拟 ReactBits 的发光边框效果 */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 24px;
  padding: 1.5px; /* 边框宽度 */
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.6), rgba(129, 140, 248, 0.3), rgba(34, 211, 238, 0.6));
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  pointer-events: none;
  opacity: 0.8;
  transition: opacity 0.3s;
}

.card:hover::after {
  opacity: 1;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.9), rgba(129, 140, 248, 0.5), rgba(34, 211, 238, 0.9));
}

/* 语言切换按钮样式已移除 */

/* Problem Card Elements */
.problem-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.problem-no {
  display: inline-block;
  background: var(--primary-color);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 6px;
}

.difficulty {
  color: #ffc069;
  font-size: 13px;
  margin-bottom: 12px;
  font-weight: 500;
}

.card h3 {
  font-size: 20px;
  margin-bottom: 16px;
  line-height: 1.4;
  font-weight: 700;
  color: #fff;
}

.tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.tag {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.score-badge {
  color: var(--secondary-color);
  font-weight: 700;
  font-size: 18px;
}

/* Problem Image */
.problem-image-container {
  margin-bottom: 24px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: #0d0d0f;
  cursor: zoom-in;
  /* 让容器宽度自适应图片 */
  display: inline-block;
  max-width: 100%;
}

.problem-image {
  max-width: 100%;
  height: auto;
  display: block;
  transition: var(--transition);
}

.card:hover .problem-image {
  transform: scale(1.05);
}

/* Markdown Content */
.markdown-body {
  border-top: 1px solid var(--glass-border);
  padding-top: 20px;
  flex-grow: 1;
}

.markdown-body strong {
  color: var(--secondary-color);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  margin-bottom: 8px;
}

.markdown-body strong::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 12px;
  background: var(--secondary-color);
  border-radius: 2px;
}

.markdown-body p {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 12px;
}

.markdown-body ul, .markdown-body ol {
  padding-left: 18px;
  margin-bottom: 12px;
  color: var(--text-secondary);
  font-size: 13px;
}

.markdown-body li {
  margin-bottom: 4px;
}

.markdown-body code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Mono', monospace;
  font-size: 0.9em;
  color: var(--secondary-color);
}

.markdown-body a {
  color: var(--secondary-color);
  text-decoration: none;
}

.markdown-body a:hover {
  text-decoration: underline;
}

/* Ranking Table */
.table-container {
  background: var(--card-bg);
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  padding: 16px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

th {
  padding: 16px 24px;
  text-align: left;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1px;
}

td {
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.02);
  transition: var(--transition);
}

tr td:first-child { border-radius: 12px 0 0 12px; }
tr td:last-child { border-radius: 0 12px 12px 0; }

tr:hover td {
  background: rgba(255, 255, 255, 0.05);
}

.rank-badge {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: bold;
  background: rgba(255, 255, 255, 0.05);
}

.rank-1 { background: linear-gradient(135deg, #fadb14 0%, #d4b106 100%); color: #000; box-shadow: 0 0 15px rgba(250, 219, 20, 0.3); }
.rank-2 { background: linear-gradient(135deg, #d9d9d9 0%, #8c8c8c 100%); color: #000; }
.rank-3 { background: linear-gradient(135deg, #ffa940 0%, #d46b08 100%); color: #000; }

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  box-shadow: 0 0 40px rgba(0,0,0,0.5);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.card, tr {
  animation: fadeIn 0.6s ease-out forwards;
}

/* ============================================
   RESPONSIVE DESIGN - 全设备适配
   ============================================ */

/* 大屏幕笔记本 (1200px - 1440px) */
@media (max-width: 1440px) {
  .main {
    padding: 48px 60px;
  }

  .header h1 {
    font-size: 36px;
  }
}

/* 中等屏幕 (992px - 1200px) */
@media (max-width: 1200px) {
  .main {
    padding: 40px 48px;
  }

  .sidebar {
    width: 220px;
  }

  .main {
    margin-left: 220px;
  }

  .logo {
    font-size: 16px;
    padding: 0 16px 36px;
  }
}

/* 平板横屏 / 小笔记本 (768px - 992px) */
@media (max-width: 992px) {
  .sidebar {
    width: 200px;
    padding: 32px 12px;
  }

  .main {
    margin-left: 200px;
    padding: 32px;
  }

  .logo {
    font-size: 14px;
    padding: 0 12px 28px;
  }

  .nav-item {
    padding: 10px 14px;
    font-size: 13px;
    gap: 10px;
  }

  .header h1 {
    font-size: 32px;
  }
}

/* 平板竖屏 + 手机 (< 768px) */
@media (max-width: 768px) {
  /* 侧边栏变为顶部导航 */
  .layout {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    padding: 12px 16px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-right: none;
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    background: rgba(3, 7, 18, 0.95);
  }

  .logo {
    padding: 0;
    font-size: 14px;
  }

  .nav-group {
    flex-direction: row;
    gap: 4px;
  }

  .nav-item {
    padding: 6px 10px;
    font-size: 10px;
    border-radius: 8px;
    flex-direction: column; /* 纵向排列图标和文字 */
    gap: 4px;
    min-width: 60px;
    justify-content: center;
  }

  .nav-text {
    display: block; /* 恢复文字显示 */
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
  }

  .nav-icon {
    width: 18px;
    height: 18px;
    opacity: 0.8;
  }

  .main {
    margin-left: 0;
    margin-top: 90px; /* 增加顶部间距，让副标题远离导航栏 */
    padding: 24px 20px;
  }

  .header {
    margin-bottom: 24px;
  }

  /* 首页 hero-badge 和通用 section-badge 移动端增加顶部间距 */
  .hero-badge,
  .section-badge {
    margin-top: 16px;
  }

  /* 移动端副标题字体统一 */
  .hero-badge-text,
  .section-badge-text {
    font-size: 11px;
    letter-spacing: 1.5px;
  }

  .hero-badge-line,
  .section-badge-line {
    width: 24px;
  }

  /* 移动端标题层级优化 */
  .header h1 {
    font-size: 28px !important;
  }

  .header p {
    font-size: 13px;
  }

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

  .card {
    padding: 20px;
    border-radius: 16px;
  }

  /* 卡片内标题和数字 - 必须小于页面标题 */
  .card h2 {
    font-size: 24px !important;
  }

  .card h3 {
    font-size: 16px;
  }

  /* 表格优化 */
  .table-container {
    overflow-x: auto;
    padding: 12px;
  }

  table {
    min-width: 400px;
  }

  th, td {
    padding: 12px 8px;
    font-size: 12px;
  }

  /* 统计卡片优化 */
  .ranking-stats {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  /* 题库页两栏改单列 */
  .intro-section {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }
}

/* 手机大屏 (414px - 576px) */
@media (max-width: 576px) {
  .sidebar {
    padding: 10px 12px;
  }

  .logo {
    font-size: 12px;
    gap: 6px;
  }

  .logo i {
    width: 18px;
    height: 18px;
  }

  .nav-item {
    padding: 6px 8px;
  }

  .nav-icon {
    width: 18px;
    height: 18px;
  }

  .main {
    margin-top: 52px;
    padding: 16px 14px;
  }

  .header {
    margin-bottom: 20px;
  }

  .header h1 {
    font-size: 24px !important;
  }

  .header p {
    font-size: 12px;
  }

  .card {
    padding: 16px;
    border-radius: 12px;
  }

  .card h2 {
    font-size: 20px !important;
  }

  .card h3 {
    font-size: 14px;
    margin-bottom: 10px;
  }

  .problem-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .score-badge {
    font-size: 14px;
  }

  .tag {
    font-size: 9px;
    padding: 2px 6px;
  }

  .markdown-body p,
  .markdown-body li {
    font-size: 12px;
  }

  th, td {
    padding: 10px 6px;
    font-size: 11px;
  }

  .rank-badge {
    width: 26px;
    height: 26px;
    font-size: 11px;
  }

  /* 卡片内规则描述 */
  div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
}

/* 手机小屏 (320px - 414px) */
@media (max-width: 414px) {
  .logo span {
    display: none;
  }

  .main {
    padding: 14px 10px;
  }

  .header h1 {
    font-size: 22px !important;
  }

  .header p {
    font-size: 11px;
  }

  .card {
    padding: 14px;
  }

  .card h2 {
    font-size: 18px !important;
  }

  th, td {
    padding: 8px 4px;
    font-size: 10px;
  }

  .rank-badge {
    width: 24px;
    height: 24px;
    font-size: 10px;
  }
}

/* 超小屏幕 (< 320px) */
@media (max-width: 320px) {
  .main {
    padding: 12px 8px;
  }

  .header h1 {
    font-size: 20px !important;
  }

  .card {
    padding: 12px;
  }

  .card h2 {
    font-size: 16px !important;
  }
}

/* 横屏手机特殊处理 */
@media (max-height: 500px) and (orientation: landscape) {
  .sidebar {
    padding: 8px 16px;
  }

  .main {
    margin-top: 48px;
  }

  .header {
    margin-bottom: 16px;
  }

  .header h1 {
    font-size: 24px !important;
  }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .card {
    border-width: 0.5px;
  }

  .sidebar {
    border-right-width: 0.5px;
  }
}

/* 暗色模式下的滚动条美化 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
  .card:hover {
    transform: none;
  }

  .nav-item:hover {
    background: transparent;
  }

  .nav-item:active {
    background: rgba(255, 255, 255, 0.05);
  }
}

/* ============================================
   性能优化 - 低端设备降级
   ============================================ */

/* 减少动画偏好的用户 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .glow-sphere {
    animation: none !important;
  }

  .hero-image:hover img {
    transform: none;
  }

  .card:hover .problem-image {
    transform: none;
  }

  /* 禁用图片特效动画 */
  .hero-image::before,
  .hero-image::after {
    animation: none !important;
  }

  .hero-image-scanline {
    display: none !important;
  }
}

/* 移动端性能优化 - 降级 backdrop-filter */
@media (max-width: 768px) {
  /* 侧边栏降级：使用半透明背景代替模糊 */
  .sidebar {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(3, 7, 18, 0.97);
  }

  /* 卡片降级：移除模糊，使用更深的背景，增强边框 */
  .card {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(17, 24, 39, 0.95);
    /* 移动端增强边框可见度 */
    border: 1px solid rgba(168, 85, 247, 0.3);
    box-shadow: 
      0 0 0 1px rgba(255, 255, 255, 0.05),
      0 4px 20px rgba(0, 0, 0, 0.3);
  }

  /* 统计卡片特殊边框 */
  .stat-card {
    border: 1px solid rgba(34, 211, 238, 0.25);
  }

  /* 表格容器边框 */
  .table-container {
    border: 1px solid rgba(168, 85, 247, 0.25);
  }

  /* 减少 glow-sphere 的模糊半径 */
  .glow-sphere {
    width: 300px;
    height: 300px;
    filter: blur(40px);
    animation: none; /* 移动端禁用动画 */
    opacity: 0.4;
  }

  .glow-sphere-2 {
    display: none; /* 隐藏第二个光晕 */
  }

  /* 简化卡片边框效果，但保留基础发光 */
  .card::after {
    display: none;
  }

  /* 禁用 hover 变换动画 */
  .card:hover {
    transform: none;
  }

  /* 题目卡片边框增强 */
  .card.problem-card {
    border: 1px solid rgba(129, 140, 248, 0.3);
  }

  /* hero-content 边框增强 */
  .hero-content {
    border: 1px solid rgba(168, 85, 247, 0.35);
  }
}

/* 低端设备检测 - 基于更保守的判断 */
@media (max-width: 480px) {
  /* 完全禁用所有模糊效果 */
  .sidebar,
  .card,
  .lightbox {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* 隐藏装饰性元素 */
  .glow-sphere,
  .glow-sphere-2,
  .bg-decoration .grid-svg {
    display: none;
  }

  /* 简化背景 */
  body::before {
    display: none;
  }

  /* 使用纯色背景代替渐变 */
  body {
    background: var(--bg-dark);
    background-image: none;
  }

  /* 小屏幕卡片边框更明显 */
  .card {
    border: 1px solid rgba(168, 85, 247, 0.4) !important;
    background: rgba(17, 24, 39, 0.98) !important;
  }

  .stat-card {
    border-color: rgba(34, 211, 238, 0.35) !important;
  }

  .table-container {
    border: 1px solid rgba(168, 85, 247, 0.3) !important;
  }
}

/* Safari 特定优化 - Safari 的 backdrop-filter 性能较差 */
@supports (-webkit-touch-callout: none) {
  @media (max-width: 992px) {
    .sidebar,
    .card {
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
    }

    .sidebar {
      background: rgba(3, 7, 18, 0.98);
    }

    .card {
      background: rgba(17, 24, 39, 0.96);
    }
  }
}

/* 打印样式 */
@media print {
  .sidebar {
    display: none;
  }

  .main {
    margin-left: 0;
    padding: 20px;
  }

  .card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* ============================================
   首页 Hero 布局系统
   ============================================ */

/* Hero Header */
.hero-header {
  margin-bottom: 48px;
}

.hero-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.hero-badge-line {
  display: block;
  width: 40px;
  height: 2px;
  background: linear-gradient(to right, var(--primary-color), transparent);
}

.hero-badge-text {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 900;
  line-height: 1.4; /* 增加行高，让两行文字间距更大 */
  letter-spacing: -1px;
}

.hero-subtitle {
  color: var(--secondary-color);
  display: inline-block;
  margin-top: 8px; /* 额外增加顶部间距 */
}

/* Hero Section - 两栏布局 */
.hero-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin-top: 32px;
}

/* Hero Content (左侧文案) */
.hero-content {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  padding: 40px;
  border: 1px solid var(--glass-border);
  position: relative;
}

.hero-content::before {
  content: '';
  position: absolute;
  left: 0;
  top: 24px;
  bottom: 24px;
  width: 4px;
  background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
  border-radius: 2px;
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-desc-main {
  font-size: clamp(16px, 2vw, 20px);
  color: #fff;
  line-height: 1.7;
  font-weight: 500;
}

.hero-desc-sub {
  font-size: clamp(14px, 1.5vw, 16px);
  color: var(--text-secondary);
  line-height: 1.8;
}

/* Hero Stats */
.hero-stats {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-item {
  text-align: center;
  flex: 1;
}

.stat-number {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 900;
  line-height: 1;
  font-family: 'Inter', sans-serif;
}

/* 依次使用渐变中的三个主色调 */
.stat-primary {
  color: #a855f7; /* 紫色 */
  text-shadow: 0 0 30px rgba(168, 85, 247, 0.4);
}

.stat-secondary {
  color: #818cf8; /* 蓝紫色 (过渡色) */
  text-shadow: 0 0 30px rgba(129, 140, 248, 0.4);
}

.stat-accent {
  color: #22d3ee; /* 青色 */
  text-shadow: 0 0 30px rgba(34, 211, 238, 0.4);
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: rgba(255, 255, 255, 0.08);
}

/* Hero Image */
.hero-image {
  border-radius: 24px;
  overflow: visible;
  position: relative;
  /* PC端：向上偏移，与标题顶部对齐 */
  margin-top: -120px;
  align-self: start;
  /* 为旋转边框预留空间 */
  padding: 3px;
}

/* 图片容器 - 实际裁剪区域 */
.hero-image-inner {
  position: relative;
  border-radius: 21px;
  overflow: hidden;
  background: #0a0a12;
}

/* 渐变叠加层 - 科技感滤镜 */
.hero-image-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    linear-gradient(180deg, rgba(168, 85, 247, 0.08) 0%, transparent 30%),
    linear-gradient(0deg, rgba(34, 211, 238, 0.08) 0%, transparent 30%);
  z-index: 2;
  pointer-events: none;
}

/* 动态旋转渐变边框 - 高级科技感 */
.hero-image::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  padding: 2px;
  background: conic-gradient(
    from var(--border-angle, 0deg),
    #a855f7 0deg,
    #818cf8 60deg,
    #22d3ee 120deg,
    #06b6d4 180deg,
    #818cf8 240deg,
    #a855f7 300deg,
    #a855f7 360deg
  );
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: hero-border-rotate 8s linear infinite;
  will-change: --border-angle;
}

/* 外发光脉冲效果 */
.hero-image::after {
  content: '';
  position: absolute;
  inset: -15px;
  border-radius: 35px;
  background: 
    radial-gradient(ellipse at 30% 20%, rgba(168, 85, 247, 0.2) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(34, 211, 238, 0.2) 0%, transparent 50%);
  z-index: -1;
  opacity: 0.6;
  animation: hero-glow-pulse 3s ease-in-out infinite alternate;
  will-change: opacity, transform;
  pointer-events: none;
  filter: blur(20px);
}

@property --border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes hero-border-rotate {
  to { --border-angle: 360deg; }
}

@keyframes hero-glow-pulse {
  0% { opacity: 0.4; transform: scale(1); }
  100% { opacity: 0.8; transform: scale(1.03); }
}

/* 角落装饰 - 更精致 */
.hero-image-corner {
  position: absolute;
  width: 32px;
  height: 32px;
  z-index: 5;
  pointer-events: none;
}

.hero-image-corner::before,
.hero-image-corner::after {
  content: '';
  position: absolute;
  background: linear-gradient(90deg, #a855f7, #22d3ee);
}

.hero-image-corner.top-left::before {
  top: 0; left: 0;
  width: 100%; height: 2px;
}
.hero-image-corner.top-left::after {
  top: 0; left: 0;
  width: 2px; height: 100%;
}

.hero-image-corner.top-right::before {
  top: 0; right: 0;
  width: 100%; height: 2px;
}
.hero-image-corner.top-right::after {
  top: 0; right: 0;
  width: 2px; height: 100%;
}

.hero-image-corner.bottom-left::before {
  bottom: 0; left: 0;
  width: 100%; height: 2px;
}
.hero-image-corner.bottom-left::after {
  bottom: 0; left: 0;
  width: 2px; height: 100%;
}

.hero-image-corner.bottom-right::before {
  bottom: 0; right: 0;
  width: 100%; height: 2px;
}
.hero-image-corner.bottom-right::after {
  bottom: 0; right: 0;
  width: 2px; height: 100%;
}

.hero-image-corner.top-left { top: -6px; left: -6px; }
.hero-image-corner.top-right { top: -6px; right: -6px; }
.hero-image-corner.bottom-left { bottom: -6px; left: -6px; }
.hero-image-corner.bottom-right { bottom: -6px; right: -6px; }

/* 扫描线效果 - 更流畅 */
.hero-image-scanline {
  position: absolute;
  top: 0;
  left: 3px;
  right: 3px;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(34, 211, 238, 0.3) 20%,
    rgba(34, 211, 238, 0.9) 50%,
    rgba(34, 211, 238, 0.3) 80%,
    transparent 100%
  );
  z-index: 6;
  opacity: 0;
  animation: hero-scanline 5s ease-in-out infinite;
  animation-delay: 2s;
  will-change: transform, opacity;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.5);
}

@keyframes hero-scanline {
  0% { 
    transform: translateY(0); 
    opacity: 0; 
  }
  3% { 
    opacity: 1; 
  }
  97% { 
    opacity: 1; 
  }
  100% { 
    transform: translateY(calc(100cqh - 6px)); 
    opacity: 0; 
  }
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

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

/* 悬停时增强效果 */
.hero-image:hover::before {
  animation-duration: 4s;
}

.hero-image:hover::after {
  opacity: 1;
  filter: blur(25px);
}

.hero-image:hover .hero-image-corner::before,
.hero-image:hover .hero-image-corner::after {
  background: linear-gradient(90deg, #22d3ee, #a855f7);
}

/* 第二个光晕球 */
.glow-sphere-2 {
  top: 70%;
  left: 80%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.12) 0%, transparent 70%);
  animation-delay: -10s;
}

/* ============================================
   首页响应式优化
   ============================================ */

@media (max-width: 1200px) {
  .hero-section {
    gap: 32px;
  }

  .hero-content {
    padding: 32px;
  }

  .hero-stats {
    gap: 24px;
  }
}

@media (max-width: 992px) {
  .hero-section {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-image {
    order: -1;
    max-height: 400px;
    /* 移动端：取消向上偏移 */
    margin-top: 0;
    align-self: auto;
  }

  .hero-image img {
    height: 400px;
  }

  /* 移动端：简化图片特效，保持视觉但减少性能消耗 */
  .hero-image {
    padding: 2px;
  }

  .hero-image::before {
    animation: none;
    background: linear-gradient(135deg, #a855f7, #818cf8, #22d3ee);
  }

  .hero-image::after {
    display: none; /* 隐藏外发光 */
  }

  .hero-image-scanline {
    display: none; /* 隐藏扫描线 */
  }

  .hero-image-corner {
    width: 20px;
    height: 20px;
  }

  .hero-image-corner.top-left { top: -4px; left: -4px; }
  .hero-image-corner.top-right { top: -4px; right: -4px; }
  .hero-image-corner.bottom-left { bottom: -4px; left: -4px; }
  .hero-image-corner.bottom-right { bottom: -4px; right: -4px; }

  .hero-image-inner {
    border-radius: 14px;
  }

  .hero-content {
    padding: 32px;
  }

  .hero-content::before {
    display: none;
  }

  .hero-stats {
    flex-wrap: wrap;
    justify-content: center;
  }

  .stat-divider {
    display: none;
  }

  .stat-item {
    flex: 0 0 auto;
    min-width: 100px;
  }
}

@media (max-width: 768px) {
  .hero-header {
    margin-bottom: 32px;
  }

  .hero-badge-line {
    width: 24px;
  }

  .hero-badge-text {
    font-size: 11px;
  }

  .hero-section {
    gap: 24px;
  }

  .hero-image {
    max-height: 280px;
    border-radius: 16px;
  }

  .hero-image img {
    height: 280px;
  }

  .hero-content {
    padding: 24px;
    border-radius: 16px;
  }

  .hero-stats {
    gap: 16px;
    margin-top: 24px;
    padding-top: 24px;
  }

  .stat-number {
    font-size: 28px;
  }

  .stat-label {
    font-size: 10px;
  }
}

@media (max-width: 480px) {
  .hero-header {
    margin-bottom: 24px;
  }

  .hero-image {
    max-height: 220px;
    border-radius: 12px;
  }

  .hero-image img {
    height: 220px;
  }

  /* 小屏幕：简化图片特效以提升性能 */
  .hero-image {
    padding: 2px;
  }

  .hero-image::before {
    animation: none !important;
    background: linear-gradient(135deg, #a855f7, #22d3ee) !important;
  }

  .hero-image::after,
  .hero-image-scanline,
  .hero-image-corner {
    display: none !important;
  }

  .hero-image-inner {
    border-radius: 10px;
  }

  .hero-image-inner::before {
    display: none;
  }

  .hero-content {
    padding: 20px;
    border-radius: 12px;
  }

  .hero-text {
    gap: 12px;
  }

  .hero-stats {
    gap: 8px;
    flex-wrap: nowrap;
  }

  .stat-item {
    min-width: auto;
    flex: 1;
  }

  .stat-number {
    font-size: 24px;
  }

  .stat-label {
    font-size: 9px;
    letter-spacing: 0.5px;
  }
}

/* ============================================
   首页特殊布局响应式
   ============================================ */

/* 题库页面两栏布局响应式 */
.intro-section {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
}

@media (max-width: 992px) {
  .intro-section {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }
}

/* 排名页面统计卡片响应式 */
.ranking-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

/* 统计卡片样式 */
.stat-card {
  padding: 24px;
}

.stat-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.stat-card-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.stat-card-icon {
  width: 20px;
  height: 20px;
  opacity: 0.6;
}

.stat-icon-cyan { color: var(--secondary-color); }
.stat-icon-purple { color: var(--primary-color); }
.stat-icon-gold { color: #fadb14; }

.stat-card-value {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 8px;
}

.stat-value-cyan { color: var(--secondary-color); }
.stat-value-purple { color: var(--primary-color); }
.stat-value-gold { color: #fadb14; }

.stat-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

@media (max-width: 768px) {
  .ranking-stats {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-card-value {
    font-size: 22px;
  }

  .stat-card-desc {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .stat-card {
    padding: 14px;
  }

  .stat-card-value {
    font-size: 20px;
  }

  .stat-card-label {
    font-size: 10px;
  }

  .stat-card-desc {
    font-size: 11px;
  }
}

/* ============================================
   TrueFocus 文字聚焦动效
   ============================================ */

.true-focus-container {
  position: relative;
  display: flex;
  gap: 0.3em;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  outline: none;
  user-select: none;
}

.true-focus-word {
  position: relative;
  font-size: inherit;
  font-weight: inherit;
  cursor: pointer;
  transition: filter var(--animation-duration, 0.5s) ease;
  outline: none;
  user-select: none;
  color: inherit;
}

.true-focus-word.active {
  filter: blur(0) !important;
}

.true-focus-word.manual:hover {
  filter: blur(0) !important;
}

.true-focus-frame {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  box-sizing: content-box;
  border: none;
  opacity: 0;
  transition: 
    transform var(--animation-duration, 0.5s) cubic-bezier(0.23, 1, 0.32, 1),
    width var(--animation-duration, 0.5s) cubic-bezier(0.23, 1, 0.32, 1),
    height var(--animation-duration, 0.5s) cubic-bezier(0.23, 1, 0.32, 1),
    opacity var(--animation-duration, 0.5s) ease;
}

.true-focus-corner {
  position: absolute;
  width: 8px;
  height: 8px;
  border: 2px solid var(--border-color, #a855f7);
  filter: drop-shadow(0px 0px 4px var(--glow-color, rgba(168, 85, 247, 0.6)));
  border-radius: 2px;
  transition: none;
}

.true-focus-corner.top-left {
  top: -6px;
  left: -6px;
  border-right: none;
  border-bottom: none;
}

.true-focus-corner.top-right {
  top: -6px;
  right: -6px;
  border-left: none;
  border-bottom: none;
}

.true-focus-corner.bottom-left {
  bottom: -6px;
  left: -6px;
  border-right: none;
  border-top: none;
}

.true-focus-corner.bottom-right {
  bottom: -6px;
  right: -6px;
  border-left: none;
  border-top: none;
}

/* Logo 专用的 TrueFocus 样式 */
.logo .true-focus-container {
  gap: 0.25em;
}

.logo .true-focus-word {
  letter-spacing: 1px;
}

.logo .true-focus-corner {
  width: 6px;
  height: 6px;
  border-width: 2px;
}

.logo .true-focus-corner.top-left {
  top: -4px;
  left: -4px;
}

.logo .true-focus-corner.top-right {
  top: -4px;
  right: -4px;
}

.logo .true-focus-corner.bottom-left {
  bottom: -4px;
  left: -4px;
}

.logo .true-focus-corner.bottom-right {
  bottom: -4px;
  right: -4px;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .logo .true-focus-container {
    gap: 0.2em;
  }
  
  .logo .true-focus-corner {
    width: 5px;
    height: 5px;
    border-width: 1.5px;
  }
  
  .logo .true-focus-corner.top-left,
  .logo .true-focus-corner.top-right,
  .logo .true-focus-corner.bottom-left,
  .logo .true-focus-corner.bottom-right {
    top: -3px;
    left: -3px;
    bottom: -3px;
    right: -3px;
  }
}

/* ============================================
   浮动联系按钮
   ============================================ */

.floating-contact-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.9), rgba(129, 140, 248, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 
    0 2px 12px rgba(168, 85, 247, 0.35),
    0 0 20px rgba(168, 85, 247, 0.15);
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  backdrop-filter: blur(10px);
  animation: floating-btn-pulse 3s ease-in-out infinite;
}

.floating-contact-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 
    0 4px 16px rgba(168, 85, 247, 0.45),
    0 0 30px rgba(168, 85, 247, 0.25);
  background: linear-gradient(135deg, rgba(168, 85, 247, 1), rgba(129, 140, 248, 1));
}

.floating-contact-btn:active {
  transform: translateY(-1px) scale(1.01);
}

.floating-contact-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

@keyframes floating-btn-pulse {
  0%, 100% {
    box-shadow: 
      0 2px 12px rgba(168, 85, 247, 0.35),
      0 0 20px rgba(168, 85, 247, 0.15);
  }
  50% {
    box-shadow: 
      0 2px 16px rgba(168, 85, 247, 0.4),
      0 0 25px rgba(168, 85, 247, 0.2);
  }
}

/* 移动端浮动按钮 */
@media (max-width: 768px) {
  .floating-contact-btn {
    bottom: 16px;
    right: 16px;
    padding: 7px 12px;
    font-size: 11px;
    gap: 5px;
  }

  .floating-contact-btn svg {
    width: 13px;
    height: 13px;
  }
}

@media (max-width: 480px) {
  .floating-contact-btn {
    bottom: 14px;
    right: 14px;
    padding: 6px 10px;
    font-size: 10px;
  }

  .floating-contact-btn svg {
    width: 12px;
    height: 12px;
  }
}

/* ============================================
   微信二维码弹窗
   ============================================ */

.contact-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1001;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.contact-modal.active {
  display: flex;
  opacity: 1;
}

.contact-modal-content {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 40px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  animation: modal-appear 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  box-shadow: 
    0 0 0 1px rgba(168, 85, 247, 0.3),
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 100px rgba(168, 85, 247, 0.15);
}

@keyframes modal-appear {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.contact-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  color: var(--text-secondary);
}

.contact-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: rotate(90deg);
}

.contact-modal-close svg {
  width: 20px;
  height: 20px;
}

.contact-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.contact-modal-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.contact-qr-wrapper {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  display: inline-block;
}

.contact-qr-wrapper img {
  width: 240px;
  height: 240px;
  display: block;
  border-radius: 8px;
}

/* 移动端弹窗优化 */
@media (max-width: 480px) {
  .contact-modal-content {
    padding: 32px 24px;
    border-radius: 20px;
  }

  .contact-modal-title {
    font-size: 18px;
  }

  .contact-qr-wrapper {
    padding: 12px;
  }

  .contact-qr-wrapper img {
    width: 200px;
    height: 200px;
  }
}
