/* ========================================
   红顶天动漫 - 全局样式系统
   浅色主题 · 与原站风格一致
   ======================================== */

:root {
  /* 主色调 - 与原站一致 */
  --primary: #6c5ce7;
  --primary-light: #a29bfe;
  --primary-dark: #4c3fb8;
  --accent: #00cec9;
  --accent-light: #48ebe5;

  /* 背景 - 浅色 */
  --bg-deep: #e8ecf1;
  --bg-dark: #f4f6fb;
  --bg-card: #ffffff;
  --bg-card-hover: #f8f9fb;
  --bg-input: #f4f6fb;
  --bg-overlay: rgba(0,0,0,0.5);

  /* 文字 - 与原站一致 */
  --text-primary: #1a1d24;
  --text-secondary: #5c6370;
  --text-muted: #8e94a0;
  --text-inverse: #ffffff;

  /* 边框 */
  --border: #e6e8ef;
  --border-light: #f0f1f5;

  /* 功能色 */
  --success: #00a36c;
  --warning: #f59e0b;
  --danger: #d63031;
  --info: #0984e3;

  /* 排行色 */
  --rank-1: #ef4444;
  --rank-2: #f97316;
  --rank-3: #eab308;

  /* 尺寸 */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --header-h: 60px;
  --max-width: 1200px;

  /* 阴影 */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
  --shadow-glow: 0 0 20px rgba(108,92,231,0.15);

  /* 动画 */
  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;

  /* 字体 */
  font-family: 'Segoe UI', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--text-primary);
  background: var(--bg-dark);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ========== 布局 ========== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}
.section { padding: 40px 0; }
.section.alt { background: #f0f3f8; }

/* 区块标题 */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.section-head h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-head h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 22px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: 2px;
}
.more {
  color: var(--text-muted);
  font-size: 14px;
  transition: color var(--transition);
}
.more:hover { color: var(--primary); }

/* ========== 头部导航 ========== */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.header-inner {
  display: flex;
  align-items: center;
  height: var(--header-h);
  gap: 20px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 800;
  flex-shrink: 0;
}
.logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: white;
}
.logo-text {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 搜索栏 */
.header-search {
  flex: 1;
  max-width: 400px;
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border-radius: var(--radius);
  padding: 0 12px;
  height: 38px;
  border: 1px solid var(--border);
  transition: border var(--transition);
}
.header-search:focus-within {
  border-color: var(--primary);
  background: #fff;
}
.header-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
}
.header-search input::placeholder { color: var(--text-muted); }
.header-search button {
  background: var(--primary);
  color: white;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  transition: background var(--transition);
}
.header-search button:hover { background: var(--primary-dark); }

/* 导航链接 */
.header-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-link {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
}
.nav-link:hover, .nav-link.active {
  background: #eef2ff;
  color: var(--primary);
}

/* 头部按钮 */
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.btn-sm {
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
}
.btn-outline {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary-sm {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}
.btn-primary-sm:hover { opacity: 0.9; }

/* 用户区域 */
.user-area {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-size: 13px;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: white;
}
.balance-badge {
  background: var(--bg-input);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
}

/* ========== 漫画卡片 ========== */
.comic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 18px;
}
.comic-card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: transform var(--transition-slow), box-shadow var(--transition-slow);
  cursor: pointer;
}
.comic-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.comic-cover {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: #e8ecf1;
}
.comic-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}
.comic-card:hover .comic-cover img {
  transform: scale(1.05);
}
.comic-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}
.badge-hot { background: var(--danger); color: white; }
.badge-new { background: var(--accent); color: white; }
.badge-update { background: var(--primary); color: white; }
.badge-free { background: var(--success); color: white; }
.badge-vip { background: linear-gradient(135deg, #f59e0b, #ef4444); color: white; }
.comic-chapters {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.65);
  color: white;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
}
.comic-info { padding: 12px 14px; }
.comic-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.comic-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.comic-tag {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  background: #eef2ff;
  color: var(--primary);
}

/* ========== 轮播图 ========== */
.hero-slider {
  position: relative;
  width: 100%;
  height: 420px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}
.hero-slider-wrapper {
  display: flex;
  transition: transform 0.5s ease;
  height: 100%;
}
.hero-slide {
  min-width: 100%;
  height: 100%;
  position: relative;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 60%);
  display: flex;
  align-items: flex-end;
  padding: 40px 30px;
}
.hero-text h3 { font-size: 28px; color: white; margin-bottom: 8px; }
.hero-text p { font-size: 15px; color: rgba(255,255,255,0.8); margin-bottom: 12px; }
.hero-btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: white;
  font-size: 14px;
  font-weight: 600;
  display: inline-block;
  transition: background var(--transition);
}
.hero-btn:hover { background: var(--primary-dark); }
.slider-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}
.slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: all var(--transition);
}
.slider-dot.active {
  background: white;
  width: 24px;
  border-radius: 4px;
}
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: white;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  opacity: 0;
}
.hero-slider:hover .slider-btn { opacity: 1; }
.slider-btn:hover { background: rgba(255,255,255,0.4); }
.slider-prev { left: 16px; }
.slider-next { right: 16px; }

