* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --primary: #1f6bff;
  --primary-dark: #1657d6;
  --accent: #ff7a45;
  --text: #16213a;
  --muted: #7488a6;
  --line: #e6edf7;
  --bg: #f3f6fb;
  --card: #ffffff;
}
html, body { margin: 0; padding: 0; }

/* 主题配色 */
body.theme-green { --primary: #0f9d63; --primary-dark: #0b7d4e; --bg: #f2f8f5; }
body.theme-dark { --primary: #3f6cff; --primary-dark: #2d54d6; --text: #e8eefb; --muted: #93a3c2; --line: #26324a; --bg: #101725; --card: #182133; }
body.theme-orange { --primary: #ff6a2b; --primary-dark: #e2541a; --bg: #fdf5f1; }
body.theme-dark .hero { background: linear-gradient(135deg, #1b2a48, #2b4370 60%, #34518a); }
body.theme-dark .field { background: #131c2c; color: #e8eefb; }
body.theme-dark .sheet { background: #182133; color: #e8eefb; }
body.theme-dark .tabbar { background: rgba(20,28,44,.96); }

/* 顶部品牌 */
.hero-top { display: flex; align-items: center; gap: 12px; position: relative; }
.brand-logo { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; background: rgba(255,255,255,.18); }
.brand-fallback { display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; color: #fff; }
.hero h1 { font-size: 20px; margin: 0 0 2px; }

/* 幻灯图 */
.banner-strip { display: flex; gap: 10px; overflow-x: auto; padding: 12px 14px 2px; scroll-snap-type: x mandatory; max-width: 560px; margin: 0 auto; }
.banner-strip::-webkit-scrollbar { display: none; }
.banner-item { position: relative; flex: 0 0 88%; scroll-snap-align: start; border-radius: 14px; overflow: hidden; display: block; text-decoration: none; }
.banner-item img { width: 100%; height: 148px; object-fit: cover; display: block; }
.banner-item span { position: absolute; left: 0; right: 0; bottom: 0; color: #fff; font-size: 13px; padding: 22px 12px 9px; background: linear-gradient(transparent, rgba(0,0,0,.55)); }

/* 地址选择 */
.addr-row { display: flex; align-items: center; gap: 8px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.addr-row:last-child { border-bottom: 0; }
.addr-main { flex: 1; font-size: 13.5px; }
.addr-main b { font-size: 14px; }
.addr-main .sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.prov-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.prov-grid button { padding: 10px 4px; border: 1px solid var(--line); background: #fff; border-radius: 9px; font-size: 13px; color: #41557a; }
.prov-grid button.on { background: #eef3ff; border-color: #c9dcff; color: var(--primary); font-weight: 600; }
.parse-box { width: 100%; min-height: 96px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; background: #fbfcff; }
.parse-tip { color: var(--muted); font-size: 12px; margin-top: 8px; line-height: 1.6; }

/* 支付 */
.qr-tip { text-align: center; color: var(--muted); font-size: 12px; margin-top: 10px; }
.pay-link { word-break: break-all; font-size: 12px; color: var(--primary); }

/* 页脚 */
.site-foot { text-align: center; color: #9fb0c6; font-size: 12px; padding: 6px 0 26px; line-height: 1.8; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  padding-bottom: calc(70px + env(safe-area-inset-bottom));
}
img { max-width: 100%; display: block; }
input, select, textarea, button { font-family: inherit; font-size: 15px; }

.wrap { max-width: 560px; margin: 0 auto; padding: 0 14px; }

/* 顶部 */
.hero {
  background: linear-gradient(135deg, #1f6bff 0%, #3f86ff 55%, #5aa1ff 100%);
  color: #fff;
  padding: 26px 18px 46px;
  border-radius: 0 0 22px 22px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; width: 220px; height: 220px; right: -70px; top: -90px;
  background: rgba(255,255,255,.16); border-radius: 50%;
}
.hero h1 { font-size: 22px; margin: 0 0 6px; font-weight: 700; letter-spacing: .5px; }
.hero p { margin: 0; font-size: 13px; opacity: .88; }
.hero-stats { display: flex; gap: 22px; margin-top: 18px; position: relative; }
.hero-stats div b { display: block; font-size: 18px; }
.hero-stats div span { font-size: 12px; opacity: .82; }

/* 卡片 */
.card {
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
  margin-top: 14px;
  box-shadow: 0 6px 18px rgba(22, 46, 88, .06);
}
.card-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 15px; font-weight: 600; margin-bottom: 12px;
}
.card-title small { font-weight: 400; color: var(--muted); font-size: 12px; }

label.lb { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 6px; }
.field {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fbfcff; color: var(--text); outline: none;
  transition: border-color .15s;
}
.field:focus { border-color: #9dc0ff; background: #fff; }
.grid3 select.field { font-size: 13px; }
select.field { -webkit-appearance: none; appearance: none; background-image: linear-gradient(45deg, transparent 50%, #8aa0c0 50%), linear-gradient(135deg, #8aa0c0 50%, transparent 50%); background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 26px; }
.grid2 { display: flex; gap: 10px; }
.grid2 > div { flex: 1; }
.grid3 { display: flex; gap: 10px; }
.grid3 > div { flex: 1; min-width: 0; }

.btn {
  width: 100%; padding: 13px; border: 0; border-radius: 12px; font-size: 16px; font-weight: 600;
  background: var(--primary); color: #fff; cursor: pointer; transition: background .15s, transform .05s;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .65; }
.btn.ghost { background: #eef3ff; color: var(--primary); }
.btn.light { background: #f2f5fb; color: #41557a; font-weight: 500; }
.btn.mini { width: auto; padding: 7px 12px; font-size: 13px; border-radius: 9px; }

/* 比价结果 */
.q-item {
  border: 1px solid var(--line); border-radius: 12px; padding: 13px; margin-bottom: 10px;
  background: #fff;
}
.q-item.best { border-color: #ffd6b3; background: linear-gradient(180deg, #fffaf5, #fff); }
.q-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.q-name { font-weight: 600; font-size: 15px; }
.q-brand { color: var(--muted); font-size: 12px; margin-top: 3px; }
.q-price { color: #e03e2d; font-size: 20px; font-weight: 700; white-space: nowrap; }
.q-price small { font-size: 12px; font-weight: 400; color: var(--muted); display: block; text-align: right; }
.q-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.tag {
  font-size: 11px; padding: 3px 8px; border-radius: 999px; background: #eef3ff; color: #295ac4;
}
.tag.warm { background: #fff2e8; color: #d4601f; }
.tag.gray { background: #f2f4f8; color: #667c99; }
.q-act { margin-top: 11px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.q-save { font-size: 12px; color: #12a45b; }
.q-save s { color: #a9b6c9; }

/* 订单 */
.order {
  border: 1px solid var(--line); border-radius: 12px; padding: 13px; margin-bottom: 10px; background: #fff;
}
.order-top { display: flex; justify-content: space-between; font-size: 14px; }
.badge { font-size: 12px; padding: 3px 8px; border-radius: 8px; background: #eef3ff; color: #295ac4; }
.badge.ok { background: #eafaf1; color: #12885a; }
.badge.gray { background: #f2f4f8; color: #7a8da8; }
.badge.warn { background: #fff4e5; color: #c76a12; }
.kv { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.kv b { color: #41557a; font-weight: 500; }
.order-acts { display: flex; gap: 8px; margin-top: 10px; }

/* 分销 */
.wallet { background: linear-gradient(135deg, #24376b, #3d5ea8); color: #fff; border-radius: 14px; padding: 18px; margin-top: 14px; }
.wallet .num { font-size: 28px; font-weight: 700; letter-spacing: .5px; }
.wallet .sub { font-size: 12px; opacity: .8; }
.wallet-row { display: flex; gap: 18px; margin-top: 14px; font-size: 12px; }
.wallet-row div span { display: block; opacity: .76; margin-top: 2px; }
.invite-box { display: flex; gap: 8px; margin-top: 12px; }
.invite-box .field { font-size: 12px; padding: 9px; }
.team-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.team-tabs button {
  flex: 1; padding: 8px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: #41557a;
}
.team-tabs button.on { background: #eef3ff; border-color: #c9dcff; color: var(--primary); font-weight: 600; }
.line-item { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.line-item:last-child { border-bottom: 0; }
.empty { text-align: center; color: var(--muted); font-size: 13px; padding: 26px 0; }

/* 底部 tab */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: rgba(255,255,255,.96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
}
.tabbar button {
  flex: 1; border: 0; background: transparent; padding: 8px 0 9px; color: #8b9cb4;
  display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px;
}
.tabbar button svg { width: 22px; height: 22px; }
.tabbar button.on { color: var(--primary); font-weight: 600; }

/* 弹层 */
.mask {
  position: fixed; inset: 0; background: rgba(16, 28, 48, .45); z-index: 40;
  display: none; align-items: flex-end;
}
.mask.show { display: flex; }
.sheet {
  width: 100%; max-width: 560px; margin: 0 auto; background: #fff;
  border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  max-height: 86vh; overflow-y: auto;
}
.sheet h3 { margin: 0 0 4px; font-size: 17px; }
.sheet .sub { color: var(--muted); font-size: 12px; margin: 0 0 14px; }
.sheet-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.sheet-row:last-of-type { border-bottom: 0; }

.toast {
  position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%);
  background: rgba(18, 28, 44, .88); color: #fff; padding: 10px 16px; border-radius: 10px;
  font-size: 13px; max-width: 78%; text-align: center; z-index: 60; display: none;
}
.toast.show { display: block; }

.notice { background: #fff8ec; border: 1px solid #ffe6bf; color: #9a6a1c; font-size: 12.5px; padding: 9px 12px; border-radius: 10px; margin-top: 12px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 10px; }
.loading { text-align: center; padding: 30px 0; color: var(--muted); font-size: 13px; }
.spinner {
  width: 22px; height: 22px; margin: 0 auto 10px; border-radius: 50%;
  border: 2px solid #dbe6f8; border-top-color: var(--primary); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
