/* ===== 野花影院 全局样式 ===== */
:root {
  --primary: #7c3aed;
  --primary-light: #a855f7;
  --primary-lighter: #c084fc;
  --primary-soft: #ede9fe;
  --primary-dark: #2e1065;
  --bg: #f5f3ff;
  --bg-card: rgba(255, 255, 255, 0.85);
  --text: #2e1065;
  --text-secondary: #4c1d95;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --border: #f3e8ff;
  --shadow: rgba(124, 58, 237, 0.1);
  --shadow-strong: rgba(124, 58, 237, 0.25);
  --radius: 16px;
  --radius-lg: 20px;
  --transition: all 0.3s ease;
}

/* 暗色模式 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1025;
    --bg-card: rgba(46, 16, 101, 0.7);
    --text: #f5f3ff;
    --text-secondary: #e9d5ff;
    --text-muted: #a78bfa;
    --text-light: #8b7bb5;
    --border: #4c1d95;
    --shadow: rgba(0, 0, 0, 0.4);
    --shadow-strong: rgba(0, 0, 0, 0.5);
    --primary-soft: #4c1d95;
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg);
  background-image: 
    radial-gradient(ellipse at 20% 50%, rgba(124, 58, 237, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(168, 85, 247, 0.06) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, #f0e9ff 100%);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%237c3aed' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* ===== 滚动动画 ===== */
@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.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes glow {
  0%, 100% {
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
  }
  50% {
    box-shadow: 0 4px 30px rgba(168, 85, 247, 0.5);
  }
}

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

/* 滚动进入动画 */
section, article, aside > div {
  animation: fadeInUp 0.6s ease-out both;
}

section:nth-child(2), article:nth-child(2) {
  animation-delay: 0.1s;
}

section:nth-child(3), article:nth-child(3) {
  animation-delay: 0.2s;
}

/* ===== 头部导航 ===== */
header {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #c084fc 100%);
  padding: 15px 20px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: glow 3s ease-in-out infinite;
}

nav {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

nav > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

nav span[style*="font-size: 32px"] {
  font-size: 32px;
  animation: float 3s ease-in-out infinite;
  display: inline-block;
}

nav h1 {
  color: #ffffff;
  font-size: 28px;
  margin: 0;
  font-weight: 900;
  letter-spacing: 2px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, #fff 0%, #f0e9ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  align-items: center;
}

nav ul li a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 8px 14px;
  border-radius: 50px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

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

nav ul li a:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

nav ul li a:hover::before {
  left: 100%;
}

/* ===== 主内容区 ===== */
main {
  max-width: 1400px;
  margin: 30px auto;
  padding: 0 20px;
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

main > div:first-child {
  flex: 1;
  min-width: 300px;
}

/* ===== 区块标题 ===== */
section h2 {
  color: var(--primary);
  font-size: 26px;
  border-left: 5px solid var(--primary);
  padding-left: 15px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  transition: all 0.3s ease;
}

section h2::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 15px;
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 3px;
}

section h2 span {
  font-size: 14px;
  color: var(--primary-light);
  font-weight: normal;
}

/* ===== 热门漫画卡片 ===== */
#hot > div:last-child {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

#hot article {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 15px var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

#hot article::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.05), rgba(168, 85, 247, 0.05));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
  pointer-events: none;
}

#hot article:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 30px var(--shadow-strong);
}

#hot article:hover::before {
  opacity: 1;
}

#hot article img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

#hot article:hover img {
  transform: scale(1.05);
}

#hot article > div {
  padding: 15px;
  position: relative;
  z-index: 2;
}

#hot article h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  color: var(--text);
  font-weight: 800;
  transition: color 0.3s ease;
}

#hot article:hover h3 {
  color: var(--primary);
}

#hot article p {
  margin: 4px 0;
  font-size: 13px;
  color: var(--text-muted);
}

#hot article p span[style*="color: #7c3aed"] {
  color: var(--primary) !important;
  font-weight: 600;
}

#hot article p span[style*="background: #ede9fe"] {
  background: var(--primary-soft);
  padding: 2px 8px;
  border-radius: 12px;
  color: var(--primary);
  font-size: 12px;
  transition: all 0.3s ease;
}

#hot article:hover p span[style*="background: #ede9fe"] {
  background: var(--primary);
  color: white;
}

/* ===== 精品推荐 ===== */
#recommend > div:last-child {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

#recommend article {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 15px var(--shadow);
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#recommend article:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px var(--shadow-strong);
}

#recommend article img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

#recommend article:hover img {
  transform: scale(1.03);
}

#recommend article > div {
  padding: 15px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

#recommend article h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  color: var(--text);
  transition: color 0.3s ease;
}

#recommend article:hover h3 {
  color: var(--primary);
}

