:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --accent: #f59e0b;
  --bg: #ffffff;
  --bg-gray: #f5f5f5;
  --bg-card: #ffffff;
  --text: #333333;
  --text-light: #666666;
  --text-muted: #999999;
  --border: #e5e5e5;
  --border-light: #f0f0f0;
  --success: #22c55e;
  --danger: #ef4444;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
  --radius: 6px;
  --radius-sm: 4px;
  --font: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --max-width: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; display: block; }

.container {
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding-inline: clamp(12px, 4vw, 24px);
}

/* === 顶部通知条 === */
.top-bar {
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  padding: 6px 0;
  text-align: center;
}
.top-bar a { color: #fff; text-decoration: underline; }

/* === 导航 === */
.header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  gap: 16px;
}
.logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}
.logo span { color: var(--text); font-weight: 400; font-size: 13px; margin-left: 6px; }

.nav-links {
  display: flex;
  gap: 22px;
  list-style: none;
  align-items: center;
}
.nav-links a {
  color: var(--text);
  font-size: 14px;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.search-box {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex: 0 0 260px;
}
.search-box input {
  border: none;
  outline: none;
  padding: 7px 12px;
  font-size: 13px;
  flex: 1;
  min-width: 0;
}
.search-box button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0 14px;
  cursor: pointer;
  font-size: 13px;
}

.nav-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 13px;
}
.nav-actions a { color: var(--text-light); }
.cart-badge {
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 10px;
  margin-left: 2px;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text);
}

/* === 分类导航条 === */
.cat-bar {
  background: var(--bg-gray);
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
}
.cat-bar .container {
  display: flex;
  gap: 0;
}
.cat-bar a {
  padding: 10px 18px;
  font-size: 13px;
  color: var(--text-light);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.cat-bar a:hover, .cat-bar a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: rgba(37,99,235,0.04);
}

/* === Hero 横幅 === */
.hero-banner {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  margin-bottom: 0;
}
.hero-banner img {
  width: 100%;
  height: clamp(140px, 18vw, 220px);
  object-fit: cover;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(37,99,235,0.82) 0%, rgba(37,99,235,0.3) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: clamp(24px, 6vw, 80px);
  color: #fff;
}
.hero-overlay h1 {
  font-size: clamp(20px, 4vw, 36px);
  font-weight: 700;
  margin-bottom: 8px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.hero-overlay p {
  font-size: clamp(13px, 2vw, 16px);
  opacity: 0.92;
  max-width: 480px;
}

/* === 区块标题 === */
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}
.section-title h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}
.section-title .bar {
  width: 4px;
  height: 20px;
  background: var(--primary);
  border-radius: 2px;
}
.section-title .more {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-muted);
}

/* === 商品卡片 === */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
}
.product-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}
.product-card .img-wrap {
  aspect-ratio: 1;
  overflow: hidden;
  background: #fafafa;
}
.product-card .img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-card .info {
  padding: 10px 12px 14px;
}
.product-card .name {
  font-size: 13px;
  color: var(--text);
  line-height: 1.45;
  height: 38px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 6px;
}
.product-card .price {
  color: var(--danger);
  font-size: 17px;
  font-weight: 700;
}
.product-card .price .unit {
  font-size: 12px;
  font-weight: 400;
}
.product-card .price .original {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 6px;
  font-weight: 400;
}
.product-card .meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.product-card .tag {
  display: inline-block;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 2px;
  margin-right: 4px;
}
.tag-hot { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.tag-new { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }
.tag-sale { background: #fef3c7; color: #d97706; border: 1px solid #fde68a; }

/* === 侧边栏 === */
.main-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  padding-block: 20px;
}
.sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 0;
  align-self: start;
  position: sticky;
  top: 74px;
}
.sidebar h3 {
  font-size: 14px;
  font-weight: 600;
  padding: 12px 14px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
}
.sidebar ul { list-style: none; }
.sidebar li a {
  display: block;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text-light);
  border-bottom: 1px solid var(--border-light);
}
.sidebar li a:hover, .sidebar li a.active {
  color: var(--primary);
  background: var(--primary-light);
}

/* === 公告 === */
.notice-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.notice-box .label {
  background: var(--accent);
  color: #fff;
  padding: 1px 8px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* === 优势条 === */
.features-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.features-bar .item {
  text-align: center;
  padding: 16px 8px;
  border-right: 1px solid var(--border-light);
  font-size: 13px;
}
.features-bar .item:last-child { border-right: none; }
.features-bar .icon {
  font-size: 22px;
  margin-bottom: 4px;
}
.features-bar .label { color: var(--text-light); }

/* === Footer === */
.footer {
  background: #2b2b2b;
  color: #ccc;
  padding: clamp(24px, 4vw, 40px) 0 0;
  margin-top: 40px;
  font-size: 13px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 30px;
  margin-bottom: 24px;
}
.footer h4 {
  color: #fff;
  font-size: 15px;
  margin-bottom: 12px;
}
.footer p { margin-bottom: 6px; line-height: 1.7; }
.footer ul { list-style: none; }
.footer li { margin-bottom: 5px; }
.footer a { color: #bbb; }
.footer a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid #444;
  padding: 14px 0;
  text-align: center;
  font-size: 12px;
  color: #888;
}
.footer-bottom a { color: #888; }

/* === 支付方式 === */
.payment-icons {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}
.payment-icons .pay-icon {
  width: 36px;
  height: 24px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
}
.pay-alipay { background: #1677ff; }
.pay-wechat { background: #07c160; }
.pay-bank { background: #c4a35a; }

/* === 浮动按钮 === */
.float-btn {
  position: fixed;
  right: 18px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  font-size: 18px;
  color: #fff;
}
.btn-top {
  bottom: 24px;
  background: var(--primary);
}
.btn-chat {
  bottom: 76px;
  background: var(--success);
}

/* === 面包屑 === */
.breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  padding: 12px 0;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }

/* === 按钮 === */
.btn {
  display: inline-block;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  border: none;
  cursor: pointer;
  text-align: center;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}

/* === 表格 === */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  background: var(--bg-gray);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-light);
  border-bottom: 1px solid var(--border);
}
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
}

/* === 表单 === */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
  color: var(--text-light);
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  font-family: var(--font);
}
.form-group input:focus, .form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37,99,235,0.12);
}

