/* ============ 设计基准：币安深色（可切换浅色） ============ */
:root {
  --bg: #0B0E11;
  --card: #181A20;
  --card2: #1E2329;
  --line: #2B3139;
  --text: #EAECEF;
  --sub: #848E9C;
  --dim: #5E6673;
  --yellow: #FCD535;
  --yellow-d: #F0B90B;
  --red: #F6465D;
  --green: #0ECB81;
  --bar: rgba(11, 14, 17, .96);
  --bar2: rgba(24, 26, 32, .97);
  --outer: #05070A;
  --rich: #C7CCD4;
  --radius: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tab-h: 62px;
}
body.light {
  --bg: #F7F8FA;
  --card: #FFFFFF;
  --card2: #F1F3F7;
  --line: #E6E9EF;
  --text: #181A20;
  --sub: #707A8A;
  --dim: #A2A9B3;
  --bar: rgba(255, 255, 255, .96);
  --bar2: rgba(255, 255, 255, .98);
  --outer: #E9EDF2;
  --rich: #3E4753;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; overflow-x: hidden; /* 防止任何元素把页面撑宽（微信内核下尤其明显） */ }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
input, button, textarea, select { font-family: inherit; font-size: 14px; }
button { cursor: pointer; border: none; background: none; color: inherit; padding: 0; }
ul { margin: 0; padding: 0; list-style: none; }

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  overflow-x: clip;
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 8px);
}
#app.no-tab { padding-bottom: 8px; }

/* ============ 顶部栏 ============ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--bar);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex; align-items: center; gap: 10px;
  height: 54px; padding: 0 14px;
}
.brand { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, var(--yellow), #E8A400);
  color: #0B0E11; font-weight: 800; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: -.5px;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: .2px; }

.search {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px;
  background: var(--card2); border-radius: 17px;
  border: 1px solid transparent;
  transition: border-color .2s;
}
.search:focus-within { border-color: var(--yellow); }
.search input {
  flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--text);
  font-size: 13px;
}
.search input::placeholder { color: var(--dim); }
.search svg { flex-shrink: 0; color: var(--sub); }

.icon-btn {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text); flex-shrink: 0;
}

/* 公告 */
.notice {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px; background: rgba(252, 213, 53, .07);
  border-bottom: 1px solid rgba(252, 213, 53, .12);
  font-size: 12px; color: var(--yellow);
  overflow: hidden;
}
.notice .nlabel { flex-shrink: 0; font-weight: 600; opacity: .9; }
.notice-scroll { flex: 1; overflow: hidden; position: relative; height: 18px; }
.notice-scroll span {
  position: absolute; white-space: nowrap; will-change: transform;
  animation: marquee 18s linear infinite;
}
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* ============ 通用 ============ */
.page { padding-bottom: 16px; }
.px { padding-left: 14px; padding-right: 14px; }
.sec { margin-top: 18px; }
.sec-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; margin-bottom: 10px;
}
.sec-title { font-size: 16px; font-weight: 700; letter-spacing: .2px; }
.sec-more { font-size: 12px; color: var(--sub); display: flex; align-items: center; gap: 2px; }

