/* ============================================================
   德影音响 H5 商城 · 全局样式
   规范：主色 #FF4E2E / 渐变按钮 / 白卡片 12px 圆角 / 浅灰 #F7F7F7 背景
   ============================================================ */

:root {
  --primary: #FF4E2E;
  --primary-grad: linear-gradient(135deg, #FF6B35 0%, #FF3E1D 100%);
  --primary-light: #FFF0EC;
  --accent: #FFB800;
  --success: #07C160;
  --danger: #FA5151;
  --bg: #F7F7F7;
  --card: #FFFFFF;
  --text-main: #1A1A1A;
  --text-sub: #666666;
  --text-weak: #999999;
  --line: #EEEEEE;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-main);
  background: var(--bg);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input { font-family: inherit; outline: none; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.container-narrow { max-width: 860px; margin: 0 auto; padding: 0 16px; }

/* ================= 顶部通栏 Header（桌面优先） ================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  height: 64px;
  gap: 32px;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-shrink: 0;
}

.logo-text {
  font-size: 24px;
  font-weight: 700;
  background: var(--primary-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 1px;
}

.logo-en {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-weak);
  letter-spacing: 2px;
}

.header-nav {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.header-nav a {
  display: block;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 15px;
  color: var(--text-sub);
  transition: all 0.2s;
}

.header-nav a:hover { color: var(--primary); background: var(--primary-light); }
.header-nav a.active { color: var(--primary); font-weight: 600; background: var(--primary-light); }

.header-search {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.header-search .search-bar {
  width: 100%;
  max-width: 340px;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 19px;
  padding: 0 16px;
  transition: border-color 0.2s;
}

.header-search .search-bar:hover { border-color: var(--primary); }
.header-search .search-icon { font-size: 15px; }
.header-search .search-placeholder { color: var(--text-weak); font-size: 13px; }

.header-cart {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 20px;
  color: var(--text-sub);
  transition: all 0.2s;
}

.header-cart:hover { color: var(--primary); background: var(--primary-light); }

.badge {
  position: absolute;
  top: 2px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  display: inline-block;
}

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

.site-footer {
  margin-top: 48px;
  background: #2B2B2B;
  color: #999;
  padding: 36px 0 96px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-brand .logo-text { font-size: 22px; }
.footer-brand .logo-en { color: #777; }
.footer-slogan { margin-top: 8px; font-size: 13px; color: #888; }
.footer-links { display: flex; gap: 24px; }
.footer-links a { color: #aaa; font-size: 13px; }
.footer-links a:hover { color: #fff; }
.footer-copy { width: 100%; margin-top: 24px; font-size: 12px; color: #777; text-align: center; }

/* ================= 页面容器 ================= */

#page { min-height: 70vh; padding-bottom: 24px; }

.page-title { font-size: 20px; font-weight: 600; margin: 24px 0 16px; }
.page-plain { padding: 80px 16px; }

.grid-section { margin-top: 16px; }
.card-section {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px 0 12px;
}

.section-title { font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.section-title-accent { color: var(--accent); }
.section-more { font-size: 13px; color: var(--text-weak); }
.section-more:hover { color: var(--primary); }

/* ================= 按钮 ================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 28px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  border: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary { background: var(--primary-grad); color: #fff; box-shadow: 0 4px 12px rgba(255, 78, 46, 0.3); }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-plain { background: var(--bg); color: var(--text-sub); border: 1px solid var(--line); }
.btn-plain:hover { color: var(--primary); border-color: var(--primary); }

.btn-cart {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-buy { min-width: 160px; }
.btn-block { width: 100%; }
.btn-sm { height: 32px; padding: 0 16px; font-size: 13px; border-radius: 6px; }
.btn:disabled { background: #ccc; color: #fff; box-shadow: none; cursor: not-allowed; }

.link-btn { color: var(--primary); font-size: 13px; background: none; }
.link-btn:hover { opacity: 0.8; }
.link-danger { color: var(--danger); }

/* ================= 标签 ================= */

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.6;
}

.tag-primary-light { background: var(--primary-light); color: var(--primary); }
.tag-accent { background: #FFF7E0; color: var(--accent); }

/* ================= 价格 ================= */

.price { color: var(--primary); font-weight: 700; font-size: 18px; }
.price em { font-style: normal; font-size: 12px; font-weight: 600; margin-right: 1px; }
.price-original { color: var(--text-weak); text-decoration: line-through; font-size: 13px; margin-left: 8px; }

/* ================= 商品卡片 ================= */

.goods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.goods-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.25s;
  display: block;
}

.goods-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1); }

.goods-img { aspect-ratio: 1/1; overflow: hidden; background: #fff; }
.goods-img img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.3s; }
.goods-card:hover .goods-img img { transform: scale(1.05); }

.goods-info { padding: 12px 14px 14px; }
.goods-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  height: 40px;
  line-height: 20px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.goods-tags { margin: 6px 0 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.goods-price-row { display: flex; align-items: baseline; }
.goods-sales { font-size: 12px; color: var(--text-weak); margin-top: 4px; }

/* ================= 首页：搜索横幅 ================= */

.hero-search {
  background: var(--primary-grad);
  padding: 20px 0 72px;
}

.hero-search .search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  height: 44px;
  border-radius: 22px;
  padding: 0 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.hero-search .search-icon { font-size: 16px; }
.hero-search .search-placeholder { color: var(--text-weak); font-size: 14px; }

/* ================= 首页：Banner 轮播 ================= */

.banner-section { margin-top: -56px; }

.banner {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 1200 / 420;
}

.banner-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.banner-slide.active { opacity: 1; pointer-events: auto; }
.banner-slide a { display: block; width: 100%; height: 100%; position: relative; }
.banner-slide img { width: 100%; height: 100%; object-fit: cover; }

.banner-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 78, 46, 0.55) 0%, rgba(0, 0, 0, 0) 55%);
}

