/* ============================================
   电竞显示器 - 资源导航风格样式
   www.gaoshuaxin.cn
   主色调: #2196f3
   ============================================ */

/* CSS 变量 */
:root {
  --accent-color: #2196f3;
  --accent-dark: #1976d2;
  --accent-light: #e3f2fd;
  --text-primary: #212121;
  --text-secondary: #757575;
  --text-muted: #9e9e9e;
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --bg-card: #fafafa;
  --border-color: #e0e0e0;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
  --radius: 8px;
  --radius-sm: 4px;
  --max-width: 1200px;
  --header-height: 64px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

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

/* ============================================
   布局组件
   ============================================ */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.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 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
}

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

.nav a {
  color: var(--text-secondary);
  font-weight: 500;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

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

/* Main */
.main {
  min-height: calc(100vh - var(--header-height) - 200px);
  padding: 24px 0;
}

/* Footer */
.footer {
  background-color: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  padding: 40px 0;
  margin-top: 48px;
}

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

.footer-brand {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.8;
}

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

.footer-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

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

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

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

.footer-bottom {
  border-top: 1px solid var(--border-color);
  margin-top: 32px;
  padding-top: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ============================================
   搜索组件
   ============================================ */

.search-section {
  background: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
  padding: 48px 0;
  margin-bottom: 32px;
}

.search-box {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 16px 56px 16px 20px;
  font-size: 1rem;
  border: none;
  border-radius: var(--radius);
  background-color: var(--bg-primary);
  box-shadow: var(--shadow);
}

.search-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.3);
}

.search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background-color: var(--accent-color);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-btn:hover {
  background-color: var(--accent-dark);
}

.search-tags {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.search-tag {
  padding: 6px 14px;
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 20px;
  font-size: 0.875rem;
}

/* ============================================
   分类筛选
   ============================================ */

.category-filter {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.category-btn {
  padding: 8px 16px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

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

/* ============================================
   卡片组件
   ============================================ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  background-color: var(--bg-primary);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

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

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

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

.card-body {
  padding: 16px;
}

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

.card-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.card-tag {
  padding: 2px 8px;
  background-color: var(--accent-light);
  color: var(--accent-color);
  border-radius: 4px;
  font-size: 0.75rem;
}

/* 显示器卡片特殊样式 */
.monitor-card .card-image {
  position: relative;
}

.monitor-specs {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  display: flex;
  gap: 16px;
  font-size: 0.75rem;
}

.monitor-spec {
  display: flex;
  align-items: center;
  gap: 4px;
}

.rating {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #ffc107;
  font-size: 0.875rem;
}

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

/* ============================================
   链接列表
   ============================================ */

.link-list {
  background-color: var(--bg-primary);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.link-item {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.2s;
}

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

.link-item:hover {
  background-color: var(--bg-card);
}

.link-icon {
  width: 48px;
  height: 48px;
  background-color: var(--accent-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 16px;
  flex-shrink: 0;
  color: var(--accent-color);
  font-weight: 600;
}

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

.link-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.link-url {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.link-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: 16px;
  flex-shrink: 0;
}

.link-tag {
  padding: 4px 10px;
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  border-radius: 4px;
  font-size: 0.75rem;
}

.verified {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #4caf50;
  font-size: 0.75rem;
}

/* ============================================
   面包屑
   ============================================ */

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

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

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

.breadcrumb-separator {
  color: var(--text-muted);
}

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

/* ============================================
   页面标题区
   ============================================ */

.page-header {
  margin-bottom: 32px;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.page-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
}

.page-stats {
  display: flex;
  gap: 24px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

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

.stat-value {
  font-weight: 600;
  color: var(--text-primary);
}

/* ============================================
   子分类
   ============================================ */

.subcategory-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.subcategory-item {
  padding: 12px 20px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-weight: 500;
  transition: all 0.2s;
}

.subcategory-item:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

/* ============================================
   分页
   ============================================ */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
}

.page-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

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

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================
   文章详情页
   ============================================ */

.article-container {
  max-width: 800px;
  margin: 0 auto;
}

.article-header {
  margin-bottom: 32px;
}

.article-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 16px;
}

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

.article-meta-separator {
  color: var(--text-muted);
}

.article-content {
  background-color: var(--bg-primary);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  padding: 32px;
}

.article-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent-light);
}

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

.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 li {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

/* 规格参数表 */
.specs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
}

.specs-table th,
.specs-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.specs-table th {
  background-color: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-primary);
  width: 30%;
}

.specs-table td {
  color: var(--text-secondary);
}

/* 标签 */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

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

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

/* 相关推荐 */
.related-section {
  margin-top: 32px;
}

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

/* ============================================
   侧边栏组件
   ============================================ */

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

.sidebar-widget {
  background-color: var(--bg-primary);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  padding: 20px;
  margin-bottom: 24px;
}

.widget-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-light);
}

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

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

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

.widget-list a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  display: block;
}

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

/* ============================================
   404 页面
   ============================================ */

.error-page {
  text-align: center;
  padding: 80px 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;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background-color: var(--accent-color);
  color: white;
  border-radius: var(--radius);
  font-weight: 500;
  transition: background-color 0.2s;
}

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

.btn-secondary {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

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

/* ============================================
   响应式设计
   ============================================ */

@media (max-width: 1024px) {
  .two-column {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: 2;
  }

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

@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  .nav {
    display: none;
  }

  .search-section {
    padding: 32px 0;
  }

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

  .link-item {
    flex-wrap: wrap;
  }

  .link-meta {
    width: 100%;
    margin-left: 64px;
    margin-top: 12px;
  }

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

  .article-title {
    font-size: 1.5rem;
  }

  .article-content {
    padding: 20px;
  }

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

@media (max-width: 480px) {
  .category-filter {
    gap: 8px;
  }

  .category-btn {
    padding: 6px 12px;
    font-size: 0.8125rem;
  }

  .page-title {
    font-size: 1.375rem;
  }

  .subcategory-grid {
    gap: 8px;
  }

  .subcategory-item {
    padding: 8px 14px;
    font-size: 0.875rem;
  }

  .pagination {
    flex-wrap: wrap;
  }
}

/* ============================================
   工具类
   ============================================ */

.text-center {
  text-align: center;
}

.mt-4 {
  margin-top: 16px;
}

.mb-4 {
  margin-bottom: 16px;
}

.hidden {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
