:root {
  --topbar-bg: #1c2431;
  --menu-bg: #e9ebef;
  --card-bg: #ffffff;
  --primary: #ff5a26;
  --primary-2: #ff8f1f;
  --cart: #ffb000;
  --price: #ff3d00;
  --green: #34c759;
  --green-sel-bg: #d9f7e3;
  --green-sel-border: #34c759;
  --purple: #8a6fd6;
  --text: #1f2733;
  --text-sub: #8a94a3;
  --blue: #2f6bff;
  --radius: 14px;
  --shadow: 0 6px 20px rgba(20, 30, 50, 0.08);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: #0d1117;
}

body {
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

.app {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #3a5bb0 0%, #4f7fd0 35%, #7aa6e8 70%, #b9d8f5 100%);
  overflow: hidden;
}

.ic { width: 22px; height: 22px; fill: currentColor; flex: none; }

/* ===== 顶部工具栏 ===== */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--topbar-bg);
  color: #cfd6e2;
}

.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex: none;
  background: conic-gradient(from 210deg, #4285f4, #34a853, #fbbc05, #ea4335, #4285f4);
  position: relative;
}
.brand-logo::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--topbar-bg);
}

.search-box {
  flex: 1;
  height: 30px;
  border-radius: 16px;
  background: #2c3647;
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: #7e8aa0;
}
.search-box .ic { width: 18px; height: 18px; }

.help-ic { color: #9aa6ba; display: flex; }
.help-ic .ic { width: 22px; height: 22px; }

.lang {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: #e6ebf5;
  flex: none;
}
.flag-cn {
  width: 20px;
  height: 14px;
  border-radius: 2px;
  background: #de2910;
  position: relative;
  overflow: hidden;
}
.flag-cn::before {
  content: "★";
  color: #ffde00;
  font-size: 8px;
  position: absolute;
  top: 1px;
  left: 2px;
}
.lang .caret { width: 16px; height: 16px; }

/* ===== 菜单条 ===== */
.menubar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--menu-bg);
  color: #4a5568;
}
.menu-label { font-size: 15px; font-weight: 500; }
.menubar .burger { width: 24px; height: 24px; }

/* ===== 视图容器 ===== */
.view-container {
  flex: 1;
  padding: 12px;
  position: relative;
}

