/* ============================================
   jmcomic 漫画平台 - 全站样式表
   暗色科幻主题 · 毛玻璃 · 响应式
   ============================================ */

/* ---------- 基础重置与全局变量 ---------- */
:root {
  --primary: #8b5cf6;
  --primary-light: #a78bfa;
  --primary-dark: #6d28d9;
  --accent: #7c3aed;
  --bg-deep: #07071a;
  --bg-dark: #0d0d20;
  --bg-card: #1a1a35;
  --bg-glass: rgba(26, 26, 53, 0.6);
  --border-color: #2d2d55;
  --text-main: #e0e0f0;
  --text-muted: #b0b0d0;
  --text-dim: #8888aa;
  --text-bright: #f0f0ff;
  --gradient-main: linear-gradient(135deg, #7c3aed, #6d28d9);
  --gradient-hover: linear-gradient(135deg, #8b5cf6, #7c3aed);
  --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 12px 40px rgba(139, 92, 246, 0.25);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--bg-dark);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  border-radius: 10px;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: 
    radial-gradient(ellipse at 20% 0%, rgba(139, 92, 246, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(109, 40, 217, 0.1) 0%, transparent 50%),
    linear-gradient(135deg, #0a0a18 0%, #14142a 100%);
  color: var(--text-main);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  background-attachment: fixed;
}

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

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(139, 92, 246, 0.3); }
  50% { box-shadow: 0 0 35px rgba(139, 92, 246, 0.6); }
}

section {
  animation: fadeInUp 0.6s ease-out both;
}

section:nth-child(2) { animation-delay: 0.1s; }
section:nth-child(3) { animation-delay: 0.2s; }
section:nth-child(4) { animation-delay: 0.3s; }

/* ---------- 容器与通用布局 ---------- */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: var(--transition);
  position: relative;
}

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

a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transition: width 0.3s ease;
}

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

img {
  max-width: 100%;
  display: block;
  background-color: #1c1c3e;
  transition: transform 0.5s ease, filter 0.5s ease;
}

/* ---------- 头部导航 ---------- */
.site-header {
  background: rgba(13, 13, 32, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(45, 45, 85, 0.6);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

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

.logo h1 {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 1px;
  background: linear-gradient(135deg, #f0f0ff 30%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 20px rgba(139, 92, 246, 0.2);
  animation: fadeIn 0.8s ease;
}

.logo h1 span {
  color: var(--primary);
  -webkit-text-fill-color: var(--primary);
  background: none;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  color: #d0d0e8;
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  position: relative;
  transition: var(--transition);
}

.nav-links a::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transition: width 0.3s ease;
}

.nav-links a:hover {
  color: var(--primary-light);
  border-bottom-color: transparent;
}

.nav-links a:hover::before {
  width: 100%;
}

.nav-links a::after {
  display: none;
}

.nav-links .active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.nav-links .active::before {
  width: 100%;
}

/* ---------- 卡片系统 ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 24px;
  margin: 32px 0;
}

.card {
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(45, 45, 85, 0.6);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
  position: relative;
  cursor: pointer;
  box-shadow: var(--shadow-card);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  transition: left 0.5s ease;
}

.card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
}

.card:hover::before {
  left: 100%;
}

.card img {
  width: 100%;
  height: auto;
  aspect-ratio: 220/310;
  object-fit: cover;
  background: linear-gradient(135deg, #1c1c3e, #252550);
  transition: transform 0.5s ease, filter 0.5s ease;
}

.card:hover img {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.card-body {
  padding: 16px 14px;
  background: linear-gradient(180deg, rgba(26, 26, 53, 0.9), rgba(26, 26, 53, 1));
}

.card-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 6px;
  transition: color 0.3s;
}

.card:hover .card-title {
  color: var(--primary-light);
}

.card-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.badge {
  display: inline-block;
  background: rgba(45, 45, 85, 0.8);
  color: var(--primary-light);
  padding: 4px 12px;
  border-radius: 30px;
  font-size: 0.75rem;
  margin-top: 8px;
  border: 1px solid rgba(139, 92, 246, 0.3);
  transition: var(--transition);
}

.badge:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ---------- 区块标题 ---------- */
h2 {
  font-size: 2rem;
  color: var(--text-bright);
  margin: 48px 0 20px;
  border-left: 6px solid var(--primary);
  padding-left: 18px;
  position: relative;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.1), transparent);
  border-radius: 0 8px 8px 0;
  animation: fadeInUp 0.6s ease;
}

