/* 韩漫网站 - 全局样式 */
:root {
  --primary: #ff5722; /* 充满活力的橙色，适合漫画主题 */
  --primary-hover: #f44336;
  --text-dark: #333333;
  --text-gray: #666666;
  --text-light: #999999;
  --bg-body: #f5f6f7;
  --bg-white: #ffffff;
  --border-color: #eeeeee;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --radius: 8px;
  --container-width: 1200px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background-color: var(--bg-body);
  color: var(--text-dark);
  line-height: 1.6;
  font-size: 16px;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
  object-fit: cover;
}

/* 布局容器 */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 16px;
}

/* 顶部导航 */
.header {
  background: var(--bg-white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  height: 60px;
}

.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

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

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

.nav-menu {
  display: flex;
  gap: 24px;
}

.nav-menu a {
  font-weight: 500;
  color: var(--text-dark);
  padding: 8px 0;
  position: relative;
}

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

/* 移动端菜单按钮 (默认隐藏) */
.mobile-toggle {
  display: none;
  font-size: 24px;
  cursor: pointer;
}

/* 搜索框 */
.search-bar {
  display: flex;
  background: #f0f0f0;
  border-radius: 20px;
  padding: 6px 16px;
  align-items: center;
  width: 260px;
}

.search-bar input {
  background: transparent;
  border: none;
  outline: none;
  width: 100%;
  font-size: 14px;
  color: var(--text-dark);
}

.search-bar button {
  background: transparent;
  border: none;
  color: var(--text-gray);
  cursor: pointer;
}

/* 首页主要内容 */
.main-content {
  padding: 24px 0;
}

/* 焦点图/Banner */
.hero-section {
  margin-bottom: 32px;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  height: 300px;
  background: #ddd;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  padding: 40px 24px 24px;
  color: white;
}

.hero-title {
  font-size: 28px;
  margin-bottom: 8px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero-desc {
  font-size: 14px;
  opacity: 0.9;
}

/* 板块通用样式 */
.section {
  margin-bottom: 32px;
  background: var(--bg-white);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
  position: relative;
  padding-left: 12px;
}

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

.more-link {
  font-size: 14px;
  color: var(--text-gray);
}

/* 漫画网格布局 */
.manga-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px 16px;
}

.manga-item {
  display: flex;
  flex-direction: column;
  transition: transform 0.2s;
}

.manga-item:hover {
  transform: translateY(-4px);
}

.cover-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 3/4;
  margin-bottom: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cover-wrap img {
  width: 100%;
  height: 100%;
  transition: transform 0.3s;
}

.manga-item:hover .cover-wrap img {
  transform: scale(1.05);
}

.manga-tag {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
}

.manga-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.manga-meta {
  font-size: 12px;
  color: var(--text-light);
  display: flex;
  justify-content: space-between;
}

/* 标签云/分类 */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tag-btn {
  padding: 6px 16px;
  background: #f5f5f5;
  border-radius: 20px;
  font-size: 14px;
  color: var(--text-gray);
  transition: all 0.2s;
}

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

/* ================= 内页新增样式 ================= */

/* 筛选区样式 (works.html) */
.filter-section {
  padding-bottom: 10px;
}

.filter-group {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 14px;
  color: var(--text-light);
  width: 60px;
  flex-shrink: 0;
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-options a {
  font-size: 14px;
  color: var(--text-gray);
  padding: 4px 12px;
  border-radius: 16px;
}

.filter-options a.active,
.filter-options a:hover {
  background: rgba(255, 87, 34, 0.1);
  color: var(--primary);
}

/* 分页样式 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-gray);
  font-size: 14px;
}

.page-btn.active,
.page-btn:hover:not(.disabled) {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.page-btn.disabled {
  background: #f5f5f5;
  color: #ccc;
  cursor: not-allowed;
}

/* 面包屑导航 */
.breadcrumb {
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--text-light);
}

.breadcrumb a {
  color: var(--text-gray);
}

/* 详情页头部 (detail.html) */
.detail-header {
  display: flex;
  gap: 32px;
}

.detail-cover {
  width: 240px;
  flex-shrink: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.detail-info {
  flex: 1;
}

.detail-title {
  font-size: 28px;
  margin-bottom: 16px;
}

.detail-meta {
  margin-bottom: 20px;
}

.detail-meta li {
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-gray);
}

.tag-status {
  background: #e8f5e9;
  color: #4caf50;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.detail-desc {
  font-size: 14px;
  color: var(--text-gray);
  line-height: 1.8;
  margin-bottom: 24px;
  display: -webkit-box;
  -webkit-line-clamp: 3; /* 限制行数 */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.detail-actions {
  display: flex;
  gap: 16px;
}

.btn-read {
  background: var(--primary);
  color: white;
  padding: 10px 32px;
  border-radius: 24px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(255, 87, 34, 0.3);
}

.btn-fav {
  background: white;
  border: 1px solid var(--border-color);
  padding: 10px 24px;
  border-radius: 24px;
  color: var(--text-dark);
  cursor: pointer;
}

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

.btn-fav:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* 章节列表 */
.chapter-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.chapter-item {
  border: 1px solid var(--border-color);
  padding: 10px;
  border-radius: 4px;
  text-align: center;
  font-size: 14px;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chapter-item:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(255, 87, 34, 0.05);
}

.btn-load-more {
  background: #f5f5f5;
  border: none;
  padding: 10px 24px;
  border-radius: 20px;
  color: var(--text-gray);
  cursor: pointer;
  font-size: 14px;
}

.btn-load-more:hover {
  background: #e0e0e0;
}

/* SEO文本区域 */
.seo-text-section {
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.seo-content {
  font-size: 14px;
  color: var(--text-gray);
  line-height: 1.8;
}

.seo-content h3 {
  color: var(--text-dark);
  font-size: 16px;
  margin: 16px 0 8px;
}

/* ================= 帮助、联系、社区页面样式 ================= */

/* 帮助中心 (help.html) */
.faq-list {
  margin-top: 16px;
}

.faq-item {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px dashed var(--border-color);
}

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

.faq-question {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.faq-answer {
  font-size: 14px;
  color: var(--text-gray);
  padding-left: 24px;
}

/* 联系我们 (contact.html) */
.contact-form-box {
  background: #fff;
}

.contact-form .form-group {
  margin-bottom: 16px;
}

.contact-form label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-dark);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
}

.contact-form textarea {
  resize: vertical;
}

.btn-submit {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.btn-submit:hover {
  background: var(--primary-hover);
}

/* 读者社区 (community.html) */
.community-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
}

.community-tabs {
  display: flex;
  gap: 16px;
}

.community-tabs a {
  font-size: 14px;
  color: var(--text-gray);
  padding-bottom: 4px;
}

.community-tabs a.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

.post-item {
  display: flex;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
}

.post-avatar {
  width: 40px;
  height: 40px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  flex-shrink: 0;
}

.post-content {
  flex: 1;
}

.post-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  display: block;
}

.post-preview {
  font-size: 14px;
  color: var(--text-gray);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.btn-post-new {
  width: 100%;
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  margin-top: 16px;
}

.user-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  text-align: center;
}

.user-item {
  font-size: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: #eee;
  border-radius: 50%;
  margin: 0 auto 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
}

/* 页脚 */
.footer {
  background: var(--bg-white);
  border-top: 1px solid var(--border-color);
  padding: 40px 0 20px;
  margin-top: 40px;
  text-align: center;
}

.footer-links {
  margin-bottom: 20px;
}

.footer-links a {
  margin: 0 10px;
  color: var(--text-gray);
  font-size: 14px;
}

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

/* 响应式设计 */
@media (max-width: 1024px) {
  .manga-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .chapter-list {
    grid-template-columns: repeat(3, 1fr);
  }
  .community-layout {
    grid-template-columns: 1fr; /* 社区页面单列 */
  }
  .sidebar-section {
    display: none; /* 移动端简化：隐藏侧边栏 */
  }
}

@media (max-width: 768px) {
  .nav-menu {
    display: none; /* 移动端暂隐，简化处理 */
  }
  
  .mobile-toggle {
    display: block;
  }

  .search-bar {
    display: none; /* 移动端可点图标展开，此处简化 */
  }
  
  .manga-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  
  .hero-section {
    height: 200px;
    margin-bottom: 20px;
  }
  
  .hero-title {
    font-size: 20px;
  }

  .section {
    padding: 16px;
  }

  /* 内页响应式调整 */
  .detail-header {
    flex-direction: column;
    gap: 16px;
  }

  .detail-cover {
    width: 140px;
    margin: 0 auto;
  }

  .detail-title {
    text-align: center;
    font-size: 22px;
  }

  .detail-actions {
    justify-content: center;
  }

  .chapter-list {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .contact-wrapper > div {
      grid-template-columns: 1fr !important; /* 强制单列 */
  }
}

@media (max-width: 480px) {
  .manga-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .container {
    padding: 0 12px;
  }
  
  .logo {
    font-size: 18px;
  }
}
