/* ============================================
   手办网 - 手册风格样式表
   www.shoubandiy.cn
   关键词: 手办购买指南 热门手办行情价格 二次元手办收藏交流
   ============================================ */

/* CSS 变量 */
:root {
  --accent-color: #009688;
  --accent-dark: #00796b;
  --accent-light: #b2dfdb;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-primary: #fff;
  --bg-secondary: #f5f5f5;
  --bg-dark: #263238;
  --border-color: #e0e0e0;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
  --radius: 4px;
  --max-width: 1200px;
  --header-height: 60px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-secondary);
}

a {
  color: var(--accent-color);
  text-decoration: none;
}

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

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

/* ============================================
   布局组件
   ============================================ */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* 页头 */
.header {
  background: var(--bg-primary);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-color);
}

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

.nav {
  display: flex;
  gap: 30px;
}

.nav a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  padding: 5px 0;
  border-bottom: 2px solid transparent;
  transition: all 0.3s;
}

.nav a:hover,
.nav a.active {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 0 15px;
  width: 240px;
}

.search-box input {
  border: none;
  background: transparent;
  padding: 10px 0;
  width: 100%;
  outline: none;
  font-size: 0.9rem;
}

.search-box button {
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}

/* 页脚 */
.footer {
  background: var(--bg-dark);
  color: #fff;
  padding: 40px 0 20px;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  margin-bottom: 30px;
}

.footer h4 {
  font-size: 1rem;
  margin-bottom: 15px;
  color: var(--accent-light);
}

.footer ul {
  list-style: none;
}

.footer li {
  margin-bottom: 8px;
}

.footer a {
  color: #b0bec5;
  font-size: 0.9rem;
}

.footer a:hover {
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid #37474f;
  padding-top: 20px;
  text-align: center;
  color: #78909c;
  font-size: 0.85rem;
}

/* ============================================
   首页组件
   ============================================ */

/* Hero 区域 */
.hero {
  background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-dark) 100%);
  color: #fff;
  padding: 60px 0;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 15px;
  font-weight: 600;
}

.hero p {
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* 分类卡片 */
.categories {
  padding: 40px 0;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.category-card {
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  border-top: 3px solid var(--accent-color);
}

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

.category-card h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.category-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* 热门手册列表 */
.section {
  padding: 40px 0;
}

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

.section-title {
  font-size: 1.3rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--accent-color);
  border-radius: 2px;
}

.view-all {
  font-size: 0.9rem;
}

/* 手册列表 */
.manual-list {
  background: var(--bg-primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.manual-item {
  display: flex;
  align-items: center;
  padding: 20px 25px;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.3s;
}

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

.manual-item:hover {
  background: var(--bg-secondary);
}

.manual-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 20px;
  flex-shrink: 0;
}

.manual-icon svg {
  width: 24px;
  height: 24px;
  fill: var(--accent-color);
}

.manual-info {
  flex: 1;
}

.manual-info h4 {
  font-size: 1rem;
  margin-bottom: 5px;
  color: var(--text-primary);
}

.manual-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.manual-meta span {
  margin-right: 15px;
}

.manual-actions {
  display: flex;
  gap: 10px;
}

/* 三栏文章列表 */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.article-column {
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.article-column h3 {
  font-size: 1rem;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-light);
  color: var(--accent-color);
}

.article-list {
  list-style: none;
}

.article-list li {
  padding: 10px 0;
  border-bottom: 1px dashed var(--border-color);
}

.article-list li:last-child {
  border-bottom: none;
}

.article-list a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

/* 搜索区域 */
.search-section {
  background: var(--bg-primary);
  padding: 40px 0;
  text-align: center;
}

.search-section h2 {
  margin-bottom: 20px;
  color: var(--text-primary);
}

.search-large {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--border-color);
}

.search-large input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 15px 20px;
  font-size: 1rem;
  outline: none;
}

.search-large button {
  background: var(--accent-color);
  color: #fff;
  border: none;
  padding: 0 30px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.3s;
}

.search-large button:hover {
  background: var(--accent-dark);
}

/* ============================================
   分类页组件
   ============================================ */

/* 面包屑 */
.breadcrumb {
  background: var(--bg-primary);
  padding: 15px 0;
  border-bottom: 1px solid var(--border-color);
}