h3 {
  font-size: 1.5rem;
  color: var(--text-bright);
  margin: 30px 0 16px;
  position: relative;
}

/* ---------- 侧边栏布局 ---------- */
.layout {
  display: flex;
  gap: 40px;
  margin: 40px 0;
  animation: fadeInUp 0.8s ease;
}

.main-content {
  flex: 3;
  min-width: 0;
}

.sidebar {
  flex: 1.2;
  background: rgba(20, 20, 46, 0.8);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(45, 45, 85, 0.6);
  border-radius: 20px;
  padding: 24px 20px;
  height: fit-content;
  position: sticky;
  top: 90px;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.sidebar:hover {
  border-color: rgba(139, 92, 246, 0.5);
}

.sidebar h3 {
  color: var(--text-bright);
  font-size: 1.4rem;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 10px;
  margin-bottom: 20px;
  position: relative;
}

.sidebar h3::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 40%;
  height: 2px;
  background: var(--primary-light);
  animation: shimmer 2s infinite;
}

.sidebar ul {
  list-style: none;
}

.sidebar li {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(45, 45, 85, 0.5);
  color: #d0d0e8;
  transition: var(--transition);
  cursor: pointer;
}

.sidebar li:hover {
  background: rgba(139, 92, 246, 0.1);
  padding-left: 8px;
  padding-right: 8px;
  border-radius: 8px;
}

.sidebar .stat-number {
  color: var(--primary-light);
  font-weight: 600;
}

/* ---------- 评论区 ---------- */
.review-card {
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(45, 45, 85, 0.5);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 16px;
  transition: var(--transition);
  animation: fadeInUp 0.5s ease both;
}

.review-card:nth-child(2) { animation-delay: 0.05s; }
.review-card:nth-child(3) { animation-delay: 0.1s; }
.review-card:nth-child(4) { animation-delay: 0.15s; }
.review-card:nth-child(5) { animation-delay: 0.2s; }
.review-card:nth-child(6) { animation-delay: 0.25s; }
.review-card:nth-child(7) { animation-delay: 0.3s; }
.review-card:nth-child(8) { animation-delay: 0.35s; }

.review-card:hover {
  transform: translateX(8px);
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.15);
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.review-username {
  color: var(--primary-light);
  font-weight: 600;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.review-username::before {
  content: '👤';
  font-size: 0.9rem;
}

.review-time {
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ---------- 按钮 ---------- */
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 24px 0;
}

.btn {
  display: inline-block;
  background: var(--gradient-main);
  color: #ffffff;
  padding: 14px 36px;
  border-radius: 60px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(109, 40, 217, 0.4);
  letter-spacing: 0.5px;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover {
  background: var(--gradient-hover);
  transform: translateY(-3px) scale(1.02);
  color: white;
  text-decoration: none;
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.5);
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn:active {
  transform: translateY(-1px) scale(0.98);
}

/* ---------- 底部 ---------- */
.site-footer {
  background: rgba(10, 10, 24, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(45, 45, 85, 0.5);
  margin-top: 60px;
  padding: 36px 0;
  position: relative;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  margin-bottom: 20px;
}

.copyright {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.8;
}

.footer-links a {
  color: var(--primary-light);
  transition: var(--transition);
}

.footer-links a:hover {
  color: #fff;
  text-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
  transform: translateY(-2px);
}

/* ---------- 图文详情 ---------- */
.detail-article {
  background: rgba(22, 22, 48, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 30px 28px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(45, 45, 85, 0.5);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.detail-article::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--primary));
  background-size: 200% 100%;
  animation: shimmer 3s infinite;
}

.detail-article p {
  margin-bottom: 18px;
  color: var(--text-main);
  line-height: 1.8;
}

.detail-article h3 {
  color: var(--primary-light);
  margin-top: 24px;
}

.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
  margin: 32px 0;
}

.char-card {
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(45, 45, 85, 0.5);
  border-radius: var(--radius-md);
  padding: 20px 12px;
  text-align: center;
  transition: var(--transition);
  animation: fadeInUp 0.5s ease both;
}

.char-card:nth-child(2) { animation-delay: 0.05s; }
.char-card:nth-child(3) { animation-delay: 0.1s; }
.char-card:nth-child(4) { animation-delay: 0.15s; }
.char-card:nth-child(5) { animation-delay: 0.2s; }
.char-card:nth-child(6) { animation-delay: 0.25s; }

.char-card:hover {
  transform: translateY(-6px) scale(1.03);
  border-color: var(--primary);
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.2);
}

