/* ===== 全局样式与变量 ===== */
:root {
  --bg-primary: #0a0a18;
  --bg-secondary: #14142a;
  --bg-card: rgba(28, 28, 62, 0.75);
  --bg-card-alt: rgba(26, 26, 53, 0.75);
  --bg-glass: rgba(20, 20, 46, 0.6);
  --border-color: rgba(45, 45, 85, 0.8);
  --text-primary: #f0f0ff;
  --text-secondary: #d0d0e8;
  --text-muted: #b0b0d0;
  --text-dim: #8888aa;
  --accent: #8b5cf6;
  --accent-light: #a78bfa;
  --accent-gradient: linear-gradient(135deg, #8b5cf6, #a78bfa);
  --accent-btn-gradient: linear-gradient(135deg, #7c3aed, #6d28d9);
  --shadow-accent: rgba(124, 58, 237, 0.4);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --transition-speed: 0.3s;
  --font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: linear-gradient(135deg, #0a0a18 0%, #14142a 100%);
  color: var(--text-primary);
  font-family: var(--font-family);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.5s ease;
}

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

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-speed) ease;
}

ul {
  list-style: none;
}

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

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

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), #5b21b6);
  border-radius: 10px;
  border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--accent-light), var(--accent));
}

/* ===== 头部导航 ===== */
header {
  background-color: rgba(13, 13, 32, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.8rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

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

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

nav .logo-icon {
  background: var(--accent-gradient);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-block;
  box-shadow: 0 4px 12px var(--shadow-accent);
  animation: pulse 3s infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 4px 12px var(--shadow-accent);
  }
  50% {
    box-shadow: 0 4px 20px var(--shadow-accent), 0 0 30px rgba(139, 92, 246, 0.3);
  }
}

nav h1 {
  color: var(--text-primary);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #f0f0ff, var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

nav div {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  align-items: center;
  font-weight: 500;
}

nav div a {
  color: var(--text-secondary);
  font-size: 1rem;
  position: relative;
  padding: 0.3rem 0;
}

nav div a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-gradient);
  transition: width var(--transition-speed) ease;
}

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

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

nav div a.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}

/* ===== 主内容区 ===== */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
  animation: fadeIn 0.8s ease-out;
}

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

/* ===== 章节标题 ===== */
section h2 {
  color: var(--text-primary);
  font-size: 2rem;
  border-left: 6px solid var(--accent);
  padding-left: 1rem;
  margin-bottom: 1.8rem;
  position: relative;
  transition: transform var(--transition-speed) ease;
}

section h2:hover {
  transform: translateX(5px);
}

/* ===== 卡片通用样式 ===== */
article {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease, border-color var(--transition-speed) ease;
  position: relative;
}

article:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.5);
}

article img {
  transition: transform 0.5s ease, filter 0.5s ease;
}

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

article h3 {
  color: var(--text-primary);
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  transition: color var(--transition-speed) ease;
}

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

article p {
  color: var(--text-muted);
  margin: 0.2rem 0;
  font-size: 0.9rem;
}

article .tag {
  display: inline-block;
  background: rgba(45, 45, 85, 0.8);
  color: var(--accent-light);
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  font-size: 0.8rem;
  transition: background var(--transition-speed) ease, color var(--transition-speed) ease;
}

article:hover .tag {
  background: rgba(139, 92, 246, 0.2);
}

/* ===== 热门漫画网格 ===== */
#hot .grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.5rem;
}

#hot article {
  background: var(--bg-card);
}

#hot article:nth-child(even) {
  background: var(--bg-card-alt);
}

#hot article .card-body {
  padding: 1rem;
}

#hot article .update-date {
  color: var(--accent-light);
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
}

/* ===== 精品推荐 ===== */
#featured .grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

#featured article {
  background: var(--bg-card);
  border-radius: var(--radius-md);
}

#featured article:nth-child(even) {
  background: var(--bg-card-alt);
}

#featured article .card-body {
  padding: 1.2rem;
}

#featured article .desc {
  color: var(--text-secondary);
  margin-top: 0.8rem;
  line-height: 1.5;
}

/* ===== 漫画详细介绍 ===== */
#detail {
  background: rgba(22, 22, 48, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 2rem;
  border-radius: var(--radius-lg);
  margin-bottom: 3rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-speed) ease;
}

#detail:hover {
  transform: scale(1.01);
}

#detail .detail-content {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 1.5rem;
}

#detail .detail-content img {
  border-radius: 12px;
  max-width: 100%;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

#detail .detail-text {
  flex: 1;
  min-width: 260px;
}

#detail h3 {
  color: var(--text-primary);
  font-size: 1.5rem;
  margin-bottom: 0.8rem;
}

#detail h3.sub {
  font-size: 1.3rem;
  margin-top: 1.5rem;
}

#detail p {
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ===== 角色介绍 ===== */
#characters .grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

#characters article {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  transition: all var(--transition-speed) ease;
}

#characters article:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

#characters article img {
  border-radius: 50%;
  width: 120px;
  height: 120px;
  object-fit: cover;
  margin-bottom: 0.8rem;
  border: 3px solid var(--accent);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
  transition: all 0.5s ease;
}

#characters article:hover img {
  border-color: var(--accent-light);
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.5);
}

#characters article h3 {
  color: var(--text-primary);
  margin: 0.5rem 0 0.2rem;
}

#characters article .role {
  color: var(--accent-light);
  margin: 0.2rem 0;
}

#characters article .desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ===== 平台介绍 ===== */
#platform {
  background: rgba(20, 20, 46, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 2rem;
  border-radius: var(--radius-lg);
  margin-bottom: 3rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
}

