/* ===== 基础 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: #1f2937;
  background: #f3f4f6;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: 80px;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: 14px; }

/* ===== 语言切换 ===== */
.lang-switch { position: absolute; top: 16px; right: 16px; display: flex; gap: 4px; z-index: 10; }
.lang-btn {
  background: rgba(255,255,255,0.2); color: #fff; padding: 4px 10px; border-radius: 6px;
  font-size: 12px; font-weight: 600; border: 1px solid rgba(255,255,255,0.3);
}
.lang-btn.active { background: #fff; color: #4f46e5; }

.lang-mini { display: flex; gap: 2px; }
.lang-mini-btn {
  background: rgba(0,0,0,0.06); color: #6b7280; padding: 4px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 600;
}
.topbar.admin .lang-mini-btn { background: #374151; color: #cbd5e1; }
.lang-mini-btn.active { background: #4f46e5; color: #fff; }
.topbar.admin .lang-mini-btn.active { background: #818cf8; color: #1f2937; }

/* ===== 筛选面板 ===== */
.filter-toggle {
  background: #fff; border: 1px solid #e5e7eb; padding: 10px 14px; border-radius: 10px;
  font-size: 13px; color: #4f46e5; font-weight: 600; position: relative;
}
.filter-toggle:active { background: #eef2ff; }
.filter-badge {
  display: inline-block; background: #4f46e5; color: #fff; font-size: 10px;
  min-width: 18px; height: 18px; line-height: 18px; text-align: center; border-radius: 9px;
  padding: 0 5px; margin-left: 4px; font-weight: 700;
}
.filter-panel {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 12px 14px; margin-bottom: 12px; box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.filter-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; flex-wrap: wrap; }
.filter-label { font-size: 13px; color: #6b7280; font-weight: 500; min-width: 80px; }
.filter-row select {
  flex: 1; min-width: 120px; padding: 8px 10px; border: 1px solid #e5e7eb; border-radius: 8px;
  background: #fff; outline: none; font-size: 13px;
}
.chip-group { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.chip-group .chip { padding: 4px 10px; font-size: 12px; }
.range-input { display: flex; align-items: center; gap: 6px; flex: 1; }
.range-input input {
  width: 90px; padding: 6px 8px; border: 1px solid #e5e7eb; border-radius: 6px;
  font-size: 13px; outline: none;
}
.range-input input:focus { border-color: #4f46e5; }
.range-input span { color: #9ca3af; }

/* ===== 木种标签 ===== */
.wood-badge {
  display: inline-block; background: #fef3c7; color: #b45309; padding: 2px 8px;
  border-radius: 4px; font-size: 12px; font-weight: 600; margin-bottom: 6px;
}
.card-wood {
  display: inline-block; background: #fef3c7; color: #b45309; padding: 1px 6px;
  border-radius: 4px; font-size: 10px; font-weight: 600; margin: 2px 0;
}
.drawer-item-wood {
  display: inline-block; background: #fef3c7; color: #b45309; padding: 1px 4px;
  border-radius: 3px; font-size: 10px; margin: 1px 0;
}
.item-mini .muted.small { font-size: 10px; }


.login-page {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 24px 20px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}
.brand { text-align: center; margin-bottom: 20px; }
.brand-logo { font-size: 48px; margin-bottom: 4px; }
.brand h1 { font-size: 22px; color: #1f2937; }
.brand .subtitle { color: #6b7280; font-size: 13px; margin-top: 4px; }

.tabs { display: flex; border-bottom: 2px solid #e5e7eb; margin-bottom: 20px; }
.tab { flex: 1; padding: 12px; color: #6b7280; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab.active { color: #4f46e5; border-color: #4f46e5; }

.form { display: none; flex-direction: column; gap: 12px; }
.form.active { display: flex; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #4b5563; font-weight: 500; }
.form input { padding: 12px 14px; border: 1.5px solid #e5e7eb; border-radius: 10px; outline: none; transition: border-color 0.2s; }
.form input:focus { border-color: #4f46e5; }
.form-tip { color: #6b7280; font-size: 12px; text-align: center; margin-top: 8px; }
.form-tip strong { color: #4f46e5; }

.btn-primary {
  background: #4f46e5; color: #fff; padding: 12px 20px; border-radius: 10px; font-weight: 600;
  transition: all 0.2s;
}
.btn-primary:active { transform: scale(0.98); }
.btn-secondary {
  background: #f3f4f6; color: #1f2937; padding: 10px 16px; border-radius: 10px; font-weight: 500;
}
.btn-danger {
  background: #fee2e2; color: #b91c1c; padding: 10px 16px; border-radius: 10px; font-weight: 500;
}
.btn-block { width: 100%; padding: 14px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

.msg { text-align: center; font-size: 13px; min-height: 18px; margin-top: 8px; }
.msg.error { color: #dc2626; }
.msg.ok { color: #059669; }

/* ===== 顶部条 ===== */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: #fff; padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  padding-top: max(10px, env(safe-area-inset-top));
}
.topbar.admin { background: #1f2937; color: #fff; }
.topbar.admin .brand { color: #fff; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 8px; }
.logo { font-size: 24px; }
.brand { font-weight: 700; font-size: 16px; }
.me-name { font-size: 13px; color: #6b7280; }
.topbar.admin .me-name { color: #cbd5e1; }
.iconbtn {
  background: #f3f4f6; padding: 6px 10px; border-radius: 8px; font-size: 18px; position: relative;
}
.topbar.admin .iconbtn { background: #374151; color: #fff; }
.cart-count {
  position: absolute; top: -4px; right: -4px; background: #ef4444; color: #fff;
  font-size: 11px; min-width: 18px; height: 18px; line-height: 18px; text-align: center;
  border-radius: 9px; padding: 0 5px; font-weight: 700;
}

/* ===== Tabs 导航 ===== */
.tabs-nav {
  position: sticky; top: 44px; z-index: 9;
  background: #fff; display: flex; padding: 0 8px;
  border-bottom: 1px solid #e5e7eb;
}
.tabs-nav.admin { top: 50px; background: #1f2937; }
.tabnav {
  flex: 1; padding: 12px 4px; color: #6b7280; font-size: 13px; font-weight: 500;
  border-bottom: 2px solid transparent; transition: all 0.2s;
}
.tabs-nav.admin .tabnav { color: #9ca3af; }
.tabnav.active { color: #4f46e5; border-color: #4f46e5; }
.tabs-nav.admin .tabnav.active { color: #fff; border-color: #818cf8; }

/* ===== 视图 ===== */
main { padding: 16px; max-width: 1440px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; }
.admin-main { max-width: 1200px; margin: 0 auto; }

/* ===== 筛选栏 ===== */
.filter-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.filter-bar input, .filter-bar select {
  flex: 1; padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 10px; background: #fff; outline: none;
}
.chip {
  padding: 6px 14px; border-radius: 16px; background: #fff; border: 1px solid #e5e7eb;
  color: #6b7280; font-size: 13px; transition: all 0.2s;
}
.chip.active { background: #4f46e5; color: #fff; border-color: #4f46e5; }

/* ===== 产品网格 ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.card {
  background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06); transition: all 0.2s; cursor: pointer;
  border: 2px solid transparent;
}
.card:active { transform: scale(0.98); }
.card.selected { border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79,70,229,0.15); }
.card-img { aspect-ratio: 3/4; background: #f3f4f6; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.card-body { padding: 8px 10px 10px; }
.card-code { font-size: 12px; font-weight: 600; color: #4f46e5; }
.card-size { font-size: 11px; color: #6b7280; margin: 2px 0 6px; }
.card-btn {
  width: 100%; padding: 6px 0; border-radius: 6px; background: #eef2ff; color: #4f46e5;
  font-size: 12px; font-weight: 600;
}
.card.selected .card-btn { background: #4f46e5; color: #fff; }
.card.status-sold { opacity: 0.55; }
.card.status-sold::after {
  content: '已售'; position: absolute; top: 8px; right: 8px; background: #6b7280; color: #fff;
  padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600;
}
.card { position: relative; }
.card.status-hidden::after {
  content: '下架'; position: absolute; top: 8px; right: 8px; background: #ef4444; color: #fff;
  padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600;
}
.card-status { font-size: 11px; color: #6b7280; margin-bottom: 4px; }
.card-actions { display: flex; gap: 4px; }
.card-actions button { flex: 1; font-size: 11px; }

.empty { padding: 40px 16px; text-align: center; color: #9ca3af; font-size: 14px; }
.loading { padding: 30px; text-align: center; color: #9ca3af; }
.muted { color: #6b7280; }
.small { font-size: 12px; }

/* ===== 抽屉 ===== */
.drawer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  background: #fff; border-radius: 20px 20px 0 0; box-shadow: 0 -10px 30px rgba(0,0,0,0.15);
  transform: translateY(100%); transition: transform 0.3s; max-height: 70vh; display: flex; flex-direction: column;
}
.drawer.open { transform: translateY(0); }
.drawer-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 19; opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.drawer-mask.open { opacity: 1; pointer-events: all; }
.drawer-header {
  display: flex; justify-content: space-between; align-items: center; padding: 16px;
  border-bottom: 1px solid #e5e7eb;
}
.drawer-list { flex: 1; overflow-y: auto; padding: 8px 12px; }
.drawer-item { display: flex; gap: 10px; padding: 8px; border-bottom: 1px solid #f3f4f6; align-items: center; }
.drawer-item img { width: 50px; height: 50px; object-fit: cover; border-radius: 6px; }
.drawer-item-info { flex: 1; }
.drawer-item-code { font-weight: 600; font-size: 13px; }
.drawer-item-size { font-size: 11px; color: #6b7280; }
.drawer-footer { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid #e5e7eb; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.drawer-footer button { flex: 1; padding: 14px; }

/* ===== 结算预览 ===== */
.checkout-summary { background: #f8fafc; border: 1px solid #dbe3f0; border-radius: 12px; margin: 14px 0 16px; overflow: hidden; }
.checkout-summary-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: #eef2ff; color: #3730a3; font-weight: 700; }
.checkout-summary-head strong { font-size: 12px; background: #4f46e5; color: #fff; padding: 3px 8px; border-radius: 999px; }
.checkout-items { max-height: 172px; overflow-y: auto; padding: 4px 12px; }
.checkout-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #e5e7eb; }
.checkout-item:last-child { border-bottom: none; }
.checkout-item img { width: 44px; height: 44px; border-radius: 7px; object-fit: cover; background: #e5e7eb; }
.checkout-item div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.checkout-item strong { color: #3730a3; font-size: 12px; }
.checkout-item span { color: #64748b; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checkout-lock-note { margin: 0; padding: 9px 12px; border-top: 1px solid #dbe3f0; color: #92400e; background: #fffbeb; font-size: 12px; line-height: 1.55; }
button:disabled { opacity: .58; cursor: not-allowed; transform: none !important; }

/* ===== 对话框 ===== */
.dlg-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 30;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.dlg {
  background: #fff; border-radius: 16px; padding: 20px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
  position: relative;
}
.dlg-wide { max-width: 720px; }
.dlg h3 { margin-bottom: 12px; }
.dlg-close {
  position: absolute; top: 12px; right: 12px; background: #f3f4f6; width: 32px; height: 32px;
  border-radius: 50%; font-size: 16px; display: flex; align-items: center; justify-content: center;
}
.dlg-actions { display: flex; gap: 8px; margin-top: 16px; justify-content: flex-end; }
.dlg-actions button, .dlg-actions a { font-size: 14px; }
.dlg-tip { color: #6b7280; font-size: 13px; margin-bottom: 12px; }
.dlg form { display: flex; flex-direction: column; gap: 10px; }
.dlg form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #4b5563; }
.dlg form input, .dlg form textarea {
  padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 8px; outline: none; resize: vertical;
}
.dlg form input:focus, .dlg form textarea:focus { border-color: #4f46e5; }
.dlg img { max-width: 100%; border-radius: 8px; margin-bottom: 12px; }

/* 详情对话框 */
.dlg-detail-body { display: flex; flex-direction: column; gap: 12px; }
.dlg-detail-body img { max-height: 60vh; object-fit: contain; }
#dlg-detail .dlg-wide { max-width: 980px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 20px; align-items: start; }
#dlg-detail .carousel { height: min(72vh, 680px); aspect-ratio: auto; margin-bottom: 0; }
#dlg-detail .dlg-detail-body { padding: 4px 4px 4px 0; }
.detail-table { width: 100%; border-collapse: collapse; }

/* ===== Carousel ===== */
.carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  background: #f3f4f6;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  cursor: grab;
}
.carousel:active { cursor: grabbing; }
.carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.3s ease;
  will-change: transform;
}
.carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
}
.carousel-slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  cursor: zoom-in;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.4);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.2s;
}
.carousel:hover .carousel-btn,
.carousel:focus-within .carousel-btn { opacity: 1; }
.carousel-prev { left: 8px; }
.carousel-next { right: 8px; }
.carousel-dots {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
}
.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  transition: all 0.2s;
  cursor: pointer;
}
.carousel-dot.active { background: #fff; width: 22px; border-radius: 4px; }
.carousel-label {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  z-index: 2;
}
.detail-table th, .detail-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid #e5e7eb; }
.detail-table th { background: #f9fafb; color: #6b7280; font-weight: 500; font-size: 13px; width: 40%; }

/* 订单详情 */
.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-bottom: 16px;
  background: #f9fafb; padding: 12px; border-radius: 8px; font-size: 13px;
}
.detail-grid > div { word-break: break-all; }
.items-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px;
}
.item-mini { text-align: center; background: #f9fafb; padding: 6px; border-radius: 6px; }
.item-mini img { width: 100%; aspect-ratio: 3/4; object-fit: contain; border-radius: 4px; margin: 0 0 4px; }
.item-mini .muted { font-size: 11px; }

/* ===== 订单卡 ===== */
.order-card {
  background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06); border-left: 4px solid #e5e7eb;
}
.order-card.status-pending { border-left-color: #f59e0b; }
.order-card.status-confirmed { border-left-color: #10b981; }
.order-card.status-rejected { border-left-color: #ef4444; }
.order-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.order-id { font-weight: 700; font-size: 14px; }
.order-status { font-size: 12px; padding: 2px 8px; border-radius: 4px; background: #f3f4f6; }
.status-confirmed .order-status { background: #d1fae5; color: #047857; }
.status-rejected .order-status { background: #fee2e2; color: #b91c1c; }
.status-pending .order-status { background: #fef3c7; color: #b45309; }
.order-time { color: #6b7280; font-size: 12px; margin-bottom: 10px; }
.order-items { display: flex; gap: 8px; overflow-x: auto; padding: 6px 0; }
.order-items-compact { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 8px; }
.order-items-compact .muted { width: 100%; margin-top: 4px; }
.order-item { flex: 0 0 auto; width: 80px; text-align: center; }
.order-item img { width: 80px; height: 60px; object-fit: cover; border-radius: 4px; display: block; }
.order-item div { font-size: 11px; }
.order-ship { font-size: 13px; padding: 8px 0; border-top: 1px solid #f3f4f6; }
.order-ship > div + div { margin-top: 2px; }
.order-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #f3f4f6; }
.order-foot { margin-top: 8px; padding: 6px 10px; border-radius: 6px; font-size: 13px; }
.order-foot.ok { background: #d1fae5; color: #047857; }
.order-foot.err { background: #fee2e2; color: #b91c1c; }
.order-foot.warn { background: #fed7aa; color: #9a3412; }
.order-foot.shipped { background: #ddd6fe; color: #5b21b6; }
.order-foot.lock {
  background: linear-gradient(90deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e; display: flex; align-items: center; gap: 6px; font-weight: 600;
  border: 1px solid #fcd34d;
}
.order-countdown {
  display: inline-block; font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 15px; font-weight: 700; color: #b91c1c;
  background: rgba(255,255,255,0.7); padding: 1px 8px; border-radius: 4px; margin-left: 4px;
}
.order-countdown.expired { color: #6b7280; }
.order-foot { background: #fef3c7; color: #b45309; }

/* ===== 表单块 ===== */
.form-block { background: #fff; border-radius: 12px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.form-block label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; font-size: 13px; color: #4b5563; }
.form-block input, .form-block textarea, .form-block select {
  padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 8px; outline: none;
}
.form-block input:focus, .form-block textarea:focus { border-color: #4f46e5; }

/* ===== 数据表格 ===== */
.data-table { width: 100%; background: #fff; border-radius: 12px; overflow: hidden; border-collapse: collapse; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f3f4f6; font-size: 13px; }
.data-table th { background: #f9fafb; color: #6b7280; font-weight: 600; }
.data-table code { background: #eef2ff; color: #4f46e5; padding: 2px 6px; border-radius: 4px; font-size: 12px; }
.badge { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 11px; background: #f3f4f6; color: #6b7280; }
.badge.new { background: #dbeafe; color: #1d4ed8; }
.badge.used { background: #f3f4f6; color: #9ca3af; }

/* 邀请码生成 */
.invite-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.invite-form label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.invite-form input { padding: 8px 10px; border: 1px solid #e5e7eb; border-radius: 6px; }
.invite-form button { grid-column: span 2; }
.new-invites { margin-top: 12px; }
.success-block { background: #ecfdf5; border: 1px solid #6ee7b7; border-radius: 8px; padding: 12px; }
.codes-line { margin: 8px 0; display: flex; flex-wrap: wrap; gap: 4px; }
.codes-line code { background: #fff; color: #047857; padding: 4px 8px; border-radius: 4px; font-size: 12px; }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%);
  background: #1f2937; color: #fff; padding: 10px 20px; border-radius: 8px; font-size: 14px;
  opacity: 0; transition: opacity 0.2s, bottom 0.2s; z-index: 100; pointer-events: none;
  max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; bottom: 110px; }
.toast.error { background: #b91c1c; }
.toast.ok { background: #047857; }

/* ===== 图片放大预览 ===== */
.image-zoom-mask { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(2, 6, 23, .92); }
.image-zoom-mask img { display: block; max-width: 100%; max-height: 94vh; border-radius: 10px; object-fit: contain; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.image-zoom-mask .image-zoom-close { position: fixed; top: 18px; right: 18px; background: rgba(255,255,255,.9); z-index: 1; }

/* ===== PC 端 ===== */
@media (min-width: 720px) {
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
  body { font-size: 15px; }
  .tabs-nav { padding: 0 20px; }
  .tabnav { font-size: 14px; }
  .drawer { left: auto; right: 24px; bottom: 24px; width: 380px; max-height: 80vh; border-radius: 16px; }
}


@media (max-width: 719px) {
  main { padding: 10px; }
  .topbar { padding-left: 12px; padding-right: 12px; }
  .topbar-left { min-width: 0; }
  .brand { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .me-name { display: none; }
  #dlg-detail .dlg-wide { display: block; padding: 14px; }
  #dlg-detail .carousel { height: min(62vh, 520px); margin: 34px 0 14px; }
  #dlg-detail .dlg-detail-body { padding: 0; }
  .dlg-actions { position: sticky; bottom: -20px; padding: 12px 0 0; background: #fff; }
  .dlg-actions button { flex: 1; }
  .order-actions-customer button { width: 100%; }
}
