/* ========================================
   家庭影院 - 样式表
   www.jiayinktv.cn
   专注于4K家庭影院系统的评测与搭建
   ======================================== */

/* CSS 变量 */
: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-dark: #263238;
  --border-color: #e0e0e0;
  --success: #4caf50;
  --warning: #ff9800;
  --error: #f44336;
  --star-color: #ffc107;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;
  --gap: 24px;
  --gap-sm: 16px;
}

/* 重置 */
*, *::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-light);
}

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

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

/* ========================================
   Header 页头
   ======================================== */
.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: 64px;
}

.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: white;
  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 Section
   ======================================== */
.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.125rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 32px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
}

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

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

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

.btn-secondary {
  background: rgba(255,255,255,0.2);
  color: white;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.3);
}

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

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

/* ========================================
   Section 通用
   ======================================== */
.section {
  padding: 64px 0;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 24px;
  background: var(--accent-color);
  border-radius: 2px;
}

/* ========================================
   特色评测
   ======================================== */
.featured-review {
  background: var(--bg-secondary);
}

.featured-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.featured-image {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, #37474f 0%, #263238 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 4rem;
}

.featured-content {
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-badge {
  display: inline-block;
  background: var(--accent-color);
  color: white;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 16px;
  width: fit-content;
}

.featured-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.3;
}

.featured-content p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

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

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

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

/* ========================================
   分类导航
   ======================================== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}

.category-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  transition: all 0.2s;
}

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

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

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

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

/* ========================================
   文章列表
   ======================================== */
.review-list {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.review-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--gap);
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

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

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

.review-content {
  padding: 24px 24px 24px 0;
  display: flex;
  flex-direction: column;
}

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

.review-category {
  color: var(--accent-color);
  font-weight: 500;
}

.review-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 12px;
  line-height: 1.4;
}

.review-content h3 a {
  color: var(--text-primary);
}

.review-content h3 a:hover {
  color: var(--accent-color);
}

.review-excerpt {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 16px;
  flex: 1;
}

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

.review-author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.author-avatar {
  width: 28px;
  height: 28px;
  background: var(--accent-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ========================================
   侧边栏组件
   ======================================== */
.sidebar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.sidebar-box {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
}

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

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

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

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

.article-list a {
  color: var(--text-primary);
  font-size: 0.9375rem;
  display: block;
  line-height: 1.5;
}

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

.article-list .date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

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

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

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

.breadcrumb span {
  color: var(--text-muted);
  margin: 0 8px;
}

.breadcrumb .current {
  color: var(--text-primary);
}

/* ========================================
   分类页头部
   ======================================== */
.category-header {
  background: var(--bg-secondary);
  padding: 48px 0;
  text-align: center;
}

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

.category-header p {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 24px;
}

.sort-bar {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.sort-bar a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 20px;
  transition: all 0.2s;
}

.sort-bar a:hover,
.sort-bar a.active {
  background: var(--accent-color);
  color: white;
}

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

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

.pagination a {
  background: white;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

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

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

.pagination .prev,
.pagination .next {
  width: auto;
  padding: 0 16px;
}

/* ========================================
   文章详情页
   ======================================== */
.article-header {
  background: var(--bg-secondary);
  padding: 48px 0 32px;
}

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

.article-meta-header {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.article-meta-header .rating {
  margin: 0;
}

.article-main {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
  padding: 48px 0;
}

.article-content {
  font-size: 1.0625rem;
  line-height: 1.8;
}

.article-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 48px 0 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-color);
}

.article-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 32px 0 16px;
}

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

.article-content p strong {
  color: var(--text-primary);
}

.article-image {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 3rem;
  margin: 32px 0;
}

/* 评分框 */
.rating-box {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

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

.rating-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

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

.rating-item span {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

/* 优缺点 */
.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  margin: 32px 0;
}

.pros,
.cons {
  padding: 24px;
  border-radius: var(--radius);
}

.pros {
  background: #e8f5e9;
}

.cons {
  background: #ffebee;
}

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

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

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

.pros ul,
.cons ul {
  list-style: none;
}

.pros li,
.cons li {
  padding: 8px 0;
  padding-left: 24px;
  position: relative;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

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

.cons li::before {
  content: '✗';
  position: absolute;
  left: 0;
  color: var(--error);
  font-weight: 700;
}

/* 结论 */
.verdict {
  background: var(--accent-color);
  color: white;
  padding: 32px;
  border-radius: var(--radius);
  margin: 32px 0;
}

.verdict h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.verdict p {
  color: rgba(255,255,255,0.9);
  margin: 0;
}

/* 文章侧边栏 */
.article-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.sidebar-sticky {
  position: sticky;
  top: 88px;
}

.product-info {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.product-image {
  aspect-ratio: 1;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 3rem;
  margin-bottom: 16px;
}

.product-info h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.product-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 16px;
}

.product-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 标签 */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.tag {
  background: var(--bg-secondary);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

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

/* ========================================
   推荐文章区
   ======================================== */
.recommended {
  background: var(--bg-secondary);
  padding: 48px 0;
}

.recommended-grid {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.recommended-grid a {
  color: var(--text-primary);
  font-weight: 500;
  padding: 8px 16px;
  background: white;
  border-radius: 20px;
  border: 1px solid var(--border-color);
}

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

/* ========================================
   Footer 页脚
   ======================================== */
.footer {
  background: var(--bg-dark);
  color: white;
  padding: 64px 0 32px;
}

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

.footer-brand h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 16px;
}

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

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

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

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

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

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

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.5);
}

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

.error-content {
  max-width: 480px;
}

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

.error-content h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 16px;
}

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

.error-search {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
}

.error-search input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  outline: none;
}

.error-search input:focus {
  border-color: var(--accent-color);
}

.error-links {
  display: flex;
  gap: 24px;
  justify-content: center;
}

.error-links a {
  color: var(--accent-color);
  font-weight: 500;
}

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

  .article-sidebar {
    order: -1;
  }

  .sidebar-sticky {
    position: static;
  }

  .product-info {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 24px;
    text-align: left;
  }

  .product-image {
    margin-bottom: 0;
  }
}

@media (max-width: 768px) {
  :root {
    --gap: 16px;
  }

  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 0;
  }

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

  .search-box {
    width: auto;
    flex: 1;
    margin-left: 16px;
  }

  .hero {
    padding: 48px 0;
  }

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

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

  .hero-buttons {
    flex-direction: column;
    padding: 0 48px;
  }

  .featured-card {
    grid-template-columns: 1fr;
  }

  .featured-image {
    aspect-ratio: 16/9;
  }

  .featured-content {
    padding: 24px;
  }

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

  .review-card {
    grid-template-columns: 1fr;
  }

  .review-image {
    aspect-ratio: 16/9;
  }

  .review-content {
    padding: 20px;
  }

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

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

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

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

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

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

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

  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .sort-bar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .pagination a,
  .pagination span {
    width: 36px;
    height: 36px;
  }
}
