/* ===== 全局样式 ===== */
:root {
  --primary: #7c3aed;
  --primary-dark: #6d28d9;
  --primary-light: #8b5cf6;
  --primary-soft: #f3e8ff;
  --bg: #f5f3ff;
  --bg-dark: #0f0a1a;
  --card-bg: #ffffff;
  --card-bg-dark: #1a1025;
  --text: #2d1b69;
  --text-dark: #e9d5ff;
  --text-muted: #6b7280;
  --text-muted-dark: #9ca3af;
  --border-radius: 12px;
  --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 8px 25px rgba(109, 40, 217, 0.2);
  --transition: all 0.3s ease;
  --gradient: linear-gradient(135deg, #6d28d9, #8b5cf6, #a78bfa);
  --gradient-banner: linear-gradient(135deg, #4c1d95, #6d28d9, #8b5cf6, #a78bfa);
}

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

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

body {
  background: var(--bg);
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
}

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

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

ul, ol {
  list-style-position: inside;
}

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

::-webkit-scrollbar-track {
  background: rgba(124, 58, 237, 0.1);
  border-radius: 10px;
}

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

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* ===== Header ===== */
header {
  background: var(--gradient-banner);
  padding: 1rem 0;
  box-shadow: 0 2px 20px rgba(109, 40, 217, 0.3);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: slideDown 0.5s ease;
}

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

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

.logo-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-container h1 {
  color: #ffffff;
  font-size: 1.8rem;
  margin: 0;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  background: linear-gradient(135deg, #ffffff, #e9d5ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
  }
  to {
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
  }
}

.badge {
  color: #e9d5ff;
  margin-left: 10px;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.15);
  padding: 4px 14px;
  border-radius: 20px;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 500;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.nav-links a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.nav-links a::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: #ffffff;
  transition: var(--transition);
}

.nav-links a:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.nav-links a:hover::before {
  width: 70%;
}

/* ===== Main Layout ===== */
main {
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 20px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

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

.sidebar {
  flex: 1;
  min-width: 250px;
}

/* ===== Section Styles ===== */
section {
  margin-bottom: 40px;
  animation: fadeInUp 0.6s ease;
}

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

.section-title {
  color: var(--primary-dark);
  border-left: 5px solid var(--primary-light);
  padding-left: 15px;
  font-size: 1.8rem;
  margin-bottom: 20px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 15px;
  width: 50%;
  height: 3px;
  background: var(--gradient);
  border-radius: 3px;
}

/* ===== Card Grid ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

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

/* ===== Card Styles ===== */
.card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  border: 1px solid rgba(124, 58, 237, 0.1);
}

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

.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, transparent, rgba(124, 58, 237, 0.1));
  opacity: 0;
  transition: var(--transition);
  pointer-events: none;
}

.card:hover::after {
  opacity: 1;
}

.card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: var(--transition);
}

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

.card-body {
  padding: 15px;
}

.card-title {
  margin: 0 0 8px;
  font-size: 1.1rem;
  color: var(--text);
  transition: var(--transition);
}

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

.card-meta {
  margin: 4px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.card-update {
  margin: 4px 0;
  font-size: 0.85rem;
  color: var(--primary-light);
  font-weight: 500;
}

.card-tag {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 3px 12px;
  border-radius: 15px;
  font-size: 0.75rem;
  font-weight: 500;
  transition: var(--transition);
}

.card:hover .card-tag {
  background: var(--primary);
  color: #ffffff;
}

/* ===== Detail Section ===== */
.detail-section {
  background: var(--card-bg);
  padding: 30px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.detail-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--gradient);
}

.detail-content {
  margin-top: 20px;
}

.detail-content h3 {
  font-size: 1.5rem;
  color: var(--text);
  margin-bottom: 15px;
}

.detail-content p {
  line-height: 1.8;
  color: #4b5563;
  font-size: 1rem;
  margin-bottom: 15px;
  text-align: justify;
}

/* ===== Character Grid ===== */
.characters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.character-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.character-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-soft), transparent);
  opacity: 0;
  transition: var(--transition);
}

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

.character-card:hover::before {
  opacity: 1;
}

.character-img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 15px;
  border: 4px solid var(--primary-soft);
  transition: var(--transition);
  position: relative;
  z-index: 1;
}

.character-card:hover .character-img {
  border-color: var(--primary);
  transform: scale(1.05);
}

.character-role {
  margin: 0 0 5px;
  font-size: 0.9rem;
  color: var(--primary-light);
  font-weight: 500;
}

