/* ========================================
   按摩与理疗设备 - 样式表
   www.jianzhifen.cn
   满足家庭健康需求
   ======================================== */

/* CSS 变量 */
:root {
  --accent-color: #2196f3;
  --accent-dark: #1976d2;
  --accent-light: #e3f2fd;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-white: #fff;
  --bg-light: #f5f7fa;
  --bg-gray: #e8ecef;
  --border-color: #e0e0e0;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius-sm: 4px;
  --radius-md: 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: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-light);
}

a {
  text-decoration: none;
  color: var(--accent-color);
  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;
}

.section {
  padding: 40px 0;
}

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

/* ========================================
   页头 Header
   ======================================== */

.header {
  background: var(--bg-white);
  box-shadow: var(--shadow-sm);
  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: 22px;
  font-weight: 700;
  color: var(--accent-color);
}

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

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

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

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

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

.header-search input {
  width: 200px;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.header-search button {
  padding: 8px 16px;
  background: var(--accent-color);
  color: var(--bg-white);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
}

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

/* ========================================
   Hero 区域
   ======================================== */

.hero {
  background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-dark) 100%);
  color: var(--bg-white);
  padding: 60px 0;
  text-align: center;
}

.hero h1 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 12px;
}

.hero p {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: 32px;
}

.hero-search {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  gap: 12px;
  background: var(--bg-white);
  padding: 8px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.hero-search input {
  flex: 1;
  padding: 12px 16px;
  border: none;
  font-size: 16px;
  outline: none;
}

.hero-search select {
  padding: 12px 16px;
  border: none;
  border-left: 1px solid var(--border-color);
  font-size: 14px;
  background: transparent;
  cursor: pointer;
}

.hero-search button {
  padding: 12px 32px;
  background: var(--accent-color);
  color: var(--bg-white);
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
}

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

/* ========================================
   分类卡片
   ======================================== */

.categories {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: -30px;
  position: relative;
  z-index: 10;
}

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

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

.category-icon {
  width: 56px;
  height: 56px;
  background: var(--accent-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 24px;
}

.category-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

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

/* ========================================
   产品卡片
   ======================================== */

.product-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.product-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 20px;
  transition: box-shadow 0.2s;
}

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

.product-image {
  width: 120px;
  height: 120px;
  background: var(--bg-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 48px;
}

.product-info {
  flex: 1;
}

.product-info h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.product-brand {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 12px;
}

.product-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}

.product-meta span {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.product-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-color);
}

.product-action {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.btn {
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-align: center;
}

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

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

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

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

/* ========================================
   筛选器
   ======================================== */

.filter-panel {
  background: var(--bg-white);
  padding: 20px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.filter-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-label {
  font-weight: 500;
  color: var(--text-secondary);
}

.filter-btn {
  padding: 6px 16px;
  border: 1px solid var(--border-color);
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

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

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

.breadcrumb {
  background: var(--bg-white);
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
}

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

.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;
}

/* ========================================
   文章列表
   ======================================== */

.article-section {
  background: var(--bg-white);
  padding: 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.article-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

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

.article-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.article-item::before {
  content: "•";
  color: var(--accent-color);
  font-weight: bold;
}

.article-item a {
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
}

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

/* 三栏文章布局 */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
}

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

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

.pagination a,
.pagination span {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}

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

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

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

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

.article-header {
  background: var(--bg-white);
  padding: 40px 0;
  margin-bottom: 24px;
}

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

.article-meta {
  display: flex;
  gap: 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

.article-content {
  background: var(--bg-white);
  padding: 40px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

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

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

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

.article-content ul {
  margin-bottom: 16px;
  padding-left: 20px;
}

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

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

.product-highlight {
  background: var(--accent-light);
  padding: 24px;
  border-radius: var(--radius-md);
  margin: 24px 0;
}

.product-highlight h3 {
  margin-top: 0;
  color: var(--accent-dark);
}

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

.error-page {
  text-align: center;
  padding: 80px 20px;
}

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

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

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

/* ========================================
   页脚 Footer
   ======================================== */

.footer {
  background: var(--text-primary);
  color: var(--bg-white);
  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 .logo {
  color: var(--bg-white);
  margin-bottom: 16px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.footer-links h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 14px;
}

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

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

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

@media (max-width: 1024px) {
  .categories {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

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

  .nav {
    order: 3;
    width: 100%;
    margin-top: 12px;
    gap: 20px;
    justify-content: center;
  }

  .header-search {
    display: none;
  }

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

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

  .hero-search select {
    border-left: none;
    border-top: 1px solid var(--border-color);
  }

  .categories {
    grid-template-columns: 1fr;
    margin-top: 20px;
  }

  .product-card {
    flex-direction: column;
  }

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

  .product-action {
    flex-direction: row;
  }

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

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

  .article-content {
    padding: 24px;
  }

  .filter-group {
    justify-content: flex-start;
  }
}

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

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

  .section {
    padding: 24px 0;
  }

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

  .product-action {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}
