/* ========== CSS 变量 ========== */
:root {
  --accent-color: #2196f3;
  --accent-dark: #1976d2;
  --accent-light: #64b5f6;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-primary: #fff;
  --bg-secondary: #f5f5f5;
  --bg-dark: #1a1a2e;
  --border-color: #e0e0e0;
  --success: #4caf50;
  --danger: #f44336;
  --warning: #ff9800;
  --star: #ffc107;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;
  --header-height: 64px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

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

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

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

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

ul, ol {
  list-style: none;
}

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

.section {
  padding: 48px 0;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--text-primary);
}

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

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

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

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-color);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
}

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

.nav a {
  color: var(--text-secondary);
  font-weight: 500;
  padding: 8px 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: 24px;
  padding: 8px 16px;
  width: 240px;
}

.search-box input {
  border: none;
  background: none;
  outline: none;
  flex: 1;
  font-size: 0.875rem;
}

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

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

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

.hero-desc {
  font-size: 1.125rem;
  color: rgba(255,255,255,0.8);
  max-width: 600px;
  margin: 0 auto 32px;
}

.hero-cta {
  display: inline-flex;
  gap: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-size: 1rem;
}

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

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

.btn-outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.3);
}

.btn-outline:hover {
  border-color: #fff;
  color: #fff;
}

/* ========== 评分组件 ========== */
.rating {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stars {
  display: flex;
  gap: 2px;
}

.star {
  color: var(--star);
  font-size: 1rem;
}

.star.empty {
  color: var(--border-color);
}

.rating-score {
  font-weight: 600;
  color: var(--text-primary);
}

.rating-box {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
}

.rating-box .score {
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent-color);
}

.rating-box .stars {
  justify-content: center;
  margin: 8px 0;
}

/* ========== 卡片组件 ========== */
.card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.card-image {
  aspect-ratio: 16/10;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 3rem;
}

.card-content {
  padding: 20px;
}

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

.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

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

/* ========== 分类网格 ========== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.category-card {
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
}

.category-card:hover {
  border-color: var(--accent-color);
  transform: translateY(-4px);
}

.category-icon {
  width: 64px;
  height: 64px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 2rem;
}

.category-card:hover .category-icon {
  background: var(--accent-color);
  color: #fff;
}

.category-name {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.category-count {
  font-size: 0.875rem;
  color: var(--text-muted);
}

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

.article-item {
  display: flex;
  gap: 20px;
  padding: 20px;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}

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

.article-thumb {
  width: 200px;
  height: 140px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 2.5rem;
  flex-shrink: 0;
}

.article-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

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

.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.article-excerpt {
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
}

/* ========== 优缺点组件 ========== */
.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.pros, .cons {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.pros h4, .cons h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pros h4 {
  color: var(--success);
}

.cons h4 {
  color: var(--danger);
}

.pros ul, .cons ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pros li, .cons li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.pros li::before {
  content: '✓';
  color: var(--success);
  font-weight: 700;
}

.cons li::before {
  content: '✗';
  color: var(--danger);
  font-weight: 700;
}

/* ========== 侧边栏组件 ========== */
.sidebar-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}

.sidebar-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

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

.sidebar-list a::before {
  content: '•';
  color: var(--accent-color);
}

/* ========== 面包屑 ========== */
.breadcrumb {
  background: var(--bg-secondary);
  padding: 16px 0;
}

.breadcrumb ol {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
}

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

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

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

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

/* ========== 分页 ========== */
.pagination {
  display: flex;
  align-items: center;
  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-weight: 500;
}

.pagination a {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

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

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

/* ========== 文章详情 ========== */
.article-header {
  text-align: center;
  padding: 48px 0;
}

.article-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.article-header .meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-muted);
}

.article-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
}

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

.article-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 32px 0 16px;
  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-bottom: 16px;
  padding-left: 24px;
}

.article-content ul {
  list-style: disc;
}

.article-content ol {
  list-style: decimal;
}

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

/* ========== 评分细分 ========== */
.rating-breakdown {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.rating-breakdown h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.rating-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.rating-item span:first-child {
  width: 80px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.rating-bar {
  flex: 1;
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.rating-bar-fill {
  height: 100%;
  background: var(--accent-color);
  border-radius: 4px;
}

/* ========== 购买链接 ========== */
.buy-section {
  display: flex;
  gap: 16px;
  margin-top: 32px;
}

.buy-btn {
  flex: 1;
  padding: 16px 24px;
  background: var(--success);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
  text-align: center;
  transition: background 0.2s;
}

.buy-btn:hover {
  background: #388e3c;
  color: #fff;
}

.compare-btn {
  flex: 1;
  padding: 16px 24px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: var(--radius);
  font-weight: 600;
  text-align: center;
  transition: background 0.2s;
}

.compare-btn:hover {
  background: var(--border-color);
  color: var(--text-primary);
}

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

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.main-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
}

/* ========== 页脚 ========== */
.footer {
  background: var(--bg-dark);
  color: #fff;
  padding: 48px 0 24px;
}

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

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

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

.footer-col h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col a {
  color: rgba(255,255,255,0.7);
  font-size: 0.9375rem;
}

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

.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: 0.875rem;
}

/* ========== 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: 8rem;
  font-weight: 700;
  color: var(--accent-color);
  line-height: 1;
  margin-bottom: 16px;
}

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

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

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

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

@media (max-width: 768px) {
  .header .nav {
    display: none;
  }

  .search-box {
    width: auto;
    padding: 8px 12px;
  }

  .search-box input {
    display: none;
  }

  .hero {
    padding: 60px 0;
  }

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

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

  .hero-cta {
    flex-direction: column;
  }

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

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

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

  .article-thumb {
    width: 100%;
    height: 200px;
  }

  .pros-cons {
    grid-template-columns: 1fr;
  }

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

  .footer-brand .logo {
    justify-content: center;
  }

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

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

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

  .pagination a,
  .pagination span {
    width: 36px;
    height: 36px;
    font-size: 0.875rem;
  }
}
