/* ========================================
   茶道 - 健康茶饮知识库
   主色调: #7c6a46 (茶色)
   ======================================== */

/* CSS 变量 */
:root {
  --accent-color: #7c6a46;
  --accent-light: #9a8660;
  --accent-dark: #5c4e32;
  --bg-primary: #faf8f5;
  --bg-secondary: #f5f2ed;
  --bg-card: #ffffff;
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border-color: #e8e4dc;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;
  --header-height: 64px;
}

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

html {
  scroll-behavior: smooth;
}

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-color: var(--bg-primary);
}

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

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 20px;
}

/* ========================================
   页头
   ======================================== */
.header {
  background-color: var(--bg-card);
  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: var(--header-height);
}

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

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

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

.nav a {
  padding: 8px 16px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.95rem;
}

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

/* ========================================
   搜索框
   ======================================== */
.search-box {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.search-box input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  font-size: 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  background-color: var(--bg-card);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(124, 106, 70, 0.1);
}

.search-box::before {
  content: "🔍";
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  opacity: 0.5;
}

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

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

.hero-title span {
  color: var(--accent-color);
}

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

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

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

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

.breadcrumb span {
  margin: 0 8px;
  color: var(--text-muted);
}

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

/* ========================================
   卡片
   ======================================== */
.card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
  transition: box-shadow 0.2s, transform 0.2s;
}

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

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

.card-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.card-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 12px;
}

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

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

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

/* ========================================
   网格布局
   ======================================== */
.grid {
  display: grid;
  gap: 20px;
}

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

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

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

/* ========================================
   分类标签
   ======================================== */
.tag {
  display: inline-block;
  padding: 6px 14px;
  background-color: var(--bg-secondary);
  border-radius: 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all 0.2s;
}

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

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ========================================
   文章列表
   ======================================== */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.article-item {
  display: flex;
  gap: 16px;
  padding: 20px;
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}

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

.article-thumb {
  width: 120px;
  height: 80px;
  background-color: var(--bg-secondary);
  border-radius: var(--radius);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.article-content {
  flex: 1;
}

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

.article-excerpt {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ========================================
   侧边栏
   ======================================== */
.sidebar {
  width: 260px;
  flex-shrink: 0;
}

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

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

.sidebar-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

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

.sidebar-list a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  display: block;
}

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

/* ========================================
   内容区域
   ======================================== */
.content-wrapper {
  display: flex;
  gap: 24px;
  padding: 32px 0;
}

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

/* ========================================
   文章正文
   ======================================== */
.article-header {
  margin-bottom: 32px;
}

.article-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.3;
}

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

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

.article-body h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px 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;
}

/* 信息框 */
.info-box {
  background-color: var(--bg-secondary);
  border-left: 4px solid var(--accent-color);
  padding: 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 24px 0;
}

.info-box-title {
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--accent-color);
}

.info-box ul {
  margin: 0;
  padding-left: 20px;
}

.info-box li {
  margin-bottom: 6px;
  color: var(--text-secondary);
}

/* ========================================
   目录
   ======================================== */
.toc {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: sticky;
  top: 84px;
}

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

.toc ul {
  list-style: none;
  padding: 0;
}

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

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

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

.toc .toc-h2 {
  padding-left: 0;
}

.toc .toc-h3 {
  padding-left: 16px;
}

/* ========================================
   三栏底部
   ======================================== */
.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding: 40px 0;
  border-top: 1px solid var(--border-color);
}

.footer-col h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col a {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

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

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

.footer p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 12px;
}

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

/* ========================================
   404 页面
   ======================================== */
.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
}

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

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

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

.btn {
  display: inline-block;
  padding: 12px 32px;
  background-color: var(--accent-color);
  color: white;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  transition: background-color 0.2s;
}

.btn:hover {
  background-color: var(--accent-dark);
  color: white;
}

/* ========================================
   分类页头部
   ======================================== */
.category-header {
  background-color: var(--bg-secondary);
  padding: 40px 0;
  text-align: center;
}

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

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

.category-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 24px;
}

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

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent-color);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ========================================
   子分类
   ======================================== */
.subcategories {
  margin-top: 32px;
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 1024px) {
  .content-wrapper {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

  .toc {
    position: static;
  }
}

@media (max-width: 768px) {
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

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

  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 0;
  }

  .nav {
    width: 100%;
    justify-content: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
  }

  .article-item {
    flex-direction: column;
  }

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

  .category-stats {
    flex-direction: column;
    gap: 16px;
  }

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

@media (max-width: 480px) {
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 32px 0;
  }

  .hero {
    padding: 40px 0;
  }
}