.banner-title {
  position: absolute;
  left: 48px;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  letter-spacing: 1px;
}

.banner-dots {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s;
}

.banner-dot.active { width: 20px; background: #fff; }

/* ================= 首页：金刚区 ================= */

.cat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  padding: 20px 12px;
}

.cat-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 4px;
  border-radius: 10px;
  transition: all 0.2s;
}

.cat-icon:hover { background: var(--primary-light); transform: translateY(-2px); }

.cat-icon-bg {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.cat-icon-name { font-size: 13px; color: var(--text-sub); }

/* ================= 首页：秒杀 / 热卖 ================= */

.countdown {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-sub);
}

.countdown-label { color: var(--accent); font-weight: 600; }

.countdown-nums b {
  display: inline-block;
  background: #2B2B2B;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
  padding: 2px 5px;
  min-width: 26px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.seckill-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 16px;
}

.seckill-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: 10px;
  padding: 12px;
  transition: all 0.2s;
}

.seckill-item:hover { background: var(--primary-light); transform: translateY(-2px); }

.seckill-img { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 1/1; }
.seckill-img img { width: 100%; height: 100%; object-fit: cover; }

.seckill-flag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
}

.seckill-name {
  font-size: 13px;
  color: var(--text-main);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.seckill-price .price { color: var(--accent); font-size: 20px; }
.seckill-price .price em { font-size: 12px; }

.hot-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 16px;
}

.hot-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 10px;
  transition: all 0.2s;
}

.hot-item:hover { background: var(--primary-light); transform: translateY(-2px); }

