/* ===== 基础变量 ===== */
:root {
  --accent-color: #795548;
  --accent-light: #a1887f;
  --accent-dark: #5d4037;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-primary: #fff;
  --bg-secondary: #f8f6f4;
  --bg-card: #fff;
  --border-color: #e8e4e0;
  --shadow: 0 2px 8px rgba(121, 85, 72, 0.08);
  --shadow-hover: 0 4px 16px rgba(121, 85, 72, 0.12);
  --radius: 8px;
  --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-secondary);
}

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

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

ul {
  list-style: none;
}

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

/* ===== 头部 ===== */
.header {
  background: var(--bg-primary);
  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 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-color);
}

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

.nav a {
  color: var(--text-primary);
  font-weight: 500;
}

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

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

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

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

/* ===== Hero区域 ===== */
.hero {
  background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-dark) 100%);
  color: #fff;
  padding: 60px 0;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.hero p {
  font-size: 1.125rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* ===== A-Z导航 ===== */
.az-nav {
  background: var(--bg-primary);
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
}

.az-nav-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.az-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 600;
  transition: all 0.2s;
}

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

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

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

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

.card-desc {
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ===== 术语定义项 ===== */
.definition-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 16px;
  border-left: 4px solid var(--accent-color);
}

.definition-item h3 {
  font-size: 1.125rem;
  color: var(--accent-color);
  margin-bottom: 8px;
}

.definition-item p {
  color: var(--text-secondary);
  line-height: 1.7;
}

.definition-item .meta {
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-muted);
}

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

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

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

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

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

/* ===== 区块标题 ===== */
.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  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;
}

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

.article-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

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

.article-item::before {
  content: '•';
  color: var(--accent-color);
  font-weight: bold;
}

.article-item a {
  color: var(--text-primary);
  flex: 1;
}

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

.article-item .date {
  font-size: 14px;
  color: var(--text-muted);
}

/* ===== 三栏布局 ===== */
.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ===== 两栏布局 ===== */
.two-col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

/* ===== 内容区域 ===== */
.section {
  padding: 40px 0;
}

.section-alt {
  background: var(--bg-primary);
}

/* ===== 详情页内容 ===== */
.content-main {
  background: var(--bg-primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
}

.content-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.content-header h1 {
  font-size: 2rem;
  margin-bottom: 12px;
  color: var(--text-primary);
}

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

.content-body {
  line-height: 1.8;
  color: var(--text-secondary);
}

.content-body h2 {
  font-size: 1.5rem;
  margin: 32px 0 16px;
  color: var(--text-primary);
}

.content-body h3 {
  font-size: 1.25rem;
  margin: 24px 0 12px;
  color: var(--text-primary);
}

.content-body p {
  margin-bottom: 16px;
}

.content-body ul {
  margin-bottom: 16px;
  padding-left: 20px;
}

.content-body ul li {
  list-style: disc;
  margin-bottom: 8px;
}

/* ===== 相关术语 ===== */
.related-terms {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.related-terms a {
  display: inline-block;
  padding: 8px 16px;
  background: var(--bg-secondary);
  border-radius: 20px;
  font-size: 14px;
  color: var(--text-primary);
  transition: all 0.2s;
}

.related-terms a:hover {
  background: var(--accent-color);
  color: #fff;
}

/* ===== 404页面 ===== */
.error-page {
  text-align: center;
  padding: 80px 20px;
}

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

.error-title {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 16px;
}

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

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

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

/* ===== 页脚 ===== */
.footer {
  background: var(--accent-dark);
  color: #fff;
  padding: 40px 0;
  margin-top: 60px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 24px;
}

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

.footer-links a:hover {
  color: #fff;
}

.copyright {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 0;
    gap: 12px;
  }

  .nav {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 20px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
  }

  .search-box {
    display: none;
  }

  .hero {
    padding: 40px 0;
  }

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

  .az-nav-inner {
    gap: 6px;
  }

  .az-nav a {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .three-col {
    grid-template-columns: 1fr;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .content-main {
    padding: 24px;
  }

  .content-header h1 {
    font-size: 1.5rem;
  }

  .footer-inner {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .error-code {
    font-size: 80px;
  }
}

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

  .section {
    padding: 24px 0;
  }

  .card {
    padding: 20px;
  }

  .definition-item {
    padding: 20px;
  }
}
