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

:root {
  --primary: #6c5ce7;
  --primary-dark: #5a4bd1;
  --secondary: #00cec9;
  --accent: #fd79a8;
  --bg: #f8f9fd;
  --bg-alt: #eef0f8;
  --text: #2d3436;
  --text-light: #636e72;
  --white: #ffffff;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: all 0.3s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

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

/* ==================== 顶部通知条 ==================== */
.top-bar {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--white);
  text-align: center;
  padding: 8px 0;
  font-size: 13px;
}

/* ==================== 导航栏 ==================== */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  transition: var(--transition);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}

.logo-icon { font-size: 28px; }

.nav-list {
  display: flex;
  gap: 28px;
}

.nav-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  position: relative;
  padding: 4px 0;
  transition: var(--transition);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: var(--transition);
}

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

.nav-link:hover, .nav-link.active { color: var(--primary); }

/* 汉堡菜单 */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* ==================== Hero ==================== */
.hero {
  position: relative;
  min-height: 500px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 50%, #fd79a8 100%);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.15) 0%, transparent 40%);
}

.hero-content {
  position: relative;
  z-index: 1;
  color: var(--white);
  text-align: center;
  padding: 60px 20px;
}

.hero-title {
  font-size: 48px;
  font-weight: 900;
  margin-bottom: 16px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.highlight {
  background: linear-gradient(180deg, transparent 60%, rgba(253,121,168,0.6) 60%);
  padding: 0 4px;
}

.hero-desc {
  font-size: 18px;
  max-width: 600px;
  margin: 0 auto 32px;
  opacity: 0.95;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.btn {
  display: inline-block;
  padding: 14px 36px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--white);
  color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}

.btn-outline:hover {
  background: var(--white);
  color: var(--primary);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 60px;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}

.stat-item strong {
  display: block;
  font-size: 36px;
  font-weight: 800;
}

.stat-item span {
  font-size: 14px;
  opacity: 0.85;
}

/* ==================== 通用 Section ==================== */
.section {
  padding: 80px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
}

.section-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  position: relative;
  padding-left: 16px;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 28px;
  background: linear-gradient(var(--primary), var(--accent));
  border-radius: 2px;
}

.section-more {
  font-size: 14px;
  color: var(--primary);
  font-weight: 500;
  transition: var(--transition);
}

.section-more:hover { color: var(--accent); }

/* ==================== 漫画卡片网格 ==================== */
.comic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 24px;
}

.comic-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
}

.comic-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.comic-cover {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
  background: linear-gradient(135deg, var(--c1, #a29bfe), var(--c2, #6c5ce7));
}

.comic-info {
  padding: 12px 14px;
}

.comic-info h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comic-info p {
  font-size: 12px;
  color: var(--text-light);
}

.comic-tag {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--white);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 6px;
}

/* ==================== 排行 ==================== */
.ranking-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.tab-btn {
  padding: 8px 24px;
  border-radius: 50px;
  border: none;
  background: var(--white);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.tab-btn.active, .tab-btn:hover {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--white);
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--white);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.ranking-item:hover { transform: translateX(6px); }

.rank-num {
  font-size: 24px;
  font-weight: 900;
  width: 40px;
  text-align: center;
  flex-shrink: 0;
}

.rank-num.top { color: var(--accent); }

.rank-cover {
  width: 50px;
  height: 66px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--c1), var(--c2));
}

.rank-info { flex: 1; }

.rank-info h4 {
  font-size: 15px;
  font-weight: 700;
}

.rank-info span {
  font-size: 12px;
  color: var(--text-light);
}

.rank-score {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}

/* ==================== 分类卡片 ==================== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
}

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

.category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  opacity: 0;
  transition: var(--transition);
  z-index: 0;
}

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

.category-card:hover { transform: translateY(-4px); color: var(--white); }

.cat-emoji, .category-card h3, .category-card p {
  position: relative;
  z-index: 1;
}

.cat-emoji { font-size: 40px; display: block; margin-bottom: 8px; }

.category-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }

.category-card p { font-size: 12px; opacity: 0.8; }

/* ==================== 完结推荐 ==================== */
.finished-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.finished-card {
  display: flex;
  gap: 16px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.finished-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.finished-cover {
  width: 90px;
  height: 120px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--c1), var(--c2));
}

.finished-info { flex: 1; }

.finished-info h4 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.finished-info .desc {
  font-size: 13px;
  color: var(--text-light);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.finished-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-light);
}

.finished-meta .status {
  background: #00b894;
  color: var(--white);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
}

/* ==================== 关于 ==================== */
.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.about-text p {
  font-size: 16px;
  color: var(--text-light);
  margin-bottom: 20px;
}

.about-features li {
  font-size: 15px;
  padding: 6px 0;
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.about-stat-card {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--white);
  padding: 28px 20px;
  border-radius: var(--radius);
  text-align: center;
}

.about-stat-card strong {
  display: block;
  font-size: 28px;
  font-weight: 800;
}

.about-stat-card span {
  font-size: 13px;
  opacity: 0.9;
}

/* ==================== 页脚 ==================== */
.footer {
  background: #1a1a2e;
  color: rgba(255,255,255,0.7);
  padding: 60px 0 20px;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--white);
  display: block;
  margin-bottom: 12px;
}

.footer-col h4 {
  color: var(--white);
  font-size: 15px;
  margin-bottom: 16px;
}

.footer-col ul li { padding: 4px 0; }

.footer-col ul li a {
  font-size: 14px;
  transition: var(--transition);
}

.footer-col ul li a:hover { color: var(--accent); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
}

.footer-bottom a { color: var(--accent); }

/* ==================== 回到顶部 ==================== */
.back-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--white);
  border: none;
  font-size: 22px;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 999;
}

.back-top.show { opacity: 1; visibility: visible; }

.back-top:hover { transform: translateY(-3px); }

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

.animate-on-scroll {
  animation: fadeInUp 0.6s ease forwards;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
  .top-bar { font-size: 12px; padding: 6px 10px; }

  .menu-toggle { display: flex; }

  .nav {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: var(--shadow);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .nav.open { max-height: 400px; }

  .nav-list {
    flex-direction: column;
    gap: 0;
    padding: 10px 20px;
  }

  .nav-link { padding: 12px 0; border-bottom: 1px solid #eee; }

  .hero { min-height: 380px; }
  .hero-title { font-size: 30px; }
  .hero-desc { font-size: 15px; }
  .hero-stats { gap: 30px; }
  .stat-item strong { font-size: 26px; }

  .section { padding: 50px 0; }
  .section-title { font-size: 22px; }

  .comic-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .category-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

  .about-content { grid-template-columns: 1fr; gap: 30px; }

  .footer-top { grid-template-columns: 1fr 1fr; gap: 24px; }

  .ranking-item { padding: 10px 12px; gap: 10px; }
  .rank-num { font-size: 18px; width: 28px; }
  .rank-cover { width: 40px; height: 53px; }

  .finished-list { grid-template-columns: 1fr; }

  .back-top { bottom: 16px; right: 16px; width: 44px; height: 44px; font-size: 18px; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 26px; }
  .hero-actions .btn { padding: 12px 28px; font-size: 14px; }
  .comic-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .footer-top { grid-template-columns: 1fr; }
}

/* ==================== SEO 友好 - 打印样式 ==================== */
@media print {
  .header, .footer, .back-top { display: none; }
}