.hot-rank {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hot-img {
  width: 76px;
  height: 76px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: #fff;
}

.hot-img img { width: 100%; height: 100%; object-fit: contain; }
.hot-info { min-width: 0; flex: 1; }
.hot-name {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.hot-sales { font-size: 12px; color: var(--text-weak); margin: 4px 0 6px; }

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

.category-layout {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  align-items: flex-start;
}

.cat-side {
  width: 168px;
  flex-shrink: 0;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px;
  position: sticky;
  top: 80px;
}

.cat-side-item {
  display: block;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-sub);
  margin-bottom: 4px;
  transition: all 0.2s;
}

.cat-side-item:hover { background: var(--bg); color: var(--primary); }

.cat-side-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.cat-main { flex: 1; min-width: 0; }
.cat-title { font-size: 18px; font-weight: 600; }
.cat-count { font-size: 12px; color: var(--text-weak); margin: 4px 0 12px; }

/* ================= 搜索页 ================= */

.search-page { margin-top: 20px; }

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.search-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  height: 44px;
  padding: 0 8px 0 16px;
  transition: border-color 0.2s;
}

.search-input-wrap:focus-within { border-color: var(--primary); }
.search-input-wrap input { flex: 1; border: none; font-size: 14px; background: none; }
.btn-search { height: 36px; padding: 0 20px; font-size: 14px; border-radius: 18px; }

.search-block { margin-bottom: 18px; }
.search-block-head { display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 600; margin-bottom: 10px; }

.keyword-chips { display: flex; flex-wrap: wrap; gap: 10px; }

.chip {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text-sub);
  transition: all 0.2s;
}

.chip:hover { color: var(--primary); border-color: var(--primary); }
.chip-hot { background: var(--primary-light); color: var(--primary); border-color: transparent; }

.search-result-count { font-size: 13px; color: var(--text-weak); margin-bottom: 12px; }

/* ================= 商品详情 ================= */

.product-page { margin-top: 20px; }

.product-top {
  display: flex;
  gap: 32px;
  padding: 24px;
}

.product-gallery { flex: 1; max-width: 460px; }

.product-main-img {
  aspect-ratio: 1/1;
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
}

.product-main-img img { width: 100%; height: 100%; object-fit: contain; }

.product-thumbs { display: flex; gap: 10px; margin-top: 12px; }

.thumb {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: #fff;
}

.thumb.active { border-color: var(--primary); }
.thumb img { width: 100%; height: 100%; object-fit: contain; }

.product-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.product-tags { display: flex; gap: 8px; margin-bottom: 12px; }

.product-name { font-size: 24px; font-weight: 700; line-height: 1.35; }

.product-subtitle { font-size: 14px; color: var(--text-sub); margin-top: 8px; }

.product-price-box {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 16px;
  background: var(--primary-light);
  border-radius: 10px;
  padding: 14px 16px;
}

.product-price { font-size: 32px; }
.product-price em { font-size: 16px; }
.product-original { font-size: 14px; }

.product-off {
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  border-radius: 6px;
  padding: 2px 8px;
}

.product-meta {
  display: flex;
  gap: 24px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-sub);
}

.product-meta b { color: var(--text-main); font-weight: 600; }
.product-meta .rating { color: var(--accent); font-weight: 700; }

.product-desc {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.8;
}

.qty-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.qty-label { font-size: 14px; color: var(--text-sub); }
.qty-stock { font-size: 12px; color: var(--text-weak); }

.qty-selector {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.qty-btn {
  width: 36px;
  height: 34px;
  font-size: 16px;
  color: var(--text-sub);
  transition: all 0.2s;
}

.qty-btn:hover { color: var(--primary); background: var(--primary-light); }

.qty-num {
  min-width: 44px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  line-height: 34px;
  font-variant-numeric: tabular-nums;
}

/* 图文详情 */

.detail-section { margin-top: 16px; padding: 20px; }
.detail-title { font-size: 18px; font-weight: 600; margin-bottom: 14px; }
.detail-img { border-radius: 10px; overflow: hidden; margin-bottom: 14px; }
.detail-img img { width: 100%; max-height: 420px; object-fit: cover; }

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

.detail-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-sub);
}