.char-card img {
  border-radius: 50%;
  width: 100px;
  height: 100px;
  object-fit: cover;
  margin: 0 auto 12px;
  border: 3px solid rgba(139, 92, 246, 0.3);
  transition: var(--transition);
}

.char-card:hover img {
  border-color: var(--primary);
  transform: scale(1.1);
  animation: pulse-glow 2s infinite;
}

.char-name {
  color: var(--text-bright);
  font-weight: 600;
  margin-bottom: 4px;
}

.char-role {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

/* ---------- 平台介绍 ---------- */
#platform > div {
  background: rgba(20, 20, 46, 0.8);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  padding: 30px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(45, 45, 85, 0.5);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

#platform > div::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 200%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.1), transparent 70%);
  pointer-events: none;
}

#platform p {
  color: var(--text-main);
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

/* ---------- APP下载区 ---------- */
#app-download {
  text-align: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(109, 40, 217, 0.05));
  border-radius: var(--radius-lg);
  border: 1px solid rgba(139, 92, 246, 0.2);
  position: relative;
  overflow: hidden;
}

#app-download::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: shimmer 3s infinite;
}

#app-download h2 {
  border-left-color: transparent;
  background: none;
  padding-left: 0;
}

#app-download p {
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto;
}

#app-download .btn-group {
  justify-content: center;
}

/* ---------- 评论滚动区域 ---------- */
#reviews > div {
  max-height: 600px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}

#reviews > div::-webkit-scrollbar {
  width: 6px;
}

#reviews > div::-webkit-scrollbar-track {
  background: transparent;
}

#reviews > div::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  border-radius: 10px;
}

