/* 盆栽之家 - 指南风格样式表 */
/* 主色调: #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: #f5f5f5;
  --bg-light: #fafafa;
  --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;
  --header-height: 64px;
}

/* ===== 重置样式 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

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

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

ul {
  list-style: none;
}

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

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

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

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

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 600;
  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: 18px;
}

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

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

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

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-md);
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  width: 180px;
}

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

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

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

.hero p {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

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

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

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

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

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

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

/* ===== 分类网格 ===== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 32px;
}

.category-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  transition: all 0.3s;
}

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

.category-card .icon {
  width: 56px;
  height: 56px;
  background: var(--accent-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 24px;
}

.category-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

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

/* ===== 内容区块 ===== */
.section {
  padding: 48px 0;
}

.section-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

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

/* ===== 指南列表 ===== */
.guideline-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.guideline-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: all 0.2s;
}

.guideline-item:hover {
  border-color: var(--accent-color);
  box-shadow: var(--shadow-sm);
}

.guideline-item h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.guideline-item p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 12px;
}

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

/* ===== 文章卡片 ===== */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.article-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.3s;
}

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

.article-card .thumb {
  width: 100%;
  height: 160px;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

.article-card .content {
  padding: 20px;
}

.article-card .category {
  font-size: 12px;
  color: var(--accent-color);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.article-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
}

.article-card .excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

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

.column h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-color);
}

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

.column li a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-size: 14px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border-color);
}

.column li a::before {
  content: '•';
  color: var(--accent-color);
}

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

/* ===== 文章详情页 ===== */
.article-header {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--border-color);
}

.article-header h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 16px;
}

.article-meta {
  display: flex;
  gap: 24px;
  font-size: 14px;
  color: var(--text-secondary);
}

.article-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-content {
  padding: 32px 0;
}

.article-content h2 {
  font-size: 24px;
  font-weight: 600;
  margin: 32px 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.article-content h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 24px 0 12px;
}

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

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

.article-content li {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.article-content ul li {
  list-style: disc;
}

.article-content ol li {
  list-style: decimal;
}

/* ===== 原则卡片 ===== */
.principle-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 24px 0;
}

.principle-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--bg-light);
  padding: 20px;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--accent-color);
}

.principle-item .check {
  width: 24px;
  height: 24px;
  background: var(--accent-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  flex-shrink: 0;
}

.principle-item h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.principle-item p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

/* ===== 示例框 ===== */
.example-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 24px 0;
}

.example-do,
.example-dont {
  padding: 20px;
  border-radius: var(--radius-md);
}

.example-do {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
}

.example-dont {
  background: #ffebee;
  border: 1px solid #ef9a9a;
}

.example-do .label {
  color: #2e7d32;
  font-weight: 600;
  margin-bottom: 8px;
}

.example-dont .label {
  color: #c62828;
  font-weight: 600;
  margin-bottom: 8px;
}

/* ===== 资源列表 ===== */
.resource-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
}

.resource-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-light);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-primary);
}

.resource-item:hover {
  background: var(--accent-light);
}

/* ===== 相关指南 ===== */
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.related-card {
  padding: 20px;
  background: var(--bg-light);
  border-radius: var(--radius-md);
  text-align: center;
  transition: all 0.2s;
}

.related-card:hover {
  background: var(--accent-light);
}

.related-card h4 {
  font-size: 14px;
  font-weight: 600;
}

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

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

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

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

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

/* ===== 快速参考 ===== */
.quick-ref {
  background: var(--bg-light);
  padding: 32px;
  border-radius: var(--radius-lg);
  text-align: center;
}

.quick-ref h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
}

/* ===== 下载区域 ===== */
.download-section {
  background: var(--accent-light);
  padding: 32px;
  border-radius: var(--radius-lg);
  text-align: center;
  margin: 32px 0;
}

.download-section h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.download-section p {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* ===== 页脚 ===== */
.footer {
  background: var(--bg-secondary);
  padding: 48px 0 24px;
  margin-top: 64px;
  border-top: 1px solid var(--border-color);
}

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

.footer-brand p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 12px;
}

.footer-links h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

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

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

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

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

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

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

.error-page h1 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 16px;
}

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

/* ===== 响应式设计 ===== */
@media (max-width: 1024px) {
  .category-grid,
  .article-grid,
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

@media (max-width: 768px) {
  .nav {
    display: none;
  }

  .search-box {
    display: none;
  }

  .hero h1 {
    font-size: 28px;
  }

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

  .example-box {
    grid-template-columns: 1fr;
  }

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

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

/* ===== 辅助类 ===== */
.text-center {
  text-align: center;
}

.mt-4 {
  margin-top: 16px;
}

.mb-4 {
  margin-bottom: 16px;
}