.detail-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 8px;
}

/* 商品详情底部操作栏 */

.product-actionbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--card);
  border-top: 1px solid var(--line);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
  z-index: 90;
}

.actionbar-inner {
  height: 62px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  color: var(--text-sub);
  padding: 0 10px;
  height: 100%;
}

.action-item .action-icon { font-size: 20px; line-height: 1.2; }
.action-item.active { color: var(--primary); }

.action-btns { flex: 1; display: flex; justify-content: flex-end; gap: 12px; }

/* ================= 购物车 ================= */

.cart-page { margin-top: 20px; padding-bottom: 110px; }

.cart-list { padding: 4px 16px; }

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

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

.check-box { display: inline-flex; align-items: center; cursor: pointer; }

.check-box input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.cart-img {
  width: 84px;
  height: 84px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--line);
}

.cart-img img { width: 100%; height: 100%; object-fit: contain; }

.cart-info { flex: 1; min-width: 0; }

.cart-name {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  display: block;
}

.cart-sub { font-size: 12px; color: var(--text-weak); margin-top: 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.cart-price-row { display: flex; align-items: baseline; margin-top: 6px; }
.cart-price-row .price { font-size: 16px; }

.cart-ops {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.cart-del { color: var(--text-weak); }
.cart-del:hover { color: var(--danger); }

/* 购物车底部结算栏 */

.cart-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--card);
  border-top: 1px solid var(--line);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
  z-index: 90;
}

.cart-bar-inner {
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.all-check { gap: 6px; font-size: 13px; color: var(--text-sub); }

.cart-bar-right { display: flex; align-items: center; gap: 16px; }

.cart-total { font-size: 13px; color: var(--text-sub); }
.cart-total .price { font-size: 22px; }
.cart-total-sub { font-size: 12px; color: var(--text-weak); margin-left: 4px; }

/* ================= 确认订单 ================= */

.checkout-page { margin-top: 20px; padding-bottom: 40px; }
.checkout-page .card-section { margin-bottom: 16px; }

.ck-addr { padding: 0; }

.addr-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background 0.2s;
}

.addr-card:hover { background: var(--primary-light); }
.addr-empty { color: var(--text-sub); justify-content: space-between; }

.addr-main { flex: 1; min-width: 0; }
.addr-line1 { display: flex; align-items: center; gap: 10px; }
.addr-line1 b { font-size: 16px; }
.addr-phone { color: var(--text-sub); font-size: 14px; }
.addr-line2 { font-size: 13px; color: var(--text-sub); margin-top: 6px; }
.addr-arrow { font-size: 20px; color: var(--text-weak); }

.ck-goods-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; }

.ck-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
}

.ck-item img {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: contain;
  border: 1px solid var(--line);
  background: #fff;
}

.ck-item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ck-item-name { font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ck-item-price { display: flex; align-items: baseline; justify-content: space-between; }
.ck-item-price .price { font-size: 15px; }
.ck-item-qty { font-size: 13px; color: var(--text-weak); }

.amount-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-sub);
}

.amount-row .free { color: var(--success); font-weight: 600; }
.amount-total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 14px; color: var(--text-main); font-weight: 600; }
.amount-total .price { font-size: 22px; }

.btn-submit { width: 100%; margin-top: 8px; height: 50px; font-size: 16px; }

/* ================= 订单列表 ================= */

.orders-page { margin-top: 20px; }

.order-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.order-tab {
  position: relative;
  padding: 8px 18px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 14px;
  color: var(--text-sub);
  transition: all 0.2s;
}

.order-tab .badge { position: static; margin-left: 4px; display: inline-block; }

.order-tab.active { background: var(--primary-grad); color: #fff; border-color: transparent; }
.order-tab.active .badge { background: rgba(255, 255, 255, 0.9); color: var(--primary); }

.order-list { display: flex; flex-direction: column; gap: 14px; }

.order-card { padding: 0; overflow: hidden; }

.order-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-weak);
}