/* ---------- 响应式设计 ---------- */
@media (max-width: 1200px) {
  .container {
    padding: 0 16px;
  }
  
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 900px) {
  .layout {
    flex-direction: column;
    gap: 24px;
  }
  
  .sidebar {
    position: static;
    width: 100%;
    top: auto;
  }
  
  .header-flex {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .nav-links {
    width: 100%;
    justify-content: flex-start;
    gap: 16px;
  }
  
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  
  h2 {
    font-size: 1.8rem;
  }
  
  .detail-article {
    padding: 20px 16px;
  }
  
  .char-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

@media (max-width: 600px) {
  .container {
    padding: 0 12px;
  }
  
  .nav-links {
    gap: 10px;
    font-size: 0.9rem;
  }
  
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
  }
  
  .card-body {
    padding: 10px 8px;
  }
  
  .card-title {
    font-size: 1rem;
  }
  
  .card-text {
    font-size: 0.8rem;
  }
  
  h2 {
    font-size: 1.5rem;
    margin: 32px 0 16px;
    padding-left: 12px;
  }
  
  h3 {
    font-size: 1.2rem;
  }
  
  .logo h1 {
    font-size: 1.5rem;
  }
  
  .btn {
    padding: 12px 24px;
    font-size: 0.9rem;
    width: 100%;
    text-align: center;
  }
  
  .btn-group {
    flex-direction: column;
    gap: 12px;
  }
  
  .detail-article {
    padding: 16px 12px;
    border-radius: var(--radius-md);
  }
  
  .char-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .char-card {
    padding: 14px 8px;
  }
  
  .char-card img {
    width: 80px;
    height: 80px;
  }
  
  .sidebar {
    padding: 16px 12px;
  }
  
  .footer-links {
    gap: 12px;
    font-size: 0.9rem;
  }
  
  .copyright {
    font-size: 0.8rem;
  }
  
  #platform > div {
    padding: 20px 16px;
  }
  
  #app-download {
    padding: 24px 16px;
  }
  
  .review-card {
    padding: 14px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- 暗色模式适配 ---------- */
@media (prefers-color-scheme: dark) {
  body {
    background: 
      radial-gradient(ellipse at 20% 0%, rgba(139, 92, 246, 0.2) 0%, transparent 60%),
      radial-gradient(ellipse at 80% 20%, rgba(109, 40, 217, 0.15) 0%, transparent 50%),
      linear-gradient(135deg, #05050f 0%, #0f0f22 100%);
  }
  
  .site-header {
    background: rgba(5, 5, 15, 0.9);
  }
  
  .card {
    background: rgba(16, 16, 35, 0.7);
  }
  
  .sidebar {
    background: rgba(12, 12, 30, 0.85);
  }
  
  .detail-article {
    background: rgba(14, 14, 32, 0.85);
  }
  
  .review-card {
    background: rgba(16, 16, 35, 0.7);
  }
}

/* ---------- 辅助功能 ---------- */
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 打印样式 ---------- */
@media print {
  .site-header,
  .sidebar,
  .btn-group,
  .site-footer,
  #app-download {
    display: none !important;
  }
  
  body {
    background: #fff;
    color: #000;
  }
  
  .card,
  .detail-article,
  .review-card {
    break-inside: avoid;
    border: 1px solid #ddd;
    box-shadow: none;
  }
}

/* ---------- 性能优化 ---------- */
.card img,
.char-card img {
  loading: lazy;
}

.card img {
  aspect-ratio: 220/310;
  object-fit: cover;
}

/* 渐变Banner效果 */
#hot::before {
  content: '';
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--primary-dark), var(--primary));
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
  border-radius: 2px;
  margin-bottom: 20px;
}

/* 毛玻璃效果增强 */
.glass-effect {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 滚动动画增强 */
@keyframes scrollReveal {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-grid .card {
  animation: scrollReveal 0.6s ease both;
}

.card-grid .card:nth-child(2n) {
  animation-delay: 0.1s;
}

.card-grid .card:nth-child(3n) {
  animation-delay: 0.2s;
}

.card-grid .card:nth-child(4n) {
  animation-delay: 0.3s;
}

/* 悬浮粒子效果 */
.site-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0.5;
}

/* 图片懒加载占位 */
img[loading="lazy"] {
  background: linear-gradient(135deg, #1c1c3e 25%, #252550 50%, #1c1c3e 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* 悬停时文字发光效果 */
.card:hover .card-title {
  text-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}

/* 侧边栏滚动条 */
.sidebar ul {
  max-height: 400px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}

.sidebar ul::-webkit-scrollbar {
  width: 4px;
}

.sidebar ul::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar ul::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

/* 评论卡片hover效果 */
.review-card p {
  transition: color 0.3s;
}

.review-card:hover p {
  color: var(--text-bright);
}

/* 按钮组内按钮样式区分 */
.btn-group .btn:nth-child(2) {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.btn-group .btn:nth-child(3) {
  background: linear-gradient(135deg, #6d28d9, #7c3aed);
}

/* 响应式调整卡片网格 */
@media (max-width: 480px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .card-body {
    padding: 8px 6px;
  }
  
  .card-title {
    font-size: 0.9rem;
    margin-bottom: 4px;
  }
  
  .card-text {
    font-size: 0.75rem;
  }
  
  .badge {
    font-size: 0.65rem;
    padding: 3px 8px;
  }
  
  .char-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .char-card {
    padding: 10px 6px;
  }
  
  .char-card img {
    width: 60px;
    height: 60px;
    margin-bottom: 8px;
  }
  
  .char-name {
    font-size: 0.9rem;
  }
  
  .char-role {
    font-size: 0.75rem;
  }
}

/* 暗色模式下的图片滤镜 */
@media (prefers-color-scheme: dark) {
  img {
    filter: brightness(0.9) contrast(1.1);
  }
  
  img:hover {
    filter: brightness(1) contrast(1.1);
  }
}

/* 动画性能优化 */
.card,
.char-card,
.review-card,
.btn {
  will-change: transform;
}

/* 渐变Banner */
#featured::before {
  content: '';
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-light), var(--primary), var(--primary-dark), var(--primary-light));
  background-size: 200% 100%;
  animation: shimmer 2.5s linear infinite;
  border-radius: 2px;
  margin-bottom: 20px;
}

/* 平台介绍区特殊效果 */
#platform h2 {
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.15), transparent);
  border-radius: 0 12px 12px 0;
}

