/* ===== 基础变量 ===== */
:root {
  --accent-color: #e91e63;
  --primary: #e91e63;
  --primary-dark: #c2185b;
  --secondary: #ff4081;
  --dark: #1a1a2e;
  --gray-dark: #2d2d44;
  --gray: #6b6b7b;
  --gray-light: #e8e8ec;
  --light: #f8f8fa;
  --white: #ffffff;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-hover: 0 4px 16px rgba(233,30,99,0.2);
  --radius: 8px;
  --radius-lg: 12px;
  --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(--dark);
  background: var(--light);
}

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

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

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

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

/* ===== 头部 ===== */
.header {
  background: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

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

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

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

.nav a {
  color: var(--gray-dark);
  font-weight: 500;
  transition: color 0.3s;
}

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

.search-box {
  position: relative;
}

.search-box input {
  width: 200px;
  padding: 8px 16px;
  border: 1px solid var(--gray-light);
  border-radius: 20px;
  font-size: 14px;
  outline: none;
  transition: all 0.3s;
}

.search-box input:focus {
  border-color: var(--primary);
  width: 240px;
}

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

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

.hero p {
  font-size: 20px;
  color: rgba(255,255,255,0.8);
  margin-bottom: 32px;
}

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

.hero-search input {
  width: 100%;
  padding: 16px 24px;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 16px;
  outline: none;
}

.hero-search button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 500;
  transition: background 0.3s;
}

.hero-search button:hover {
  background: var(--primary-dark);
}

/* ===== 分类区域 ===== */
.section {
  padding: 60px 0;
}

.section-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 32px;
  text-align: center;
}

.categories {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.category-card {
  background: var(--white);
  padding: 32px 24px;
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}

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

.category-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 28px;
}

.category-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.category-card p {
  color: var(--gray);
  font-size: 14px;
}

/* ===== 内容卡片 ===== */
.content-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.content-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}

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

.card-image {
  height: 180px;
  background: linear-gradient(135deg, var(--gray-light) 0%, var(--light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray);
  font-size: 48px;
}

.card-body {
  padding: 20px;
}

.card-tag {
  display: inline-block;
  background: rgba(233,30,99,0.1);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 12px;
}

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

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

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

/* ===== 列表布局 ===== */
.content-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.list-item {
  background: var(--white);
  padding: 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: flex;
  gap: 20px;
  transition: all 0.3s;
}

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

.list-image {
  width: 160px;
  height: 120px;
  background: linear-gradient(135deg, var(--gray-light) 0%, var(--light) 100%);
  border-radius: var(--radius);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray);
  font-size: 32px;
}

.list-content {
  flex: 1;
}

.list-content h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.list-content p {
  color: var(--gray);
  font-size: 14px;
  margin-bottom: 12px;
  line-height: 1.6;
}

.list-meta {
  display: flex;
  gap: 16px;
  color: var(--gray);
  font-size: 13px;
}

.btn-primary {
  display: inline-block;
  background: var(--primary);
  color: var(--white);
  padding: 10px 24px;
  border-radius: var(--radius);
  font-weight: 500;
  transition: background 0.3s;
}

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

/* ===== 侧边栏布局 ===== */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
}

.sidebar-section {
  background: var(--white);
  padding: 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.sidebar-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--gray-light);
}

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

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

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

.sidebar-list a {
  color: var(--dark);
  display: flex;
  justify-content: space-between;
}

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

.sidebar-list .num {
  color: var(--gray);
  font-size: 12px;
}

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

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

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

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

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

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

/* ===== 分类头部 ===== */
.category-header {
  background: var(--white);
  padding: 40px 0;
  text-align: center;
  border-bottom: 1px solid var(--gray-light);
}

.category-header h1 {
  font-size: 36px;
  margin-bottom: 12px;
}

.category-header p {
  color: var(--gray);
  font-size: 16px;
}

/* ===== 筛选器 ===== */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 20px;
  border: 1px solid var(--gray-light);
  background: var(--white);
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

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

.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  font-size: 14px;
}

.pagination a {
  background: var(--white);
  color: var(--dark);
  box-shadow: var(--shadow);
}

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

.pagination .current {
  background: var(--primary);
  color: var(--white);
  font-weight: 500;
}

/* ===== 文章页 ===== */
.article-header {
  background: var(--white);
  padding: 40px 0;
}

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

.article-meta {
  display: flex;
  gap: 24px;
  color: var(--gray);
  font-size: 14px;
}

.article-image {
  width: 100%;
  height: 400px;
  background: linear-gradient(135deg, var(--gray-light) 0%, var(--light) 100%);
  border-radius: var(--radius-lg);
  margin: 24px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray);
  font-size: 64px;
}

.article-content {
  background: var(--white);
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.article-content h2 {
  font-size: 24px;
  margin: 32px 0 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--gray-light);
}

.article-content h3 {
  font-size: 20px;
  margin: 24px 0 12px;
}

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

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

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

/* ===== 404 页面 ===== */
.error-page {
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
}

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

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

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

/* ===== 页脚 ===== */
.footer {
  background: var(--dark);
  color: var(--white);
  padding: 60px 0 24px;
}

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

.footer-brand .logo {
  margin-bottom: 16px;
}

.footer-brand p {
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  line-height: 1.6;
}

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

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

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

.footer-links a {
  color: rgba(255,255,255,0.7);
  font-size: 14px;
}

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

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  text-align: center;
  color: rgba(255,255,255,0.5);
  font-size: 14px;
}

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

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

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

  .nav {
    order: 3;
    width: 100%;
    margin-top: 12px;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .search-box {
    order: 2;
  }

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

  .hero {
    padding: 48px 0;
  }

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

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

  .categories {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

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

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

  .list-image {
    width: 100%;
    height: 160px;
  }

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

  .article-image {
    height: 200px;
  }

  .article-content {
    padding: 24px;
  }

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

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

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

  .category-card {
    padding: 24px;
  }

  .section {
    padding: 40px 0;
  }

  .section-title {
    font-size: 22px;
  }
}