.card { background: var(--card); border-radius: var(--radius); }
.divider { height: 1px; background: var(--line); }
.muted { color: var(--sub); }
.small { font-size: 12px; }
.center { text-align: center; }
.row { display: flex; align-items: center; }
.between { display: flex; align-items: center; justify-content: space-between; }
.gap8 { gap: 8px; }
.gap12 { gap: 12px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.hide { display: none !important; }

.btn {
  display: flex; align-items: center; justify-content: center;
  height: 46px; border-radius: 10px; font-size: 15px; font-weight: 700;
  width: 100%; transition: transform .08s, opacity .2s;
}
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--yellow); color: #0B0E11; }
.btn-primary:disabled { background: #3A3F47; color: var(--dim); }
.btn-ghost { background: var(--card2); color: var(--text); border: 1px solid var(--line); }
.btn-sm { height: 34px; font-size: 13px; border-radius: 8px; width: auto; padding: 0 14px; font-weight: 600; }

/* 商城分类行：按钮不可压缩、不折行 */
.cat-row {
  display: flex; gap: 8px; overflow-x: auto; padding: 12px 14px 4px;
  scrollbar-width: none;
}
.cat-row::-webkit-scrollbar { display: none; }
.cat-row .btn { flex: 0 0 auto; width: auto; white-space: nowrap; }

.pill {
  display: inline-flex; align-items: center; padding: 2px 7px;
  border-radius: 4px; font-size: 10px; font-weight: 600;
}
.pill-y { background: rgba(252, 213, 53, .14); color: var(--yellow); }
.pill-r { background: rgba(246, 70, 93, .14); color: var(--red); }
.pill-g { background: rgba(14, 203, 129, .14); color: var(--green); }
.pill-b { background: rgba(43, 49, 57, .9); color: var(--sub); }

.price { color: var(--yellow); font-weight: 700; }
.price .cur { font-size: 11px; margin-right: 1px; }
.price .big { font-size: 19px; }
.price-old { color: var(--dim); text-decoration: line-through; font-size: 11px; margin-left: 6px; }

/* ============ Banner ============ */
.banner-wrap { padding: 12px 14px 0; }
.banner-scroll {
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.banner-scroll::-webkit-scrollbar { display: none; }
.banner-item {
  flex: 0 0 100%; scroll-snap-align: center;
  border-radius: 14px; overflow: hidden; position: relative;
  aspect-ratio: 900 / 420; background: var(--card2);
}
.banner-item img { width: 100%; height: 100%; object-fit: cover; }
.banner-dots { display: flex; gap: 4px; justify-content: center; margin-top: 8px; }
.banner-dots i { width: 4px; height: 4px; border-radius: 2px; background: #3A3F47; transition: all .25s; }
.banner-dots i.on { width: 14px; background: var(--yellow); }

/* ============ 保障条 ============ */
.guards {
  display: flex; justify-content: space-between;
  margin: 14px 14px 0; padding: 10px 4px;
  background: var(--card); border-radius: 10px;
}
.guard { flex: 1; text-align: center; font-size: 11px; color: var(--sub); }
.guard svg { display: block; margin: 0 auto 4px; color: var(--yellow); }

/* ============ 分类 ============ */
.cats {
  display: flex; gap: 6px; overflow-x: auto; padding: 0 14px;
  scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.cat {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 4px 2px; min-width: 62px;
}
.cat-icon {
  width: 44px; height: 44px; border-radius: 14px;
  background: var(--card2); display: flex; align-items: center; justify-content: center;
  color: var(--yellow); border: 1px solid var(--line);
}
.cat span { font-size: 11px; color: var(--sub); white-space: nowrap; }
.cat.on .cat-icon { background: rgba(252, 213, 53, .12); border-color: rgba(252, 213, 53, .5); }
.cat.on span { color: var(--text); }

/* ============ 限时特惠 ============ */
.flash-box {
  margin: 0 14px; background: var(--card); border-radius: var(--radius);
  padding: 12px; border: 1px solid rgba(252, 213, 53, .14);
}
.flash-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.flash-title { font-size: 15px; font-weight: 700; color: var(--yellow); }
.flash-sub { font-size: 11px; color: var(--sub); }
.flash-scroll { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; }
.flash-scroll::-webkit-scrollbar { display: none; }
.flash-item { flex: 0 0 108px; }
.flash-item .cov {
  width: 108px; height: 108px; border-radius: 10px; overflow: hidden; background: var(--card2);
}
.flash-item .cov img { width: 100%; height: 100%; object-fit: cover; object-position: 18% center; }
.flash-item .t {
  font-size: 12px; margin-top: 6px; line-height: 1.35; height: 32px;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

/* ============ 榜单 ============ */
.rank-list { margin: 0 14px; background: var(--card); border-radius: var(--radius); overflow: hidden; }
.rank-item { display: flex; align-items: center; gap: 10px; padding: 12px 12px; }
.rank-item + .rank-item { border-top: 1px solid var(--line); }
.rank-no {
  width: 18px; text-align: center; font-size: 13px; font-weight: 800; color: var(--dim);
  font-style: italic;
}
.rank-no.top { color: var(--yellow); }
.rank-cov { width: 54px; height: 54px; border-radius: 8px; overflow: hidden; background: var(--card2); flex-shrink: 0; }
.rank-cov img { width: 100%; height: 100%; object-fit: cover; }
.rank-body { flex: 1; min-width: 0; }
.rank-title {
  font-size: 13px; font-weight: 600; line-height: 1.35;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
}
.rank-meta { font-size: 11px; color: var(--dim); margin-top: 3px; display: flex; gap: 8px; }
.rank-price { text-align: right; flex-shrink: 0; }
.rank-price .p { color: var(--yellow); font-weight: 700; font-size: 14px; }

/* ============ 商品网格 ============ */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 14px; }
.pcard {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  transition: transform .12s;
}
.pcard:active { transform: scale(.98); }
.pcard .cov { position: relative; aspect-ratio: 4/3; background: var(--card2); }
.pcard .cov img { width: 100%; height: 100%; object-fit: cover; }
.pcard .badge {
  position: absolute; top: 6px; left: 6px; padding: 2px 6px;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 700; border-radius: 4px;
}
.pcard .body { padding: 8px 9px 10px; }
.pcard .t {
  font-size: 12.5px; line-height: 1.35; height: 34px; font-weight: 500;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.pcard .meta { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 8px; }
.pcard .p { color: var(--yellow); font-weight: 700; font-size: 15px; }
.pcard .p em { font-size: 11px; font-style: normal; font-weight: 500; }
.pcard .s { font-size: 10.5px; color: var(--dim); }

/* ============ 底部导航（科技简洁风，始终固定底部） ============ */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--bar2);
  backdrop-filter: blur(14px) saturate(180%);
  border-top: 1px solid var(--line);
  display: flex; z-index: 60;
}
.tabbar::before {
  content: ''; position: absolute; top: -1px; left: 20%; right: 20%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(252, 213, 53, .55), transparent);
}
.tabbar.hide { display: none; }
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 10px; color: var(--dim); letter-spacing: .3px;
}
.tab .tico {
  width: 48px; height: 30px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, color .2s, box-shadow .2s;
}
.tab svg { width: 20px; height: 20px; }
.tab.on { color: var(--text); font-weight: 600; }
.tab.on .tico {
  background: linear-gradient(135deg, var(--yellow), var(--yellow-d));
  color: #111; box-shadow: 0 4px 14px rgba(252, 213, 53, .3);
}
@supports (bottom: env(safe-area-inset-bottom)) {
  .tabbar { bottom: constant(safe-area-inset-bottom); }
}

/* ============ 详情页 ============ */
.detail-hero { position: relative; background: var(--card2); }
.detail-hero img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.float-back {
  position: absolute; top: 12px; left: 12px; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(0, 0, 0, .5); display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
}
.detail-card { background: var(--card); border-radius: 16px 16px 0 0; margin-top: -12px; position: relative; padding: 16px 14px; }
.detail-title { font-size: 18px; font-weight: 700; line-height: 1.4; }
.detail-sub { font-size: 12.5px; color: var(--sub); margin-top: 6px; line-height: 1.5; }
.detail-price-row { display: flex; align-items: baseline; gap: 8px; margin-top: 14px; }
.detail-price { color: var(--yellow); font-weight: 800; font-size: 28px; letter-spacing: -.5px; }
.detail-price em { font-size: 14px; font-style: normal; margin-right: 2px; }
.detail-stats { display: flex; gap: 18px; margin-top: 10px; font-size: 12px; color: var(--sub); }
.tagrow { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.tag {
  padding: 3px 8px; border-radius: 5px; font-size: 11px;
  background: var(--card2); color: var(--sub); border: 1px solid var(--line);
}
.block { margin-top: 10px; background: var(--card); border-radius: var(--radius); padding: 14px; }
.block-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.block-title::before { content: ''; width: 3px; height: 13px; background: var(--yellow); border-radius: 2px; }
.rich { font-size: 13.5px; line-height: 1.75; color: var(--rich); }
.rich h3 { font-size: 14px; color: var(--text); margin: 14px 0 6px; }
.rich p { margin: 6px 0; }
.rich img { border-radius: 8px; margin: 8px 0; }
.rich a { color: var(--yellow); }
.rich ul { padding-left: 18px; list-style: disc; }

.buybar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 60;
  background: var(--bar2); border-top: 1px solid var(--line);
  padding: 10px 14px calc(10px + var(--safe-b));
  display: flex; align-items: center; gap: 12px;
}
.buybar .price { flex: 1; }
.buybar .btn { width: 150px; height: 44px; }

/* ============ 表单 ============ */
.field { padding: 14px 0; }
.field + .field { border-top: 1px solid var(--line); }
.field label { display: block; font-size: 12.5px; color: var(--sub); margin-bottom: 8px; }
.field input, .field textarea, .field select {
  width: 100%; height: 44px; background: var(--card2); border: 1px solid var(--line);
  border-radius: 9px; color: var(--text); padding: 0 12px; outline: none;
}
.field textarea { height: auto; padding: 10px 12px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--yellow); }
.field input::placeholder, .field textarea::placeholder { color: var(--dim); }

