/* style.css - 日漫番外动漫 btgpdt.cn */
:root {
  --bg-primary: #0a0a18;
  --bg-secondary: #14142e;
  --bg-card: #1a1a35;
  --bg-glass: rgba(26, 26, 53, 0.7);
  --border-color: #2d2d55;
  --border-hover: #8b5cf6;
  --text-primary: #e0e0f0;
  --text-secondary: #b0b0d0;
  --text-muted: #8888aa;
  --text-heading: #f0f0ff;
  --accent: #a78bfa;
  --accent-strong: #8b5cf6;
  --accent-glow: rgba(139, 92, 246, 0.3);
  --gradient-main: linear-gradient(135deg, #a78bfa, #8b5cf6);
  --gradient-btn: linear-gradient(135deg, #7c3aed, #6d28d9);
  --gradient-btn-hover: linear-gradient(135deg, #8b5cf6, #7c3aed);
  --font-main: system-ui, -apple-system, 'Segoe UI', Roboto, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --shadow-card: 0 4px 15px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 10px 25px var(--accent-glow);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --transition-speed: 0.3s;
}

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

body {
  background: linear-gradient(135deg, #0a0a18 0%, #14142a 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

h1, h2, h3, h4, h5, h6 {
  color: var(--text-heading);
  font-weight: 600;
  line-height: 1.3;
}

img {
  background: #2d2d55;
  max-width: 100%;
  height: auto;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 导航栏 */
.nav-wrap {
  background: rgba(13, 13, 32, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 15px 0;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

.logo h1 {
  font-size: 1.9rem;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 1px;
  animation: logoGlow 3s ease-in-out infinite alternate;
}

@keyframes logoGlow {
  from { text-shadow: 0 0 10px rgba(139, 92, 246, 0.3); }
  to { text-shadow: 0 0 20px rgba(139, 92, 246, 0.7), 0 0 40px rgba(139, 92, 246, 0.3); }
}

.menu {
  display: flex;
  gap: 25px;
  flex-wrap: wrap;
  list-style: none;
}

.menu a {
  color: #d0d0e8;
  font-weight: 500;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-speed) ease;
  position: relative;
}

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

.menu a:hover {
  color: var(--accent);
  border-bottom-color: transparent;
  text-decoration: none;
}

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

.menu .active {
  color: var(--accent-strong);
  border-bottom-color: var(--accent-strong);
}

.menu .active::after {
  width: 100%;
}

/* 通用卡片 */
.section-title {
  margin: 45px 0 25px;
  font-size: 2rem;
  border-left: 6px solid var(--accent-strong);
  padding-left: 18px;
  position: relative;
  animation: fadeInUp 0.6s ease;
}

.section-title::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 0;
  bottom: 0;
  width: 6px;
  background: var(--gradient-main);
  border-radius: 3px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 25px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-card);
  animation: fadeInUp 0.6s ease;
  animation-fill-mode: both;
  position: relative;
}

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

.card img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease, filter 0.3s ease;
  aspect-ratio: 220/310;
  object-fit: cover;
}

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

.card-body {
  padding: 15px;
  background: linear-gradient(to top, rgba(26, 26, 53, 0.95), rgba(26, 26, 53, 0.8));
  backdrop-filter: blur(5px);
}

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

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

.card-meta {
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.badge {
  background: rgba(45, 45, 85, 0.8);
  color: #c4b5fd;
  padding: 3px 10px;
  border-radius: 30px;
  font-size: 0.75rem;
  display: inline-block;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(139, 92, 246, 0.2);
  transition: all var(--transition-speed) ease;
}

.badge:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: var(--accent);
}

/* 详情区域 */
.detail-box {
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  padding: 30px;
  border: 1px solid var(--border-color);
  margin: 40px 0;
  animation: fadeInUp 0.6s ease;
  box-shadow: var(--shadow-card);
}

.detail-box p {
  color: var(--text-primary);
  margin-top: 15px;
  font-size: 1.05rem;
  line-height: 1.8;
}

/* 角色卡片 */
.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 25px;
}

.character-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeInUp 0.6s ease;
  animation-fill-mode: both;
  position: relative;
  overflow: hidden;
}

.character-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-main);
  transform: scaleX(0);
  transition: transform var(--transition-speed) ease;
}

