/* ============================================================
   51漫画 - 完整样式表
   主题：深空紫罗兰 · 暗色沉浸式
   ============================================================ */

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: radial-gradient(ellipse at 20% 0%, #1a1a3e 0%, #0a0a1a 60%);
  color: #e0e0f0;
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

/* 暗色模式（默认即暗色，此规则保证强制暗色） */
@media (prefers-color-scheme: dark) {
  body {
    background: radial-gradient(ellipse at 20% 0%, #14142e 0%, #05050f 70%);
  }
}

a {
  color: #a78bfa;
  text-decoration: none;
  transition: color 0.25s ease, text-shadow 0.25s ease, opacity 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

a:hover {
  color: #c4b5fd;
  text-shadow: 0 0 15px rgba(167, 139, 250, 0.4);
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  background: linear-gradient(145deg, #1c1c40, #12122a);
  display: block;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease, filter 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

img:hover {
  transform: scale(1.03) translateY(-4px);
  box-shadow: 0 12px 30px rgba(124, 58, 237, 0.25);
  filter: brightness(1.08);
}

h1, h2, h3, h4 {
  color: #f0f0ff;
  font-weight: 700;
  line-height: 1.3;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin: 2.5rem 0 1.5rem;
  border-left: 5px solid transparent;
  border-image: linear-gradient(180deg, #8b5cf6, #6366f1) 1;
  padding-left: 20px;
  position: relative;
  letter-spacing: 0.5px;
}

h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #8b5cf6, transparent);
  border-radius: 3px;
}

h3 {
  font-size: 1.3rem;
  margin: 1.2rem 0 0.6rem;
  color: #e8e8f0;
}

p {
  margin-bottom: 0.8rem;
  color: #c0c0d8;
}

/* ---------- 容器与布局 ---------- */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px);
}

.layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2.5rem;
  margin: 3rem 0;
}

@media (max-width: 992px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

.grid {
  display: grid;
  gap: 1.8rem;
}

/* ---------- 卡片 ---------- */
.card {
  background: rgba(26, 26, 53, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 18px;
  padding: 20px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(124, 58, 237, 0.25), inset 0 0 30px rgba(139, 92, 246, 0.05);
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(30, 30, 60, 0.85);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  background: linear-gradient(135deg, #7c3aed, #6d28d9, #5b21b6);
  background-size: 200% 200%;
  color: #fff !important;
  padding: 14px 32px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
  position: relative;
  overflow: hidden;
  text-decoration: none !important;
}

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

.btn:hover {
  background-position: 100% 50%;
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.5);
  color: #fff !important;
  text-shadow: 0 2px 10px rgba(255, 255, 255, 0.2);
}

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

.btn:active {
  transform: scale(0.98);
}

.btn-group .btn + .btn {
  margin-left: 15px;
}

@media (max-width: 480px) {
  .btn-group .btn + .btn {
    margin-left: 0;
    margin-top: 10px;
  }
  .btn-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
}

/* ---------- 导航栏 ---------- */
.navbar {
  background: rgba(13, 13, 32, 0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 15px 0;
  border-bottom: 1px solid rgba(139, 92, 246, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

.logo h1 {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 800;
  background: linear-gradient(135deg, #c4b5fd, #8b5cf6, #6366f1, #a78bfa);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 2px;
  animation: gradientShift 6s ease infinite;
  cursor: pointer;
}

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

.nav-links {
  display: flex;
  gap: clamp(12px, 2.5vw, 28px);
  flex-wrap: wrap;
}

.nav-links a {
  color: #d0d0e8;
  font-weight: 500;
  font-size: 1rem;
  position: relative;
  padding: 4px 2px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #8b5cf6, #a78bfa);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links .active::after {
  width: 100%;
}

.nav-links a:hover {
  color: #a78bfa;
  text-decoration: none;
}

.nav-links .active {
  color: #a78bfa;
  font-weight: 700;
}

@media (max-width: 768px) {
  .nav-wrap {
    justify-content: center;
    text-align: center;
  }
  .nav-links {
    justify-content: center;
    gap: 14px;
    font-size: 0.9rem;
  }
}

/* ---------- 侧边栏 ---------- */
aside {
  background: rgba(20, 20, 46, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(139, 92, 246, 0.12);
  border-radius: 20px;
  padding: 24px;
  height: fit-content;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.side-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding: 12px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s ease, padding 0.2s ease;
}

.side-item:hover {
  background: rgba(139, 92, 246, 0.05);
  padding-left: 8px;
  border-radius: 8px;
}

.side-item:last-child {
  border-bottom: none;
}

.side-item span {
  color: #d0d0e8;
  font-size: 0.9rem;
}

.rank-num {
  color: #8b5cf6 !important;
  font-weight: 700;
  margin-right: 10px;
  font-size: 1.1rem !important;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- 评论卡片 ---------- */
.comment-card {
  background: rgba(26, 26, 53, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 15px;
  transition: all 0.3s ease;
  cursor: default;
}

.comment-card:hover {
  transform: translateY(-3px);
  border-color: rgba(139, 92, 246, 0.25);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.comment-user {
  color: #a78bfa;
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.comment-time {
  color: #8888aa;
  font-size: 0.8rem;
  margin-bottom: 8px;
}

/* ---------- 底部 ---------- */
footer {
  background: rgba(10, 10, 24, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(139, 92, 246, 0.08);
  padding: 2.5rem 0;
  margin-top: 4rem;
}

.footer-links a {
  color: #a78bfa;
  margin-right: 18px;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: #c4b5fd;
  text-decoration: underline;
}

.copyright {
  color: #8888aa;
  font-size: 0.85rem;
  margin-top: 20px;
  line-height: 1.8;
}

.copyright a {
  color: #8888aa;
  font-size: 0.85rem;
}

.copyright a:hover {
  color: #a78bfa;
}

/* ---------- 区块样式 ---------- */
section {
  margin: 2.5rem 0;
  animation: fadeInUp 0.6s ease both;
}

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

/* 渐变banner效果 */
#platform {
  background: linear-gradient(135deg, rgba(20, 20, 46, 0.9), rgba(30, 27, 75, 0.9), rgba(49, 46, 129, 0.8)) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 24px;
  padding: 35px;
  position: relative;
  overflow: hidden;
}

#platform::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.2), transparent 60%);
  animation: floatBlob 8s ease-in-out infinite;
}

@keyframes floatBlob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -30px) scale(1.1); }
  66% { transform: translate(-15px, 20px) scale(0.9); }
}

/* 详情区域 */
#detail article {
  background: rgba(22, 22, 48, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 25px;
  border-radius: 20px;
  border: 1px solid rgba(139, 92, 246, 0.1);
  transition: box-shadow 0.3s ease;
}

#detail article:hover {
  box-shadow: 0 12px 40px rgba(124, 58, 237, 0.15);
}

/* APP 下载区 */
#app {
  text-align: center;
  padding: 2rem 0;
}

/* ---------- 响应式调整 ---------- */
@media (max-width: 768px) {
  body {
    font-size: 15px;
  }
  
  h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
  }
  
  .grid {
    gap: 1.2rem;
  }
  
  .card {
    padding: 15px;
    border-radius: 14px;
  }
  
  .btn {
    padding: 12px 24px;
    font-size: 0.9rem;
  }
  
  #platform {
    padding: 25px;
  }
  
  #detail article {
    padding: 20px;
  }
  
  aside {
    padding: 18px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 14px;
  }
  
  .nav-links {
    gap: 10px;
    font-size: 0.85rem;
  }
  
  .logo h1 {
    font-size: 1.5rem;
  }
  
  .comment-card {
    margin-bottom: 10px;
  }
  
  .side-item {
    font-size: 0.85rem;
  }
  
  /* 评论双栏改单栏 */
  #reviews > div {
    grid-template-columns: 1fr !important;
  }
  
  /* 双栏布局改单栏 */
  #detail {
    grid-template-columns: 1fr !important;
  }
  
  /* 详情+角色双栏改单栏 */
  div[style*="grid-template-columns: 2fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* ---------- 滚动动画 ---------- */
@media (prefers-reduced-motion: no-preference) {
  .card, .comment-card, section {
    opacity: 0;
    animation: cardReveal 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }
  
  .card:nth-child(1), .comment-card:nth-child(1) { animation-delay: 0.05s; }
  .card:nth-child(2), .comment-card:nth-child(2) { animation-delay: 0.1s; }
  .card:nth-child(3), .comment-card:nth-child(3) { animation-delay: 0.15s; }
  .card:nth-child(4), .comment-card:nth-child(4) { animation-delay: 0.2s; }
  .card:nth-child(5), .comment-card:nth-child(5) { animation-delay: 0.25s; }
  .card:nth-child(6), .comment-card:nth-child(6) { animation-delay: 0.3s; }
  .card:nth-child(7), .comment-card:nth-child(7) { animation-delay: 0.35s; }
  .card:nth-child(8), .comment-card:nth-child(8) { animation-delay: 0.4s; }
  .card:nth-child(9), .comment-card:nth-child(9) { animation-delay: 0.45s; }
  .card:nth-child(10), .comment-card:nth-child(10) { animation-delay: 0.5s; }
  .card:nth-child(11), .comment-card:nth-child(11) { animation-delay: 0.55s; }
  .card:nth-child(12), .comment-card:nth-child(12) { animation-delay: 0.6s; }
  .card:nth-child(n+13) { animation-delay: 0.65s; }
  
  @keyframes cardReveal {
    from {
      opacity: 0;
      transform: translateY(25px) scale(0.98);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }
}

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

::-webkit-scrollbar-track {
  background: #0a0a1a;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #7c3aed, #4c1d95);
  border-radius: 5px;
  border: 2px solid #0a0a1a;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #8b5cf6, #6d28d9);
}

/* 选中文本 */
::selection {
  background: rgba(139, 92, 246, 0.4);
  color: #ffffff;
}

/* 焦点样式 */
:focus-visible {
  outline: 2px solid #8b5cf6;
  outline-offset: 2px;
  border-radius: 4px;
}

/* 无障碍：减少动画 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 高对比度模式 */
@media (forced-colors: active) {
  .btn {
    border: 2px solid ButtonText;
  }
  .card {
    border: 1px solid CanvasText;
  }
}

/* 打印样式 */
@media print {
  body {
    background: white;
    color: black;
  }
  .navbar, footer, .btn, aside {
    display: none;
  }
}

/* 性能优化：GPU加速 */
.card, .btn, .nav-links a {
  will-change: transform;
  transform: translateZ(0);
}

/* 图片懒加载淡入 */
img[loading="lazy"] {
  animation: imgFadeIn 0.5s ease;
}

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

/* 自定义工具类 */
.text-gradient {
  background: linear-gradient(135deg, #a78bfa, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* 响应式字体 */
h2 { font-size: clamp(1.4rem, 3.5vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }
p { font-size: clamp(0.9rem, 1.5vw, 1rem); }

/* 移动端触控优化 */
@media (hover: none) {
  .card:hover {
    transform: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  }
  
  .btn:hover {
    transform: scale(1.02);
  }
  
  img:hover {
    transform: none;
  }
}

/* 深色模式微调 */
@media (prefers-color-scheme: dark) {
  .card {
    background: rgba(20, 20, 45, 0.8);
  }
  
  .comment-card {
    background: rgba(20, 20, 45, 0.8);
  }
}

/* 结语 */
/* 51漫画 - 为用户提供极致阅读体验 */