.paylist { display: flex; flex-direction: column; gap: 8px; }
.payopt {
  display: flex; align-items: center; gap: 10px; padding: 12px;
  background: var(--card2); border: 1px solid var(--line); border-radius: 10px;
}
.payopt.on { border-color: var(--yellow); background: rgba(252, 213, 53, .06); }
.payopt .ico { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.payopt .nm { flex: 1; font-size: 13.5px; }
.radio { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line); display: flex; align-items: center; justify-content: center; }
.payopt.on .radio { border-color: var(--yellow); }
.payopt.on .radio::after { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--yellow); }

.sumrow { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; font-size: 13px; }
.sumrow .k { color: var(--sub); }
.sumrow.total { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 12px; }

/* ============ 订单状态 ============ */
.status-hero {
  padding: 24px 16px 20px; text-align: center;
  background: radial-gradient(120% 100% at 50% 0%, rgba(252, 213, 53, .16), transparent 70%);
}
.status-hero .t { font-size: 19px; font-weight: 700; margin-top: 10px; }
.status-hero .s { font-size: 12.5px; color: var(--sub); margin-top: 6px; }
.status-icon { width: 52px; height: 52px; margin: 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.status-icon.ok { background: rgba(14, 203, 129, .12); color: var(--green); }
.status-icon.wait { background: rgba(252, 213, 53, .12); color: var(--yellow); }
.status-icon.off { background: rgba(132, 142, 156, .12); color: var(--sub); }

.keybox {
  background: linear-gradient(135deg, rgba(252, 213, 53, .1), rgba(252, 213, 53, .03));
  border: 1px dashed rgba(252, 213, 53, .4); border-radius: 10px;
  padding: 14px; margin-top: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; color: var(--yellow); word-break: break-all; line-height: 1.7;
}
.kv { display: flex; justify-content: space-between; padding: 9px 0; font-size: 13px; }
.kv .k { color: var(--sub); flex-shrink: 0; margin-right: 12px; }
.kv .v { text-align: right; word-break: break-all; }

/* ============ 个人中心 ============ */
.me-hero {
  padding: 20px 16px 22px;
  background: linear-gradient(160deg, #1B1E24, #0B0E11);
  border-bottom: 1px solid var(--line);
}
body.light .me-hero { background: linear-gradient(160deg, #FFFFFF, #EFF2F6); }
.avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--yellow), #C99400);
  color: #0B0E11; font-weight: 800; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.menu { background: var(--card); border-radius: var(--radius); margin: 12px 14px 0; overflow: hidden; }
.mi { display: flex; align-items: center; gap: 10px; padding: 14px; font-size: 13.5px; }
.mi + .mi { border-top: 1px solid var(--line); }
.mi .ico { color: var(--sub); display: flex; }
.mi .arr { margin-left: auto; color: var(--dim); }

/* ============ 分销 ============ */
.dist-hero {
  margin: 12px 14px 0; padding: 18px;
  border-radius: 16px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #2A2107 0%, #17181C 60%);
  border: 1px solid rgba(252, 213, 53, .22);
}
.dist-hero::after {
  content: ''; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px;
  border-radius: 50%; background: rgba(252, 213, 53, .12); filter: blur(6px);
}
.dist-hero .t { font-size: 16px; font-weight: 700; color: #F0F2F5; }
.dist-hero .s { font-size: 11.5px; color: rgba(234, 236, 239, .6); margin-top: 4px; }
.dist-nums { display: flex; margin-top: 16px; position: relative; z-index: 1; }
.dist-num { flex: 1; }
.dist-num .v { font-size: 20px; font-weight: 800; color: var(--yellow); font-variant-numeric: tabular-nums; }
.dist-num .v small { font-size: 11px; font-weight: 500; margin-left: 2px; }
.dist-num .k { font-size: 11px; color: rgba(234, 236, 239, .6); margin-top: 2px; }

.codebox {
  display: flex; align-items: center; gap: 10px; padding: 12px;
  background: var(--card2); border: 1px dashed var(--line); border-radius: 10px;
}
.codebox .code {
  flex: 1; font-family: ui-monospace, Menlo, monospace; font-size: 17px;
  font-weight: 700; letter-spacing: 2px; color: var(--yellow);
}

.lv3 { display: flex; gap: 8px; }
.lv-item {
  flex: 1; background: var(--card2); border-radius: 10px; padding: 12px 10px; text-align: center;
  border: 1px solid var(--line);
}
.lv-item .n { font-size: 11px; color: var(--sub); }
.lv-item .c { font-size: 20px; font-weight: 800; margin: 4px 0 2px; }
.lv-item .r { font-size: 10.5px; color: var(--yellow); }

.clist { background: var(--card); border-radius: var(--radius); overflow: hidden; }
.citem { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.citem + .citem { border-top: 1px solid var(--line); }

/* ============ 登录 ============ */
.auth-wrap { padding: 38px 24px 24px; }
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.auth-logo .brand-mark { width: 38px; height: 38px; border-radius: 11px; font-size: 16px; }
.auth-logo .nm { font-size: 20px; font-weight: 800; }
.auth-title { font-size: 24px; font-weight: 800; letter-spacing: -.3px; }
.auth-sub { font-size: 13px; color: var(--sub); margin-top: 8px; line-height: 1.6; }
.auth-switch { text-align: center; font-size: 13px; color: var(--sub); margin-top: 18px; }
.auth-switch b { color: var(--yellow); font-weight: 600; }

/* ============ 空状态 / 加载 ============ */
.empty { padding: 56px 20px; text-align: center; color: var(--dim); font-size: 13px; }
.empty svg { margin: 0 auto 12px; opacity: .5; }
.loading { padding: 40px 0; text-align: center; color: var(--dim); font-size: 13px; }
.skeleton { background: linear-gradient(90deg, var(--card2) 25%, var(--card) 37%, var(--card2) 63%); background-size: 400% 100%; animation: sk 1.4s ease infinite; border-radius: 8px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ============ Toast / Sheet ============ */
#toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  background: rgba(38, 42, 49, .98); color: var(--text);
  padding: 10px 18px; border-radius: 22px; font-size: 13px;
  max-width: 80vw; text-align: center; z-index: 200;
  opacity: 0; pointer-events: none; transition: opacity .22s, transform .22s;
  border: 1px solid var(--line);
}
#toast.on { opacity: 1; transform: translateX(-50%) translateY(-6px); }

.mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .65); z-index: 100;
  opacity: 0; pointer-events: none; transition: opacity .22s;
}
.mask.on { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%) translateY(100%);
  width: 100%; max-width: 480px; background: var(--card);
  border-radius: 18px 18px 0 0; z-index: 101; transition: transform .28s cubic-bezier(.3, .9, .3, 1);
  padding: 18px 16px calc(18px + var(--safe-b));
  max-height: 84vh; overflow-y: auto;
}
.sheet.on { transform: translateX(-50%) translateY(0); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-head .t { font-size: 16px; font-weight: 700; }
.qr {
  width: 200px; height: 200px; margin: 8px auto; border-radius: 10px;
  background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden;
  padding: 8px;
}
.qr img { width: 100%; height: 100%; object-fit: contain; }

/* 复选框 */
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--sub); line-height: 1.5; }
.check .box {
  width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--line);
  flex-shrink: 0; margin-top: 1px; display: flex; align-items: center; justify-content: center;
}
.check.on .box { background: var(--yellow); border-color: var(--yellow); color: #0B0E11; }

/* 顶部返回栏 */
.navbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 10px;
  height: 50px; padding: 0 14px; background: var(--bar);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.navbar .t { font-size: 15px; font-weight: 600; flex: 1; text-align: center; margin-right: 34px; }

@media (min-width: 520px) {
  body { background: var(--outer); }
  #app { box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
}

/* ============ 主题切换 ============ */
.theme-btn { transition: transform .3s; }
.theme-btn:active { transform: rotate(40deg); }

/* ============ AI 悬浮球 + 对话抽屉 ============ */
.ai-fab {
  position: fixed; right: 14px; z-index: 58;
  bottom: calc(var(--tab-h) + var(--safe-b) + 14px);
  width: 50px; height: 50px; border-radius: 50%;
  background: linear-gradient(135deg, var(--yellow), var(--yellow-d));
  color: #111; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(252, 213, 53, .4);
  font-weight: 800; font-size: 15px;
}
.ai-fab::after {
  content: ''; position: absolute; inset: -5px; border-radius: 50%;
  border: 1.5px solid rgba(252, 213, 53, .45);
  animation: fabPulse 2.2s ease-out infinite;
}
@keyframes fabPulse {
  0% { transform: scale(.9); opacity: 1; }
  70%, 100% { transform: scale(1.28); opacity: 0; }
}
#app.no-tab ~ .ai-fab, .ai-fab.low { bottom: calc(var(--safe-b) + 14px); }

.aidrawer {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%) translateY(105%);
  width: 100%; max-width: 480px; height: 72vh; z-index: 102;
  background: var(--bg); border-radius: 18px 18px 0 0;
  border: 1px solid var(--line); border-bottom: none;
  display: flex; flex-direction: column;
  transition: transform .3s cubic-bezier(.3, .9, .3, 1);
}
.aidrawer.on { transform: translateX(-50%) translateY(0); }