.character-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
}

.character-card:hover::before {
  transform: scaleX(1);
}

.character-card img {
  border-radius: 50%;
  width: 120px;
  height: 120px;
  object-fit: cover;
  margin-bottom: 15px;
  border: 3px solid var(--accent-strong);
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.character-card:hover img {
  transform: scale(1.05);
  box-shadow: 0 0 20px var(--accent-glow);
}

.character-card h3 {
  margin-bottom: 10px;
  font-size: 1.3rem;
}

.character-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 4px 0;
}

.character-card p:last-child {
  color: var(--text-primary);
  font-size: 0.9rem;
  margin-top: 10px;
  line-height: 1.5;
}

/* 平台 & APP 盒子 */
.platform-box,
.app-box {
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  padding: 30px;
  border: 1px solid var(--border-color);
  margin: 30px 0;
  animation: fadeInUp 0.6s ease;
  box-shadow: var(--shadow-card);
}

.platform-box p,
.app-box p {
  color: var(--text-primary);
  margin-top: 15px;
  line-height: 1.8;
}

.app-box {
  text-align: center;
}

.app-box p {
  max-width: 600px;
  margin: 0 auto 20px;
}

/* 按钮 */
.btn {
  display: inline-block;
  background: var(--gradient-btn);
  color: #ffffff;
  padding: 12px 32px;
  border-radius: 40px;
  font-weight: 600;
  margin: 10px 10px 0 0;
  border: none;
  transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 1rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.btn::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;
}

.btn:hover {
  background: var(--gradient-btn-hover);
  transform: translateY(-2px) scale(1.02);
  text-decoration: none;
  color: #fff;
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

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

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

/* 评论 */
.comment-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.comment-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 18px;
  transition: all var(--transition-speed) ease;
  animation: fadeInUp 0.5s ease;
  animation-fill-mode: both;
}

.comment-item:hover {
  border-color: var(--border-hover);
  background: rgba(26, 26, 53, 0.8);
  transform: translateX(5px);
}

.comment-user {
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.comment-time {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-left: 15px;
  font-weight: normal;
}

.comment-text {
  color: var(--text-primary);
  margin-top: 8px;
  line-height: 1.6;
}

/* 布局 */
.layout {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
}

.main-content {
  flex: 2;
  min-width: 300px;
}

.sidebar {
  flex: 1;
  min-width: 260px;
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 25px;
  border: 1px solid var(--border-color);
  height: fit-content;
  position: sticky;
  top: 90px;
  animation: fadeInRight 0.6s ease;
  box-shadow: var(--shadow-card);
}

.sidebar h3 {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 18px;
  font-size: 1.2rem;
  position: relative;
}

.sidebar h3::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 50px;
  height: 2px;
  background: var(--gradient-main);
}

.rank-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border-color);
  color: var(--text-secondary);
  transition: all var(--transition-speed) ease;
  cursor: pointer;
}

.rank-item:hover {
  color: var(--accent);
  padding-left: 10px;
  background: rgba(139, 92, 246, 0.05);
  border-radius: 8px;
}

.stats {
  background: var(--bg-card);
  padding: 15px;
  border-radius: var(--radius-sm);
  margin: 12px 0;
  transition: all var(--transition-speed) ease;
}

.stats:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.stats .num {
  font-size: 1.6rem;
  color: var(--accent);
  font-weight: 700;
  display: block;
}

/* 底部 */
footer {
  background: rgba(10, 10, 24, 0.9);
  backdrop-filter: blur(10px);
  margin-top: 60px;
  padding: 40px 0 20px;
  border-top: 1px solid var(--border-color);
}

.footer-links a,
footer .container a {
  color: var(--accent);
  margin-right: 20px;
  font-size: 0.9rem;
  transition: all var(--transition-speed) ease;
}

.footer-links a:hover,
footer .container a:hover {
  color: #c4b5fd;
  text-decoration: none;
}

