﻿/* ==========================================================================
   桔色蜜语 · 团队营销系统 · 样式表 v1.0
   会员端（H5 小程序原型）+ 管理后台
   ========================================================================== */

:root {
  --orange: #E4572E;
  --orange-2: #F2903F;
  --orange-deep: #C9431F;
  --cream: #FFF8F2;
  --cream-2: #FFFDFB;
  --ink: #33241D;
  --ink-2: #5B463B;
  --muted: #9C8378;
  --soft: #FFF3EC;
  --line: #F3E7DF;
  --green: #2F855A;
  --gold: #B7791F;
  --danger: #C53030;
  --radius: 16px;
  --shadow: 0 6px 22px rgba(228, 87, 46, .09);
  --shadow-sm: 0 2px 10px rgba(120, 70, 45, .07);
}

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

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: #EDE6E0;
  font-size: 14px;
  line-height: 1.5;
}

button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--ink); }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

/* ---------- 通用 ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 42px; padding: 0 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; letter-spacing: .3px;
  background: #fff; color: var(--ink-2); border: 1px solid var(--line);
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.985); }
.btn-primary {
  background: linear-gradient(135deg, var(--orange-2), var(--orange));
  color: #fff; border: 0; box-shadow: 0 6px 16px rgba(228, 87, 46, .26);
}
.btn-ghost { background: #fff; color: var(--orange); border: 1px solid #F6CDBC; }
.btn-ghost.danger { color: var(--danger); border-color: #F3C9C9; }
.btn-block { display: flex; width: 100%; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 12.5px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }

.link-btn {
  color: var(--orange); font-size: 12.5px; font-weight: 600;
  padding: 2px 0; border-bottom: 1px dashed rgba(228, 87, 46, .45);
}

.muted { color: var(--muted); font-size: 12px; }
.center { text-align: center; }
.legal {
  color: #B49C90; font-size: 11px; line-height: 1.75;
  margin: 14px 18px 5px; text-align: center;
}

.badge {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px;
  border-radius: 6px; font-size: 11px; font-weight: 600; letter-spacing: .2px;
  white-space: nowrap;
}
.badge-member { background: #F4ECE7; color: #8B7568; }
.badge-district { background: #FFEADF; color: #C9431F; }
.badge-city { background: linear-gradient(135deg, var(--orange-2), var(--orange)); color: #fff; }
.badge-admin { background: #2C211C; color: #FFD9A8; }

.chip {
  display: inline-flex; align-items: center; height: 19px; padding: 0 7px;
  border-radius: 5px; font-size: 10.5px; font-weight: 600; white-space: nowrap;
}
.chip-pending { background: #FFF6E5; color: var(--gold); }
.chip-settled { background: #EAF6EE; color: var(--green); }
.chip-void { background: #F2F2F2; color: #999; }

.empty {
  text-align: center; color: var(--muted); font-size: 12.5px;
  padding: 26px 16px; line-height: 1.9;
}

/* ---------- 会员端外壳 ---------- */

.shell {
  max-width: 430px; margin: 0 auto; min-height: 100vh;
  background: var(--cream); position: relative;
  padding-bottom: 74px;
  box-shadow: 0 0 60px rgba(90, 50, 30, .13);
  overflow-x: hidden;
}

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: 46px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  background: rgba(255, 248, 242, .94);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid rgba(243, 231, 223, .9);
}
.topbar-brand { font-size: 15px; font-weight: 700; letter-spacing: 2px; color: var(--orange); }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.page { padding-bottom: 8px; }

/* ---------- 登录 / 注册 ---------- */

.auth {
  max-width: 430px; margin: 0 auto; min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--cream);
  box-shadow: 0 0 60px rgba(90, 50, 30, .13);
}

