/* 51漫画 - 卡片瀑布流风格（SEO优化） */

:root {
  --bg-primary: #f9fafb;
  --bg-secondary: #fff;
  --accent: #f97316;
  --accent-hover: #ea580c;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

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

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
}

/* 头部导航 */
header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: var(--shadow-sm);
}

.header-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.5px;
}

.logo span {
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--accent);
}

/* 主内容区 */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

/* 首页主栏+侧栏布局 */
.main-wrap {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.main-content {
  flex: 1;
  min-width: 0;
}

/* 右侧栏 */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 88px;
}

.sidebar-block {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.sidebar-block h3 {
  font-size: 16px;
  color: var(--text-primary);
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
}

.sidebar-links {
  list-style: none;
}

.sidebar-links li {
  margin-bottom: 10px;
}

.sidebar-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  display: block;
  padding: 6px 0;
  transition: color 0.2s;
}

.sidebar-links a:hover {
  color: var(--accent);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-item {
  display: inline-block;
  padding: 6px 14px;
  background: #f3f4f6;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  border-radius: 20px;
  transition: background 0.2s, color 0.2s;
}

.tag-item:hover {
  background: var(--accent);
  color: #fff;
}

.sidebar-articles {
  list-style: none;
}

.sidebar-articles li {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-articles li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.sidebar-articles a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s;
}

.sidebar-articles a:hover {
  color: var(--accent);
}

/* 顶部介绍区 */
.top-banner {
  background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
  border-radius: 16px;
  padding: 48px 40px;
  margin-bottom: 40px;
  box-shadow: var(--shadow-md);
}

.top-banner .banner-inner {
  max-width: 820px;
  margin: 0 auto;
}

.top-banner h1 {
  font-size: 28px;
  color: var(--text-primary);
  margin-bottom: 20px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.top-banner .desc {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.85;
  max-width: 720px;
}

/* 详细介绍区 */
.intro-detail {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 40px 48px;
  margin-bottom: 48px;
  box-shadow: var(--shadow-sm);
}

.intro-detail .intro-inner {
  max-width: 800px;
  margin: 0 auto;
}

.intro-detail h2 {
  font-size: 22px;
  color: var(--text-primary);
  margin-bottom: 28px;
  font-weight: 700;
  border-left: 4px solid var(--accent);
  padding-left: 16px;
  line-height: 1.4;
}

.intro-detail p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.95;
  margin-bottom: 22px;
  text-align: justify;
  text-indent: 2em;
}

.intro-detail p:last-child {
  margin-bottom: 0;
}

/* 首页内容区块包裹 */
.home-section {
  margin-bottom: 56px;
}

.home-section:last-of-type {
  margin-bottom: 40px;
}

/* 分类标题 */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.section-header h2 {
  font-size: 26px;
  color: var(--text-primary);
  font-weight: 700;
  position: relative;
  padding-bottom: 0;
  margin: 0;
}

.section-header h2::after {
  display: none;
}

.section-header .title-wrap {
  position: relative;
  padding-bottom: 4px;
}

.section-header .title-wrap::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 48px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

.section-header .more {
  flex-shrink: 0;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
  white-space: nowrap;
}

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

/* 漫画卡片网格 - 从左到右、逐行排列 */
.waterfall-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  margin-bottom: 0;
}

.waterfall-item {
  background: var(--bg-secondary);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s, box-shadow 0.3s;
}

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

.waterfall-item a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.waterfall-item .cover {
  width: 100%;
  aspect-ratio: 3/4;
  overflow: hidden;
  position: relative;
}

.waterfall-item .cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.waterfall-item:hover .cover img {
  transform: scale(1.08);
}

.waterfall-item .badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--accent);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.waterfall-item .info {
  padding: 16px;
}

.waterfall-item .title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.waterfall-item .meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.waterfall-item .tag {
  background: #f3f4f6;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
}