#recommend article p {
  margin: 5px 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
}

#recommend article p:last-child {
  flex: 0;
  color: var(--text-light);
  font-size: 13px;
  margin-top: 8px;
}

/* ===== 漫画详细介绍 ===== */
#detail {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: 0 4px 20px var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#detail h2 {
  margin-top: 0;
}

#detail h3 {
  color: var(--text);
  font-size: 20px;
  margin-bottom: 15px;
  position: relative;
  padding-left: 15px;
}

#detail h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  background: linear-gradient(180deg, var(--primary), var(--primary-light));
  border-radius: 2px;
}

#detail p {
  line-height: 1.8;
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 15px;
}

#detail div[style*="margin-top: 15px"] {
  margin-top: 15px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

#detail div[style*="margin-top: 15px"] span {
  background: var(--primary-soft);
  color: var(--primary);
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
}

#detail div[style*="margin-top: 15px"] span:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-strong);
}

/* ===== 角色介绍 ===== */
#characters > div:last-child {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

#characters article {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 15px var(--shadow);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#characters article:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px var(--shadow-strong);
}

#characters article img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 15px;
  border: 3px solid var(--primary-light);
  transition: all 0.3s ease;
}

#characters article:hover img {
  transform: scale(1.05);
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
}

#characters article h3 {
  margin: 0 0 5px 0;
  color: var(--text);
  font-size: 20px;
}

#characters article p {
  margin: 5px 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

#characters article p:nth-child(3) {
  color: var(--primary);
  font-weight: 600;
}

#characters article p:nth-child(4) {
  color: var(--text-muted);
}

/* ===== 平台介绍 ===== */
#platform {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: 0 4px 20px var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#platform h2 {
  margin-top: 0;
}

#platform p {
  line-height: 1.8;
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 15px;
}

/* ===== APP下载 ===== */
#download {
  background: linear-gradient(135deg, #7c3aed, #a855f7, #c084fc);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
  animation: glow 3s ease-in-out infinite;
}

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

#download h2 {
  color: white;
  font-size: 28px;
  margin-top: 0;
  border: none;
  padding: 0;
}

#download h2::after {
  display: none;
}

#download p {
  font-size: 16px;
  line-height: 1.8;
  max-width: 600px;
  margin: 0 auto 30px auto;
  opacity: 0.95;
}

#download div {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

#download div a {
  display: inline-block;
  padding: 15px 40px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 800;
  font-size: 18px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

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

#download div a:hover::before {
  left: 100%;
}

#download div a:first-child {
  background: white;
  color: var(--primary);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#download div a:first-child:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

#download div a:nth-child(2) {
  background: transparent;
  color: white;
  border: 2px solid white;
}

#download div a:nth-child(2):hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-3px);
}

#download div a:last-child {
  background: #fbbf24;
  color: var(--primary-dark);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#download div a:last-child:hover {
  background: #f59e0b;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* ===== 用户评论 ===== */
#comments > div:last-child {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

#comments > div:last-child > div {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 4px 15px var(--shadow);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#comments > div:last-child > div:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px var(--shadow-strong);
}

#comments > div:last-child > div p:first-child {
  margin: 0 0 10px 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

#comments > div:last-child > div div:last-child {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

#comments > div:last-child > div div:last-child span:first-child {
  font-weight: 700;
  color: var(--primary);
  font-size: 14px;
}

#comments > div:last-child > div div:last-child span:last-child {
  color: var(--text-light);
  font-size: 12px;
}

/* ===== 侧边栏 ===== */
aside {
  width: 300px;
  flex-shrink: 0;
}

aside > div {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

aside > div:hover {
  box-shadow: 0 8px 25px var(--shadow-strong);
}

aside h3 {
  color: var(--primary);
  font-size: 20px;
  margin-top: 0;
  border-bottom: 2px solid var(--border);
  padding-bottom: 10px;
  position: relative;
}

aside h3::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 50px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

aside ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

aside ul li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
  cursor: pointer;
}

aside ul li:last-child {
  border-bottom: none;
}

aside ul li:hover {
  padding-left: 10px;
  color: var(--primary);
}

aside ul li span {
  background: var(--primary);
  color: white;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

aside ul li:hover span {
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.3);
}

/* 周榜颜色渐变 */
aside ul li:nth-child(1) span {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
}