.auth-hero {
  flex: none; padding: 46px 24px 54px;
  background: linear-gradient(158deg, #F2903F 0%, #E4572E 58%, #C9431F 100%);
  color: #fff; border-radius: 0 0 26px 26px;
  position: relative; overflow: hidden;
}
.auth-hero::after {
  content: ""; position: absolute; right: -60px; top: -50px;
  width: 190px; height: 190px; border-radius: 50%;
  background: rgba(255, 255, 255, .12);
}
.auth-brand { font-size: 30px; font-weight: 700; letter-spacing: 6px; }
.auth-slogan { font-size: 13px; opacity: .92; margin-top: 6px; letter-spacing: 1px; }
.auth-points { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.auth-points span {
  font-size: 11px; padding: 4px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .19); letter-spacing: .5px;
}

.auth-card {
  flex: 1; margin: -34px 16px 22px; padding: 16px 16px 18px;
  background: #fff; border-radius: 22px; box-shadow: var(--shadow);
  position: relative; z-index: 2;
}

.seg { display: flex; background: var(--soft); border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.seg-btn {
  flex: 1; height: 34px; border-radius: 9px; font-size: 13px;
  font-weight: 600; color: var(--muted); transition: all .16s;
}
.seg-btn.active { background: #fff; color: var(--orange); box-shadow: var(--shadow-sm); }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 5px; font-weight: 600; }
.field label .req { color: var(--orange); font-size: 11px; }
.field input, .field select {
  width: 100%; height: 42px; padding: 0 12px;
  background: var(--cream-2); border: 1px solid var(--line); border-radius: 11px;
  outline: none; transition: border-color .15s, background .15s;
}
.field input:focus, .field select:focus { border-color: #F0A98C; background: #fff; }
.field input::placeholder { color: #C5B2A8; }

.auth-err { color: var(--danger); font-size: 12px; min-height: 17px; margin: 2px 0 8px; }
.auth-demo {
  margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line);
  color: #B49C90; font-size: 11px; line-height: 1.8;
}

.warn-bar {
  background: #FFF4E0; color: #8A6116; font-size: 12px; line-height: 1.7;
  padding: 10px 16px; text-align: center; border-bottom: 1px solid #F4E3C4;
}

/* ---------- 首页 ---------- */

.hero {
  background: linear-gradient(155deg, #F2903F 0%, #E4572E 60%, #D8452A 100%);
  padding: 20px 18px 20px; color: #fff;
  border-radius: 0 0 24px 24px;
}
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.hero-hi { font-size: 15px; opacity: .95; }
.hero-hi b { font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.hero-sub { font-size: 12px; opacity: .88; margin-top: 4px; }
.hero-sub b { letter-spacing: 1px; }
.hero .badge { background: rgba(255, 255, 255, .22); color: #fff; }

.hero-stats {
  display: flex; margin-top: 16px; padding: 12px 0;
  background: rgba(255, 255, 255, .16); border-radius: 14px;
}
.hero-stats > div { flex: 1; text-align: center; }
.hero-stats > div + div { border-left: 1px solid rgba(255, 255, 255, .28); }
.hero-stats b { display: block; font-size: 18px; font-weight: 700; }
.hero-stats small { display: block; font-size: 10.5px; opacity: .85; margin-top: 2px; }

.card {
  background: #fff; border-radius: var(--radius); margin: 12px 14px;
  padding: 15px 15px; box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 12px;
}
.card-title { font-size: 14.5px; font-weight: 700; letter-spacing: .3px; }

.code-card { border: 1px dashed #F3C3AE; background: linear-gradient(180deg, #fff, #FFFBF7); }
.code-main { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.code-val {
  font-size: 27px; font-weight: 800; letter-spacing: 4px;
  color: var(--orange); font-family: "SF Mono", Menlo, Consolas, monospace;
}
.code-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); }

.level-block { padding: 12px; border-radius: 13px; background: #FCF7F3; border: 1px solid #F7ECE4; }
.level-block.reached { background: linear-gradient(180deg, #FFF6EF, #FFEFE4); border-color: #F8D5C3; }
.level-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.level-name { font-size: 13.5px; font-weight: 700; }
.level-state { font-size: 11px; color: var(--muted); font-weight: 600; }
.level-block.reached .level-state { color: var(--orange); }

.cond { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 12.5px; color: var(--ink-2); }
.cond .dot {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  background: #fff; border: 1.5px solid #E3D2C8; color: #fff;
  font-size: 10px; display: flex; align-items: center; justify-content: center;
}
.cond.done .dot { background: var(--orange); border-color: var(--orange); }
.cond-text { flex: 1; }
.cond-num { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cond.done .cond-num { color: var(--orange); font-weight: 600; }

.rule-row { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid #F8F0EA; }
.rule-row:last-child { border-bottom: 0; }
.rule-no {
  flex: none; width: 20px; height: 20px; border-radius: 6px;
  background: var(--soft); color: var(--orange); font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.rule-row b { font-size: 13px; display: block; margin-bottom: 2px; }
.rule-row .muted { line-height: 1.65; }

/* 多商品金额表 */
.rule-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.rule-table th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: 11px;
  padding: 6px 4px; border-bottom: 1px solid var(--line);
}
.rule-table td { padding: 8px 4px; border-bottom: 1px solid #F8F0EA; font-variant-numeric: tabular-nums; }
.rule-table tr:last-child td { border-bottom: 0; }
.rule-table .rt-name { font-weight: 600; }
.rule-table .rt-name .muted { font-weight: 400; margin-top: 1px; }
.rule-note { font-size: 11px; color: var(--muted); line-height: 1.7; margin-top: 10px; }
/* 端口切换入口 */
.port-link { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid #F8F0EA; text-decoration: none; color: var(--ink); }
.port-link:last-child { border-bottom: 0; }
.port-name { font-weight: 600; font-size: 13.5px; }
.port-tag { font-size: 11px; color: var(--muted); }
.port-arrow { margin-left: auto; color: var(--orange); font-weight: 700; }

/* ================= 购物车 / 地址 / 二维码 ================= */

.quick-4 { gap: 8px; }
.quick-4 .quick-btn { padding: 11px 4px; font-size: 11.5px; }
.quick-4 .quick-btn .qi { font-size: 19px; }

.prod-acts { display: flex; gap: 10px; }
.prod-acts .btn { flex: 1; height: 44px; }

.kv-link { color: var(--orange); font-weight: 600; font-size: 12.5px; cursor: pointer; }

/* 购物车 */
.cart-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid #F7EFE9;
}
.cart-row:last-child { border-bottom: 0; }
.cart-info { flex: 1; min-width: 0; }
.cart-name { font-size: 13.5px; font-weight: 600; }
.cart-price { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.qty.small button { width: 28px; height: 28px; font-size: 14px; }
.qty.small b { width: 30px; font-size: 13px; }
.cart-right { text-align: right; min-width: 72px; }
.cart-sub { font-size: 14px; font-weight: 700; color: var(--orange); }
.cart-del { font-size: 11px; color: #B49C90; margin-top: 3px; }

.cart-foot {
  margin: 12px 14px; padding: 14px 16px 16px;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.cart-total { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.cart-total small { font-size: 12px; color: var(--muted); }
.cart-total b { font-size: 23px; font-weight: 700; color: var(--orange); }

/* 地址 */
.addr { padding: 11px 0; border-bottom: 1px solid #F7EFE9; }
.addr:last-of-type { border-bottom: 0; }
.addr.default { background: #FFFBF7; border-radius: 12px; padding: 11px 12px; margin: 4px 0; }
.addr-head { display: flex; align-items: center; gap: 8px; }
.addr-head b { font-size: 13.5px; }
.tag-default {
  font-size: 10px; background: var(--orange); color: #fff;
  padding: 2px 6px; border-radius: 5px; font-weight: 600;
}
.addr-body { font-size: 12.5px; color: var(--ink-2); line-height: 1.6; margin-top: 4px; }
.addr-acts { display: flex; gap: 14px; margin-top: 7px; }

.ck { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); margin: 4px 0 10px; }
.ck input { width: 16px; height: 16px; accent-color: var(--orange); }
.addr-form-acts { display: flex; gap: 10px; }
.addr-form-acts .btn { flex: 1; height: 42px; }

.ck-list { border-top: 1px solid var(--line); }
.ck-line { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.ck-line b { color: var(--orange); }
.ck-addr { margin-top: 10px; font-size: 12px; color: var(--ink-2); line-height: 1.7; }

/* 二维码 */
.qr-card { text-align: center; }
.qr-box {
  margin: 4px auto 10px; width: 66%;
  padding: 8px; background: #fff; border-radius: 12px;
  border: 1px solid var(--line);
}
.qr-box svg { display: block; width: 100%; height: auto; }
.qr-code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 22px; font-weight: 800; letter-spacing: 4px; color: var(--orange);
}
.qr-tip { font-size: 11.5px; color: var(--muted); margin-top: 5px; }

.link-btn.danger { color: var(--danger); border-bottom-color: rgba(197, 48, 48, .35); }
.buy-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: linear-gradient(135deg, #FFF6EF, #FFEDE0);
  border: 1px solid #F9DCCB;
}
.buy-cta-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.buy-cta-main b { font-size: 14px; }
.buy-cta-main .muted { font-size: 11.5px; }
.buy-cta.off { background: #F7F2EF; border-color: #EBE0D9; }
/* 登录页端口提示 */
.auth-port { font-size: 11.5px; opacity: .9; margin-top: 8px; letter-spacing: .3px; }

/* 后台端筛选 */
.seg-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.seg-tab {
  height: 32px; padding: 0 14px; border-radius: 999px; font-size: 12.5px;
  background: #fff; border: 1px solid #E8DDD6; color: var(--ink-2);
}
.seg-tab.on { background: var(--orange); border-color: var(--orange); color: #fff; font-weight: 600; }

/* 后台规则页里的行内输入 */
.table input {
  height: 30px; padding: 0 8px; border-radius: 7px;
  border: 1px solid #E8DDD6; background: #fff; outline: none; font-size: 12.5px;
}
.table input:focus { border-color: #F0A98C; background: #FFFDFB; }
.table select {
  height: 30px; padding: 0 6px; border-radius: 7px;
  border: 1px solid #E8DDD6; background: #fff; font-size: 12.5px;
}

.quick { display: flex; gap: 10px; }
.quick-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 6px; border-radius: 13px; background: #FCF7F3;
  font-size: 12px; color: var(--ink-2); font-weight: 600;
  transition: background .15s;
}
.quick-btn:active { background: var(--soft); }
.quick-btn .qi { color: var(--orange); font-size: 21px; line-height: 1; }

/* ---------- 底部导航 ---------- */

.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px; z-index: 40;
  display: flex; padding: 6px 4px 8px;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: saturate(180%) blur(10px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 18px rgba(120, 70, 45, .06);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 5px 0; color: #A8938A; font-size: 10.5px; transition: color .15s;
}
.tab-icon { font-size: 21px; line-height: 1; }
.tab.active { color: var(--orange); }
.tab.active .tab-icon { transform: translateY(-1px); }

/* ---------- 团队 ---------- */

.team-head { padding: 14px 14px 2px; }
.team-stats {
  display: flex; background: linear-gradient(135deg, #FFF3EA, #FFE9DC);
  border-radius: 15px; padding: 13px 0; border: 1px solid #F9DCCB;
}
.team-stats > div { flex: 1; text-align: center; }
.team-stats > div + div { border-left: 1px solid rgba(228, 87, 46, .14); }
.team-stats b { display: block; font-size: 16px; color: var(--orange-deep); font-weight: 700; }
.team-stats small { font-size: 10.5px; color: #9A6A55; }

.team-toolbar { display: flex; gap: 9px; padding: 12px 14px 6px; align-items: center; }
.search {
  flex: 1; height: 38px; padding: 0 12px; border-radius: 11px;
  border: 1px solid var(--line); background: #fff; outline: none;
}
.search:focus { border-color: #F0A98C; }
.chip-btn {
  height: 38px; padding: 0 12px; border-radius: 11px; font-size: 12px;
  background: #fff; border: 1px solid var(--line); color: var(--ink-2);
  white-space: nowrap; font-weight: 600;
}
.chip-btn.on { background: var(--orange); color: #fff; border-color: var(--orange); }

.team-actions {
  display: flex; align-items: center; gap: 14px;
  padding: 2px 16px 8px;
}

.tree {
  background: #fff; margin: 0 14px; border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.trow {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px; border-bottom: 1px solid #F7EFE9;
  transition: background .12s;
}
.trow:last-child { border-bottom: 0; }
.trow.clickable:active { background: #FFF8F2; }
.caret { width: 11px; flex: none; color: var(--muted); font-size: 10px; text-align: center; }

.avatar {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #8B7568; background: #F1E7E1;
}
.avatar.lv-district { background: #FFE6D8; color: #C9431F; }
.avatar.lv-city { background: linear-gradient(135deg, var(--orange-2), var(--orange)); color: #fff; }
.avatar.lv-admin { background: #2C211C; color: #FFD9A8; }
.avatar.big { width: 52px; height: 52px; font-size: 19px; }

.tmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tname { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.tsub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tright { flex: none; text-align: right; display: flex; flex-direction: column; gap: 1px; }
.tnum { font-size: 13px; color: var(--ink-2); }
.tnum b { font-weight: 700; color: var(--ink); }
.tnum i { color: #D8C7BD; font-style: normal; margin: 0 1px; }
.tlabel { font-size: 9.5px; color: var(--muted); }

/* ---------- 奖励 ---------- */

.rw-summary {
  margin: 14px; padding: 16px; border-radius: 18px; color: #fff;
  background: linear-gradient(150deg, #F2903F, #E4572E 70%);
  box-shadow: 0 10px 24px rgba(228, 87, 46, .22);
}
.rw-big small { font-size: 11.5px; opacity: .88; }
.rw-big b { display: block; font-size: 29px; font-weight: 700; letter-spacing: .5px; margin-top: 2px; }
.rw-two { display: flex; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .25); }
.rw-two > div { flex: 1; }
.rw-two small { font-size: 10.5px; opacity: .85; display: block; }
.rw-two b { font-size: 15px; font-weight: 700; }

.ftabs { display: flex; gap: 7px; padding: 0 14px 10px; overflow-x: auto; }
.ftabs::-webkit-scrollbar { display: none; }
.ftab {
  flex: none; height: 30px; padding: 0 12px; border-radius: 999px;
  font-size: 12px; background: #fff; color: var(--muted); border: 1px solid var(--line);
}
.ftab.on { background: var(--soft); color: var(--orange); border-color: #F6CDBC; font-weight: 600; }

.rw-list { background: #fff; margin: 0 14px; border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.rw-row { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-bottom: 1px solid #F7EFE9; }
.rw-row:last-child { border-bottom: 0; }
.rw-left { flex: none; }
.rw-main { flex: 1; min-width: 0; }
.rw-note { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rw-time { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.rw-right { flex: none; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.rw-amt { font-size: 14px; font-weight: 700; color: var(--orange); }

.rw-tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  border-radius: 6px; font-size: 10.5px; font-weight: 600; white-space: nowrap;
}
.tag-direct { background: #EAF6EE; color: var(--green); }
.tag-district { background: #FFF0E6; color: #C9431F; }
.tag-city { background: #FDE9E1; color: #B93A17; }
.tag-manual { background: #EEF2F8; color: #3B6EA5; }

/* ---------- 下单 ---------- */

.product { padding: 0; overflow: hidden; }
.prod-cover {
  height: 108px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(150deg, #FFD9C6, #F2903F 55%, #E4572E);
  color: #fff;
}
.prod-cover b { font-size: 22px; letter-spacing: 5px; }
.prod-cover small { font-size: 10.5px; opacity: .9; letter-spacing: 1px; margin-top: 3px; }
.prod-body { padding: 14px 15px 16px; }
.prod-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.prod-name { font-size: 14px; font-weight: 600; }
.prod-price { font-size: 19px; font-weight: 700; color: var(--orange); }
.qty-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; }
.qty { display: flex; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty button { width: 34px; height: 32px; font-size: 16px; color: var(--ink-2); background: #fff; }
.qty button:active { background: var(--soft); }
.qty b { width: 38px; text-align: center; font-size: 14px; }
.total-row {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 11px 0 14px; border-top: 1px dashed var(--line); margin-top: 8px;
}
.total-row b { font-size: 22px; font-weight: 700; color: var(--orange); }

.od-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid #F8F0EA; }
.od-row:last-child { border-bottom: 0; }
.od-title { font-size: 13px; font-weight: 600; }
.od-time { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.od-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.od-right b { font-size: 14px; color: var(--ink); }

/* ---------- 我的 ---------- */

.profile { display: flex; align-items: center; gap: 13px; padding: 18px 18px 10px; }
.profile-main { flex: 1; min-width: 0; }
.profile-name { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.profile-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

.kv { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid #F8F0EA; font-size: 13px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; }

/* ---------- Toast / Modal ---------- */

#toast-host {
  position: fixed; left: 0; right: 0; bottom: 96px; z-index: 200;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  max-width: 320px; padding: 10px 16px; border-radius: 12px;
  background: rgba(44, 33, 28, .92); color: #fff; font-size: 12.5px; line-height: 1.6;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  animation: toastIn .22s ease;
}
.toast-ok { background: rgba(47, 133, 90, .95); }
.toast-err { background: rgba(197, 48, 48, .95); }
.toast.out { opacity: 0; transform: translateY(6px); transition: all .3s; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.mask {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(40, 26, 20, .45);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fadeIn .16s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%; max-width: 360px; background: #fff; border-radius: 18px;
  padding: 20px 18px 16px; box-shadow: 0 20px 50px rgba(0, 0, 0, .22);
}
.modal-title { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.modal-body { font-size: 13px; color: var(--ink-2); line-height: 1.7; }
.modal-body p { margin: 0; }
.modal-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.modal-input {
  width: 100%; height: 40px; padding: 0 11px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--cream-2); outline: none;
}
.modal-input:focus { border-color: #F0A98C; background: #fff; }
.modal-hint { font-size: 11px; color: var(--muted); margin-top: 6px; min-height: 14px; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; height: 40px; }

/* ==========================================================================
   管理后台
   ========================================================================== */

.admin-body { background: #F2F4F7; }

.gate {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: linear-gradient(160deg, #F7EFE9, #EFE3DA 60%, #E8D8CC);
}
.gate-card {
  width: 100%; max-width: 372px; background: #fff; border-radius: 20px;
  padding: 26px 22px 20px; box-shadow: 0 24px 60px rgba(90, 50, 30, .18);
}
.gate-brand { font-size: 24px; font-weight: 700; letter-spacing: 4px; color: var(--orange); }
.gate-sub { font-size: 12px; color: var(--muted); margin-top: 4px; letter-spacing: .5px; }

.admin {
  display: flex; max-width: 1460px; margin: 0 auto; min-height: 100vh;
  background: #fff; box-shadow: 0 0 50px rgba(30, 40, 60, .08);
}

.sidebar {
  flex: none; width: 208px; background: #2A1F1A; color: #D9CCC5;
  padding: 18px 12px; display: flex; flex-direction: column; gap: 4px;
}
.side-brand { padding: 4px 10px 18px; }
.side-brand b { display: block; font-size: 16px; color: #fff; letter-spacing: 2px; }
.side-brand small { font-size: 10.5px; color: #A08C82; letter-spacing: .5px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  height: 40px; padding: 0 12px; border-radius: 10px;
  font-size: 13px; color: #CBBCB4; text-align: left; transition: all .14s;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: linear-gradient(135deg, #E4572E, #C9431F); color: #fff; font-weight: 600; }
.nav-item svg { font-size: 16px; }
.side-foot { margin-top: auto; padding: 12px 10px 2px; font-size: 10.5px; color: #7E6C63; line-height: 1.7; }
.side-foot a { color: #E9A88F; text-decoration: none; }

.content { flex: 1; min-width: 0; padding: 20px 24px 40px; background: #FAF8F6; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.page-head h1 { font-size: 20px; margin: 0; letter-spacing: .5px; }
.page-head p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi {
  background: #fff; border-radius: 14px; padding: 14px 16px;
  border: 1px solid #EFE7E2; box-shadow: 0 1px 3px rgba(60, 40, 30, .04);
}
.kpi small { font-size: 11.5px; color: var(--muted); display: block; }
.kpi b { font-size: 24px; font-weight: 700; display: block; margin-top: 4px; letter-spacing: -.4px; }
.kpi.accent b { color: var(--orange); }
.kpi .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

.panel { background: #fff; border: 1px solid #EFE7E2; border-radius: 14px; margin-bottom: 16px; overflow: hidden; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px; border-bottom: 1px solid #F2EAE5;
}
.panel-title { font-size: 14px; font-weight: 700; }
.panel-body { padding: 14px 16px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px;
  padding: 9px 12px; background: #FCF8F5; border-bottom: 1px solid #F2EAE5;
  white-space: nowrap; position: sticky; top: 0;
}
.table td { padding: 9px 12px; border-bottom: 1px solid #F7F1EC; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #FFFBF8; }
.table .num { font-variant-numeric: tabular-nums; }
.table .right { text-align: right; }
.table .nowrap { white-space: nowrap; }

.filter-bar { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid #F2EAE5; background: #FCFAF8; }
.filter-bar input, .filter-bar select {
  height: 34px; padding: 0 10px; border-radius: 9px;
  border: 1px solid #E8DDD6; background: #fff; outline: none; font-size: 12.5px;
}
.filter-bar input { flex: 1; min-width: 150px; }
.filter-bar input:focus { border-color: #F0A98C; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed #EFE7E2; }

.note { font-size: 12px; line-height: 1.75; color: var(--ink-2); }
.note.warn { background: #FFF7E8; border: 1px solid #F5E3BE; color: #8A6116; padding: 10px 12px; border-radius: 10px; }
.note.danger { background: #FFF1F1; border: 1px solid #F5D2D2; color: #9B2C2C; padding: 10px 12px; border-radius: 10px; }

.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.bar-row .bl { width: 68px; color: var(--muted); flex: none; }
.bar-track { flex: 1; height: 8px; background: #F3EBE6; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #F2903F, #E4572E); }
.bar-row .bv { width: 52px; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }

.tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px;
  border-radius: 5px; font-size: 10.5px; font-weight: 600; white-space: nowrap;
}

.actions { display: flex; gap: 6px; flex-wrap: wrap; }

.mini-tree { font-size: 12.5px; }
.mini-tree .mt-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid #F7F1EC; }
.mini-tree .mt-row:last-child { border-bottom: 0; }
.mini-tree .mt-name { font-weight: 600; }
.mini-tree .mt-meta { color: var(--muted); font-size: 11px; }

/* 响应式 */
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .admin { flex-direction: column; }
  .sidebar { width: auto; flex-direction: row; align-items: center; overflow-x: auto; padding: 10px; gap: 6px; }
  .side-brand { padding: 0 10px 0 4px; }
  .side-brand small { display: none; }
  .side-nav { flex-direction: row; }
  .nav-item { height: 34px; white-space: nowrap; }
  .side-foot { display: none; }
  .content { padding: 16px 14px 32px; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi b { font-size: 20px; }
}
