/* ============================================================
   仙花先森 · 商城前端 设计系统 v2
   风格与 share-h5 代付模板保持一致: 活力橙 / 圆角卡片 / 轻投影
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #FF5A1F;
  --primary-dark: #E04A0E;
  --primary-gradient: linear-gradient(135deg, #FF7A3C, #FF5A1F);
  --primary-light: #FFF0E8;
  --success: #07C160;
  --success-light: #E8F8EE;
  --warning: #FF9500;
  --danger: #FF3B30;
  --text: #1a1a1a;
  --text-secondary: #666;
  --text-light: #999;
  --bg: #f5f6f8;
  --white: #fff;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-lift: 0 6px 20px rgba(0, 0, 0, 0.10);
  --shadow-primary: 0 4px 14px rgba(255, 90, 31, 0.32);
  --border: 1px solid rgba(0, 0, 0, 0.04);
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
html { scrollbar-width: none; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  max-width: 414px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
#app { padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }

/* 金额等宽数字 */
.product-price, .detail-price, .order-amount, .pay-hero-amount,
.order-total-num, .my-order-amount, .pay-amount, .confirm-price {
  font-variant-numeric: tabular-nums;
  -webkit-font-feature-settings: 'tnum';
  font-feature-settings: 'tnum';
}

/* ============ 顶部导航 ============ */
.nav-bar {
  background: linear-gradient(160deg, #FF8A50 0%, #FF5A1F 88%);
  padding: 12px 14px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-logo { flex-shrink: 0; display: flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.nav-logo::before {
  content: ''; width: 5px; height: 18px; border-radius: 3px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.logo-text {
  font-size: 17px; font-weight: 800; color: #fff;
  white-space: nowrap; letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(160, 45, 5, 0.25);
}
.nav-search { display: flex; flex: 1; gap: 8px; min-width: 0; }
.search-box {
  flex: 1; display: flex; align-items: center;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 18px;
  height: 36px;
  padding: 0 6px 0 12px;
  min-width: 0;
  box-shadow: 0 2px 8px rgba(160, 45, 5, 0.12);
  transition: box-shadow 0.2s;
}
.search-box:focus-within { box-shadow: 0 2px 14px rgba(160, 45, 5, 0.28); }
.search-ico { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: #bbb; stroke-width: 2; stroke-linecap: round; }
.search-input {
  flex: 1; min-width: 0; height: 100%;
  border: none; background: transparent;
  padding: 0 8px; font-size: 13px; outline: none; color: var(--text);
}
.search-input::placeholder { color: #bbb; }
.search-input::-webkit-search-cancel-button { display: none; }
.search-clear {
  display: none; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  border: none; background: #eee; color: #999;
  font-size: 14px; line-height: 1; cursor: pointer; flex-shrink: 0;
}
.search-clear:active { background: #e0e0e0; }
.search-btn {
  background: #fff; border: none; color: var(--primary);
  padding: 0 16px; border-radius: 18px;
  font-size: 13px; font-weight: 700; cursor: pointer;
  box-shadow: 0 2px 8px rgba(160, 45, 5, 0.15);
  transition: transform 0.15s;
}
.search-btn:active { transform: scale(0.94); }
.nav-user-btn {
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff; padding: 6px 12px; border-radius: 16px;
  font-size: 12px; cursor: pointer;
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
  transition: background 0.2s;
}
.nav-user-btn svg { width: 15px; height: 15px; fill: none; stroke: #fff; stroke-width: 2; }
.nav-user-btn:active { background: rgba(255, 255, 255, 0.35); }

/* ============ 分类标签 ============ */
.cat-tabs {
  display: flex; gap: 8px;
  padding: 14px 14px 10px;
  overflow-x: auto;
  background: var(--white);
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  margin-top: -14px;
  position: relative; z-index: 2;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.03);
  -webkit-mask-image: linear-gradient(to right, #000 0%, #000 92%, transparent 100%);
  mask-image: linear-gradient(to right, #000 0%, #000 92%, transparent 100%);
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  padding: 7px 16px; border-radius: 20px;
  font-size: 13px; background: #f5f5f7;
  color: var(--text-secondary);
  cursor: pointer; flex-shrink: 0;
  transition: var(--transition); font-weight: 500;
}
.cat-tab:active { transform: scale(0.94); }
.cat-tab.active {
  background: var(--primary-gradient);
  color: #fff; font-weight: 600;
  box-shadow: 0 2px 10px rgba(255, 90, 31, 0.3);
}

/* ============ 商品网格 ============ */
.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px 12px 20px;
  animation: fadeIn 0.25s ease;
}
.plain-page {
  display: block !important;
  padding: 14px 14px 24px;
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* 首页横幅 */
.home-banner {
  grid-column: 1 / -1;
  background: var(--primary-gradient);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex; align-items: center; justify-content: space-between;
  color: #fff;
  box-shadow: var(--shadow-primary);
  position: relative;
  overflow: hidden;
  min-height: 88px;
}
.home-banner::before {
  content: ''; position: absolute; right: -20px; top: -40px;
  width: 130px; height: 130px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}
.home-banner::after {
  content: ''; position: absolute; right: 46px; bottom: -56px;
  width: 100px; height: 100px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.banner-title { font-size: 18px; font-weight: 800; letter-spacing: 0.5px; }
.banner-sub { font-size: 12px; opacity: 0.85; margin-top: 6px; }
.banner-deco {
  font-size: 44px; font-weight: 900; opacity: 0.28;
  transform: rotate(-12deg);
  position: relative; z-index: 1;
}

/* 商品卡片 */
.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
  border: var(--border);
  animation: cardIn 0.3s ease both;
}
.product-card:nth-child(2n) { animation-delay: 0.05s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.product-card:active { transform: scale(0.97); }
.product-img-wrap { position: relative; }
.product-img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  background: #fafafa; display: block;
  animation: imgIn 0.4s ease;
}
@keyframes imgIn { from { opacity: 0; } to { opacity: 1; } }
.product-img-ph {
  width: 100%; aspect-ratio: 1;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 140, 80, 0.10), transparent 50%),
    radial-gradient(circle at 75% 80%, rgba(255, 90, 31, 0.07), transparent 45%),
    #fafafa;
  position: relative;
}
.product-img-ph::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d5d5d5' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2L3 6v14a2 2 0 002 2h14a2 2 0 002-2V6l-3-4z'/%3E%3Cline x1='3' y1='6' x2='21' y2='6'/%3E%3Cpath d='M16 10a4 4 0 01-8 0'/%3E%3C/svg%3E") center/44px no-repeat;
  opacity: 0.6;
}
.product-tag {
  position: absolute; top: 8px; left: 8px;
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.96), rgba(255, 90, 31, 0.96));
  color: #fff; font-size: 10px; font-weight: 600;
  padding: 3px 9px; border-radius: 8px 8px 8px 2px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(255, 90, 31, 0.35);
}
.product-body { padding: 2px 0 0; }
.product-name {
  font-size: 13px; font-weight: 600;
  padding: 10px 10px 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  min-height: 40px;
}
.product-price-row {
  padding: 4px 10px 12px;
  display: flex; align-items: baseline; gap: 6px;
}
.product-price { font-size: 18px; font-weight: 800; color: var(--primary); }
.product-price .yen { font-size: 11px; font-weight: 700; margin-right: 1px; }
.product-orig { font-size: 12px; color: var(--text-light); text-decoration: line-through; }

/* ============ 骨架屏 ============ */
.sk-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  border: var(--border);
}
.sk { position: relative; overflow: hidden; background: #f0f0f2; }
.sk::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.sk-img { width: 100%; aspect-ratio: 1; }
.sk-body { padding: 10px; }
.sk-line { height: 13px; border-radius: 6px; margin-bottom: 8px; }
.sk-line.w80 { width: 80%; }
.sk-line.w50 { width: 50%; }
.sk-price { height: 20px; width: 40%; border-radius: 6px; }
.sk-order { height: 118px; border-radius: var(--radius); margin-bottom: 12px; }

/* ============ 空状态 / 搜索历史 ============ */
.empty-search {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px 30px;
}
.empty-ico {
  width: 64px; height: 64px; margin: 0 auto 16px;
  border-radius: 50%;
  background: #eceef1;
  display: flex; align-items: center; justify-content: center;
}
.empty-ico svg { width: 30px; height: 30px; fill: none; stroke: #b9bdc4; stroke-width: 2; stroke-linecap: round; }
.empty-ico.order svg { width: 34px; height: 34px; }
.empty-text { font-size: 15px; font-weight: 600; color: var(--text-secondary); }
.empty-sub { font-size: 13px; color: var(--text-light); margin-top: 6px; }
.empty-search .btn-primary { margin-top: 18px; }
.history-box { margin-top: 26px; text-align: left; }
.history-title {
  font-size: 12px; color: var(--text-light);
  margin-bottom: 10px; display: flex; align-items: center; gap: 5px;
}
.history-title::before { content: '⏱'; font-size: 12px; }
.history-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.history-chip {
  padding: 6px 14px; border-radius: 16px;
  background: var(--white); border: var(--border);
  font-size: 12px; color: var(--text-secondary);
  cursor: pointer; box-shadow: var(--shadow);
  transition: var(--transition);
}
.history-chip:active { transform: scale(0.94); background: var(--primary-light); color: var(--primary-dark); }

/* ============ 分类页 ============ */
.page-head { margin: 4px 2px 14px; }
.page-title { font-size: 19px; font-weight: 800; }
.page-desc { font-size: 12px; color: var(--text-light); margin-top: 5px; }
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
  border: var(--border);
  position: relative;
  animation: cardIn 0.3s ease both;
}
.cat-card:nth-child(2n) { animation-delay: 0.05s; }
.cat-card:active { transform: scale(0.96); }
.cat-card-icon {
  width: 52px; height: 52px;
  border-radius: 17px;
  background: var(--primary-gradient);
  color: #fff; font-size: 22px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px;
  box-shadow: 0 4px 12px rgba(255, 90, 31, 0.25);
}
.cat-card-name { font-size: 14px; font-weight: 600; text-align: center; }
.cat-card-arrow {
  position: absolute; right: 12px; top: 14px;
  font-size: 16px; color: #dcdce0;
}

/* ============ 订单页 ============ */
.orders-page { padding: 2px 0; }
.seg-control {
  display: flex;
  background: #eceef1;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 16px;
}
.seg-item {
  flex: 1; text-align: center;
  padding: 9px 0; border-radius: 9px;
  font-size: 14px; font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  transition: var(--transition);
}
.seg-item.active {
  background: var(--white);
  color: var(--primary);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}
.query-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 16px 16px;
  box-shadow: var(--shadow);
  border: var(--border);
}
.query-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.order-search-box { display: flex; flex-direction: column; gap: 10px; }
.order-input {
  width: 100%; height: 46px;
  border: 1.5px solid #e8e8e8; border-radius: 12px;
  padding: 0 14px; font-size: 14px;
  outline: none; background: #fafafa;
  transition: border-color 0.2s;
}
.order-input:focus { border-color: var(--primary); background: #fff; }

.order-badge {
  font-size: 12px; font-weight: 700;
  padding: 3px 10px; border-radius: 10px;
}
.order-badge.pending { color: var(--primary); background: var(--primary-light); }
.order-badge.paid { color: var(--success); background: var(--success-light); }
.order-badge.expired { color: var(--text-light); background: #f2f2f4; }

/* 我的订单卡片 */
.my-order-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: var(--border);
  margin-bottom: 12px;
  overflow: hidden;
  animation: cardIn 0.3s ease both;
}
.my-order-card:nth-child(2) { animation-delay: 0.05s; }
.my-order-card:nth-child(3) { animation-delay: 0.1s; }
.my-order-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid #f5f5f6;
}
.order-no {
  font-size: 12px; color: var(--text-light);
  font-family: ui-monospace, 'SF Mono', Consolas, monospace;
  letter-spacing: 0.3px;
}
.my-order-body {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
}
.my-order-img {
  width: 64px; height: 64px;
  border-radius: 10px; object-fit: cover;
  flex-shrink: 0; background: #fafafa;
}
.my-order-img.ph { background: #f0f0f2; position: relative; overflow: hidden; }
.my-order-info { flex: 1; min-width: 0; }
.my-order-name {
  font-size: 14px; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 1;
  -webkit-box-orient: vertical; overflow: hidden;
}
.my-order-meta { font-size: 12px; color: var(--text-light); margin-top: 5px; }
.my-order-time { font-size: 11px; color: #c2c2c6; margin-top: 3px; }
.my-order-amount {
  font-size: 16px; font-weight: 800; color: var(--text);
  flex-shrink: 0;
}
.my-order-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 10px 14px 14px;
}
.proxy-flag {
  margin: -4px 14px 12px;
  padding: 6px 10px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 8px;
  font-size: 12px;
  display: flex; align-items: center; gap: 5px;
}
.proxy-flag::before { content: '🤝'; }

/* 订单查询结果卡片 */
.order-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: var(--border);
  animation: cardIn 0.3s ease both;
}
.order-card-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid #f5f5f6;
}
.order-card-body { padding: 6px 16px 10px; }
.order-row {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 9px 0; font-size: 13.5px;
  border-bottom: 1px solid #f7f7f8;
}
.order-row:last-child { border: none; }
.order-row span:first-child { color: var(--text-light); flex-shrink: 0; }
.order-row span:last-child { text-align: right; word-break: break-all; }
.order-amount { font-weight: 700; color: var(--primary); }
.proxy-text { color: var(--primary); font-weight: 600; }
.order-sk-list { padding-top: 2px; }

/* ============ 底部Tab ============ */
.tab-bar {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 414px;
  display: flex;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.04), 0 -4px 20px rgba(0, 0, 0, 0.05);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.tab-item {
  flex: 1; text-align: center;
  padding: 8px 0 8px;
  font-size: 11px;
  color: var(--text-light);
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: color 0.2s;
}
.tab-item svg {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tab-item.active { color: var(--primary); font-weight: 600; }
.tab-item.active svg { transform: translateY(-1px) scale(1.08); }

/* ============ 弹窗 ============ */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn0 0.2s ease;
}
@keyframes fadeIn0 { from { opacity: 0; } to { opacity: 1; } }
.modal-content {
  background: var(--white);
  border-radius: 22px 22px 0 0;
  width: 100%;
  max-width: 414px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 18px 16px;
  position: relative;
  animation: slideUp 0.28s cubic-bezier(0.32, 0.72, 0.35, 1);
}
.modal-content::-webkit-scrollbar { display: none; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  font-size: 22px;
  color: var(--text-light);
  cursor: pointer;
  z-index: 10;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: #f2f2f4;
  line-height: 1;
  transition: background 0.15s;
}
.modal-close:active { background: #e6e6e9; }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; }

/* ============ 商品详情 ============ */
.detail-modal { padding-bottom: 0; }
.detail-gallery {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  border-radius: var(--radius);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.detail-gallery::-webkit-scrollbar { display: none; }
.detail-img {
  width: 100%; flex-shrink: 0;
  scroll-snap-align: center;
  aspect-ratio: 1; object-fit: cover;
  border-radius: var(--radius);
  display: block; background: #fafafa;
  animation: imgIn 0.4s ease;
}
.detail-img.ph {
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 140, 80, 0.10), transparent 55%),
    radial-gradient(circle at 75% 80%, rgba(255, 90, 31, 0.07), transparent 45%),
    #fafafa;
  position: relative;
}
.detail-img.ph::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d5d5d5' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2L3 6v14a2 2 0 002 2h14a2 2 0 002-2V6l-3-4z'/%3E%3Cline x1='3' y1='6' x2='21' y2='6'/%3E%3Cpath d='M16 10a4 4 0 01-8 0'/%3E%3C/svg%3E") center/60px no-repeat;
  opacity: 0.6;
}
.detail-info-card { padding: 16px 2px 4px; }
.detail-price-row {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.detail-price { font-size: 28px; font-weight: 800; color: var(--primary); }
.detail-price .yen { font-size: 15px; }
.detail-orig { font-size: 14px; color: var(--text-light); text-decoration: line-through; }
.detail-stock {
  font-size: 12px; color: var(--text-secondary);
  background: #f2f2f4; border-radius: 10px;
  padding: 3px 10px; margin-left: auto;
}
.detail-name { font-size: 17px; font-weight: 700; margin-top: 10px; line-height: 1.5; }
.detail-section { margin-top: 14px; }
.detail-section-title {
  font-size: 14px; font-weight: 700;
  padding-left: 9px; position: relative;
  margin-bottom: 10px;
}
.detail-section-title::before {
  content: ''; position: absolute; left: 0; top: 3px;
  width: 4px; height: 14px; border-radius: 2px;
  background: var(--primary-gradient);
}
.detail-desc {
  font-size: 14px; color: var(--text-secondary);
  line-height: 1.7;
  background: #fafafb;
  border-radius: var(--radius-sm);
  padding: 14px;
  white-space: pre-wrap; word-break: break-word;
}
.detail-buy-btn {
  position: sticky; bottom: 0;
  margin: 16px -16px 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, #fff 62%, rgba(255, 255, 255, 0));
  display: block;
}

/* ============ 下单弹窗 ============ */
.confirm-prod {
  display: flex; gap: 12px; align-items: center;
  background: #fafafb;
  border-radius: var(--radius-sm);
  padding: 12px;
}
.confirm-img {
  width: 64px; height: 64px;
  border-radius: 10px; object-fit: cover;
  flex-shrink: 0; background: #fafafa;
}
.confirm-img.ph { background: #f0f0f2; }
.confirm-info { flex: 1; min-width: 0; }
.confirm-name {
  font-size: 14px; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.confirm-price { font-size: 16px; font-weight: 800; color: var(--primary); margin-top: 6px; }
.qty-panel {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 4px 6px;
}
.qty-label { font-size: 15px; font-weight: 600; }
.qty-control { display: flex; align-items: center; gap: 14px; }
.qty-btn {
  width: 34px; height: 34px;
  border: 1.5px solid #e5e5e8; border-radius: 10px;
  background: #fff; font-size: 18px; cursor: pointer;
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  line-height: 1;
}
.qty-btn:active { background: var(--primary-light); border-color: var(--primary); color: var(--primary); transform: scale(0.92); }
.qty-val { font-size: 17px; font-weight: 700; min-width: 30px; text-align: center; font-variant-numeric: tabular-nums; }
.order-total {
  font-size: 14px; color: var(--text-secondary);
  margin: 14px 0 4px; text-align: right;
}
.order-total-num { font-size: 22px; font-weight: 800; color: var(--primary); }

/* ============ 支付弹窗 ============ */
.pay-modal { max-width: 414px; }
.pay-hero { text-align: center; padding: 8px 0 18px; }
.pay-hero-label { font-size: 13px; color: var(--text-light); }
.pay-hero-amount {
  font-size: 38px; font-weight: 800; color: var(--text);
  margin-top: 6px; letter-spacing: -0.5px;
}
.pay-order-info {
  background: #fafafb;
  border-radius: var(--radius-sm);
  padding: 4px 14px;
  margin-bottom: 18px;
}
.pay-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 0; font-size: 13.5px;
  border-bottom: 1px solid #f0f0f2;
}
.pay-row:last-child { border: none; }
.pay-row span:first-child { color: var(--text-light); flex-shrink: 0; }
.pay-row span:last-child { text-align: right; word-break: break-all; }
.pay-order-no {
  font-size: 12.5px; font-weight: 600;
  font-family: ui-monospace, 'SF Mono', Consolas, monospace;
}
.pay-methods { margin-bottom: 16px; }
.pay-method-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.pay-method-list { display: flex; flex-direction: column; gap: 10px; }
.pay-method-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px;
  border: 2px solid #eef0f2;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.pay-method-item input { display: none; }
.pay-method-item.checked { border-color: var(--primary); background: #fff8f5; }
.pm-ico {
  width: 34px; height: 34px; border-radius: 10px;
  color: #fff; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.pm-ico.wechat { background: #07C160; }
.pm-ico.alipay { background: #1677FF; }
.pm-ico.mock { background: #8a8f99; }
.pay-method-name { font-size: 15px; font-weight: 500; flex: 1; }
.pm-check {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid #dcdce0;
  flex-shrink: 0;
  transition: var(--transition);
  position: relative;
}
.pay-method-item.checked .pm-check {
  border-color: var(--primary);
  background: var(--primary);
}
.pay-method-item.checked .pm-check::after {
  content: ''; position: absolute;
  left: 6px; top: 3px;
  width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.pay-btn { margin-bottom: 8px; }
.pay-btn:disabled { opacity: 0.6; }
.pay-tip { text-align: center; font-size: 12px; color: var(--text-light); }

/* ============ 支付成功 ============ */
.pay-success-modal {
  max-width: 360px;
  text-align: center;
  padding: 36px 24px 28px;
  align-self: center;
  border-radius: 22px;
}
.pay-success-icon {
  width: 68px; height: 68px;
  border-radius: 50%;
  background: var(--success);
  margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(7, 193, 96, 0.35);
  animation: popIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }
.pay-success-icon svg {
  width: 34px; height: 34px;
  fill: none; stroke: #fff; stroke-width: 3;
  stroke-linecap: round; stroke-linejoin: round;
}
.pay-success-icon svg path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: drawCheck 0.4s 0.25s ease forwards; }
@keyframes drawCheck { to { stroke-dashoffset: 0; } }
.pay-success-title { font-size: 20px; font-weight: 700; margin-bottom: 18px; }
.pay-success-info {
  background: #fafafb;
  border-radius: var(--radius-sm);
  padding: 4px 16px;
  margin-bottom: 20px;
  text-align: left;
}

/* ============ 按钮 ============ */
.btn-primary {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 24px;
  background: var(--primary-gradient);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 16px;
  box-shadow: var(--shadow-primary);
  transition: transform 0.15s ease, filter 0.15s ease;
  letter-spacing: 1px;
}
.btn-primary:active { transform: scale(0.97); filter: brightness(0.95); }
.btn-primary:disabled { opacity: 0.55; box-shadow: none; }
.btn-sm { height: 40px; width: auto; padding: 0 26px; font-size: 14px; margin: 18px auto 0; display: inline-flex; align-items: center; }
.btn-ghost {
  height: 34px; padding: 0 16px;
  border: 1px solid #e2e2e6; border-radius: 17px;
  background: #fff; color: var(--text-secondary);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: var(--transition);
}
.btn-ghost:active { background: #f4f4f6; transform: scale(0.96); }
.btn-mini-primary {
  height: 34px; padding: 0 18px;
  border: none; border-radius: 17px;
  background: var(--primary-gradient);
  color: #fff; font-size: 13px; font-weight: 600;
  cursor: pointer; box-shadow: 0 2px 10px rgba(255, 90, 31, 0.3);
  transition: transform 0.15s ease;
}
.btn-mini-primary:active { transform: scale(0.95); }

/* ============ 代付模板选择(secret-gate) ============ */
.proxy-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; text-align: center; }
.tpl-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.tpl-item {
  border: 2px solid #eef0f2;
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.tpl-item:active { transform: scale(0.96); }
.tpl-item.selected { border-color: var(--primary); background: var(--primary-light); }
.tpl-item-name { display: flex; align-items: center; gap: 6px; }
.tpl-name { font-size: 13px; font-weight: 600; }
.tpl-hot {
  font-size: 10px; font-weight: 700;
  color: #fff; background: var(--primary-gradient);
  padding: 1px 6px; border-radius: 6px 6px 6px 1px;
}
.tpl-check {
  position: absolute; top: 7px; right: 7px;
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid #dcdce0;
  background: #fff;
  transition: var(--transition);
}
.tpl-item.selected .tpl-check { border-color: var(--primary); background: var(--primary); }
.tpl-item.selected .tpl-check::after {
  content: ''; position: absolute;
  left: 5px; top: 2px;
  width: 4px; height: 8px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* 迷你模板预览卡片 */
.tpl-mini {
  width: 108px; height: 82px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.tpl-mini-head {
  height: 24px; flex-shrink: 0;
  display: flex; align-items: center;
  padding: 0 8px; gap: 5px;
}
.tpl-mini-avatar { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.tpl-mini-line { height: 3px; border-radius: 2px; display: inline-block; }
.tpl-mini-line.gray { background: #e2e2e6; }
.tpl-mini-body {
  flex: 1;
  display: flex; flex-direction: column;
  justify-content: center;
  padding: 0 9px; gap: 5px;
}
.tpl-mini-price {
  width: 26px; height: 7px;
  border-radius: 2px;
  background: #ffb59d;
}
.tpl-mini-btn {
  height: 14px; flex-shrink: 0;
  margin: 0 8px 7px;
  border-radius: 7px;
}
.proxy-result { text-align: center; }
.proxy-result h2 { font-size: 19px; margin: 14px 0; color: var(--success); }
.proxy-card-preview {
  border-radius: 12px; padding: 20px; margin: 16px 0; text-align: center;
}
.proxy-card-preview .card-prod-name { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.proxy-card-preview .card-amount { font-size: 28px; font-weight: 700; margin: 12px 0; }
.proxy-share-btn {
  display: block; width: 100%; height: 44px; line-height: 44px;
  border: none; border-radius: 22px;
  color: #fff; font-size: 16px; font-weight: 600;
  cursor: pointer; margin-top: 8px;
}
.order-info {
  background: #fafafb; border-radius: var(--radius-sm);
  padding: 12px; margin-bottom: 12px;
}
.order-info-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14px; }
.order-info-row:last-child { margin-bottom: 0; }

/* ============ 个人中心 ============ */
.profile-page { padding: 2px 0; }
.profile-header {
  background: var(--primary-gradient);
  border-radius: var(--radius-lg);
  padding: 26px 20px;
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-primary);
  position: relative;
  overflow: hidden;
}
.profile-header::before {
  content: ''; position: absolute; right: -30px; top: -46px;
  width: 130px; height: 130px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}
.profile-header.guest { background: linear-gradient(135deg, #b9bcc4, #9aa0aa); box-shadow: 0 4px 14px rgba(120, 128, 140, 0.3); }
.profile-avatar {
  width: 62px; height: 62px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  border: 2px solid rgba(255, 255, 255, 0.55);
  color: #fff; font-size: 24px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  position: relative; z-index: 1;
}
.profile-avatar svg { width: 30px; height: 30px; fill: none; stroke: #fff; stroke-width: 2; }
.profile-info { flex: 1; min-width: 0; position: relative; z-index: 1; }
.profile-name { color: #fff; font-size: 19px; font-weight: 700; }
.profile-phone { color: rgba(255, 255, 255, 0.78); font-size: 12.5px; margin-top: 5px; }
.profile-vip {
  width: 26px; height: 26px;
  fill: rgba(255, 255, 255, 0.85);
  position: relative; z-index: 1;
}
.profile-menu {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 16px;
  border: var(--border);
}
.profile-menu-item {
  display: flex; align-items: center;
  padding: 15px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f5f5f6;
  transition: background 0.15s;
}
.profile-menu-item:last-child { border: none; }
.profile-menu-item:active { background: #fafafb; }
.menu-ico {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-right: 12px; flex-shrink: 0;
}
.menu-ico svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.menu-ico.orders { background: var(--primary-gradient); }
.menu-ico.cat { background: linear-gradient(135deg, #4CA6FF, #2B7DE9); }
.menu-ico.home { background: linear-gradient(135deg, #34C77B, #07C160); }
.menu-text { flex: 1; font-size: 15px; font-weight: 500; }
.menu-arrow { font-size: 20px; color: #cfcfd4; }
.profile-logout-btn {
  width: 100%; height: 46px;
  border: none; border-radius: 23px;
  background: #fff; color: var(--danger);
  font-size: 15px; font-weight: 600;
  cursor: pointer; margin-top: 4px;
  border: 1px solid #ffd9d6;
  box-shadow: var(--shadow);
  transition: background 0.15s;
}
.profile-logout-btn:active { background: #fff5f4; }

/* ============ 登录注册弹窗 ============ */
.auth-modal { padding: 24px 20px 30px; }
.auth-header { text-align: center; margin-bottom: 22px; }
.auth-logo {
  font-size: 25px; font-weight: 800;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 1px;
}
.auth-subtitle { font-size: 13px; color: var(--text-light); margin-top: 8px; }
.auth-tabs {
  display: flex; margin-bottom: 22px;
  background: #eceef1; border-radius: 12px; padding: 4px;
}
.auth-tab {
  flex: 1; text-align: center;
  padding: 9px 0; font-size: 14px; font-weight: 600;
  color: var(--text-light); cursor: pointer;
  border-radius: 9px;
  transition: var(--transition);
}
.auth-tab.active {
  background: var(--white);
  color: var(--primary);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}
.auth-form { display: flex; flex-direction: column; gap: 15px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field label { font-size: 13px; color: var(--text-light); font-weight: 500; }
.auth-field input {
  height: 46px;
  border: 1.5px solid #e8e8e8; border-radius: 12px;
  padding: 0 14px; font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
  background: #fafafa;
}
.auth-field input:focus { border-color: var(--primary); background: #fff; }
#authSubmit { margin-top: 8px; }
#authSubmit:disabled { opacity: 0.6; cursor: not-allowed; }

/* ============ Toast ============ */
.app-toast {
  position: fixed;
  left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(8px);
  background: rgba(20, 20, 24, 0.88);
  color: #fff;
  padding: 10px 22px;
  border-radius: 22px;
  font-size: 13.5px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  max-width: 82vw;
  text-align: center;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}
.app-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.app-toast.ok { background: rgba(7, 150, 90, 0.94); }
.app-toast.err { background: rgba(210, 50, 40, 0.94); }

/* ============ 通用 ============ */
.loading {
  text-align: center; padding: 44px;
  color: var(--text-light); font-size: 14px;
  grid-column: 1 / -1;
}
.loading::after {
  content: ''; display: block; width: 26px; height: 26px;
  margin: 14px auto 0;
  border: 3px solid #e8e8ea; border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 56px 20px; color: var(--text-light); grid-column: 1 / -1; }