.order-no { flex: 1; }
.order-status { font-weight: 600; }
.status-0 { color: var(--accent); }
.status-1 { color: var(--primary); }
.status-2 { color: #4A90D9; }
.status-3 { color: var(--success); }
.status-4 { color: var(--text-weak); }

.order-body {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
}

.order-thumbs { display: flex; gap: 6px; }
.order-thumbs img {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
}

.order-info { flex: 1; min-width: 0; }
.order-name {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.order-more { font-size: 12px; color: var(--text-weak); margin-top: 4px; }
.order-addr {
  font-size: 12px;
  color: var(--text-weak);
  margin-top: 4px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.order-total { text-align: right; flex-shrink: 0; }
.order-price .price { font-size: 18px; }
.order-count { display: block; font-size: 12px; color: var(--text-weak); margin-top: 2px; }

.order-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

/* ================= 我的 ================= */

.mine-page { margin-top: 20px; }

.mine-user {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  background: linear-gradient(135deg, #FF6B35 0%, #FF3E1D 100%);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(255, 78, 46, 0.25);
  margin-bottom: 16px;
}

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.6);
}

.mine-user-info { flex: 1; }
.mine-nickname { color: #fff; font-size: 20px; font-weight: 700; }
.mine-slogan { color: rgba(255, 255, 255, 0.85); font-size: 13px; margin-top: 4px; }
.mine-user .btn-plain { background: rgba(255, 255, 255, 0.92); border: none; color: var(--primary); }

.mine-block-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
}

.mine-order-icons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.mine-order-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-sub);
  padding: 8px 0;
  border-radius: 8px;
  transition: all 0.2s;
}

.mine-order-item:hover { color: var(--primary); background: var(--primary-light); }

.mine-order-icon { position: relative; font-size: 26px; line-height: 1.2; }
.mine-order-icon .badge { top: -6px; right: -12px; }

.mine-fav-list { display: flex; flex-direction: column; }

.mine-fav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

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

.mine-fav-img {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--line);
}

.mine-fav-img img { width: 100%; height: 100%; object-fit: contain; }

.mine-fav-info { flex: 1; min-width: 0; }
.mine-fav-name { font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: block; }
.mine-fav-price { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.mine-fav-price .price { font-size: 15px; }

.mine-menu { padding: 4px 16px; }

.mine-menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: var(--text-main);
  transition: color 0.2s;
}

.mine-menu-item:last-child { border-bottom: none; }
.mine-menu-item:hover { color: var(--primary); }
.mine-menu-item span { color: var(--text-weak); font-size: 16px; }

/* ================= 弹窗 / 对话框 / Toast ================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.closing { opacity: 0; transition: opacity 0.2s; }

.dialog {
  width: 360px;
  max-width: 86vw;
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 24px;
  animation: popIn 0.25s ease;
}

.dialog-title { font-size: 17px; font-weight: 600; text-align: center; }
.dialog-body { font-size: 14px; color: var(--text-sub); text-align: center; margin: 14px 0 22px; line-height: 1.7; }
.dialog-actions { display: flex; gap: 12px; }
.dialog-actions .btn { flex: 1; }

.modal {
  width: 480px;
  max-width: 92vw;
  max-height: 82vh;
  background: var(--card);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  animation: popIn 0.25s ease;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  font-size: 22px;
  color: var(--text-weak);
  line-height: 1;
  padding: 0 4px;
}

.modal-close:hover { color: var(--primary); }

.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-foot { padding: 12px 20px 20px; }

.addr-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  border-radius: 8px;
}

.addr-row:hover { background: var(--primary-light); }
.addr-row-main { flex: 1; min-width: 0; }
.addr-row-ops { display: flex; gap: 10px; flex-shrink: 0; }
.addr-none { text-align: center; color: var(--text-weak); padding: 28px 0; }

.form-field {
  display: block;
  margin-bottom: 14px;
}

.form-field span {
  display: block;
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.form-field input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-field input:focus { border-color: var(--primary); }

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-sub);
  cursor: pointer;
}

.form-check input { width: 16px; height: 16px; accent-color: var(--primary); }

.about-ver { color: var(--text-weak); font-size: 12px; margin-top: 4px; }

/* Toast */