aside ul li:nth-child(2) span {
  background: linear-gradient(135deg, #a855f7, #c084fc);
}

aside ul li:nth-child(3) span {
  background: linear-gradient(135deg, #c084fc, #d8b4fe);
  color: #4c1d95;
}

aside ul li:nth-child(4) span {
  background: linear-gradient(135deg, #d8b4fe, #e9d5ff);
  color: #4c1d95;
}

aside ul li:nth-child(5) span {
  background: linear-gradient(135deg, #ede9fe, #f3e8ff);
  color: #4c1d95;
}

aside ul li:nth-child(6) span {
  background: linear-gradient(135deg, #f3e8ff, #faf5ff);
  color: #4c1d95;
}

/* 阅读增长榜 */
aside ul li p {
  flex: 1;
}

aside ul li span[style*="color: #a855f7"] {
  background: none;
  color: var(--primary-light) !important;
  font-weight: 700;
  width: auto;
  height: auto;
}

/* 阅读统计 */
aside div:last-child div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  text-align: center;
  margin-top: 15px;
}

aside div:last-child div div {
  background: var(--primary-soft);
  border-radius: 12px;
  padding: 15px;
  transition: all 0.3s ease;
}

aside div:last-child div div:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px var(--shadow);
}

aside div:last-child div div p:first-child {
  font-size: 24px;
  font-weight: 900;
  color: var(--primary);
  margin: 0;
}

aside div:last-child div div p:last-child {
  font-size: 13px;
  color: var(--text-muted);
  margin: 5px 0 0 0;
}

/* ===== 页脚 ===== */
footer {
  background: linear-gradient(135deg, #2e1065, #4c1d95);
  color: #e9d5ff;
  padding: 40px 20px 20px 20px;
  margin-top: 40px;
  position: relative;
  z-index: 1;
}

footer > div:first-child {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 30px;
}

footer > div:first-child > div {
  flex: 1;
  min-width: 250px;
}

footer h3 {
  color: white;
  font-size: 20px;
  margin-bottom: 15px;
  position: relative;
}

footer h3::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 30px;
  height: 2px;
  background: linear-gradient(90deg, #a855f7, #c084fc);
}

footer ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

footer ul li a {
  color: #c4b5fd;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.3s ease;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

footer ul li a:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

footer p {
  font-size: 14px;
  line-height: 1.6;
  color: #c4b5fd;
}

footer > div:last-child {
  max-width: 1400px;
  margin: 30px auto 0 auto;
  border-top: 1px solid #4c1d95;
  padding-top: 20px;
  text-align: center;
  font-size: 14px;
  color: #a78bfa;
}

footer > div:last-child p {
  margin: 5px 0;
}

/* ===== 响应式设计 ===== */
@media (max-width: 1200px) {
  main {
    flex-direction: column;
  }

  aside {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
  }

  aside > div {
    margin-bottom: 0;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  header {
    padding: 10px 15px;
  }

  nav {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  nav ul {
    justify-content: center;
    gap: 8px;
  }

  nav ul li a {
    font-size: 13px;
    padding: 6px 10px;
  }

  main {
    padding: 0 15px;
    margin: 20px auto;
  }

  section h2 {
    font-size: 22px;
  }

  #hot > div:last-child {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
  }

  #hot article img {
    height: 160px;
  }

  #recommend > div:last-child {
    grid-template-columns: 1fr;
  }

  #detail, #platform {
    padding: 20px;
  }

  #download {
    padding: 30px 20px;
  }

  #download div {
    flex-direction: column;
    align-items: center;
  }

  #download div a {
    width: 100%;
    max-width: 300px;
    text-align: center;
  }

  aside {
    grid-template-columns: 1fr;
  }

  footer > div:first-child {
    flex-direction: column;
    text-align: center;
  }

  footer h3::after {
    left: 50%;
    transform: translateX(-50%);
  }

  footer ul {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  nav h1 {
    font-size: 24px;
  }

  nav span[style*="font-size: 32px"] {
    font-size: 24px;
  }

  #hot > div:last-child {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  #hot article img {
    height: 140px;
  }

  #hot article h3 {
    font-size: 16px;
  }

  #hot article p {
    font-size: 12px;
  }

  #characters > div:last-child {
    grid-template-columns: 1fr;
  }

  #comments > div:last-child {
    grid-template-columns: 1fr;
  }

  #download h2 {
    font-size: 24px;
  }

  #download p {
    font-size: 14px;
  }
}

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

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

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--primary-lighter));
}

/* ===== 焦点可见性 ===== */
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* ===== 暗色模式适配 ===== */
@media (prefers-color-scheme: dark) {
  header {
    background: linear-gradient(135deg, #4c1d95, #6d28d9, #7c3aed);
  }

  #download {
    background: linear-gradient(135deg, #4c1d95, #6d28d9, #7c3aed);
  }

  footer {
    background: linear-gradient(135deg, #1a1025, #2e1065);
  }
}

/* ===== 高性能动画优化 ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== 打印样式 ===== */
@media print {
  header, footer, aside, #download, #comments {
    display: none !important;
  }

  main {
    margin: 0;
    padding: 0;
  }

  body {
    background: white;
    color: black;
  }
}