/* ============ AI 客服页 ============ */
.service-wrap {
  display: flex; flex-direction: column;
  height: calc(100dvh - var(--tab-h) - var(--safe-b));
  min-height: 420px;
}
.service-scroll { flex: 1; overflow-y: auto; padding: 14px 14px 6px; }
.service-head {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px;
}
.robot-live {
  width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0;
  animation: robotFloat 3.2s ease-in-out infinite;
  position: relative;
}
.robot-live img { width: 100%; height: 100%; border-radius: 50%; }
.robot-live::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  border: 1.5px solid rgba(252, 213, 53, .5);
  animation: fabPulse 2.4s ease-out infinite;
}
@keyframes robotFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
.service-head .nm { font-size: 16px; font-weight: 700; }
.service-head .ds { font-size: 11.5px; color: var(--sub); margin-top: 3px; line-height: 1.5; }
.ai-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; color: var(--green); font-weight: 600;
}
.ai-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: blinkDot 1.6s infinite; }
@keyframes blinkDot { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.ai-menu { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.ai-menu .mi2 {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 4px; font-size: 11.5px; color: var(--sub);
}
.ai-menu .mi2 svg { color: var(--yellow); }
.ai-menu .mi2:active { transform: scale(.97); }

.msgs { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; }
.msg { display: flex; gap: 8px; max-width: 86%; }
.msg .av { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; overflow: hidden; background: var(--card2); }
.msg .av img { width: 100%; height: 100%; }
.msg .bubble {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 4px 14px 14px 14px; padding: 10px 12px;
  font-size: 13.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word;
}
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.user .bubble {
  background: linear-gradient(135deg, var(--yellow), var(--yellow-d));
  color: #111; border: none; border-radius: 14px 4px 14px 14px; font-weight: 500;
}
.typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--sub); animation: ty 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes ty { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

.chat-inputbar {
  flex-shrink: 0; display: flex; gap: 8px; align-items: center;
  padding: 9px 12px calc(9px); border-top: 1px solid var(--line); background: var(--bar2);
}
.chat-inputbar input {
  flex: 1; height: 40px; background: var(--card2); border: 1px solid var(--line);
  border-radius: 20px; padding: 0 15px; color: var(--text); outline: none; font-size: 13.5px;
}
.chat-inputbar input:focus { border-color: var(--yellow); }
.chat-inputbar .send {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--yellow), var(--yellow-d)); color: #111;
  display: flex; align-items: center; justify-content: center;
}
.chat-inputbar .send:disabled { opacity: .5; }