/* === 新闻列表 === */
.news-list .news-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
}
.news-item .thumb {
  flex: 0 0 180px;
  aspect-ratio: 16/10;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.news-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-item .content { flex: 1; min-width: 0; }
.news-item h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.news-item h3 a { color: var(--text); }
.news-item h3 a:hover { color: var(--primary); }
.news-item .summary { font-size: 13px; color: var(--text-light); line-height: 1.6; margin-bottom: 6px; }
.news-item .date { font-size: 12px; color: var(--text-muted); }

/* === 关于页 === */
.about-section { margin-bottom: 30px; }
.about-section h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
}
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.team-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}
.team-card .avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary-light);
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: var(--primary);
  font-weight: 700;
}
.team-card .name { font-size: 15px; font-weight: 600; }
.team-card .title { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.team-card .bio { font-size: 12px; color: var(--text-light); line-height: 1.6; }

/* === 评价 === */
.review-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}
.review-item .user {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
}
.review-item .stars { color: var(--accent); font-size: 13px; margin-bottom: 4px; }
.review-item .text { font-size: 13px; color: var(--text-light); line-height: 1.6; }
.review-item .time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* === 商品详情 === */
.detail-wrap {
  display: grid;
  grid-template-columns: 480px 1fr;
  gap: 30px;
  padding: 20px 0;
}
.detail-img {
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fafafa;
}
.detail-img img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}
.detail-info { padding-top: 4px; }
.detail-info .pname {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
  color: var(--text);
}
.detail-price-box {
  background: #fff7f0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}
.detail-price-box .now {
  font-size: 28px;
  font-weight: 700;
  color: var(--danger);
}
.detail-price-box .now .unit { font-size: 16px; font-weight: 400; }
.detail-price-box .was {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 10px;
}
.detail-price-box .discount {
  display: inline-block;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 2px;
  margin-left: 8px;
}
.detail-tags { margin-bottom: 14px; }
.detail-meta {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}
.spec-row {
  display: flex;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-light);
}
.spec-row .spec-label {
  flex: 0 0 80px;
  color: var(--text-muted);
}
.spec-row .spec-val { color: var(--text); }
.qty-select {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 18px 0;
}
.qty-select button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--bg-gray);
  font-size: 16px;
  cursor: pointer;
  color: var(--text);
  line-height: 1;
}
.qty-select input {
  width: 50px;
  height: 32px;
  border: 1px solid var(--border);
  border-left: none;
  border-right: none;
  text-align: center;
  font-size: 14px;
  outline: none;
  -moz-appearance: textfield;
}
.qty-select input::-webkit-inner-spin-button { -webkit-appearance: none; }
.detail-actions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}
.detail-actions .btn {
  padding: 10px 28px;
  font-size: 15px;
}

/* 详情标签页 */
.detail-tabs {
  margin-top: 30px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
}
.tab-nav {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.tab-nav button {
  padding: 12px 24px;
  font-size: 14px;
  border: none;
  background: var(--bg-gray);
  cursor: pointer;
  color: var(--text-light);
  border-bottom: 2px solid transparent;
  font-family: var(--font);
}
.tab-nav button.active {
  background: var(--bg-card);
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}
.tab-panel {
  padding: 20px;
  display: none;
}
.tab-panel.active { display: block; }
.tab-panel .desc-text {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-light);
  margin-bottom: 16px;
}
.tab-panel .desc-img {
  max-width: 500px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

/* === 响应式 === */
@media (max-width: 768px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  .sidebar { display: none; }
  .header .container { flex-wrap: wrap; height: auto; padding-block: 8px; }
  .search-box { flex: 1 1 100%; order: 3; margin-top: 4px; }
  .nav-links { display: none; }
  .hamburger { display: block; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    gap: 10px;
    z-index: 99;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .features-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  .news-item { flex-direction: column; }
  .news-item .thumb { flex: none; width: 100%; }
  .cat-bar .container { gap: 0; }
  .detail-wrap { grid-template-columns: 1fr; gap: 16px; }
  .detail-info .pname { font-size: 17px; }
  .detail-price-box .now { font-size: 22px; }
  .detail-actions { flex-direction: column; }
  .detail-actions .btn { width: 100%; }
  .tab-nav { overflow-x: auto; }
  .tab-nav button { padding: 10px 16px; font-size: 13px; white-space: nowrap; }
  /* Checkout & contact two-column grids stack on mobile */
  [style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; }
  /* About page two-column grid stacks on mobile */
  [style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
}
@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .product-card .info { padding: 8px 10px 12px; }
  .product-card .price { font-size: 15px; }
}