/* 列表页样式 */
.list-header {
  background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
  border-radius: 16px;
  padding: 40px;
  margin-bottom: 40px;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.list-header h1 {
  font-size: 32px;
  color: var(--text-primary);
  margin-bottom: 12px;
  font-weight: 700;
}

.list-header p {
  font-size: 16px;
  color: var(--text-secondary);
}

/* 内容页样式 */
.article-container {
  max-width: 900px;
  margin: 0 auto;
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 48px;
  box-shadow: var(--shadow-md);
}

.breadcrumb {
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--text-secondary);
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--accent-hover);
}

.breadcrumb span {
  margin: 0 8px;
}

.article-container h1 {
  font-size: 32px;
  color: var(--text-primary);
  margin-bottom: 20px;
  font-weight: 700;
  line-height: 1.4;
}

.article-meta {
  display: flex;
  gap: 20px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-secondary);
}

.article-img {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-md);
}

.article-content p {
  font-size: 16px;
  line-height: 1.9;
  color: var(--text-secondary);
  margin-bottom: 24px;
  text-align: justify;
}

.article-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* 底部 */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 40px 20px;
  text-align: center;
  color: var(--text-secondary);
}

.footer-wrap {
  max-width: 1400px;
  margin: 0 auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 32px;
  list-style: none;
  margin-bottom: 20px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

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

.copyright {
  font-size: 14px;
  color: var(--text-secondary);
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .waterfall-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 992px) {
  .main-wrap {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    position: static;
    top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
  }
  
  .sidebar-block {
    flex: 1;
    min-width: 260px;
    margin-bottom: 0;
  }
  
  .waterfall-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .top-banner {
    padding: 36px 28px;
  }
  
  .top-banner .banner-inner {
    max-width: 100%;
  }
  
  .top-banner h1 {
    font-size: 26px;
  }
  
  .intro-detail {
    padding: 32px 24px;
  }
  
  .intro-detail .intro-inner {
    max-width: 100%;
  }
  
  .home-section {
    margin-bottom: 48px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    flex-direction: column;
  }
  
  .sidebar-block {
    min-width: 100%;
  }
  
  .header-wrap {
    height: 56px;
  }
  
  .logo {
    font-size: 20px;
  }
  
  .nav-links {
    gap: 20px;
    font-size: 14px;
  }
  
  .waterfall-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .top-banner {
    padding: 28px 20px;
  }
  
  .top-banner h1 {
    font-size: 24px;
  }
  
  .top-banner .desc {
    font-size: 15px;
  }
  
  .intro-detail {
    padding: 28px 20px;
  }
  
  .intro-detail h2 {
    font-size: 20px;
  }
  
  .intro-detail p {
    font-size: 14px;
  }
  
  .intro-detail {
    padding: 28px 20px;
  }
  
  .section-header {
    margin-bottom: 20px;
    padding-bottom: 12px;
  }

  .section-header .title-wrap::after {
    width: 40px;
  }
  
  .section-header h2 {
    font-size: 22px;
  }
  
  .home-section {
    margin-bottom: 40px;
  }
  
  .article-container {
    padding: 32px 24px;
  }
  
  .article-container h1 {
    font-size: 26px;
  }
}

@media (max-width: 480px) {
  .nav-links {
    gap: 16px;
    font-size: 13px;
  }
  
  .waterfall-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .waterfall-item {
    border-radius: 10px;
  }
  
  .waterfall-item .info {
    padding: 12px;
  }
  
  .waterfall-item .title {
    font-size: 14px;
  }
  
  .top-banner {
    padding: 24px 16px;
    border-radius: 12px;
  }
  
  .top-banner h1 {
    font-size: 22px;
  }
  
  .intro-detail {
    padding: 24px 16px;
    border-radius: 12px;
  }
  
  .section-header h2 {
    font-size: 20px;
  }
  
  .section-header .title-wrap::after {
    width: 36px;
  }
  
  .home-section {
    margin-bottom: 36px;
  }
  
  .article-container {
    padding: 24px 16px;
    border-radius: 12px;
  }
  
  .article-container h1 {
    font-size: 24px;
  }
  
  .article-content p {
    font-size: 15px;
  }
  
  main {
    padding: 24px 12px 60px;
  }
}
