/* ============================================
   盆栽DIY教程网站 - 系列教程风格样式
   www.penzaiyanghu.cn
   主色调: #4caf50 (绿色)
   ============================================ */

/* CSS 变量定义 */
:root {
  --accent-color: #4caf50;
  --accent-dark: #388e3c;
  --accent-light: #c8e6c9;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-primary: #fff;
  --bg-secondary: #f8f9fa;
  --bg-card: #fff;
  --border-color: #e0e0e0;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;
  --gap-sm: 12px;
  --gap-md: 20px;
  --gap-lg: 32px;
}

/* 重置样式 */
*, *::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-primary);
}

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

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

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

ul {
  list-style: none;
}

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

/* ============================================
   页头 Header
   ============================================ */
.header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
}

.nav {
  display: flex;
  gap: var(--gap-lg);
}

.nav a {
  color: var(--text-secondary);
  font-weight: 500;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}

.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-md);
  padding: 8px 16px;
  width: 240px;
}

.search-box input {
  border: none;
  background: none;
  outline: none;
  width: 100%;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

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

/* ============================================
   面包屑导航
   ============================================ */
.breadcrumb {
  background: var(--bg-secondary);
  padding: 12px 0;
  font-size: 0.875rem;
}

.breadcrumb-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

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

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

.breadcrumb-separator {
  color: var(--text-muted);
}

.breadcrumb-current {
  color: var(--text-primary);
  font-weight: 500;
}

/* ============================================
   Hero 区域
   ============================================ */
.hero {
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--bg-secondary) 100%);
  padding: 60px 0;
  text-align: center;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.hero-desc {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 32px;
}

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

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

.hero-stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-color);
}

.hero-stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ============================================
   区块标题
   ============================================ */
.section {
  padding: 48px 0;
}

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

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

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

.section-more {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

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

/* ============================================
   系列卡片
   ============================================ */
.series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap-md);
}

.series-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.series-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.series-card-cover {
  height: 160px;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
  font-size: 3rem;
}

.series-card-body {
  padding: 20px;
}

.series-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.series-card-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.series-card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.series-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.series-card-badge {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

/* 特色系列 */
.featured-series {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 32px;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  align-items: center;
}

.featured-series-cover {
  width: 200px;
  height: 200px;
  background: var(--accent-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: var(--accent-color);
}

.featured-series-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.featured-series-desc {
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.6;
}

.featured-series-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
}

.featured-series-stat {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.featured-series-stat strong {
  color: var(--text-primary);
  font-size: 1.125rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.9375rem;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

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

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

/* ============================================
   文章列表
   ============================================ */
.article-list {
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
}

.article-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: box-shadow 0.2s;
}

.article-item:hover {
  box-shadow: var(--shadow-sm);
}

.article-item-cover {
  width: 120px;
  height: 80px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.5rem;
}

.article-item-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.article-item-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

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

/* ============================================
   三栏文章列表
   ============================================ */
.three-col-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap-md);
}

.col-list {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 20px;
}

.col-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-light);
}

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

