/* ===== 基础变量 ===== */
:root {
  --accent-color: #607d8b;
  --accent-light: #78909c;
  --accent-dark: #455a64;
  --text-primary: #263238;
  --text-secondary: #546e7a;
  --text-muted: #78909c;
  --bg-primary: #ffffff;
  --bg-secondary: #f5f7f8;
  --bg-tertiary: #eceff1;
  --border-color: #cfd8dc;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --radius-sm: 4px;
  --radius-md: 8px;
  --max-width: 1200px;
  --header-height: 64px;
}

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

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

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-secondary);
}

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

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

ul {
  list-style: none;
}

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

/* ===== 布局容器 ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 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: var(--header-height);
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

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

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

.nav a {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
}

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

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-box input {
  width: 200px;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  outline: none;
}

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

.search-box button {
  padding: 8px 16px;
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s;
}

.search-box button:hover {
  background: var(--accent-dark);
}

/* ===== Hero区域 ===== */
.hero {
  background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-dark) 100%);
  color: white;
  padding: 60px 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;
}

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

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

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

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

/* ===== 卡片组件 ===== */
.card {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 20px;
}

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

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

.category-card {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

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

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

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

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

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

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

.article-info h4 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 4px;
}

.article-info p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.article-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: right;
}

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

.column-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.column-section ul li {
  padding: 8px 0;
  border-bottom: 1px dashed var(--border-color);
}

.column-section ul li:last-child {
  border-bottom: none;
}

.column-section ul li a {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.column-section ul li a:hover {
  color: var(--accent-color);
}

/* ===== 规格表格 ===== */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

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

.spec-table th {
  background: var(--bg-tertiary);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.spec-table td {
  font-size: 0.9375rem;
}

.spec-table tr:hover td {
  background: var(--bg-secondary);
}

/* ===== 规格组 ===== */
.spec-group {
  margin-bottom: 32px;
}

.spec-group h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-color);
  margin-bottom: 12px;
  padding-left: 12px;
  border-left: 3px solid var(--accent-color);
}

.spec-list {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.spec-row {
  display: flex;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

.spec-row:last-child {
  border-bottom: none;
}

.spec-label {
  width: 140px;
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.spec-value {
  flex: 1;
  color: var(--text-primary);
  font-size: 0.9375rem;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

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

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

.btn-outline {
  background: transparent;
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
}

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

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

.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  color: var(--text-secondary);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
}

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

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

/* ===== 产品卡片 ===== */
.product-card {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.product-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.product-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.product-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.product-specs-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 16px 0;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

.spec-preview-item {
  font-size: 0.875rem;
}

.spec-preview-item strong {
  display: block;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 2px;
}

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

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

.article-header .meta {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.article-content {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 40px;
  margin-bottom: 40px;
}

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

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

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

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

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

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

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

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

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

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

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

/* ===== 页脚 ===== */
.footer {
  background: var(--bg-tertiary);
  padding: 40px 0 20px;
  margin-top: 60px;
}

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

.footer-brand h3 {
  font-size: 1.125rem;
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
}

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

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

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

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

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

/* ===== 两栏布局（文章页底部） ===== */
.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 24px 0;
}

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

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

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

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

  .nav {
    order: 3;
    width: 100%;
    gap: 20px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
  }

  .search-box {
    order: 2;
  }

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

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

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

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

  .spec-row {
    flex-direction: column;
    gap: 4px;
  }

  .spec-label {
    width: auto;
    font-size: 0.875rem;
  }

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

  .article-content {
    padding: 24px;
  }

  .article-header h1 {
    font-size: 1.5rem;
  }

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

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

  .nav {
    gap: 12px;
    font-size: 0.875rem;
  }

  .search-box input {
    width: 100px;
    padding: 6px 10px;
  }

  .search-box button {
    padding: 6px 12px;
  }

  .card {
    padding: 16px;
  }

  .spec-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

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