/* ===== 基础变量 ===== */
:root {
  --accent-color: #d63384;
  --accent-light: #f8d7e8;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-primary: #fff;
  --bg-secondary: #f8f9fa;
  --bg-dark: #1a1a2e;
  --border-color: #e5e5e5;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --radius: 8px;
  --max-width: 1200px;
  --sidebar-width: 220px;
}

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

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

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

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

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

.main-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr var(--sidebar-width);
  gap: 20px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 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: 60px;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-color);
}

.logo span {
  color: var(--text-primary);
}

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

.nav a {
  font-size: 15px;
  font-weight: 500;
  padding: 5px 0;
  border-bottom: 2px solid transparent;
}

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

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

.search-box input {
  border: none;
  background: none;
  outline: none;
  width: 150px;
  font-size: 13px;
}

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

/* ===== 侧边栏 ===== */
.sidebar {
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  height: fit-content;
}

.sidebar-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-color);
}

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

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

.sidebar-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-secondary);
}

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

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

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-cloud a {
  font-size: 12px;
  padding: 4px 12px;
  background: var(--bg-secondary);
  border-radius: 15px;
  color: var(--text-secondary);
}

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

/* ===== 主内容区 ===== */
.main-content {
  min-width: 0;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  padding-left: 12px;
  border-left: 4px solid var(--accent-color);
}

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

.hero h1 {
  font-size: 36px;
  margin-bottom: 15px;
}

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

/* ===== 卡片 ===== */
.card {
  background: var(--bg-primary);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card-body {
  padding: 20px;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.4;
}

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

.card-meta {
  display: flex;
  gap: 15px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

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

/* ===== 内容列表 ===== */
.content-list {
  background: var(--bg-primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.content-item {
  display: flex;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
}

.content-item:first-child {
  padding-top: 0;
}

.content-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.content-thumb {
  width: 200px;
  height: 130px;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.content-info {
  flex: 1;
  min-width: 0;
}

.content-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.content-meta {
  display: flex;
  gap: 15px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.content-summary {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

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

.pagination a,
.pagination span {
  padding: 8px 14px;
  background: var(--bg-primary);
  border-radius: var(--radius);
  font-size: 14px;
}

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

.pagination .current {
  background: var(--accent-color);
  color: #fff;
}

/* ===== 面包屑 ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

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

/* ===== 文章页 ===== */
.article-header {
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 30px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.article-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 15px;
  line-height: 1.4;
}

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

.article-image {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.article-content {
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
  font-size: 16px;
  line-height: 1.8;
}

.article-content h2 {
  font-size: 22px;
  margin: 30px 0 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.article-content h3 {
  font-size: 18px;
  margin: 25px 0 12px;
}

.article-content p {
  margin-bottom: 15px;
}

.article-content ul,
.article-content ol {
  margin-bottom: 15px;
  padding-left: 25px;
}

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

.article-content img {
  border-radius: var(--radius);
  margin: 20px 0;
}

/* ===== 作者卡片 ===== */
.author-card {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  margin-top: 30px;
}

.author-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
}

.author-info h4 {
  font-size: 16px;
  margin-bottom: 5px;
}

.author-info p {
  font-size: 13px;
  color: var(--text-secondary);
}

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

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

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  margin-bottom: 30px;
}

.footer-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 15px;
}

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

.footer-links a {
  color: #aaa;
  font-size: 14px;
}

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

.footer-bottom {
  border-top: 1px solid #333;
  padding-top: 20px;
  text-align: center;
  color: #888;
  font-size: 13px;
}

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

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

.error-title {
  font-size: 24px;
  margin: 20px 0 15px;
}

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

.btn {
  display: inline-block;
  padding: 12px 30px;
  background: var(--accent-color);
  color: #fff;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
}

.btn:hover {
  background: #b52a6f;
  color: #fff;
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

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

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

  .nav {
    order: 3;
    width: 100%;
    gap: 15px;
    margin-top: 10px;
    overflow-x: auto;
  }

  .search-box {
    display: none;
  }

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

  .content-item {
    flex-direction: column;
  }

  .content-thumb {
    width: 100%;
    height: 180px;
  }

  .article-title {
    font-size: 20px;
  }

  .article-image {
    height: 200px;
  }

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

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