/* ===== 午夜影视 - 暗夜悬疑主题样式 ===== */
/* ===== 全局重置与基础 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background: linear-gradient(145deg, #0a0a18 0%, #14142a 100%);
  color: #e0e0f0;
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ===== 星空背景装饰 ===== */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(ellipse at 20% 50%, rgba(76, 29, 149, 0.15) 0%, transparent 50%), radial-gradient(ellipse at 80% 20%, rgba(109, 40, 217, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ===== 布局容器 ===== */
.wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 1;
}

/* ===== 链接 ===== */
a {
  color: #a78bfa;
  text-decoration: none;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

a:hover {
  color: #c4b5fd;
  text-decoration: underline;
  text-shadow: 0 0 12px rgba(167, 139, 250, 0.3);
}

/* ===== 页眉 ===== */
header {
  background: rgba(13, 13, 32, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 1rem 2rem;
  border-bottom: 2px solid #2d2d55;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.logo h1 {
  color: #f0f0ff;
  font-size: 1.9rem;
  letter-spacing: 1px;
  font-weight: 700;
  background: linear-gradient(135deg, #c4b5fd, #8b5cf6, #6d28d9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  position: relative;
}

.logo h1::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #8b5cf6, transparent);
  border-radius: 2px;
}

/* ===== 导航 ===== */
nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
  flex-wrap: wrap;
}

nav a {
  color: #d0d0e8;
  font-weight: 500;
  padding: 0.3rem 0;
  position: relative;
  transition: color 0.3s ease;
}

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

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

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

.active {
  color: #8b5cf6 !important;
  border-bottom: 3px solid #8b5cf6;
}

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

/* ===== 区块与标题 ===== */
section {
  margin: 3.5rem 0;
  position: relative;
}

h2 {
  color: #f0f0ff;
  font-size: 2rem;
  border-left: 6px solid #8b5cf6;
  padding-left: 1rem;
  margin-bottom: 2rem;
  position: relative;
  animation: fadeInUp 0.6s ease-out;
}

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

h3 {
  color: #f0f0ff;
  margin: 1rem 0 0.5rem;
}

/* ===== 卡片网格 ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.8rem;
}

/* ===== 卡片 ===== */
.card {
  background: rgba(26, 26, 53, 0.7);
  border: 1px solid #2d2d55;
  border-radius: 16px;
  padding: 1rem;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease, box-shadow 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s ease-out;
}

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

.card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: #8b5cf6;
  box-shadow: 0 12px 40px rgba(139, 92, 246, 0.2), 0 0 0 1px rgba(139, 92, 246, 0.1);
}

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

.card img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  margin-bottom: 0.5rem;
  transition: transform 0.3s ease;
}

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

.card-title {
  color: #f0f0ff;
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
}

.card-sub {
  color: #b0b0d0;
  font-size: 0.9rem;
}

/* ===== 徽章 ===== */
.badge {
  display: inline-block;
  background: rgba(45, 45, 85, 0.8);
  color: #c4b5fd;
  padding: 0.2rem 0.8rem;
  border-radius: 30px;
  font-size: 0.75rem;
  margin: 0.3rem 0;
  border: 1px solid rgba(139, 92, 246, 0.3);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.badge:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: #8b5cf6;
}

/* ===== 双栏网格 ===== */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

/* ===== 内容面板 ===== */
.content-panel {
  background: rgba(22, 22, 48, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 2rem;
  border-radius: 20px;
  border: 1px solid rgba(45, 45, 85, 0.5);
  transition: border-color 0.3s ease;
}

.content-panel:hover {
  border-color: rgba(139, 92, 246, 0.4);
}

/* ===== 角色网格 ===== */
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}

.char-card {
  background: rgba(26, 26, 53, 0.7);
  border: 1px solid #2d2d55;
  border-radius: 20px;
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.char-card:hover {
  transform: translateY(-5px);
  border-color: #8b5cf6;
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.15);
}

.char-card img {
  border-radius: 50%;
  width: 130px;
  height: 130px;
  object-fit: cover;
  border: 3px solid #2d2d55;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.char-card:hover img {
  border-color: #8b5cf6;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.char-card p {
  margin: 0.3rem 0;
}

