/* 手工面包 - 烘焙教程网站样式 */
/* 主色调: 暖棕色系，体现面包的温暖感 */

:root {
  --primary-color: #8B4513;
  --secondary-color: #D2691E;
  --accent-color: #CD853F;
  --bg-color: #FFFAF0;
  --card-bg: #FFF8DC;
  --text-primary: #3E2723;
  --text-secondary: #5D4037;
  --text-muted: #8D6E63;
  --border-color: #D7CCC8;
  --shadow: 0 2px 8px rgba(139, 69, 19, 0.1);
  --shadow-hover: 0 4px 16px rgba(139, 69, 19, 0.15);
  --radius: 8px;
  --max-width: 1200px;
}

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

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

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

a:hover {
  color: var(--secondary-color);
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  padding: 1rem 0;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

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

.logo::before {
  content: "🍞";
}

.nav {
  display: flex;
  gap: 2rem;
}

.nav a {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

.nav a:hover {
  color: white;
}

.search-box {
  position: relative;
}

.search-box input {
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  border: none;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  width: 200px;
  outline: none;
}

.search-box input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.search-box::before {
  content: "🔍";
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.875rem;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-color) 100%);
  padding: 4rem 1.5rem;
  text-align: center;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

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

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

.hero-search {
  max-width: 500px;
  margin: 0 auto 2rem;
  position: relative;
}

.hero-search input {
  width: 100%;
  padding: 1rem 1.5rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.hero-search input:focus {
  border-color: var(--accent-color);
}

/* Quick Links */
.quick-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.quick-link {
  padding: 0.75rem 1.5rem;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-weight: 500;
  transition: all 0.2s;
}

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

/* Section Title */
.section-title {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-color);
  display: inline-block;
}

/* Topics Grid */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.topic-card {
  background: white;
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: all 0.2s;
  text-align: left;
}

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

.topic-card h3 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
}

.topic-card p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Main Content */
.main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

/* Article Grid */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

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

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

.article-column h3 {
  font-size: 1.125rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

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

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

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

.article-list a {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.article-list a::before {
  content: "•";
  color: var(--accent-color);
}

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

/* Breadcrumb */
.breadcrumb {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

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

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

.breadcrumb span {
  margin: 0 0.5rem;
}

/* Category Header */
.category-header {
  background: var(--card-bg);
  padding: 2rem 1.5rem;
  text-align: center;
}

.category-header h1 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.category-header p {
  color: var(--text-secondary);
}

/* Module List */
.module-list {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.module-item {
  background: white;
  padding: 1.5rem;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: all 0.2s;
}

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

.module-item h3 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.module-item p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Two Column Layout */
.two-column {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

@media (max-width: 768px) {
  .two-column {
    grid-template-columns: 1fr;
  }
}

/* Sidebar */
.sidebar {
  background: white;
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  height: fit-content;
}

.sidebar h3 {
  font-size: 1rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

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

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

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

.toc-list a {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Article Content */
.article-content {
  background: white;
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.article-content h1 {
  font-size: 1.75rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

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

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

.article-content ul,
.article-content ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

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

/* Code Block */
.code-block {
  background: #2d2d2d;
  color: #f8f8f2;
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1rem 0;
  font-family: "Consolas", "Monaco", monospace;
  font-size: 0.875rem;
}

/* Parameter Table */
.param-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.param-table th,
.param-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.param-table th {
  background: var(--card-bg);
  color: var(--primary-color);
  font-weight: 600;
}

/* Related Articles */
.related-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.related-links a {
  padding: 0.5rem 1rem;
  background: white;
  border-radius: 20px;
  box-shadow: var(--shadow);
  font-size: 0.875rem;
}

/* 404 Page */
.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem;
}

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

.error-title {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin: 1rem 0;
}

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

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: white;
  border-radius: var(--radius);
  font-weight: 500;
  transition: all 0.2s;
}

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

/* Footer */
.footer {
  background: var(--primary-color);
  color: white;
  padding: 2rem 1.5rem;
  margin-top: 3rem;
}

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

.footer p {
  opacity: 0.8;
  font-size: 0.875rem;
}

.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;
}

/* Mobile Menu */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }

  .nav {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 1rem;
    padding-top: 1rem;
  }

  .nav.active {
    display: flex;
  }

  .search-box {
    width: 100%;
  }

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

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

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