#toastWrap {
  position: fixed;
  top: 80px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 300;
  pointer-events: none;
}

.toast {
  background: rgba(26, 26, 26, 0.88);
  color: #fff;
  font-size: 14px;
  padding: 10px 22px;
  border-radius: 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.3s;
  max-width: 80vw;
  text-align: center;
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: rgba(7, 193, 96, 0.92); }
.toast-error { background: rgba(250, 81, 81, 0.92); }

/* ================= 空状态 ================= */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 56px 16px;
  text-align: center;
}

.empty-icon { font-size: 56px; opacity: 0.6; }
.empty-text { font-size: 14px; color: var(--text-weak); }

/* ================= 底部 TabBar（窄屏） ================= */

.tabbar {
  display: none;
}

/* ================= 动画 ================= */

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }

/* ================= 响应式 ================= */

@media (max-width: 1024px) {
  .banner-title { font-size: 22px; left: 32px; }
  .goods-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}

@media (max-width: 768px) {
  body { padding-bottom: 60px; }

  .site-header { display: none; }

  .tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 56px;
    background: var(--card);
    border-top: 1px solid var(--line);
    z-index: 100;
  }

  .tabbar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 11px;
    color: var(--text-weak);
    position: relative;
  }

  .tabbar-item .tab-icon { font-size: 20px; line-height: 1.2; }
  .tabbar-item.active { color: var(--primary); }
  .tabbar-item .badge { top: 2px; right: 50%; transform: translateX(18px); }

  .site-footer { padding-bottom: 20px; }
  .footer-inner { flex-direction: column; }

  .hero-search { padding: 16px 0 60px; }
  .banner-section { margin-top: -44px; }
  .banner { aspect-ratio: 16/7; }
  .banner-title { font-size: 16px; left: 20px; }
  .banner-mask { background: linear-gradient(90deg, rgba(255, 78, 46, 0.65) 0%, rgba(0, 0, 0, 0) 70%); }

  .cat-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 14px 8px; }
  .cat-icon-bg { width: 44px; height: 44px; font-size: 13px; }

  .seckill-row, .hot-row { grid-template-columns: 1fr; gap: 8px; padding: 10px; }
  .hot-item { padding: 8px; }
  .seckill-item { flex-direction: row; align-items: center; padding: 8px; }
  .seckill-img { width: 84px; aspect-ratio: 1/1; flex-shrink: 0; }
  .seckill-name { white-space: normal; }

  .category-layout { flex-direction: column; }
  .cat-side {
    width: 100%;
    position: static;
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 8px;
  }
  .cat-side-item { margin-bottom: 0; flex-shrink: 0; padding: 8px 14px; }

  .product-top { flex-direction: column; gap: 16px; padding: 14px; }
  .product-gallery { max-width: 100%; }
  .product-name { font-size: 18px; }
  .product-price { font-size: 26px; }

  .goods-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card-section { padding: 12px; }

  .cart-item { gap: 10px; }
  .cart-img { width: 72px; height: 72px; }
  .cart-total-sub { display: none; }

  .order-body { flex-wrap: wrap; }
  .order-thumbs img { width: 52px; height: 52px; }
  .order-total { width: 100%; text-align: left; display: flex; align-items: center; gap: 12px; }

  .page-title { font-size: 18px; margin: 16px 0 12px; }
  .section-title { font-size: 16px; }
  .countdown-label { display: none; }

  .container, .container-narrow { padding: 0 12px; }
  .btn-submit { margin-bottom: 8px; }
}