/* ===== 评论框 ===== */
.review-box {
  background: rgba(26, 26, 53, 0.7);
  border: 1px solid #2d2d55;
  border-radius: 16px;
  padding: 1.2rem 1.5rem;
  margin: 1rem 0;
  transition: background 0.3s ease, border-color 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.review-box:hover {
  background: rgba(26, 26, 53, 0.9);
  border-color: rgba(139, 92, 246, 0.4);
}

.review-user {
  color: #a78bfa;
  font-weight: 600;
  font-size: 1.05rem;
}

.review-time {
  color: #8888aa;
  font-size: 0.8rem;
  margin-left: 1rem;
  font-style: italic;
}

.review-box p {
  margin-top: 0.5rem;
  color: #e0e0f0;
}

/* ===== 侧边栏 ===== */
aside {
  background: rgba(20, 20, 46, 0.8);
  border: 1px solid #2d2d55;
  padding: 2rem;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.side-list {
  list-style: none;
}

.side-list li {
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(45, 45, 85, 0.8);
  color: #d0d0e8;
  transition: color 0.3s ease, padding-left 0.3s ease;
}

.side-list li:hover {
  color: #c4b5fd;
  padding-left: 8px;
}

.side-list strong {
  color: #f0f0ff;
  margin-right: 0.5rem;
}

/* ===== 按钮组 ===== */
.btn-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 2rem 0;
}

/* ===== 按钮 ===== */
.btn {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #ffffff !important;
  font-weight: 600;
  padding: 0.8rem 2.2rem;
  border-radius: 60px;
  border: none;
  cursor: pointer;
  display: inline-block;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
}

.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: linear-gradient(135deg, #8b5cf6, #7c3aed);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4);
  text-decoration: none;
  color: #fff;
}

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

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

/* ===== 页脚 ===== */
footer {
  background: rgba(10, 10, 24, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 2.5rem 2rem;
  margin-top: 4rem;
  border-top: 1px solid #2d2d55;
}

.footer-links a {
  color: #a78bfa;
  margin-right: 1.5rem;
  font-size: 0.95rem;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: #c4b5fd;
  text-decoration: none;
  text-shadow: 0 0 8px rgba(167, 139, 250, 0.3);
}

.copyright {
  color: #8888aa;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  border-top: 1px solid #232348;
  padding-top: 1.2rem;
  line-height: 2;
}

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

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

/* 滚动动画：卡片依次延迟 */
.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; }
.card:nth-child(13) { animation-delay: 0.65s; }
.card:nth-child(14) { animation-delay: 0.7s; }
.card:nth-child(15) { animation-delay: 0.75s; }
.card:nth-child(16) { animation-delay: 0.8s; }

/* 平台介绍和APP下载的样式增强 */
#platform div[style*="background"],
#app div[style*="background"] {
  background: rgba(20, 20, 46, 0.7) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(45, 45, 85, 0.5);
  transition: border-color 0.3s ease;
}

#platform div[style*="background"]:hover,
#app div[style*="background"]:hover {
  border-color: rgba(139, 92, 246, 0.4);
}

#platform p,
#app p {
  color: #e0e0f0;
  line-height: 1.8;
}

#platform strong {
  color: #c4b5fd;
  font-weight: 600;
}

/* 侧边栏内部布局优化 */
aside > div[style*="display:flex"] {
  gap: 1.5rem !important;
}

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

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

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #2d2d55, #8b5cf6);
  border-radius: 5px;
  border: 2px solid #0a0a18;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #3d3d75, #a78bfa);
}

/* ===== 响应式设计 ===== */
@media (max-width: 1200px) {
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
  }
}

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

  .logo h1 {
    font-size: 1.4rem;
  }

  nav ul {
    gap: 1rem;
    margin-top: 0.5rem;
  }

  header {
    padding: 0.8rem 1rem;
  }

  .wrap {
    padding: 15px;
  }

  h2 {
    font-size: 1.6rem;
  }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 1rem;
  }

  .char-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }

  .char-card img {
    width: 100px;
    height: 100px;
  }

  .btn {
    padding: 0.7rem 1.5rem;
    font-size: 0.9rem;
  }

  .btn-group {
    gap: 0.8rem;
  }

  .footer-links a {
    margin-right: 0.8rem;
    font-size: 0.85rem;
    display: inline-block;
    margin-bottom: 0.3rem;
  }

  .copyright {
    font-size: 0.8rem;
  }

  section {
    margin: 2.5rem 0;
  }

  .review-time {
    display: block;
    margin-left: 0;
    margin-top: 0.2rem;
  }

  .content-panel {
    padding: 1.5rem;
  }

  aside > div[style*="display:flex"] {
    flex-direction: column;
    gap: 1rem !important;
  }
}

