/* ===== 红酒知识库 - 全局样式 ===== */
:root {
  --accent-color: #7c6a46;
  --accent-light: #9a8660;
  --accent-dark: #5c4f35;
  --bg-primary: #faf8f5;
  --bg-secondary: #f5f2ed;
  --bg-card: #ffffff;
  --text-primary: #2d2a26;
  --text-secondary: #6b6560;
  --text-muted: #9a9590;
  --border-color: #e8e4df;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --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.7;
  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);
}

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

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-light));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
}

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

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

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

.search-box {
  position: relative;
  width: 280px;
}

.search-box input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  font-size: 14px;
  transition: all 0.2s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent-color);
  background: var(--bg-card);
}

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

/* ===== Main Container ===== */
.main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px;
}

/* ===== Hero Section ===== */
.hero {
  text-align: center;
  padding: 60px 20px;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  border-radius: var(--radius-lg);
  margin-bottom: 48px;
}

.hero h1 {
  font-size: 42px;
  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 32px;
}

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

.hero-search input {
  width: 100%;
  padding: 18px 24px 18px 52px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  font-size: 16px;
  background: var(--bg-card);
  transition: all 0.2s;
}

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

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

/* ===== Section Title ===== */
.section-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
  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;
}

/* ===== Card Grid ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

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

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

.card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

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

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

/* ===== Category Tags ===== */
.category-section {
  margin-bottom: 48px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.category-tag {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.category-tag:hover {
  border-color: var(--accent-color);
  background: var(--bg-secondary);
}

.category-tag .icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.category-tag .name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.category-tag .count {
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== List Section ===== */
.list-section {
  margin-bottom: 48px;
}

.list-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.list-column {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
}

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

.list-column ul {
  list-style: none;
}

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

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

.list-column a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-primary);
  font-size: 14px;
}

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

.list-column .badge {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 2px 8px;
  border-radius: 12px;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--text-secondary);
}

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

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

.breadcrumb .sep {
  opacity: 0.5;
}

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

/* ===== Page Header ===== */
.page-header {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 40px;
  margin-bottom: 32px;
}

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

.page-header p {
  color: var(--text-secondary);
  font-size: 16px;
}

.page-header .meta {
  display: flex;
  gap: 24px;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-muted);
}

/* ===== Article List ===== */
.article-list {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 32px;
}

.article-item {
  display: flex;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.2s;
}

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

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

.article-item .icon {
  width: 48px;
  height: 48px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-right: 16px;
  flex-shrink: 0;
}

.article-item .content {
  flex: 1;
}

.article-item h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}

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

.article-item .meta {
  text-align: right;
  font-size: 13px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 16px;
}

/* ===== Content Layout ===== */
.content-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
}

.sidebar {
  position: sticky;
  top: calc(var(--header-height) + 32px);
  height: fit-content;
}

.toc {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
}

.toc h4 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.toc ul {
  list-style: none;
}

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

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

.toc a {
  font-size: 14px;
  color: var(--text-secondary);
  display: block;
}

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

.related-pages {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
}

.related-pages h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.related-pages ul {
  list-style: none;
}

.related-pages li {
  padding: 8px 0;
}

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

/* ===== Article Content ===== */
.article-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 40px;
}

.article-content h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.3;
}

.article-content .article-meta {
  display: flex;
  gap: 20px;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.article-content h2 {
  font-size: 24px;
  font-weight: 600;
  margin: 40px 0 20px;
  color: var(--text-primary);
}

.article-content h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 32px 0 16px;
  color: var(--text-primary);
}

.article-content p {
  margin-bottom: 20px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.article-content ul,
.article-content ol {
  margin-bottom: 20px;
  padding-left: 24px;
  color: var(--text-secondary);
}

.article-content li {
  margin-bottom: 8px;
}

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

.info-box h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.info-box p {
  margin-bottom: 0;
  font-size: 14px;
}

/* ===== 404 Page ===== */
.error-page {
  text-align: center;
  padding: 100px 20px;
}

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

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

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--accent-color);
  color: white;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

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

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

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

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

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

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

.footer-links ul {
  list-style: none;
}

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

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

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

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .content-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    order: 2;
  }

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

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

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

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

  .search-box {
    width: 100%;
  }

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

  .hero p {
    font-size: 16px;
  }

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

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

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

  .article-item .icon {
    margin-bottom: 12px;
    margin-right: 0;
  }

  .article-item .meta {
    text-align: left;
    margin-left: 0;
    margin-top: 12px;
  }

  .article-content {
    padding: 24px;
  }

  .article-content h1 {
    font-size: 24px;
  }

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

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

@media (max-width: 480px) {
  .main {
    padding: 20px 16px;
  }

  .hero {
    padding: 40px 16px;
  }

  .page-header {
    padding: 24px;
  }

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