:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --border: #e6e6e6;
  --text: #111111;
  --muted: #666666;
  --light: #999999;
  --alipay: #1677ff;
  --alipay-bg: #f0f6ff;
  --success: #15803d;
  --warn: #b45309;
  --danger: #dc2626;
  --radius: 8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: 14px;
}

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  flex-shrink: 0;
}

/* =================== PC 前端专属结构 (.pc-shell) =================== */
.pc-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.pc-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.pc-header-inner {
  max-width: 1040px;
  margin: 0 auto;
  height: 62px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.brand-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 11px;
  color: var(--muted);
}

.pc-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pc-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid transparent;
  padding: 6px 13px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s;
}

.pc-nav-btn:hover {
  color: var(--text);
  background: #f3f3f3;
}

.pc-nav-btn.active {
  color: var(--text);
  font-weight: 500;
  border-color: var(--border);
  background: var(--bg);
}

.pc-main {
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 64px;
  flex: 1;
}

.pc-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.pc-footer {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  text-align: center;
  font-size: 12px;
  color: var(--light);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* =================== 手机前端专属结构 (.mobile-shell) =================== */
.mobile-shell {
  min-height: 100vh;
  padding-bottom: 68px;
  display: flex;
  flex-direction: column;
}

.m-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
}

.m-main {
  padding: 14px 14px 28px;
  flex: 1;
}

.m-tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 58px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 30;
}

.m-tab-item {
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
}

.m-tab-item.active {
  color: var(--text);
  font-weight: 600;
}

/* =================== 轻量化通用组件与商品图片 =================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.product-card-pc {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.product-card-pc:hover {
  border-color: #999;
}

.svg-box {
  background: #f5f5f4;
  border-radius: 6px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  overflow: hidden;
  position: relative;
}

.svg-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.product-card-pc:hover .svg-box img {
  transform: scale(1.03);
}

.view-detail-hint {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: rgba(17, 17, 17, 0.78);
  color: #fff;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.m-product-card {
  display: flex;
  gap: 14px;
  padding: 14px;
  margin-bottom: 12px;
  align-items: center;
  cursor: pointer;
}

.m-svg-box {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  background: #f5f5f4;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.m-svg-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 商品详情页大图与相册 */
.detail-main-photo {
  background: #f5f5f4;
  border: 1px solid var(--border);
  border-radius: 8px;
  height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  cursor: zoom-in;
}

.detail-main-photo.mobile {
  height: 260px;
}

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

.thumb-strip {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.thumb-item {
  width: 68px;
  height: 54px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: #f5f5f4;
  flex-shrink: 0;
  opacity: 0.7;
  transition: all 0.15s;
}

.thumb-item.active {
  border-color: var(--text);
  opacity: 1;
}

.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-gallery-showcase img {
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  background: #f5f5f4;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
  cursor: zoom-in;
}

/* 高清大图灯箱 Lightbox */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.86);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 150;
}

.lightbox-img-wrap {
  max-width: 920px;
  max-height: 78vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img-wrap img {
  max-width: 100%;
  max-height: 76vh;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.price {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.price-old {
  font-size: 12px;
  color: var(--light);
  text-decoration: line-through;
  margin-left: 6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 500;
  transition: opacity 0.15s, background 0.15s;
}

.btn:hover {
  background: #f5f5f5;
}

.btn-primary {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

.btn-primary:hover {
  background: #2b2b2b;
}

.btn-alipay {
  background: var(--alipay);
  color: #fff;
  border-color: var(--alipay);
}

.btn-alipay:hover {
  background: #0958d9;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: #f7f7f7;
  color: var(--muted);
}

.badge-paid {
  background: #ecfdf5;
  color: var(--success);
  border-color: #bbf7d0;
}

.badge-pending {
  background: #fffbeb;
  color: var(--warn);
  border-color: #fde68a;
}

.input-group {
  margin-bottom: 12px;
}

.input-group label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  outline: none;
}

.input:focus {
  border-color: var(--text);
}

.specs-list {
  margin: 12px 0;
  border-top: 1px solid var(--border);
  font-size: 12px;
}

.specs-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #f2f2f2;
  color: var(--muted);
}

.specs-row span:last-child {
  color: var(--text);
}

/* 弹窗 & 支付宝极简收银台 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.modal-box {
  background: var(--surface);
  border-radius: 10px;
  max-width: 440px;
  width: 100%;
  padding: 22px;
  border: 1px solid var(--border);
}

.qr-frame {
  width: 168px;
  height: 168px;
  margin: 12px auto;
  padding: 10px;
  border: 1px solid #cfe2ff;
  background: var(--alipay-bg);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast {
  position: fixed;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%);
  background: #111;
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  z-index: 200;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