.copyright {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 20px;
  text-align: center;
}

footer .container > div:last-child {
  text-align: center;
  margin-top: 25px;
  color: var(--text-muted);
}

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

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

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

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

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

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

/* 视差装饰 */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* 响应式 */
@media (max-width: 800px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .menu {
    gap: 12px;
    width: 100%;
    justify-content: space-between;
  }
  
  .menu a {
    font-size: 0.9rem;
    padding: 6px 0;
  }
  
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
  }
  
  .section-title {
    font-size: 1.6rem;
    margin: 35px 0 20px;
  }
  
  .detail-box,
  .platform-box,
  .app-box {
    padding: 20px;
    border-radius: 16px;
  }
  
  .character-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
  }
  
  .character-card {
    padding: 15px;
  }
  
  .character-card img {
    width: 100px;
    height: 100px;
  }
  
  .sidebar {
    position: static;
    margin-top: 30px;
  }
  
  .btn {
    padding: 10px 24px;
    font-size: 0.95rem;
    display: block;
    width: 100%;
    margin: 10px 0 0;
  }
  
  .logo h1 {
    font-size: 1.5rem;
  }
  
  .card-title {
    font-size: 1rem;
  }
  
  .comment-time {
    display: block;
    margin-left: 0;
    margin-top: 4px;
  }
}

/* 小屏幕优化 */
@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }
  
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }
  
  .section-title {
    font-size: 1.4rem;
  }
  
  .menu {
    gap: 8px;
  }
  
  .menu a {
    font-size: 0.85rem;
  }
  
  .character-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
  
  .stats .num {
    font-size: 1.3rem;
  }
  
  .card-body {
    padding: 10px;
  }
  
  .card-meta {
    font-size: 0.8rem;
  }
  
  .badge {
    font-size: 0.7rem;
    padding: 2px 8px;
  }
}

/* 暗色模式增强 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #08081a;
    --bg-secondary: #12122a;
    --bg-card: #181832;
  }
}

/* 打印样式 */
@media print {
  .nav-wrap,
  .sidebar,
  .app-box,
  footer {
    display: none;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .card,
  .detail-box,
  .platform-box {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* 无障碍 */
:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  background: var(--accent-strong);
  color: white;
}

/* 卡片动画延迟 */
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.3s; }
.card:nth-child(7) { animation-delay: 0.35s; }
.card:nth-child(8) { animation-delay: 0.4s; }
.card:nth-child(9) { animation-delay: 0.45s; }
.card:nth-child(10) { animation-delay: 0.5s; }
.card:nth-child(11) { animation-delay: 0.55s; }
.card:nth-child(12) { animation-delay: 0.6s; }

.character-card:nth-child(1) { animation-delay: 0.1s; }
.character-card:nth-child(2) { animation-delay: 0.2s; }
.character-card:nth-child(3) { animation-delay: 0.3s; }
.character-card:nth-child(4) { animation-delay: 0.4s; }

.comment-item:nth-child(1) { animation-delay: 0.05s; }
.comment-item:nth-child(2) { animation-delay: 0.1s; }
.comment-item:nth-child(3) { animation-delay: 0.15s; }
.comment-item:nth-child(4) { animation-delay: 0.2s; }
.comment-item:nth-child(5) { animation-delay: 0.25s; }
.comment-item:nth-child(6) { animation-delay: 0.3s; }
.comment-item:nth-child(7) { animation-delay: 0.35s; }
.comment-item:nth-child(8) { animation-delay: 0.4s; }
.comment-item:nth-child(9) { animation-delay: 0.45s; }
.comment-item:nth-child(10) { animation-delay: 0.5s; }
.comment-item:nth-child(11) { animation-delay: 0.55s; }
.comment-item:nth-child(12) { animation-delay: 0.6s; }
.comment-item:nth-child(13) { animation-delay: 0.65s; }
.comment-item:nth-child(14) { animation-delay: 0.7s; }
.comment-item:nth-child(15) { animation-delay: 0.75s; }

/* 减少动画偏好 */
@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;
  }
}