/* 星露谷物语工具站 - 全局样式 */
:root {
  --accent-color: #795548;
  --primary-color: #4caf50;
  --secondary-color: #8d6e63;
  --bg-color: #f5f5dc;
  --card-bg: #fffef5;
  --text-color: #3e2723;
  --text-muted: #6d4c41;
  --border-color: #d7ccc8;
  --shadow: 0 2px 8px rgba(62, 39, 35, 0.1);
  --radius: 8px;
  --max-width: 1200px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

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

a:hover {
  text-decoration: underline;
}

/* 页头 */
.header {
  background: linear-gradient(135deg, var(--primary-color) 0%, #2e7d32 100%);
  color: white;
  padding: 1rem 0;
  box-shadow: var(--shadow);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo a {
  color: white;
}

.nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.nav a {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
}

.nav a:hover {
  color: white;
  text-decoration: none;
}

.search-box {
  display: flex;
  gap: 0.5rem;
}

.search-box input {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius);
  width: 200px;
  font-size: 0.9rem;
}

.search-box button {
  padding: 0.5rem 1rem;
  background: var(--secondary-color);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
}

.search-box button:hover {
  background: #6d4c41;
}

/* 主体容器 */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Hero区域 */
.hero {
  background: linear-gradient(135deg, var(--card-bg) 0%, #f0f4c3 100%);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  margin-bottom: 2rem;
  border: 2px solid var(--border-color);
}

.hero h1 {
  font-size: 2rem;
  color: var(--text-color);
  margin-bottom: 1rem;
}

.hero p {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

.hero-keywords {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.keyword-tag {
  background: var(--primary-color);
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
}

/* 卡片网格 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(62, 39, 35, 0.15);
}

.card-title {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.card-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.card-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* 分类标签 */
.category-tags {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.category-tag {
  background: white;
  border: 2px solid var(--border-color);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--text-color);
  transition: all 0.2s;
}

.category-tag:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  text-decoration: none;
}

.category-tag.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

/* 列表项 */
.list-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.list-item-content h3 {
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}

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

.list-item-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* 面包屑 */
.breadcrumb {
  background: white;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

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

.breadcrumb span {
  margin: 0 0.5rem;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 2rem 0;
}

.pagination a,
.pagination span {
  padding: 0.5rem 1rem;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-color);
}

.pagination a:hover {
  background: var(--primary-color);
  color: white;
  text-decoration: none;
}

.pagination .current {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* 文章页样式 */
.article-header {
  text-align: center;
  margin-bottom: 2rem;
}

.article-header h1 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

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

.article-content {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 2rem;
  border: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

.article-content h2 {
  font-size: 1.4rem;
  margin: 1.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

.article-content p {
  margin-bottom: 1rem;
}

/* Q&A 问答对 */
.qa-pair {
  margin-bottom: 1.5rem;
}

.qa-question {
  background: #e8f5e9;
  padding: 1rem;
  border-radius: var(--radius);
  font-weight: bold;
  margin-bottom: 0.5rem;
  border-left: 4px solid var(--primary-color);
}

.qa-answer {
  background: white;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}

/* 侧边栏 */
.sidebar-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.sidebar-section h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

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

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

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

.sidebar-list a {
  color: var(--text-color);
  font-size: 0.9rem;
}

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

/* 三栏布局 */
.three-column {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
}

/* 两栏布局 */
.two-column {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

/* 404页面 */
.error-page {
  text-align: center;
  padding: 4rem 2rem;
}

.error-code {
  font-size: 6rem;
  font-weight: bold;
  color: var(--primary-color);
  line-height: 1;
}

.error-title {
  font-size: 1.5rem;
  margin: 1rem 0;
}

.error-desc {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: var(--primary-color);
  color: white;
  border-radius: var(--radius);
  font-size: 1rem;
}

.btn:hover {
  background: #2e7d32;
  text-decoration: none;
}

/* 页脚 */
.footer {
  background: var(--text-color);
  color: rgba(255, 255, 255, 0.8);
  padding: 2rem 0;
  margin-top: 3rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
}

.footer-links a:hover {
  color: white;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    text-align: center;
  }

  .search-box {
    width: 100%;
    justify-content: center;
  }

  .search-box input {
    width: 60%;
  }

  .hero {
    padding: 2rem 1rem;
  }

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

  .two-column,
  .three-column {
    grid-template-columns: 1fr;
  }

  .list-item {
    flex-direction: column;
    align-items: flex-start;
  }

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

@media (max-width: 480px) {
  .nav {
    justify-content: center;
  }

  .category-tags {
    justify-content: center;
  }

  .hero-keywords {
    flex-direction: column;
    align-items: center;
  }

  .article-content {
    padding: 1rem;
  }
}