/* ========== 分类标签 ========== */
.category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}
.cat-tag {
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  border: 1px solid var(--border);
}
.cat-tag:hover, .cat-tag.active {
  background: #eef2ff;
  color: var(--primary);
  border-color: var(--primary-light);
}

/* ========== 排行榜 ========== */
.rank-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.rank-tab {
  padding: 10px 20px;
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
  border: 1px solid var(--border);
}
.rank-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.rank-tab:hover:not(.active) {
  background: #eef2ff;
  color: var(--primary);
}
.rank-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rank-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all var(--transition);
  cursor: pointer;
}
.rank-item:hover {
  background: #fafbfc;
  transform: translateX(4px);
  border-color: var(--primary-light);
}
.rank-num {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rank-num.top1 { background: var(--rank-1); color: white; }
.rank-num.top2 { background: var(--rank-2); color: white; }
.rank-num.top3 { background: var(--rank-3); color: white; }
.rank-cover {
  width: 64px;
  height: 48px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-input);
}
.rank-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.rank-info { flex: 1; min-width: 0; }
.rank-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.rank-score {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--warning);
  font-weight: 600;
  flex-shrink: 0;
}

/* ========== 按钮 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
}
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white; }
.btn-primary:hover { opacity: 0.9; }
.btn-secondary { background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border-light); }

/* ========== 表单 ========== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 14px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.form-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border var(--transition);
}
.form-input:focus { border-color: var(--primary); background: #fff; }

/* ========== 页脚 - 与原站一致的深色风格 ========== */
.site-footer {
  background: linear-gradient(180deg, #0f1115, #0a0b0f);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 36px 0 30px;
  margin-top: auto;
  color: #9aa3b5;
  font-size: 13px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 30px;
  margin-bottom: 28px;
}
.footer-col h4 {
  font-size: 15px;
  color: #c7ccda;
  margin-bottom: 12px;
}
.footer-col p, .footer-col li {
  line-height: 1.8;
  color: #9aa3b5;
}
.footer-col a { color: #a29bfe; transition: color 0.2s; }
.footer-col a:hover { color: #c4bfff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 20px;
  text-align: center;
  color: #7a8194;
  font-size: 12px;
}
.footer-bottom a { color: #a29bfe; }

/* ========== 面包屑 ========== */
.breadcrumb {
  padding: 16px 0;
  font-size: 13px;
  color: var(--text-muted);
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { margin: 0 8px; color: var(--text-muted); }

/* ========== 通用 ========== */
.notice-box {
  background: #eef2ff;
  border-left: 3px solid var(--primary);
  padding: 10px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 12px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .hero-slider { height: 240px; }
  .hero-text h3 { font-size: 18px; }
  .hero-text p { font-size: 13px; }
  .comic-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .header-search { display: none; }
  .header-nav { display: none; }
}
@media (max-width: 480px) {
  .comic-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-slider { height: 180px; }
  .section-head h2 { font-size: 18px; }
}