/* ============ 个人中心 · 创业 AI 导师卡 ============ */
.mentor-card {
  margin: 12px 14px 0; border-radius: 16px; overflow: hidden; position: relative;
  background: linear-gradient(135deg, rgba(252, 213, 53, .16), var(--card) 55%);
  border: 1px solid rgba(252, 213, 53, .3);
  display: flex; align-items: center; gap: 12px; padding: 16px;
}
.mentor-card::after {
  content: ''; position: absolute; right: -30px; top: -30px; width: 130px; height: 130px;
  border-radius: 50%; background: rgba(252, 213, 53, .12); filter: blur(4px);
}
.mentor-card .rob {
  width: 86px; height: 86px; border-radius: 20px; overflow: hidden; flex-shrink: 0;
  animation: robotFloat 3.2s ease-in-out infinite;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
}
.mentor-card .rob img { width: 100%; height: 100%; }
.mentor-card .tt { font-size: 15.5px; font-weight: 700; }
.mentor-card .ss { font-size: 11.5px; color: var(--sub); margin-top: 4px; line-height: 1.55; }
.mentor-card .go {
  margin-top: 10px; display: inline-flex; align-items: center; gap: 4px;
  background: linear-gradient(135deg, var(--yellow), var(--yellow-d)); color: #111;
  font-size: 12px; font-weight: 700; padding: 7px 14px; border-radius: 16px;
}
.ostats { display: flex; gap: 8px; margin: 12px 14px 0; }
.ostat {
  flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--sub); position: relative;
}
.ostat svg { color: var(--yellow); }
.ostat .dot {
  position: absolute; top: 6px; right: 8px; min-width: 15px; height: 15px; border-radius: 8px;
  background: var(--red); color: #fff; font-size: 9.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* ============ 装修模块 ============ */
.m-text { padding: 16px 14px; }
.m-img { padding: 12px 14px; }
.m-img img { width: 100%; border-radius: 12px; }
.m-btn { padding: 10px 14px; display: flex; }
.m-btn a { display: flex; align-items: center; justify-content: center; height: 44px; border-radius: 10px; font-size: 14.5px; font-weight: 700; flex: 1; }
.m-btn a.pri { background: linear-gradient(135deg, var(--yellow), var(--yellow-d)); color: #111; }
.m-btn a.gho { background: var(--card2); color: var(--text); border: 1px solid var(--line); }
.m-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 6px 14px; }
.m-gallery a { position: relative; border-radius: 12px; overflow: hidden; background: var(--card2); aspect-ratio: 4/3; }
.m-gallery img { width: 100%; height: 100%; object-fit: cover; }
.m-gallery .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 10px 8px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .65)); color: #fff; font-size: 12px; font-weight: 600;
}
.m-spacer { width: 100%; }

/* ============ 登录美化 ============ */
.auth-wrap {
  padding: 30px 24px 24px; position: relative; overflow: hidden;
  min-height: 100vh;
}
.auth-wrap::before {
  content: ''; position: absolute; top: -120px; right: -100px; width: 300px; height: 300px;
  border-radius: 50%; background: radial-gradient(circle, rgba(252, 213, 53, .18), transparent 70%);
  pointer-events: none;
}
.auth-hero { display: flex; flex-direction: column; align-items: center; margin-bottom: 22px; }
.auth-hero .rob {
  width: 96px; height: 96px; border-radius: 26px; overflow: hidden;
  animation: robotFloat 3.4s ease-in-out infinite;
  box-shadow: 0 10px 30px rgba(252, 213, 53, .18);
}
.auth-hero .rob img { width: 100%; height: 100%; }
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.auth-logo .brand-mark { width: 38px; height: 38px; border-radius: 11px; font-size: 16px; }
.auth-logo .nm { font-size: 20px; font-weight: 800; }
.auth-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 6px 16px; box-shadow: 0 8px 30px rgba(0, 0, 0, .14);
}