/* 评论区标题特殊样式 */
#reviews h2 {
  border-left-color: var(--primary-light);
}

/* 底部版权区域 */
.copyright p {
  animation: fadeIn 1s ease;
}

.copyright p:nth-child(2) {
  animation-delay: 0.2s;
}

.copyright p:nth-child(3) {
  animation-delay: 0.4s;
}

/* 响应式标题调整 */
@media (max-width: 600px) {
  h2 {
    font-size: 1.4rem;
    margin: 28px 0 14px;
    padding-left: 10px;
    border-left-width: 4px;
  }
  
  h3 {
    font-size: 1.1rem;
    margin: 20px 0 12px;
  }
}

/* 悬停时卡片阴影增强 */
.card:hover {
  box-shadow: 
    0 12px 40px rgba(139, 92, 246, 0.25),
    0 0 0 1px rgba(139, 92, 246, 0.3);
}

/* 滚动条美化 */
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--primary-light), var(--primary));
}

/* 链接悬停效果 */
a:active {
  color: var(--primary);
}

/* 图片hover效果 */
.card img:hover {
  transform: scale(1.08);
  filter: brightness(1.15) saturate(1.2);
}

/* 角色卡片特殊效果 */
.char-card:hover .char-name {
  color: var(--primary-light);
  text-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
}

/* 侧边栏列表项hover */
.sidebar li:hover .stat-number {
  color: #fff;
  text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

/* 按钮点击涟漪效果 */
.btn:active::before {
  width: 400px;
  height: 400px;
  opacity: 0;
  transition: width 0.8s, height 0.8s, opacity 0.3s;
}

/* 响应式按钮组 */
@media (max-width: 600px) {
  .btn-group .btn {
    width: 100%;
    text-align: center;
  }
}

/* 图片占位符 */
img[src=""],
img:not([src]) {
  visibility: hidden;
}

/* 字体渲染优化 */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 卡片内容对齐 */
.card-body {
  text-align: left;
}

.card-title,
.card-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-text:nth-of-type(2) {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* 侧边栏统计数字动画 */
.sidebar .stat-number {
  position: relative;
}

.sidebar .stat-number::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--primary);
  transition: width 0.3s;
}

.sidebar li:hover .stat-number::after {
  width: 100%;
}

/* 评论时间hover */
.review-time:hover {
  color: var(--primary-light);
}

/* 底部链接间距 */
.footer-links a {
  margin: 0 4px;
}

/* 响应式调整侧边栏 */
@media (max-width: 900px) {
  .sidebar {
    position: static;
    width: 100%;
    margin-top: 24px;
  }
  
  .sidebar ul {
    max-height: none;
  }
}

/* 滚动动画触发的类 */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* 兼容性处理 */
@supports not (backdrop-filter: blur(10px)) {
  .site-header,
  .sidebar,
  .card,
  .detail-article,
  .review-card {
    background: rgba(13, 13, 32, 0.95);
  }
}

/* 最终优化：减少动画闪烁 */
@media (prefers-reduced-motion: no-preference) {
  .card img,
  .char-card img {
    transition: transform 0.4s ease, filter 0.4s ease, border-color 0.4s ease;
  }
}