/* ===== 基础重置 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --accent-color: #1565c0;
  --accent-light: #1e88e5;
  --accent-dark: #0d47a1;
  --text-primary: #212121;
  --text-secondary: #616161;
  --text-muted: #9e9e9e;
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --bg-tertiary: #fafafa;
  --border-color: #e0e0e0;
  --warning-bg: #fff3e0;
  --warning-color: #e65100;
  --success-color: #2e7d32;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;
  --header-height: 64px;
}

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-light);
}

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

/* ===== 页头 ===== */
.header {
  background-color: 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-secondary);
  font-weight: 500;
  font-size: 0.95rem;
}

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

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-box input {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  width: 200px;
}

.search-box button {
  padding: 8px 16px;
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
}

.search-box button:hover {
  background-color: var(--accent-light);
}

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

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

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

/* ===== 免责声明 ===== */
.disclaimer {
  background-color: var(--warning-bg);
  border-left: 4px solid var(--warning-color);
  padding: 16px 20px;
  margin: 24px 0;
  border-radius: var(--radius-sm);
}

.disclaimer p {
  color: var(--warning-color);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== 分类网格 ===== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 32px 0;
}

.category-card {
  background-color: var(--bg-secondary);
  padding: 32px 24px;
  border-radius: var(--radius-md);
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.category-card h3 {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.category-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ===== 模板列表 ===== */
.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 48px 0 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-color);
  display: inline-block;
}

.template-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 24px 0;
}

.template-item {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: box-shadow 0.2s;
}

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

.template-info h4 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.template-info p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.template-actions {
  display: flex;
  gap: 12px;
}

.btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

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

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

.btn-secondary {
  background-color: transparent;
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
}

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

/* ===== 三栏文章列表 ===== */
.article-section {
  background-color: var(--bg-secondary);
  padding: 48px 0;
  margin-top: 48px;
}

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

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

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

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

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

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

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

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

.breadcrumb ol {
  list-style: none;
  display: flex;
  gap: 8px;
  font-size: 0.9rem;
}

.breadcrumb li:not(:last-child)::after {
  content: ">";
  margin-left: 8px;
  color: var(--text-muted);
}

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

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

/* ===== 分类页标题区 ===== */
.category-header {
  padding: 48px 0 24px;
}

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

.category-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* ===== 分页 ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 32px 0;
}

.pagination a,
.pagination span {
  padding: 10px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.pagination a:hover {
  background-color: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

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

/* ===== 文章详情页 ===== */
.article-header {
  padding: 48px 0 24px;
}

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

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

.article-content {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 48px;
  margin: 24px 0;
}

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

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

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

.article-content ul,
.article-content ol {
  margin: 16px 0;
  padding-left: 24px;
}

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

/* ===== 下载选项 ===== */
.download-section {
  margin: 32px 0;
}

.download-section h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.download-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ===== 相关模板 ===== */
.related-section {
  margin: 48px 0;
}

.related-section h3 {
  font-size: 1.2rem;
  margin-bottom: 20px;
}

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

.related-card {
  background-color: var(--bg-secondary);
  padding: 20px;
  border-radius: var(--radius-md);
  text-align: center;
}

.related-card h4 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.related-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ===== 推荐文章行 ===== */
.recommended-row {
  background-color: var(--bg-tertiary);
  padding: 24px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.recommended-row ul {
  list-style: none;
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

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

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

/* ===== 两栏文章 ===== */
.two-column-articles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  padding: 32px 0;
}

.two-column-articles h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

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

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

.two-column-articles a {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ===== 页脚 ===== */
.footer {
  background-color: var(--text-primary);
  color: var(--text-muted);
  padding: 48px 0 24px;
  margin-top: 64px;
}

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

.footer-brand h3 {
  color: white;
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-column h4 {
  color: white;
  font-size: 1rem;
  margin-bottom: 16px;
}

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

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

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

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

.footer-bottom {
  border-top: 1px solid #424242;
  padding-top: 24px;
  text-align: center;
  font-size: 0.85rem;
}

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

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

.error-title {
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.error-message {
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 400px;
}

/* ===== 响应式设计 ===== */
@media (max-width: 992px) {
  .category-grid,
  .article-grid,
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

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

  .search-box {
    order: 2;
  }

  .search-box input {
    width: 150px;
  }

  .hero {
    padding: 48px 0;
  }

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

  .hero p {
    font-size: 1rem;
  }

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

  .template-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .two-column-articles {
    grid-template-columns: 1fr;
    gap: 32px;
  }

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

  .article-content {
    padding: 24px;
  }

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

@media (max-width: 480px) {
  .nav {
    flex-wrap: wrap;
    gap: 12px;
  }

  .nav a {
    font-size: 0.85rem;
  }

  .search-box input {
    width: 120px;
  }

  .download-options {
    flex-direction: column;
    width: 100%;
  }

  .download-options .btn {
    width: 100%;
    text-align: center;
  }
}
