:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --muted-2: #64748B;
  --line: #e6e9ef;
  --line-2: #eef1f6;
  --brand: #2b5cff;
  --brand-soft: #eef3ff;
  --orange: #f05a28;
  --green: #047857;
  --green-soft: #e8f7f1;
  --amber: #b45309;
  --amber-soft: #fdf3e3;
  --danger: #d93a3a;
  --radius: 16px;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Roboto Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  background: #e8eaee;
  color: var(--ink);
  font-family: "Plus Jakarta Sans", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

#app {
  position: relative;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  box-shadow: 0 0 40px rgba(15, 23, 42, 0.06);
}

/* ===== 导航 ===== */
.nav {
  position: sticky; top: 0; z-index: 20;
  height: 52px; display: flex; align-items: center;
  padding: 0 16px; background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.nav .back { width: 44px; height: 44px; display: grid; place-items: center; font-size: 23px; line-height: 1; color: var(--ink); cursor: pointer; border: 0; background: none; padding: 0; text-align: left; }
.nav .back.hide { visibility: hidden; }
.nav .title { flex: 1; font-size: 15px; font-weight: 650; letter-spacing: -0.2px; margin-left: 4px; }
.nav .right { width: 84px; text-align: right; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== 布局 ===== */
.pad { padding: 16px; }
.pad.has-bar { padding-bottom: 104px; }
.pad.has-tab { padding-bottom: 84px; }
.section { margin-top: 20px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.section-head h2 { font-size: 16px; font-weight: 650; letter-spacing: -0.2px; }
.section-head span { font-size: 11.5px; color: var(--muted); }
.eyebrow { font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }

/* ===== 首页 hero ===== */
.hero {
  margin: 0 -16px 0;
  padding: 22px 20px 20px;
  background:
    radial-gradient(120% 90% at 88% 0%, rgba(64, 105, 255, 0.35), transparent 58%),
    linear-gradient(150deg, #0b1526 0%, #101f3a 55%, #16294a 100%);
  color: #fff;
}
.hero h1 { font-size: 25px; line-height: 1.28; letter-spacing: -0.6px; font-weight: 700; }
.hero p { margin-top: 8px; font-size: 12.5px; color: rgba(255, 255, 255, 0.62); line-height: 1.65; max-width: 340px; }
.hero .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.hero .stat { background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 11px; padding: 9px 10px; }
.hero .stat b { display: block; font-family: var(--mono); font-size: 15px; font-weight: 600; letter-spacing: -0.3px; }
.hero .stat span { display: block; margin-top: 2px; font-size: 10.5px; color: rgba(255, 255, 255, 0.55); }

/* ===== 搜索 + 分类 ===== */
.search {
  width: 100%; display: block; border: 1px solid var(--line); outline: none;
  background: #fff; border-radius: 12px; padding: 11px 14px;
  font-size: 13px; color: var(--ink); font-family: inherit;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.search::placeholder { color: var(--muted-2); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; font-size: 12.5px; padding: 7px 14px; border-radius: 999px;
  background: #fff; color: var(--ink-2); border: 1px solid var(--line); cursor: pointer;
}
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ===== 卡片 ===== */
.card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.035);
  overflow: hidden;
}
.block {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 16px; margin-top: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.block h4 { font-size: 13.5px; font-weight: 650; margin-bottom: 10px; letter-spacing: -0.1px; }
.block p { font-size: 12.5px; color: var(--ink-2); line-height: 1.75; }
.block p + p { margin-top: 6px; }
.kv { display: flex; justify-content: space-between; gap: 14px; font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; color: var(--ink); text-align: right; word-break: break-all; }
.kv b.mono, .mono { font-family: var(--mono); font-weight: 500; letter-spacing: -0.2px; }
.total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--line); }
.total span { font-size: 13px; color: var(--muted); }
.total b { font-family: var(--mono); font-size: 22px; color: var(--ink); letter-spacing: -0.6px; }

/* ===== 产品卡（新版） ===== */
.product { margin-top: 12px; cursor: pointer; }
.product .cover { border-radius: 0; margin: 0; height: 104px; position: relative; }
.product .cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(6, 14, 28, 0.28)); }
.product .cover .cover-label { position: relative; z-index: 1; font-size: 13px; letter-spacing: 0.4px; }
.product .cover .cover-badge {
  position: absolute; z-index: 2; top: 10px; left: 10px;
  font-size: 10.5px; padding: 3px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff; backdrop-filter: blur(6px);
}
.product .body { padding: 13px 14px 14px; }
.product h3 { font-size: 15.5px; font-weight: 650; letter-spacing: -0.2px; margin-bottom: 4px; }
.product .desc { font-size: 12px; color: var(--muted); line-height: 1.6; }
.product .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.meta-chip { font-size: 10.5px; color: var(--ink-2); background: #f3f5f9; border-radius: 5px; padding: 2px 7px; }
.product .bottom { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 11px; }
.price { font-family: var(--mono); font-size: 19px; font-weight: 650; color: var(--ink); letter-spacing: -0.7px; }
.price small { font-family: inherit; font-size: 10.5px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.price.orange { color: var(--orange); }
.tag { display: inline-block; font-size: 10.5px; padding: 2px 8px; border-radius: 999px; }
.tag.std { color: var(--green); background: var(--green-soft); }
.tag.cus { color: var(--amber); background: var(--amber-soft); }
.rating { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--amber); }
.rating b { font-family: var(--mono); font-weight: 600; }

/* 封面渐变 */
.cover { display: flex; align-items: center; justify-content: center; color: #fff; overflow: hidden; background: linear-gradient(135deg, #1b3a8c, #2b5cff 55%, #6f95ff); }
.cover.c2 { background: linear-gradient(135deg, #0b3d2e, #0f9d6b 55%, #45c99a); }
.cover.c3 { background: linear-gradient(135deg, #2b1b5e, #5b3bd6 55%, #9b7bff); }
.cover.c4 { background: linear-gradient(135deg, #4a1d0b, #d4551f 55%, #ff9466); }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover.lg { height: 168px; border-radius: var(--radius) var(--radius) 0 0; margin: 0; }

/* ===== 流程 / 保障 ===== */
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.flow .step { text-align: center; }
.flow .num {
  width: 30px; height: 30px; margin: 0 auto 7px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 12px; color: var(--ink);
}
.flow .step p { font-size: 11.5px; color: var(--ink-2); line-height: 1.4; }
.flow .step span { display: block; font-size: 10.5px; color: var(--muted-2); margin-top: 2px; }

.guards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.guard { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; }
.guard .dot { width: 22px; height: 22px; border-radius: 7px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 12px; margin-bottom: 8px; }
.guard b { display: block; font-size: 12.5px; font-weight: 600; }
.guard span { display: block; margin-top: 3px; font-size: 10.5px; color: var(--muted); line-height: 1.5; }

/* ===== 分类 + 商品网格（卖场首页） ===== */
.cat-row { display: flex; gap: 16px; overflow-x: auto; padding: 14px 0 4px; scrollbar-width: none; }
.cat-row::-webkit-scrollbar { display: none; }
.cat { flex: none; width: 56px; text-align: center; background: none; border: 0; font-family: inherit; cursor: pointer; padding: 0; }
.cat .ic { width: 46px; height: 46px; border-radius: 16px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); display: flex; align-items: center; justify-content: center; margin: 0 auto 6px; }
.cat.on .ic { background: var(--ink); border-color: var(--ink); color: #fff; }
.cat span { display: block; font-size: 11px; color: var(--muted); }
.cat.on span { color: var(--ink); font-weight: 600; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; cursor: pointer; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03); }
.tile .cover { height: auto; aspect-ratio: 4 / 3; margin: 0; border-radius: 0; position: relative; }
.tile-ic { width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.2); display: flex; align-items: center; justify-content: center; color: #fff; }
.tile-badge { position: absolute; top: 8px; left: 8px; font-size: 9.5px; padding: 2px 7px; border-radius: 999px; background: rgba(6, 14, 28, 0.28); border: 1px solid rgba(255, 255, 255, 0.22); color: #fff; backdrop-filter: blur(4px); }
.tile-body { padding: 10px 11px 12px; }
.tile h3 { font-size: 13px; line-height: 1.4; font-weight: 600; height: 36px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; letter-spacing: -0.1px; }
.tile-meta { margin-top: 4px; font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.tile .price { font-size: 15px; letter-spacing: -0.5px; }
.tile .tag { font-size: 9.5px; padding: 1px 6px; }
.mall-note { margin-top: 14px; text-align: center; font-size: 10.5px; color: var(--muted-2); line-height: 1.7; }

/* ===== 详情 ===== */
.detail-card { overflow: hidden; }
.detail-body { padding: 15px 16px 16px; }
.detail-body h2 { font-size: 19px; letter-spacing: -0.4px; margin-bottom: 6px; }
.detail-body .price-row { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 10px; }
.segmented { display: flex; background: #f1f3f7; border-radius: 11px; padding: 3px; margin-top: 14px; }
.segmented button {
  flex: 1; border: 0; background: transparent; padding: 8px 4px; border-radius: 9px;
  font-size: 12px; color: var(--muted); font-family: inherit; cursor: pointer;
}
.segmented button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08); }

/* ===== 表单 ===== */
.field { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.field:last-child { border-bottom: 0; padding-bottom: 2px; }
.field label { width: 78px; flex: none; font-size: 12.5px; color: var(--muted); }
.field input, .field select, .field textarea {
  flex: 1; border: 0; outline: none; background: transparent;
  font-size: 13.5px; color: var(--ink); font-family: inherit; width: 100%;
}
.field textarea { resize: none; line-height: 1.65; }
.field .suffix { font-size: 12px; color: var(--muted); }

/* 选项 */
.opt {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 14px; margin-bottom: 8px; font-size: 13px; cursor: pointer; background: #fff;
}
.opt:last-child { margin-bottom: 0; }
.opt.on { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(43, 92, 255, 0.08); }
.opt .l { display: flex; align-items: center; gap: 10px; }
.opt .radio { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid #cbd5e1; flex: none; }
.opt.on .radio { border-color: var(--brand); background: var(--brand); box-shadow: inset 0 0 0 3px #fff; }
.opt .r { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); }

/* ===== 按钮 ===== */
.btn {
  display: block; width: 100%; text-align: center; border: none; cursor: pointer;
  padding: 13px 16px; border-radius: 12px; font-size: 15px; font-weight: 600;
  font-family: inherit; background: #fff; color: var(--ink);
  transition: transform 0.06s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.992); }
.btn:disabled { opacity: 0.45; }
.btn.primary { background: var(--ink); color: #fff; }
.btn.brand { background: var(--brand); color: #fff; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.small { padding: 9px 12px; font-size: 12.5px; border-radius: 10px; font-weight: 500; }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { width: auto; flex: 1 1 0; }

/* ===== 底部条 ===== */
.bottombar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 30;
  background: rgba(255, 255, 255, 0.96); border-top: 1px solid var(--line);
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom));
  display: flex; gap: 10px; backdrop-filter: blur(10px);
}
.bottombar .btn { margin: 0; width: auto; }
.bottombar .grow { flex: 1 1 0; }
.bottombar .grow-14 { flex: 1.4 1 0; }
.bottombar .ghost { flex: 0 0 auto; padding-left: 16px; padding-right: 16px; }
.bottombar .price-col { flex: none; display: flex; flex-direction: column; justify-content: center; min-width: 92px; }
.bottombar .price-col span { font-size: 10.5px; color: var(--muted); }
.bottombar .price-col b { font-family: var(--mono); font-size: 18px; letter-spacing: -0.5px; }

/* ===== tabbar ===== */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; height: 58px; z-index: 30;
  background: rgba(255, 255, 255, 0.97); border-top: 1px solid var(--line);
  display: flex; padding-bottom: env(safe-area-inset-bottom); backdrop-filter: blur(10px);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; color: var(--muted-2); text-decoration: none; }
.tabbar .ico { width: 21px; height: 21px; display: block; }
.tabbar .ico svg { width: 21px; height: 21px; display: block; }
.tabbar a.on { color: var(--ink); font-weight: 600; }

/* ===== 报价 / 合同 ===== */
.src { display: inline-block; font-size: 10.5px; padding: 3px 9px; border-radius: 999px; color: var(--green); background: var(--green-soft); }
.src.custom { color: var(--amber); background: var(--amber-soft); }
.contract { background: #fff; border-radius: var(--radius); border: 1px solid var(--line); padding: 20px 18px; }
.contract h4 { text-align: center; font-size: 15.5px; letter-spacing: 0.5px; margin-bottom: 14px; }
.contract .party { font-size: 12.5px; color: var(--ink-2); padding: 5px 0; }
.contract .clause { font-size: 12.5px; color: var(--ink-2); line-height: 1.8; margin-top: 10px; }
.sign {
  border: 1px dashed #bcd0ff; border-radius: 12px; padding: 16px; margin-top: 16px;
  color: var(--brand); font-size: 13px; text-align: center; background: #f8faff; cursor: pointer;
}
.sign.done { border-style: solid; color: var(--green); background: var(--green-soft); border-color: #b7e6d5; }
.hash { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 10.5px; color: var(--muted-2); font-family: var(--mono); }

/* ===== 支付 ===== */
.pay-hero { text-align: center; padding: 30px 16px 24px; }
.pay-hero .label { font-size: 12px; color: var(--muted); }
.pay-hero .amount { font-family: var(--mono); font-size: 38px; font-weight: 650; letter-spacing: -1.4px; margin-top: 6px; }
.pay-hero .order { margin-top: 10px; font-size: 11px; color: var(--muted-2); font-family: var(--mono); }
.pay-opt { display: flex; align-items: center; justify-content: space-between; padding: 14px; border: 1px solid var(--brand); border-radius: 12px; background: #f8faff; font-size: 13px; }
.pay-opt .l { display: flex; align-items: center; gap: 10px; }

/* ===== 进度 ===== */
.progress-top { display: flex; align-items: flex-end; justify-content: space-between; }
.progress-top .big { font-size: 23px; font-weight: 700; letter-spacing: -0.5px; }
.progress-top .pct { font-family: var(--mono); font-size: 26px; font-weight: 650; color: var(--brand); letter-spacing: -1px; }
.bar { height: 6px; border-radius: 3px; background: #edf0f5; margin: 12px 0 16px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #2b5cff, #6f95ff); transition: width 0.3s ease; }
.steps { display: flex; align-items: flex-start; }
.step { flex: 1; text-align: center; font-size: 10.5px; color: var(--muted-2); position: relative; }
.step .dot {
  width: 24px; height: 24px; border-radius: 50%; background: #eef1f6; color: var(--muted-2);
  margin: 0 auto 6px; display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px;
}
.step.done .dot { background: var(--brand); color: #fff; }
.step.done { color: var(--ink); }
.step-line { flex: 1; height: 2px; background: #e6e9ef; margin-top: 11px; }
.step-line.done { background: #9fb6ff; }

.timeline { list-style: none; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.timeline li:last-child { border-bottom: 0; }
.timeline .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); margin-top: 7px; flex: 0 0 7px; }
.timeline b { font-size: 12.5px; font-weight: 600; margin-right: 8px; }
.timeline .time { font-family: var(--mono); font-size: 10.5px; color: var(--muted-2); }
.timeline p { margin-top: 3px; font-size: 11.5px; color: var(--muted); }

/* ===== 订单 ===== */
.order { margin-top: 12px; padding: 15px 16px; cursor: pointer; }
.order .top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.order .no { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); }
.order .st { font-size: 10.5px; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); }
.order .bottom { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; }
.order .time { font-family: var(--mono); font-size: 11px; color: var(--muted-2); }

/* ===== 空/加载 ===== */
.empty { text-align: center; color: var(--muted); padding: 44px 0; font-size: 12.5px; }
.loading { text-align: center; color: var(--muted); padding: 44px 0; font-size: 12.5px; }
.test-badge { display: inline-block; margin-top: 8px; font-size: 10px; padding: 2px 8px; border-radius: 999px; background: var(--amber-soft); color: var(--amber); }

/* 演示区 */
.demo { border: 1px dashed #bcd0ff; background: #f8faff; }
.demo-title { font-size: 11.5px; color: #3b5bdb; margin-bottom: 10px; }
.demo .btn-row .btn { flex: 1; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  max-width: 86vw; padding: 10px 16px; border-radius: 999px;
  background: rgba(15, 23, 42, 0.94); color: #fff; font-size: 12.5px; z-index: 99;
}
.toast-error { background: rgba(217, 58, 58, 0.96); }

/* 登录 */
.login-wrap { padding-top: 26px; }
.login-wrap h1 { font-size: 24px; letter-spacing: -0.6px; }
.login-wrap .sub { margin-top: 8px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }

/* 键盘焦点可见 */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid #1D4ED8;
  outline-offset: 2px;
}
/* 表单输入：把可点高度撑到整行 */
.field input, .field select { min-height: 44px; padding: 10px 0; }\n.field textarea { padding: 10px 0; }
/* 尊重减少动效 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