.col-list li a {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.col-list li a::before {
  content: '•';
  color: var(--accent-color);
  font-weight: bold;
}

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

/* ============================================
   系列详情页 - 分类页
   ============================================ */
.series-header {
  background: var(--bg-secondary);
  padding: 48px 0;
}

.series-header-inner {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  align-items: center;
}

.series-header-cover {
  width: 200px;
  height: 200px;
  background: var(--accent-light);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: var(--accent-color);
}

.series-header-info h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.series-header-meta {
  display: flex;
  gap: 24px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 16px;
}

.series-header-desc {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
}

/* 系列目录 */
.series-toc {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.series-toc-header {
  padding: 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.series-toc-header h2 {
  font-size: 1.125rem;
  font-weight: 600;
}

.series-toc-list {
  padding: 8px;
}

.toc-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  transition: background 0.2s;
}

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

.toc-item.completed .toc-status {
  background: var(--accent-color);
  color: #fff;
}

.toc-item.current {
  background: var(--accent-light);
}

.toc-status {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.toc-content {
  flex: 1;
}

.toc-title {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.toc-date {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ============================================
   文章详情页
   ============================================ */
.article-header {
  background: var(--bg-secondary);
  padding: 40px 0;
  text-align: center;
}

.article-series-info {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.article-series-info a {
  color: var(--accent-color);
  font-weight: 500;
}

.article-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* 文章导航 */
.article-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
}

.article-nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9375rem;
  transition: all 0.2s;
}

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

.article-nav-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.article-nav-current {
  font-size: 0.9375rem;
  color: var(--text-muted);
}

/* 文章内容 */
.article-content-wrapper {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
  padding: 40px 0;
}

.article-main {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 40px;
}

.article-featured-image {
  width: 100%;
  height: 300px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 4rem;
  margin-bottom: 32px;
}

.article-body {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.article-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 32px 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.article-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 24px 0 12px;
}

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

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

.article-body ul li {
  list-style: disc;
  margin-bottom: 8px;
}

.article-body ol li {
  list-style: decimal;
  margin-bottom: 8px;
}

/* 侧边栏 */
.article-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 20px;
}

.sidebar-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

/* 进度指示器 */
.progress-indicator {
  margin-bottom: 16px;
}

.progress-bar {
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--accent-color);
  border-radius: 4px;
  transition: width 0.3s;
}

.progress-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-align: center;
}

/* 系列列表 */
.sidebar-series-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-series-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  transition: background 0.2s;
}

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

.sidebar-series-item.current {
  background: var(--accent-light);
}

.sidebar-series-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.sidebar-series-item.current .sidebar-series-num {
  background: var(--accent-color);
  color: #fff;
}

.sidebar-series-item.completed .sidebar-series-num {
  background: var(--accent-color);
  color: #fff;
}

.sidebar-series-title {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.sidebar-series-item.current .sidebar-series-title {
  color: var(--text-primary);
  font-weight: 500;
}

/* ============================================
   推荐文章
   ============================================ */
.related-section {
  background: var(--bg-secondary);
  padding: 40px 0;
}

.related-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

.related-tag {
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.related-tag:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

/* ============================================
   页脚
   ============================================ */
.footer {
  background: var(--text-primary);
  color: #fff;
  padding: 48px 0 24px;
}

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

.footer-brand {
  max-width: 300px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.footer-logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-desc {
  font-size: 0.875rem;
  color: #aaa;
  line-height: 1.6;
}

.footer-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a {
  color: #aaa;
  font-size: 0.875rem;
}

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

.footer-bottom {
  border-top: 1px solid #444;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: #888;
}

/* ============================================
   404 页面
   ============================================ */
.error-page {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
}

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

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

.error-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.error-desc {
  color: var(--text-secondary);
  margin-bottom: 32px;
}

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

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--border-color);
}

/* ============================================
   响应式设计
   ============================================ */
@media (max-width: 992px) {
  .three-col-grid {
    grid-template-columns: 1fr;
  }

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

  .article-sidebar {
    order: -1;
  }

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

  .series-header-inner,
  .featured-series {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .series-header-cover,
  .featured-series-cover {
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 0;
    gap: 12px;
  }

  .nav {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 16px;
  }

  .search-box {
    width: auto;
    flex: 1;
  }

  .hero {
    padding: 40px 0;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .hero-stats {
    gap: 24px;
  }

  .hero-stat-number {
    font-size: 1.5rem;
  }

  .series-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-brand {
    max-width: none;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .article-title {
    font-size: 1.5rem;
  }

  .article-main {
    padding: 24px;
  }

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

@media (max-width: 480px) {
  .article-item {
    grid-template-columns: 1fr;
  }

  .article-item-cover {
    width: 100%;
    height: 160px;
  }

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

  .error-actions {
    flex-direction: column;
  }
}