#platform p {
  color: var(--text-secondary);
  line-height: 1.9;
  margin-top: 1rem;
}

#platform p.advantages {
  color: var(--text-secondary);
  line-height: 2.2;
}

/* ===== APP下载区 ===== */
#app {
  background: rgba(22, 22, 48, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 3rem;
  text-align: center;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

#app::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
  animation: rotate 20s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

#app h2 {
  font-size: 2.4rem;
  position: relative;
  z-index: 1;
}

#app p {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 1rem auto;
  position: relative;
  z-index: 1;
}

#app .btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  justify-content: center;
  margin-top: 2rem;
  position: relative;
  z-index: 1;
}

#app .btn-group a {
  background: var(--accent-btn-gradient);
  color: #ffffff;
  padding: 0.9rem 2.2rem;
  border-radius: 60px;
  font-weight: 600;
  box-shadow: 0 4px 15px var(--shadow-accent);
  transition: all var(--transition-speed) ease;
  position: relative;
  overflow: hidden;
}

#app .btn-group 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;
}

#app .btn-group a:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px var(--shadow-accent);
}

#app .btn-group a:hover::before {
  left: 100%;
}

/* ===== 用户评论与侧边栏 ===== */
#reviews .review-list {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#reviews article {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.2rem;
  transition: all var(--transition-speed) ease;
}

#reviews article:hover {
  transform: translateX(8px);
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#reviews article .username {
  color: var(--accent-light);
  font-weight: 600;
  margin: 0;
}

#reviews article .comment {
  color: var(--text-secondary);
  margin: 0.5rem 0;
}

#reviews article .date {
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ===== 侧边栏 ===== */
aside {
  flex: 1;
  min-width: 240px;
  background: rgba(20, 20, 46, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  height: fit-content;
  position: sticky;
  top: 100px;
  transition: all var(--transition-speed) ease;
}

aside:hover {
  box-shadow: var(--shadow-card);
}

aside h3 {
  color: var(--text-primary);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.6rem;
  margin-bottom: 0.5rem;
}

aside ul li {
  padding: 0.5rem 0;
  color: var(--text-secondary);
  transition: all var(--transition-speed) ease;
  cursor: pointer;
  border-bottom: 1px solid transparent;
}

aside ul li:hover {
  color: var(--accent-light);
  padding-left: 8px;
  border-bottom-color: var(--border-color);
}

aside p {
  color: var(--text-secondary);
  margin: 0.3rem 0;
}

/* ===== 底部 ===== */
footer {
  background: rgba(10, 10, 24, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  margin-top: 3rem;
}

footer .footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
}

footer p {
  color: var(--text-dim);
  margin: 0.3rem 0;
}

footer a {
  color: var(--accent-light);
  transition: all var(--transition-speed) ease;
}

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

/* ===== 响应式布局 ===== */
@media (max-width: 1024px) {
  main {
    padding: 1rem;
  }
  
  section h2 {
    font-size: 1.8rem;
  }
  
  #app h2 {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  header {
    padding: 0.6rem 1rem;
  }
  
  nav {
    flex-direction: column;
    align-items: flex-start;
  }
  
  nav div {
    gap: 0.8rem;
    font-size: 0.9rem;
  }
  
  nav div a {
    font-size: 0.9rem;
  }
  
  main {
    padding: 0.8rem;
  }
  
  section h2 {
    font-size: 1.5rem;
    padding-left: 0.8rem;
  }
  
  #hot .grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }
  
  #featured .grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  #detail {
    padding: 1.5rem;
  }
  
  #detail .detail-content {
    flex-direction: column;
  }
  
  #app {
    padding: 2rem 1.5rem;
  }
  
  #app h2 {
    font-size: 1.8rem;
  }
  
  #app .btn-group {
    flex-direction: column;
    align-items: center;
  }
  
  #app .btn-group a {
    width: 100%;
    max-width: 300px;
    text-align: center;
  }
  
  aside {
    position: static;
    margin-top: 1.5rem;
  }
  
  footer .footer-content {
    flex-direction: column;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  nav h1 {
    font-size: 1.3rem;
  }
  
  section h2 {
    font-size: 1.3rem;
  }
  
  #hot .grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.8rem;
  }
  
  #characters .grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
  }
  
  #characters article img {
    width: 100px;
    height: 100px;
  }
  
  article h3 {
    font-size: 1rem;
  }
  
  article p {
    font-size: 0.8rem;
  }
}

/* ===== 暗色模式支持（默认已暗色） ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #0a0a18;
    --bg-secondary: #14142a;
    --bg-card: rgba(28, 28, 62, 0.85);
    --bg-card-alt: rgba(26, 26, 53, 0.85);
    --text-primary: #f0f0ff;
    --text-secondary: #d0d0e8;
  }
}

/* ===== 滚动动画 ===== */
@media (prefers-reduced-motion: no-preference) {
  .scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
  }
  
  .scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
  }
  50% {
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.4);
  }
}

/* ===== 工具类 ===== */
.text-gradient {
  background: linear-gradient(135deg, #f0f0ff, var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass-effect {
  background: rgba(20, 20, 46, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
}

.hover-lift {
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* ===== 渐变Banner效果 ===== */
.gradient-banner {
  background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 50%, #a78bfa 100%);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.gradient-banner::before {
  content: '';
  position: absolute;
  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='%23ffffff' fill-opacity='0.05'%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");
}

/* ===== 打印样式 ===== */
@media print {
  header, footer, aside, #app {
    display: none;
  }
  
  body {
    background: white;
    color: black;
  }
  
  article {
    break-inside: avoid;
  }
}