@media (max-width: 480px) {
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.8rem;
  }

  .card {
    padding: 0.8rem;
    border-radius: 12px;
  }

  .card-title {
    font-size: 1rem;
  }

  .card-sub {
    font-size: 0.8rem;
  }

  .badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.6rem;
  }

  h2 {
    font-size: 1.4rem;
    padding-left: 0.8rem;
  }

  .btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    width: 100%;
    text-align: center;
  }

  .btn-group {
    flex-direction: column;
  }

  nav ul {
    gap: 0.5rem;
    font-size: 0.9rem;
  }

  nav a {
    padding: 0.2rem 0.3rem;
  }

  .char-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
  }

  .char-card {
    padding: 1rem;
  }

  .char-card img {
    width: 80px;
    height: 80px;
  }
}

/* ===== 暗色模式增强 ===== */
@media (prefers-color-scheme: dark) {
  body {
    background: linear-gradient(145deg, #080812 0%, #101020 100%);
  }

  .card,
  .char-card,
  .review-box {
    background: rgba(20, 20, 40, 0.8);
  }
}

/* ===== 无障碍访问 ===== */
@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;
  }
}

/* ===== 高亮选择 ===== */
::selection {
  background: rgba(139, 92, 246, 0.4);
  color: #f0f0ff;
}

/* ===== 专注状态 ===== */
a:focus-visible,
.btn:focus-visible {
  outline: 2px solid #8b5cf6;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ===== 卡片图片懒加载过渡 ===== */
img {
  opacity: 1;
  transition: opacity 0.5s ease;
}

img[loading="lazy"] {
  opacity: 0.6;
}

img[loading="lazy"]:hover {
  opacity: 1;
}

/* ===== 内容面板文本样式增强 ===== */
.content-panel p {
  color: #e0e0f0;
  margin-bottom: 0.8rem;
  line-height: 1.8;
}

.content-panel strong {
  color: #a78bfa;
  font-weight: 600;
}

/* ===== 特色区块的标签样式 ===== */
.content-panel p:last-child {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(139, 92, 246, 0.2);
  font-size: 0.95rem;
}

/* ===== 卡片内文字样式 ===== */
.card > div {
  color: #b0b0d0;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.card > div.card-title {
  color: #f0f0ff;
  font-size: 1.2rem;
  font-weight: 700;
}

/* ===== 网格卡片特色 ===== */
.grid-2 .card {
  background: rgba(22, 22, 48, 0.7);
}

.grid-2 .card h3 {
  font-size: 1.4rem;
  margin-top: 0.8rem;
}

.grid-2 .card p {
  color: #d0d0e8;
  margin-top: 0.3rem;
  font-size: 0.95rem;
}

/* ===== 侧边栏标题 ===== */
aside h3 {
  color: #f0f0ff;
  margin-bottom: 0.8rem;
  font-size: 1.1rem;
  position: relative;
  padding-bottom: 0.5rem;
}

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

/* ===== 区块间渐变分隔 ===== */
section::after {
  content: '';
  display: block;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.2), transparent);
  margin-top: 3.5rem;
}

section:last-of-type::after {
  display: none;
}

/* ===== 平台介绍特殊样式 ===== */
#platform p,
#app p {
  font-size: 1.05rem;
}

/* ===== 页脚内容布局 ===== */
footer .wrap {
  max-width: 1400px;
}

/* ===== 图片圆角与阴影优化 ===== */
.card img,
.grid-2 img {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* ===== 卡片标题与内容间距 ===== */
.card > div:not(:first-child) {
  margin-top: 0.15rem;
}

/* ===== 悬停时卡片内文字颜色变化 ===== */
.card:hover .card-title {
  color: #c4b5fd;
}

/* ===== 评论区域的引用样式 ===== */
.review-box::before {
  content: '"';
  font-size: 2rem;
  color: #8b5cf6;
  opacity: 0.3;
  position: absolute;
  top: 5px;
  right: 15px;
  font-family: Georgia, serif;
}

.review-box {
  position: relative;
}

/* ===== 按钮组在APP下载区的对齐 ===== */
#app .btn-group {
  justify-content: flex-start;
}

/* ===== 确保所有文本在暗色背景可读 ===== */
p, li, div {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ===== 移动端底部导航优化 ===== */
@media (max-width: 480px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }

  nav {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  nav::-webkit-scrollbar {
    display: none;
  }

  nav ul {
    flex-wrap: nowrap;
    padding-bottom: 0.5rem;
    min-width: max-content;
  }

  nav a {
    white-space: nowrap;
  }
}

/* ===== 打印优化 ===== */
@media print {
  body {
    background: white;
    color: black;
  }

  header, footer, .btn-group, aside {
    display: none;
  }

  .card, .content-panel, .char-card, .review-box {
    border: 1px solid #ccc;
    background: white;
    break-inside: avoid;
  }
}