/* ===== 卡片 ===== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
}

/* ===== 商品主页 ===== */
.banner {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  display: block;
  background: linear-gradient(135deg, #b79ff0, #8a6fd6);
}
.banner img { width: 100%; display: block; }

.thumb-row { display: flex; gap: 6px; margin: 10px 0 4px; }
.thumb {
  width: 15%;
  aspect-ratio: 1;
  border-radius: 5px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #eef0f5;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.active { border-color: var(--purple); }

.prod-name { font-size: 19px; font-weight: 700; margin: 8px 0 4px; }
.prod-sold { font-size: 13px; color: var(--text-sub); }
.prod-price { color: var(--price); font-size: 28px; font-weight: 700; margin: 4px 0 10px; }
.prod-price .yen { font-size: 20px; }

.type-label { font-size: 14px; color: var(--text-sub); margin-bottom: 8px; }
.sku-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.sku {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid #d8dde6;
  background: #f4f6f9;
  font-size: 15px;
  color: #3a4455;
}
.sku .sku-ico {
  width: 26px; height: 26px; border-radius: 6px; flex: none;
  background: linear-gradient(135deg, #b79ff0, #8a6fd6);
}
.sku.active {
  border-color: var(--green-sel-border);
  background: var(--green-sel-bg);
  color: #1c7a3c;
  font-weight: 600;
}

.qty-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.qty-row .qty-label { font-size: 14px; color: var(--text-sub); }
.qty-ctrl { display: flex; align-items: center; }
.qty-btn {
  width: 34px; height: 34px; border: 1px solid #d8dde6; background: #fff;
  font-size: 18px; color: #4a5568;
}
.qty-btn.minus { border-radius: 8px 0 0 8px; }
.qty-btn.plus { border-radius: 0 8px 8px 0; }
.qty-input {
  width: 50px; height: 34px; border: 1px solid #d8dde6; border-left: none; border-right: none;
  text-align: center; font-size: 15px; outline: none;
}
.qty-stock {
  margin-left: auto;
  background: var(--green);
  color: #fff;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 8px;
}

.buy-row { display: flex; gap: 10px; }
.btn-buy, .btn-cart {
  flex: 1;
  border: none;
  border-radius: 24px;
  height: 46px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-buy { background: linear-gradient(90deg, #ff7a18, #ff3d2e); }
.btn-cart { background: linear-gradient(90deg, #ffc531, #ff9f0a); }
.btn-buy .ic, .btn-cart .ic { width: 19px; height: 19px; }

/* 详情 */
.detail-divider {
  border-top: 2px solid #eef0f4;
  margin: 16px -14px 0;
  padding: 14px 14px 0;
}
.detail-title { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.detail-intro { color: #2f9e6b; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.privilege { font-size: 14px; color: #5a6473; line-height: 1.7; }
.detail-img { width: 100%; border-radius: 8px; margin-top: 10px; display: block; }

/* ===== 订单确认页 ===== */
.section-title { display: flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.section-title .ic { width: 20px; height: 20px; color: var(--primary); }

.order-item { display: flex; align-items: center; gap: 10px; }
.order-item .oi-thumb {
  width: 46px; height: 46px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, #b79ff0, #8a6fd6);
}
.oi-info { flex: 1; min-width: 0; }
.oi-name { font-size: 15px; font-weight: 600; }
.oi-sku { font-size: 13px; color: var(--purple); font-weight: 600; margin-top: 2px; }
.oi-qty { font-size: 14px; color: var(--text-sub); }
.oi-price { font-size: 14px; color: var(--text); }
.order-total { text-align: right; margin-top: 12px; font-size: 22px; font-weight: 700; color: var(--price); }

.pay-method { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid #d8dde6; border-radius: 10px; }
.pay-method.active { border-color: var(--blue); background: #eef3ff; }
.alipay-ico {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: #1677ff; color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
}
.pay-name { flex: 1; font-size: 15px; }
.radio {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid #c2cad6; position: relative;
}
.pay-method.active .radio { border-color: var(--blue); }
.pay-method.active .radio::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--blue);
}

.pay-actions { display: flex; gap: 10px; margin-top: 4px; }
.btn-pay, .btn-cancel {
  flex: 1; border: none; border-radius: 24px; height: 46px; font-size: 16px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-pay { background: var(--blue); color: #fff; }
.btn-cancel { background: #d8dde6; color: #5a6473; }

/* ===== 订单查询页 ===== */
.order-search { display: flex; gap: 8px; margin-bottom: 12px; }
.order-search input {
  flex: 1; height: 42px; border: 1px solid #d8dde6; border-radius: 10px; padding: 0 12px; font-size: 14px; outline: none;
}
.order-search button {
  width: 46px; border: none; border-radius: 10px; background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.notice-warn {
  background: #fde6dc; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; position: relative;
}
.notice-warn .nw-title { color: #b04a2f; font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.notice-warn .nw-text { color: #8a5a4c; font-size: 13px; line-height: 1.6; }
.notice-warn .nw-close { position: absolute; top: 8px; right: 10px; color: #b08a7e; font-size: 18px; }

.order-card-head {
  background: #5b82f0; color: #fff; border-radius: 10px; padding: 12px 14px; margin: -14px -14px 12px;
}
.och-label { font-size: 14px; }
.och-no { font-size: 18px; font-weight: 700; word-break: break-all; }
.order-line { display: flex; font-size: 14px; line-height: 2; color: #4a5568; }
.order-line .ol-label { width: 78px; color: #6a7483; flex: none; }
.order-line .unpaid { color: var(--price); font-weight: 600; }
.order-line .paid { color: var(--green); font-weight: 600; }

.card-section-title { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-sub); margin: 14px 0 8px; }

/* 卡密结果 */
.card-secret {
  background: linear-gradient(135deg, #f0e9ff, #e3d8ff);
  border: 1px dashed var(--purple);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 10px;
}
.cs-label { font-size: 13px; color: var(--purple); font-weight: 600; }
.cs-code { font-size: 17px; font-weight: 700; color: #5a3fb0; word-break: break-all; margin-top: 4px; letter-spacing: 0.5px; }

.pay-success-img {
  width: 100%;
  border-radius: 10px;
  margin-top: 12px;
  display: block;
}

/* ===== 版权 ===== */
.copyright {
  text-align: center;
  padding: 14px 0 18px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
}

/* ===== 抽屉 ===== */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 50;
}
.drawer-mask.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 78%; max-width: 320px;
  background: #232c3b;
  transform: translateX(-100%);
  transition: transform .25s;
  z-index: 51;
  display: flex; flex-direction: column;
  padding: 18px 0;
}
.drawer.show { transform: translateX(0); }
.drawer-nav { flex: none; padding: 0 12px; }
.drawer-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 10px;
  color: #cfd6e2; font-size: 15px;
}
.drawer-item .ic { width: 20px; height: 20px; color: #8fa0bb; }
.drawer-item.active { background: #2f3a4d; color: #fff; }
.drawer-group { padding: 14px 14px 6px; font-size: 12px; color: #6a7688; }
.drawer-notice { margin: 16px 12px 0; }
.notice-title { display: flex; align-items: center; gap: 8px; color: #fff; font-size: 15px; font-weight: 600; }
.notice-title .ic { width: 20px; height: 20px; color: #ffb000; }
.notice-body {
  margin-top: 10px; background: #2f3a4d; border-radius: 10px; padding: 14px;
  color: #9fb0c8; font-size: 14px;
}

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px);
  background: rgba(20,26,36,0.92); color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 60; max-width: 80%;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.empty {
  text-align: center; color: rgba(255,255,255,0.9); font-size: 15px; padding: 60px 20px;
}
