* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: #f5f5f5; color: #333; line-height: 1.6;
}
a { color: inherit; text-decoration: none; }

.header { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.06); position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; height: 64px; display: flex; align-items: center; gap: 30px; }
.logo { font-size: 24px; font-weight: 800; color: #e4393c; white-space: nowrap; }
.search-box { flex: 1; display: flex; max-width: 480px; }
.search-box input { flex: 1; border: 2px solid #e4393c; border-right: none; padding: 8px 14px; font-size: 14px; border-radius: 2px 0 0 2px; outline: none; }
.search-box button { background: #e4393c; color: #fff; border: none; padding: 0 22px; font-size: 14px; cursor: pointer; border-radius: 0 2px 2px 0; }
.nav-links { display: flex; gap: 20px; align-items: center; font-size: 14px; }
.nav-links a { color: #666; cursor: pointer; transition: color .2s; }
.nav-links a:hover { color: #e4393c; }
.nav-links .cart-link { position: relative; }
.cart-badge { position: absolute; top: -8px; right: -10px; background: #e4393c; color: #fff; font-size: 11px; min-width: 16px; height: 16px; line-height: 16px; text-align: center; border-radius: 8px; padding: 0 4px; }

.category-bar { background: #fff; border-bottom: 1px solid #eee; }
.category-bar-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; gap: 24px; height: 44px; align-items: center; font-size: 14px; }
.category-bar-inner a { color: #666; cursor: pointer; }
.category-bar-inner a:hover, .category-bar-inner a.active { color: #e4393c; font-weight: 600; }

.container { max-width: 1200px; margin: 20px auto; padding: 0 20px; }

.banner { background: linear-gradient(120deg, #e4393c, #ff6b6b); color: #fff; border-radius: 8px; padding: 40px 30px; margin-bottom: 20px; }
.banner h2 { font-size: 28px; margin-bottom: 8px; }
.banner p { opacity: .9; }

.section-title { font-size: 20px; font-weight: 700; margin: 24px 0 16px; display: flex; align-items: center; gap: 10px; }
.section-title::before { content: ''; width: 4px; height: 20px; background: #e4393c; border-radius: 2px; }

.product-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.product-card { background: #fff; border-radius: 8px; overflow: hidden; cursor: pointer; transition: transform .2s, box-shadow .2s; border: 1px solid #f0f0f0; }
.product-card:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,.1); }
.product-img { width: 100%; height: 180px; background: #f9f9f9; display: flex; align-items: center; justify-content: center; font-size: 64px; overflow: hidden; }
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-info { padding: 12px; }
.product-name { font-size: 14px; height: 40px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.product-price { color: #e4393c; font-size: 18px; font-weight: 700; margin-top: 8px; }
.product-meta { font-size: 12px; color: #999; margin-top: 4px; }

.btn { display: inline-block; padding: 8px 20px; border: none; border-radius: 4px; font-size: 14px; cursor: pointer; transition: opacity .2s; color: #fff; }
.btn:hover { opacity: .85; }
.btn-primary { background: #e4393c; }
.btn-danger { background: #ff4d4f; }
.btn-success { background: #52c41a; }
.btn-default { background: #f0f0f0; color: #333; }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-lg { padding: 12px 32px; font-size: 16px; }

.detail-wrap { background: #fff; border-radius: 8px; padding: 24px; display: flex; gap: 30px; }
.detail-img { width: 400px; height: 400px; background: #f9f9f9; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 120px; overflow: hidden; }
.detail-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.img-inline { width: 28px; height: 28px; object-fit: cover; border-radius: 4px; vertical-align: middle; margin-right: 6px; }
.detail-info { flex: 1; }
.detail-info h1 { font-size: 24px; margin-bottom: 12px; }
.detail-price { color: #e4393c; font-size: 32px; font-weight: 700; margin: 16px 0; }
.detail-desc { color: #666; margin: 16px 0; line-height: 1.8; }
.qty-control { display: flex; align-items: center; gap: 12px; margin: 20px 0; }
.qty-control button { width: 32px; height: 32px; border: 1px solid #ddd; background: #fff; font-size: 18px; cursor: pointer; border-radius: 4px; }
.qty-control input { width: 60px; height: 32px; text-align: center; border: 1px solid #ddd; border-radius: 4px; }
.detail-actions { display: flex; gap: 12px; margin-top: 24px; }

.cart-table { width: 100%; background: #fff; border-radius: 8px; overflow: hidden; border-collapse: collapse; }
.cart-table th, .cart-table td { padding: 14px; text-align: center; border-bottom: 1px solid #f0f0f0; }
.cart-table th { background: #fafafa; font-weight: 600; }
.cart-table .product-cell { text-align: left; }
.cart-footer { background: #fff; margin-top: 16px; padding: 20px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.cart-total { font-size: 20px; }
.cart-total .price { color: #e4393c; font-size: 28px; font-weight: 700; }

.form-card { max-width: 420px; margin: 60px auto; background: #fff; border-radius: 8px; padding: 36px; box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.form-card h2 { text-align: center; margin-bottom: 28px; color: #e4393c; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 14px; color: #666; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; outline: none; transition: border-color .2s; font-family: inherit; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #e4393c; }
.form-card .btn { width: 100%; }
.form-switch { text-align: center; margin-top: 16px; font-size: 14px; color: #666; }
.form-switch a { color: #e4393c; cursor: pointer; }

.order-card { background: #fff; border-radius: 8px; padding: 20px; margin-bottom: 16px; }
.order-card .order-head { display: flex; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid #f0f0f0; margin-bottom: 12px; color: #999; font-size: 14px; }
.order-status { color: #e4393c; font-weight: 600; }
.order-item { display: flex; gap: 12px; align-items: center; padding: 8px 0; }
.order-item-name { flex: 1; }
.order-item-price { color: #e4393c; }
.order-total { text-align: right; margin-top: 12px; padding-top: 12px; border-top: 1px dashed #eee; }
.order-total .price { color: #e4393c; font-size: 20px; font-weight: 700; }

.empty { text-align: center; padding: 80px 20px; color: #999; }
.empty .icon { font-size: 64px; margin-bottom: 16px; }

.toast { position: fixed; top: 80px; left: 50%; transform: translateX(-50%); background: #333; color: #fff; padding: 12px 24px; border-radius: 4px; z-index: 9999; opacity: 0; transition: opacity .3s; pointer-events: none; }
.toast.show { opacity: 1; }

/* ===== 商品图片放大预览 ===== */
/* 任何带 data-preview 的图片：鼠标提示可点击放大 */
img[data-preview] { cursor: zoom-in; }
/* 悬停时右下角显示放大镜角标 */
.img-wrap { position: relative; display: inline-block; }
.img-wrap::after {
  content: '🔍';
  position: absolute; right: 8px; bottom: 8px;
  width: 30px; height: 30px; line-height: 30px;
  text-align: center; font-size: 15px;
  background: rgba(0,0,0,.55); color: #fff;
  border-radius: 50%;
  opacity: 0; transform: scale(.6);
  transition: all .2s ease;
  pointer-events: none;
  z-index: 5;
}
.img-wrap:hover::after, .img-wrap.hovering::after { opacity: 1; transform: scale(1); }
.img-preview-mask {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,.85);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; cursor: zoom-out;
  opacity: 0; transition: opacity .2s ease;
  backdrop-filter: blur(4px);
}
.img-preview-mask.show { opacity: 1; }
.img-preview-img {
  max-width: 90vw; max-height: 90vh;
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
  animation: previewPop .22s cubic-bezier(.2,.8,.3,1.2);
}
@keyframes previewPop {
  from { transform: scale(.85); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
@media (max-width: 600px) {
  .img-preview-img { max-width: 96vw; max-height: 80vh; }
}

/* 局部放大镜（悬停跟随） */
.magnifier-lens {
  position: fixed; pointer-events: none; z-index: 900;
  border: 1.5px solid #e4393c; background: rgba(255,255,255,.25);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0); /* 无外层遮罩 */
  cursor: crosshair;
}
.magnifier-zoom {
  position: fixed; pointer-events: none; z-index: 900;
  border: 1px solid #e6e6e6; border-radius: 8px; overflow: hidden;
  background-repeat: no-repeat; background-color: #fff;
  box-shadow: 0 6px 24px rgba(0,0,0,.18);
}