.breadcrumb ol {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

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

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

.breadcrumb li:not(:last-child)::after {
  content: '>';
  margin-left: 10px;
  color: var(--text-muted);
}

.breadcrumb li:last-child {
  color: var(--text-muted);
}

/* 页面标题区 */
.page-header {
  background: var(--bg-primary);
  padding: 40px 0;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.page-header h1 {
  font-size: 2rem;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.page-header p {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* 手册卡片 */
.manual-card {
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 25px;
  margin-bottom: 15px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--accent-color);
}

.manual-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.manual-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.manual-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.manual-card-meta span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* 按钮 */
.btn {
  display: inline-block;
  padding: 8px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
}

.btn-primary {
  background: var(--accent-color);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-dark);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
}

.btn-outline:hover {
  background: var(--accent-color);
  color: #fff;
}

.btn-sm {
  padding: 5px 15px;
  font-size: 0.85rem;
}

/* 章节列表 */
.section-list {
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 25px;
  box-shadow: var(--shadow);
  margin-top: 30px;
}

.section-list h3 {
  font-size: 1.1rem;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-light);
}

.section-list ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.section-list li {
  position: relative;
  padding-left: 20px;
}

.section-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent-color);
}

.section-list a {
  color: var(--text-secondary);
}

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

/* ============================================
   文章页组件
   ============================================ */

/* 两栏布局 */
.content-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 30px;
  padding: 30px 0;
}

/* 侧边栏 */
.sidebar {
  position: sticky;
  top: 80px;
  height: fit-content;
}

.sidebar-card {
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.sidebar-card h4 {
  font-size: 1rem;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-light);
  color: var(--accent-color);
}

.toc-list {
  list-style: none;
}

.toc-list li {
  margin-bottom: 8px;
}

.toc-list a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: block;
  padding: 5px 0;
}

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

.toc-list .level-2 {
  padding-left: 15px;
}

/* 主内容区 */
.main-content {
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
}

.article-header {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.article-header h1 {
  font-size: 1.8rem;
  margin-bottom: 15px;
  color: var(--text-primary);
  line-height: 1.4;
}

.article-meta {
  display: flex;
  gap: 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.article-body {
  color: var(--text-secondary);
  line-height: 1.8;
}

.article-body h2 {
  font-size: 1.4rem;
  color: var(--text-primary);
  margin: 30px 0 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-light);
}

.article-body h3 {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin: 25px 0 12px;
}

.article-body p {
  margin-bottom: 15px;
}

.article-body ul,
.article-body ol {
  margin-bottom: 15px;
  padding-left: 25px;
}

.article-body li {
  margin-bottom: 8px;
}

/* 步骤卡片 */
.step-card {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 15px;
  border-left: 4px solid var(--accent-color);
}

.step-card h4 {
  font-size: 1rem;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.step-card h4 span {
  color: var(--accent-color);
  font-weight: 700;
}

.step-card p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

/* 导航按钮 */
.article-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.article-nav a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

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

.article-nav .prev::before {
  content: '◄ ';
}

.article-nav .next::after {
  content: ' ►';
}

/* ============================================
   404 页面
   ============================================ */

.error-page {
  min-height: calc(100vh - var(--header-height) - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
}

.error-content {
  max-width: 500px;
}

.error-code {
  font-size: 8rem;
  font-weight: 700;
  color: var(--accent-color);
  line-height: 1;
  margin-bottom: 20px;
  opacity: 0.8;
}

.error-content h1 {
  font-size: 1.8rem;
  margin-bottom: 15px;
  color: var(--text-primary);
}

.error-content p {
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.error-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
}

/* ============================================
   响应式设计
   ============================================ */

@media (max-width: 992px) {
  .category-grid,
  .article-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .content-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    order: 2;
  }

  .main-content {
    order: 1;
  }
}

@media (max-width: 768px) {
  .header .container {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 20px;
  }

  .nav {
    order: 3;
    width: 100%;
    margin-top: 10px;
    gap: 20px;
    justify-content: center;
  }

  .search-box {
    width: auto;
    flex: 1;
    margin-left: 15px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .category-grid,
  .article-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

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

  .manual-item {
    flex-wrap: wrap;
  }

  .manual-actions {
    width: 100%;
    margin-top: 15px;
    justify-content: flex-end;
  }

  .main-content {
    padding: 25px;
  }

  .article-header h1 {
    font-size: 1.4rem;
  }

  .error-code {
    font-size: 5rem;
  }
}

@media (max-width: 480px) {
  .manual-card-meta {
    flex-wrap: wrap;
    gap: 10px;
  }

  .manual-card-meta .btn {
    width: 100%;
    text-align: center;
  }

  .article-meta {
    flex-wrap: wrap;
    gap: 10px;
  }

  .article-nav {
    flex-direction: column;
    gap: 15px;
  }
}
