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

body {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f6f8;
  color: #333;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
a { text-decoration: none; color: inherit; }

/* ===== 头部 ===== */
.site-header { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.06); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; gap: 32px; padding: 16px; }
.logo { font-size: 26px; font-weight: 700; color: #e64545; white-space: nowrap; }
.logo span { color: #222; }
.search-bar { flex: 1; display: flex; max-width: 560px; border: 2px solid #e64545; border-radius: 24px; overflow: hidden; }
.search-bar input { flex: 1; border: none; padding: 10px 18px; font-size: 14px; outline: none; }
.search-btn { border: none; background: #e64545; color: #fff; padding: 0 28px; font-size: 15px; cursor: pointer; }
.search-btn:hover { background: #d23838; }
.header-nav { display: flex; gap: 20px; font-size: 14px; white-space: nowrap; }
.nav-item:hover { color: #e64545; }
.cart { position: relative; }
.cart-badge { background: #e64545; color: #fff; border-radius: 10px; font-size: 12px; padding: 1px 7px; }
.sub-nav { display: flex; gap: 32px; padding: 10px 16px; border-top: 1px solid #f0f0f0; font-size: 14px; color: #555; }
.sub-nav a:hover { color: #e64545; }

/* ===== 轮播图 ===== */
.banner { margin-top: 16px; }
.carousel { position: relative; border-radius: 12px; overflow: hidden; }
.carousel-track { display: flex; transition: transform .5s ease; }
.slide { min-width: 100%; height: 320px; display: flex; align-items: center; padding: 0 64px; }
.slide-1 { background: linear-gradient(120deg, #2b3a67, #5a7bd4); }
.slide-2 { background: linear-gradient(120deg, #b0413e, #e88a63); }
.slide-3 { background: linear-gradient(120deg, #7a3b8f, #d678c0); }
.slide-text h2 { font-size: 38px; color: #fff; margin-bottom: 12px; }
.slide-text p { font-size: 17px; color: rgba(255,255,255,.85); margin-bottom: 24px; }
.cta { background: #fff; color: #e64545; border: none; padding: 10px 30px; border-radius: 22px; font-size: 15px; font-weight: 600; cursor: pointer; }
.cta:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.cta.light { background: rgba(255,255,255,.95); }
.carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,.25); color: #fff; border: none; width: 40px; height: 40px; border-radius: 50%; font-size: 16px; cursor: pointer; }
.carousel-btn:hover { background: rgba(0,0,0,.45); }
.carousel-btn.prev { left: 16px; }
.carousel-btn.next { right: 16px; }
.carousel-dots { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.carousel-dots span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.5); cursor: pointer; }
.carousel-dots span.active { background: #fff; width: 24px; border-radius: 5px; }

/* ===== 区块标题 ===== */
.section { margin-top: 40px; }
.section-title { font-size: 24px; margin-bottom: 20px; border-left: 4px solid #e64545; padding-left: 12px; }
.section-title .sub { font-size: 14px; color: #999; font-weight: 400; }

/* ===== 分类 ===== */
.category-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 16px; }
.category-card { background: #fff; border-radius: 12px; padding: 20px 8px; text-align: center; cursor: pointer; transition: all .25s; }
.category-card:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.category-card .icon { font-size: 34px; margin-bottom: 10px; }
.category-card .name { font-size: 14px; color: #444; }

/* ===== 商品 ===== */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.product-card { background: #fff; border-radius: 12px; overflow: hidden; transition: all .25s; }
.product-card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(0,0,0,.1); }
.product-img { height: 200px; display: flex; align-items: center; justify-content: center; font-size: 64px; position: relative; }
.product-tag { position: absolute; top: 10px; left: 10px; background: #e64545; color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 4px; }
.product-body { padding: 14px; }
.product-name { font-size: 15px; line-height: 1.4; height: 42px; overflow: hidden; }
.product-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.price { color: #e64545; font-size: 20px; font-weight: 700; }
.price s { color: #bbb; font-size: 13px; font-weight: 400; margin-left: 6px; }
.add-cart { background: #ffe9e9; color: #e64545; border: none; border-radius: 16px; padding: 6px 14px; font-size: 13px; cursor: pointer; }
.add-cart:hover { background: #e64545; color: #fff; }
.sales { font-size: 12px; color: #999; margin-top: 6px; }

/* ===== 促销 ===== */
.promo-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 16px; }
.promo-card { border-radius: 12px; padding: 28px; min-height: 180px; display: flex; align-items: center; }
.promo-a { background: linear-gradient(120deg, #e64545, #f3873f); }
.promo-b { background: linear-gradient(120deg, #4a6fd6, #6fc3f7); }
.promo-c { background: linear-gradient(120deg, #34a67c, #7fd6a2); }
.promo-info h3 { color: #fff; font-size: 24px; margin-bottom: 8px; }
.promo-info p { color: rgba(255,255,255,.85); font-size: 14px; margin-bottom: 16px; }
.countdown { font-size: 28px; font-weight: 700; color: #fff; letter-spacing: 2px; margin-bottom: 14px; font-variant-numeric: tabular-nums; }

/* ===== 页脚 ===== */
.site-footer { background: #2b2f36; color: #aab; margin-top: 60px; padding: 40px 0 20px; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.footer-grid h4 { color: #fff; margin-bottom: 12px; font-size: 15px; }
.footer-grid a { display: block; font-size: 13px; margin-bottom: 8px; }
.footer-grid a:hover { color: #fff; }
.hotline { color: #fff; font-size: 20px; font-weight: 700; }
.copyright { text-align: center; font-size: 12px; margin-top: 32px; padding-top: 16px; border-top: 1px solid #3d424b; }

/* ===== 响应式 ===== */
@media (max-width: 960px) {
  .category-grid { grid-template-columns: repeat(4, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .promo-grid { grid-template-columns: 1fr; }
  .header-inner { flex-wrap: wrap; gap: 12px; }
  .search-bar { order: 3; max-width: 100%; }
  .slide { height: 220px; padding: 0 40px; }
  .slide-text h2 { font-size: 26px; }
  .flashsale-grid { grid-template-columns: repeat(2, 1fr); }
  .flashsale-header { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  .flashsale-grid { grid-template-columns: 1fr; }
  .flashsale-tabs { overflow-x: auto; flex-wrap: nowrap; }
  .ftab { flex-shrink: 0; }
}

/* ===== 限时秒杀专区 ===== */
.flashsale-section {
  background: linear-gradient(135deg, #fff3e0 0%, #ffece0 100%);
  border-radius: 12px;
  padding: 20px 24px 28px;
  margin: 24px auto;
  box-shadow: 0 2px 12px rgba(255, 87, 34, 0.06);
}
.flashsale-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px; flex-wrap: wrap; gap: 12px;
}
.flashsale-title { display: flex; align-items: baseline; gap: 10px; }
.flashsale-title h2 { font-size: 24px; color: #d3380b; letter-spacing: 1px; }
.fs-icon { font-size: 22px; }
.fs-sub { color: #b07766; font-size: 13px; }
.flashsale-timer { display: flex; align-items: center; gap: 8px; }
.timer-label { color: #666; font-size: 13px; }
.timer-label.live { color: #d3380b; font-weight: 600; }
.timer-blocks { display: flex; align-items: center; gap: 4px; }
.t-block {
  background: #2a2a2a; color: #fff; font-size: 14px; font-weight: 600;
  padding: 4px 8px; border-radius: 4px; min-width: 32px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.timer-blocks.live .t-block { background: #d3380b; }
.t-sep { color: #2a2a2a; font-weight: 700; }
.flashsale-tabs {
  display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap;
  border-bottom: 1px solid rgba(0,0,0,.05); padding-bottom: 12px;
}
.ftab {
  cursor: pointer; padding: 8px 16px; border-radius: 20px;
  background: #fff; color: #555; font-size: 14px; font-weight: 500;
  border: 1px solid transparent; transition: all .2s;
  display: flex; align-items: center; gap: 6px;
}
.ftab:hover { color: #d3380b; }
.ftab.active {
  background: linear-gradient(135deg, #ff5e3a 0%, #ff2a68 100%);
  color: #fff; border-color: transparent; box-shadow: 0 2px 8px rgba(255,90,60,.4);
}
.ftab.live::before {
  content: ""; display: inline-block; width: 7px; height: 7px;
  border-radius: 50%; background: #2ecc71; box-shadow: 0 0 6px #2ecc71;
  animation: blink 1.2s infinite;
}
@keyframes blink { 50% { opacity: 0.35; } }

.flashsale-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.fs-card {
  background: #fff; border-radius: 10px; padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
  transition: transform .2s, box-shadow .2s; position: relative;
  overflow: hidden;
}
.fs-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.fs-card .discount {
  position: absolute; top: 8px; left: 8px;
  background: linear-gradient(135deg, #ff5e3a, #ff2a68);
  color: #fff; font-size: 12px; font-weight: 700;
  padding: 3px 8px; border-radius: 12px; z-index: 1;
}
.fs-img {
  width: 100%; aspect-ratio: 1/1; border-radius: 6px;
  background: #f0f0f0; display: flex; align-items: center; justify-content: center;
  font-size: 42px; color: #ddd;
}
.fs-name { font-size: 13px; color: #333; line-height: 1.4; min-height: 36px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.fs-prices { display: flex; align-items: baseline; gap: 8px; }
.fs-now { color: #d3380b; font-size: 18px; font-weight: 700; }
.fs-now .yen { font-size: 12px; margin-right: 1px; }
.fs-old { color: #999; text-decoration: line-through; font-size: 12px; }
.fs-progress { background: #fde0d6; border-radius: 10px; height: 14px; position: relative; overflow: hidden; }
.fs-progress .bar {
  background: linear-gradient(90deg, #ff5e3a, #ff2a68);
  height: 100%; border-radius: 10px; transition: width .3s;
}
.fs-progress .pct {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: #fff; font-weight: 600; text-shadow: 0 1px 1px rgba(0,0,0,.2);
}
.fs-btn {
  background: linear-gradient(135deg, #ff5e3a 0%, #ff2a68 100%);
  color: #fff; border: none; padding: 8px 0; border-radius: 16px;
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.fs-btn:hover { opacity: .92; }
.fs-btn.disabled { background: #d9d9d9; cursor: not-allowed; }
.fs-card.soldout { opacity: .65; }
.fs-card.soldout .fs-btn { background: #ccc; cursor: not-allowed; }