.character-skill {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.character-desc {
  font-size: 0.85rem;
  color: #4b5563;
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

/* ===== Platform Section ===== */
.platform-section {
  background: var(--card-bg);
  padding: 30px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.platform-section p {
  line-height: 1.8;
  color: #4b5563;
  font-size: 1rem;
  margin-bottom: 15px;
}

/* ===== App Download Section ===== */
.app-section {
  background: var(--gradient);
  padding: 40px 30px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-hover);
  text-align: center;
  position: relative;
  overflow: hidden;
}

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

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

.app-section h2 {
  color: #ffffff;
  font-size: 1.8rem;
  position: relative;
  z-index: 1;
}

.app-section p {
  line-height: 1.8;
  color: #e9d5ff;
  font-size: 1rem;
  margin: 20px 0;
  position: relative;
  z-index: 1;
}

.app-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
  position: relative;
  z-index: 1;
}

.btn {
  display: inline-block;
  padding: 12px 30px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
}

.btn-outline {
  background: transparent;
  color: #ffffff;
  border: 2px solid #ffffff;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-3px);
}

.btn-secondary {
  background: var(--primary-dark);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(109, 40, 217, 0.4);
}

.btn-secondary:hover {
  background: #5b21b6;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(109, 40, 217, 0.5);
}

/* ===== Comments Section ===== */
.comments-list {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.comment-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.comment-card::before {
  content: '"';
  position: absolute;
  top: -20px;
  right: 10px;
  font-size: 80px;
  color: var(--primary-soft);
  font-family: Georgia, serif;
  opacity: 0.5;
}

.comment-card:hover {
  transform: translateX(5px);
  box-shadow: var(--shadow-hover);
}

.comment-author {
  margin: 0 0 10px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-author::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gradient);
}

.comment-content {
  margin: 0;
  color: #4b5563;
  line-height: 1.6;
}

.comment-date {
  margin: 10px 0 0;
  font-size: 0.8rem;
  color: #9ca3af;
}

/* ===== Sidebar Widgets ===== */
.widget {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  transition: var(--transition);
}

.widget:hover {
  box-shadow: var(--shadow-hover);
}

.widget-title {
  color: var(--primary-dark);
  font-size: 1.3rem;
  margin-top: 0;
  border-left: 4px solid var(--primary-light);
  padding-left: 10px;
  margin-bottom: 15px;
}

.widget-list {
  padding-left: 20px;
  color: #4b5563;
  line-height: 2;
}

.widget-list li {
  transition: var(--transition);
  cursor: pointer;
}

.widget-list li:hover {
  color: var(--primary);
  transform: translateX(5px);
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(124, 58, 237, 0.1);
}

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

.stat-label {
  color: var(--text-muted);
}

.stat-value {
  font-weight: 700;
  color: var(--primary);
  font-size: 1.1rem;
}

/* ===== Footer ===== */
footer {
  background: linear-gradient(135deg, #2d1b69, #1a1025);
  color: #e9d5ff;
  padding: 40px 20px;
  margin-top: 40px;
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--gradient);
}

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

.footer-section {
  flex: 1;
  min-width: 250px;
}

.footer-title {
  margin: 0 0 10px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffffff;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-links a {
  color: #c4b5fd;
  text-decoration: none;
  transition: var(--transition);
  padding: 3px 8px;
  border-radius: 4px;
}

.footer-links a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.footer-text {
  margin: 5px 0;
  font-size: 0.9rem;
  color: #a78bfa;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
  header {
    padding: 0.8rem 0;
  }

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

  .badge {
    font-size: 0.75rem;
    padding: 3px 10px;
  }

  .nav-links {
    justify-content: center;
    width: 100%;
    gap: 5px;
  }

  .nav-links a {
    padding: 6px 10px;
    font-size: 0.9rem;
  }

  main {
    padding: 0 15px;
  }

  .content-main {
    flex: 100%;
  }

  .sidebar {
    flex: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
  }

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

  .card-img {
    height: 150px;
  }

  .card-body {
    padding: 10px;
  }

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

  .card-meta {
    font-size: 0.75rem;
  }

  .section-title {
    font-size: 1.4rem;
  }

  .detail-section,
  .platform-section {
    padding: 20px;
  }

  .app-section {
    padding: 30px 20px;
  }

  .app-buttons {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 250px;
  }

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

  .character-img {
    width: 100px;
    height: 100px;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
  }
}

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

  .card-img {
    height: 120px;
  }

  .card-body {
    padding: 8px;
  }

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

  .card-meta {
    font-size: 0.7rem;
  }

  .section-title {
    font-size: 1.2rem;
  }

  .detail-content h3 {
    font-size: 1.2rem;
  }

  .detail-content p {
    font-size: 0.9rem;
  }

  .comment-card {
    padding: 15px;
  }
}

/* ===== Dark Mode ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--bg-dark);
    --card-bg: var(--card-bg-dark);
    --text: var(--text-dark);
    --text-muted: var(--text-muted-dark);
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 8px 25px rgba(124, 58, 237, 0.3);
  }

  body {
    background: var(--bg);
    color: var(--text);
  }

  .card {
    background: var(--card-bg);
    border-color: rgba(255, 255, 255, 0.1);
  }

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

  .card-meta {
    color: var(--text-muted);
  }

  .detail-section,
  .platform-section,
  .widget,
  .comment-card {
    background: var(--card-bg);
  }

  .detail-content p,
  .platform-section p,
  .comment-content {
    color: #c4b5fd;
  }

  .character-desc {
    color: #c4b5fd;
  }

  .widget-list {
    color: #c4b5fd;
  }

  .comment-date {
    color: #6b7280;
  }

  .app-section {
    background: linear-gradient(135deg, #4c1d95, #6d28d9, #8b5cf6);
  }

  .btn-outline {
    border-color: #e9d5ff;
  }
}

/* ===== Scroll Animation ===== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Hover Effects ===== */
.hover-lift {
  transition: var(--transition);
}

.hover-lift:hover {
  transform: translateY(-5px);
}

/* ===== Gradient Text ===== */
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== Glass Effect ===== */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ===== Utility Classes ===== */
.text-center {
  text-align: center;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

/* ===== Print Styles ===== */
@media print {
  header,
  footer,
  .sidebar,
  .app-section {
    display: none;
  }

  body {
    background: #ffffff;
    color: #000000;
  }

  .card,
  .detail-section,
  .platform-section,
  .comment-card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* ===== Loading Animation ===== */
.loading {
  width: 40px;
  height: 40px;
  border: 4px solid var(--primary-soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

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

/* ===== Custom Animations ===== */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.float {
  animation: float 3s ease-in-out infinite;
}

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

.shimmer {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}