/* ============================================================
   消费分红平台 · 生产级前端设计系统
   主题：浅色金融风（深绿 + 藏青），真响应式：
   桌面 ≥1024px → 顶栏 + 左侧栏导航；移动 <1024px → 顶栏 + 底部标签栏
   ============================================================ */
:root{
  --bg:#f4f6fb; --card:#ffffff; --fg:#0f172a; --muted:#64748b; --line:#e6ebf2; --line-2:#eef2f7;
  /* 主题色：湖蓝。--pri 对白字对比 4.63:1（AA 达标），勿随手调浅。 */
  --pri:#0a7ea4; --pri-d:#076382; --pri-bg:#e6f5fa; --pri-l:#39c0dc;
  --acc:#2563eb; --acc-d:#1d4ed8; --acc-bg:#eaf1ff;
  --warn:#d97706; --warn-bg:#fef3e2; --err:#dc2626; --err-bg:#fdeaea;
  --ink-2:#334155; --nav-bg:#0c1726; --nav-fg:#cbd5e1; --nav-active:#39c0dc;
  --shadow:0 1px 2px rgba(15,23,42,.04),0 10px 30px -18px rgba(15,23,42,.25);
  --shadow-sm:0 1px 2px rgba(15,23,42,.06);
  --shadow-pop:0 18px 50px -18px rgba(15,23,42,.45);
  --radius:16px; --radius-sm:11px; --side-w:236px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font-family:"PingFang SC","Microsoft YaHei",system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  background:var(--bg); color:var(--fg); font-size:14px; line-height:1.6; -webkit-text-size-adjust:100%; min-height:100vh}
a{color:var(--acc); text-decoration:none}
h1,h2,h3,h4{margin:0; font-weight:700}
button{font-family:inherit}
::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-thumb{background:#cbd5e1; border-radius:10px; border:2px solid var(--bg)}
::-webkit-scrollbar-thumb:hover{background:#94a3b8}

/* ---------- 顶栏 ---------- */
.topbar{position:sticky; top:0; z-index:50; display:flex; align-items:center; gap:12px; padding:0 18px; height:56px;
  background:linear-gradient(120deg,#0b1120,#0f2942 55%,#0a3a4e); color:#e2e8f0; box-shadow:0 2px 14px rgba(2,8,20,.28)}
.topbar .brand{font-weight:800; font-size:16px; letter-spacing:.4px; display:flex; align-items:center; gap:9px; color:#fff}
.topbar .brand::before{content:""; width:11px; height:11px; border-radius:3px; background:linear-gradient(135deg,var(--pri-l),var(--pri)); box-shadow:0 0 0 3px rgba(10,126,164,.22)}
.topbar .sub{color:#94a3b8; font-size:12px; font-weight:500}
.topbar .spacer{flex:1}
.topbar .role{font-size:12px; color:#cbd5e1; background:rgba(255,255,255,.08); padding:4px 10px; border-radius:999px; border:1px solid rgba(255,255,255,.12)}
.topbar a.link{color:#cbd5e1; font-size:13px; padding:7px 12px; border-radius:9px; transition:.15s}
.topbar a.link:hover{background:rgba(255,255,255,.08); color:#fff}
.topbar .logout{color:#fecaca; background:rgba(220,38,38,.12); border:1px solid rgba(220,38,38,.25); padding:6px 12px; border-radius:9px; font-size:13px; cursor:pointer; font-weight:600}
.topbar .logout:hover{background:rgba(220,38,38,.22)}

/* ---------- 图标（统一线性 SVG，颜色永远跟随 currentColor） ---------- */
.ico{display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto; line-height:1}
svg.i{width:19px; height:19px; display:block; fill:none; stroke:currentColor; stroke-width:1.75;
  stroke-linecap:round; stroke-linejoin:round; overflow:visible}

/* ---------- 整体布局：侧栏 + 内容 ---------- */
.layout{display:flex; align-items:stretch; min-height:calc(100vh - 56px)}
.sidenav{display:none; flex:0 0 var(--side-w); width:var(--side-w); background:var(--nav-bg); color:var(--nav-fg);
  position:sticky; top:56px; align-self:flex-start; height:calc(100vh - 56px); padding:8px 12px 18px; overflow-y:auto}

/* 品牌只在顶栏出现一次；侧栏去掉重复标题后，顶部留 6px 呼吸量即可 */

/* 分组标题：小、宽字距、弱化，只做视觉分段落，不与菜单项争 */
.sidenav .nav-group{font-size:10.5px; font-weight:800; letter-spacing:1.4px; color:#4d6280;
  padding:14px 13px 6px; text-transform:uppercase}
.sidenav .nav-group:first-of-type{padding-top:6px}
/* 首个菜单项直接开头（无分组时）不要贴顶 */
.sidenav > .navitem:first-child{margin-top:6px}

.sidenav .navitem{display:flex; align-items:center; gap:11px; padding:10px 13px; border-radius:11px; color:var(--nav-fg);
  font-size:13.5px; font-weight:600; margin-bottom:2px; transition:background .16s, color .16s, box-shadow .16s; cursor:pointer; position:relative}
.sidenav .navitem .ico{color:#7d90a8; transition:color .16s, transform .16s}
.sidenav .navitem:hover{background:rgba(255,255,255,.055); color:#fff}
.sidenav .navitem:hover .ico{color:#cbd5e1}
.sidenav .navitem.active{background:linear-gradient(90deg,rgba(10,126,164,.34),rgba(10,126,164,.05) 70%,transparent);
  color:#fff; box-shadow:inset 2.5px 0 0 var(--nav-active)}
.sidenav .navitem.active .ico{color:var(--nav-active)}
.sidenav .navitem.ext .ico{color:#5f7691}
.sidenav .navitem.ext:hover .ico{color:#cbd5e1}
.sidenav .navitem.ext::after{content:"↗"; margin-left:auto; font-size:11px; opacity:.45; font-weight:700}
.sidenav .nav-sep{height:1px; background:rgba(255,255,255,.08); margin:12px 8px}
.sidenav .nav-foot{font-size:11px; color:#64748b; padding:8px 13px; line-height:1.5}

.main{flex:1; min-width:0; padding:22px 22px 28px}
.content{max-width:1080px; margin:0 auto}

/* ---------- 底部标签栏（移动端） ---------- */
.bottomnav{display:none}

/* ---------- 卡片 / 分节 ---------- */
.card{background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:18px; margin-bottom:16px; box-shadow:var(--shadow)}
.card.hover:hover{transform:translateY(-2px); box-shadow:0 14px 30px -16px rgba(15,23,42,.35)}
.card h3{margin:0 0 14px; font-size:16px; font-weight:700; display:flex; align-items:center; gap:8px}
.card h3::before{content:""; width:4px; height:16px; border-radius:3px; background:linear-gradient(var(--pri),var(--pri-d))}
.card h4{margin:16px 0 8px; font-size:13px; color:var(--muted); font-weight:600}
.section-title{font-size:18px; font-weight:800; margin:4px 2px 14px; display:flex; align-items:center; gap:8px}
.section-title small{font-size:12px; color:var(--muted); font-weight:500}

/* ---------- 栅格 ---------- */
.grid{display:grid; gap:14px; grid-template-columns:repeat(auto-fill,minmax(230px,1fr))}
.row{display:flex; gap:10px; flex-wrap:wrap; align-items:center}
.col{display:flex; flex-direction:column; gap:10px}

/* ---------- 文本 / 键值的 ---------- */
.muted{color:var(--muted); font-size:12.5px; line-height:1.7}
.muted.b{font-size:13px}
.big{font-size:30px; font-weight:800; letter-spacing:.5px; background:linear-gradient(120deg,var(--pri),#0ea5e9); -webkit-background-clip:text; background-clip:text; color:transparent}
.kv{display:flex; justify-content:space-between; align-items:center; gap:12px; padding:10px 0; border-bottom:1px dashed var(--line); font-size:13.5px}
.kv:last-child{border-bottom:none}
.kv .k{color:var(--muted); flex:0 0 auto}
.kv .v{font-weight:700; text-align:right; word-break:break-word}

/* ---------- 按钮 ---------- */
button.btn{display:inline-flex; align-items:center; justify-content:center; gap:6px; padding:10px 16px; border:none;
  border-radius:var(--radius-sm); background:linear-gradient(180deg,var(--pri),var(--pri-d)); color:#fff; font-weight:700; font-size:14px;
  cursor:pointer; transition:.15s; box-shadow:0 6px 14px -6px rgba(10,126,164,.5)}
button.btn:hover{filter:brightness(1.05); transform:translateY(-1px)}
button.btn:active{transform:translateY(0)}
button.btn:disabled{opacity:.55; cursor:not-allowed; transform:none; filter:none}
button.btn.sec{background:#f1f5f9; color:#334155; box-shadow:none}
button.btn.sec:hover{background:#e2e8f0}
button.btn.acc{background:linear-gradient(180deg,#3b82f6,#1d4ed8); box-shadow:0 6px 14px -6px rgba(37,99,235,.6)}
button.btn.danger{background:linear-gradient(180deg,#ef4444,#dc2626); box-shadow:0 6px 14px -6px rgba(220,38,38,.6)}
button.btn.ghost{background:transparent; color:var(--pri-d); box-shadow:none; border:1px solid var(--line)}
button.btn.ghost:hover{background:var(--pri-bg)}
button.sm{padding:7px 12px; font-size:12.5px; border-radius:9px}
button.block{width:100%}

/* ---------- 表单 ---------- */
label.f{display:block; font-size:12px; color:var(--muted); margin:12px 0 5px; font-weight:600}
input,select,textarea{width:100%; padding:11px 13px; border:1px solid var(--line); border-radius:var(--radius-sm);
  background:#fff; color:var(--fg); font-size:14px; font-family:inherit; transition:.15s}
input:hover,select:hover,textarea:hover{border-color:#cbd5e1}
input:focus,select:focus,textarea:focus{outline:none; border-color:var(--pri); box-shadow:0 0 0 4px rgba(10,126,164,.16)}
.input-hint{font-size:11.5px; color:var(--muted); margin-top:5px}

/* ---------- 登录图形验证码 ---------- */
/* 容器 150×45 与后端出图 160×48 严格同比例，避免 object-fit 留白或拉伸 */
.cap-row{display:flex; gap:10px; align-items:stretch}
.cap-row input{flex:1 1 0; width:auto; min-width:0; letter-spacing:3px; font-weight:700; text-transform:uppercase}
.cap-img{flex:0 0 auto; width:150px; height:45px; padding:0; border:1px solid var(--line); border-radius:11px;
  background:#fff; cursor:pointer; overflow:hidden; transition:border-color .15s, box-shadow .15s}
.cap-img:hover{border-color:var(--pri); box-shadow:0 0 0 3px rgba(10,126,164,.14)}
.cap-img:active{transform:scale(.985)}
.cap-img img{display:block; width:150px; height:45px}
.cap-img.is-busy{opacity:.45; pointer-events:none}
@media (max-width:420px){
  .cap-img, .cap-img img{width:126px; height:37.8px}
}

/* ---------- 分段标签（后台等） ---------- */
.tabs{display:flex; gap:4px; overflow-x:auto; padding:5px; background:#fff; border:1px solid var(--line); border-radius:14px; margin-bottom:16px; box-shadow:var(--shadow-sm)}
.tabs button{flex:0 0 auto; padding:9px 16px; border:none; background:transparent; color:var(--muted); border-radius:10px; cursor:pointer; font-size:13.5px; font-weight:600; white-space:nowrap; transition:.15s}
.tabs button:hover{color:var(--ink-2); background:#f8fafc}
.tabs button.active{background:linear-gradient(180deg,var(--pri),var(--pri-d)); color:#fff; box-shadow:0 4px 10px -4px rgba(10,126,164,.45)}

/* ---------- 状态徽章 ---------- */
.pill{display:inline-block; padding:3px 11px; border-radius:999px; font-size:12px; font-weight:700; letter-spacing:.2px; white-space:nowrap}
.pill.g{background:#dcfce7; color:#15803d}.pill.y{background:#fef3c7; color:#b45309}
.pill.r{background:#fee2e2; color:#b91c1c}.pill.b{background:var(--acc-bg); color:#1d4ed8}.pill.n{background:#eef2f7; color:#64748b}
.pill.p{background:var(--pri-bg); color:var(--pri-d)}

/* ---------- 统计块 / KPI ---------- */
.stats{display:grid; gap:14px; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); margin-bottom:16px}

/* 指标分组：同类指标聚在一起，优于 13 张卡平铺 */
.stat-group{margin-bottom:16px}
.stat-group-title{font-size:11px; font-weight:800; letter-spacing:1.3px; color:#94a3b8; margin:0 2px 9px}
.stat-group .stats{margin-bottom:0}

/* 运营看板 · 最新批次状态条 */
.dash-batch{display:flex; align-items:center; gap:14px; padding:16px 18px; margin-bottom:18px; border-radius:16px;
  color:#e2e8f0; background:linear-gradient(120deg,#0b1120,#0f2942 58%,#0a3446);
  border:1px solid rgba(255,255,255,.07); box-shadow:0 12px 30px -20px rgba(2,8,20,.85)}
.dash-batch .db-ico{flex:0 0 auto; width:42px; height:42px; border-radius:13px; display:flex; align-items:center; justify-content:center;
  background:rgba(57,192,220,.16); color:var(--pri-l); border:1px solid rgba(57,192,220,.26)}
.dash-batch .db-ico svg.i{width:20px; height:20px}
.dash-batch .db-main{min-width:0; flex:1}
.dash-batch .db-title{font-size:16.5px; font-weight:800; color:#fff; display:flex; align-items:center; gap:9px; letter-spacing:.3px}
.dash-batch .db-sub{font-size:12px; color:#8aa1b8; margin-top:3px; font-variant-numeric:tabular-nums}
.dash-batch .db-metrics{display:flex; gap:26px; padding-left:20px; border-left:1px solid rgba(255,255,255,.1)}
.dash-batch .db-m i{display:block; font-style:normal; font-size:11px; color:#7d93a9; letter-spacing:.3px}
.dash-batch .db-m b{font-size:15px; font-weight:800; color:#fff; font-variant-numeric:tabular-nums}
.dash-batch.is-empty{background:linear-gradient(120deg,#f8fafc,#f4f7fb); border-color:var(--line); color:var(--fg);
  box-shadow:var(--shadow-sm)}
.dash-batch.is-empty .db-ico{background:var(--pri-bg); color:var(--pri-d); border-color:#c9e8f2}
.dash-batch.is-empty .db-main b{display:block; font-size:15px; color:var(--ink-2)}
.dash-batch.is-empty .db-main span{font-size:12.5px; color:var(--muted)}
.dash-batch.is-empty .db-main{flex:1}

/* ---------- 快捷操作（看板） ---------- */
.quick{display:grid; gap:10px; grid-template-columns:repeat(auto-fit,minmax(230px,1fr))}
.quick-item{display:flex; align-items:center; gap:12px; padding:13px 14px; text-align:left; cursor:pointer;
  border:1px solid var(--line); border-radius:13px; background:#fff; font-family:inherit;
  transition:border-color .16s, background .16s, box-shadow .16s, transform .16s}
.quick-item:hover{border-color:#bfe0ea; background:#f8fcfd; transform:translateY(-1px);
  box-shadow:0 12px 24px -20px rgba(15,23,42,.9)}
.quick-item .qi-ico{flex:0 0 auto; width:36px; height:36px; border-radius:11px; display:flex; align-items:center; justify-content:center;
  background:var(--pri-bg); color:var(--pri-d)}
.quick-item .qi-ico svg.i{width:18px; height:18px}
.quick-item .qi-txt{display:flex; flex-direction:column; min-width:0; line-height:1.35}
.quick-item .qi-txt b{font-size:13.5px; font-weight:700; color:var(--fg)}
.quick-item .qi-txt i{font-style:normal; font-size:11.5px; color:var(--muted); margin-top:1px}
/* 指标卡：图标置右上角做弱装饰，把横向空间全部让给数值——
   金额会随业务增长变长（¥51,999.98 → ¥1,234,567.89），左侧图标槽会先撑破卡片 */
.stat{position:relative; display:block; background:linear-gradient(135deg,#fff,#f7fbfd); border:1px solid #dcebf2;
  border-radius:14px; padding:14px 15px 13px; box-shadow:var(--shadow-sm);
  transition:border-color .16s, box-shadow .16s, transform .16s}
.stat:hover{border-color:#bfe0ea; box-shadow:0 10px 24px -18px rgba(15,23,42,.5); transform:translateY(-1px)}
.stat .s-ico{position:absolute; top:12px; right:12px; width:30px; height:30px; border-radius:10px;
  display:flex; align-items:center; justify-content:center; background:var(--pri-bg); color:var(--pri-d)}
.stat .s-ico svg.i{width:15px; height:15px}
.stat .label{font-size:12px; color:var(--muted); font-weight:600; padding-right:38px; line-height:1.45}
.stat .value{font-size:22px; font-weight:800; color:var(--pri-d); margin-top:5px; letter-spacing:.2px; line-height:1.3;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-variant-numeric:tabular-nums}
.stat .value.blue{color:var(--acc-d)}
/* .green 是语义色（正向 / 成功），不随品牌主题走，避免红涨绿跌的语义被主题色带偏 */
.stat .value.green{color:#15803d}
.stat .delta{font-size:11.5px; color:var(--muted); margin-top:2px}

/* ---------- 表格 ---------- */
.table-wrap{overflow-x:auto; border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow-sm); background:#fff}
table.t{width:100%; border-collapse:collapse; font-size:13px; background:#fff}
table.t th,table.t td{text-align:left; padding:12px 14px; border-bottom:1px solid var(--line-2); white-space:nowrap}
table.t th{background:#f8fafc; color:var(--muted); font-weight:700; font-size:12px; letter-spacing:.3px; position:sticky; top:0}
table.t tbody tr:hover{background:#f8fafc}
table.t tbody tr:last-child td{border-bottom:none}
table.t td.wrap{white-space:normal}
.table-foot{font-size:12px; color:var(--muted); padding:10px 4px; display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px}

/* ---------- 提示框 / 风险框 ---------- */
.notice{background:#fffbeb; border:1px solid #fde68a; color:#92400e; border-radius:12px; padding:12px 14px; font-size:12.5px; margin-bottom:16px; line-height:1.7}
.warnbox{background:#fef2f2; border:1px solid #fecaca; color:#991b1b; border-radius:12px; padding:12px 14px; font-size:12.5px; margin-bottom:16px; line-height:1.7}
.notice b,.warnbox b{font-weight:800}
.tip{background:var(--pri-bg); border:1px solid #bfe3ee; color:#08556e; border-radius:12px; padding:12px 14px; font-size:12.5px; margin-bottom:16px; line-height:1.7}

/* ---------- 门户 Hero ---------- */
.hero{background:linear-gradient(120deg,#0b1120,#0e3a4d 70%); color:#fff; border-radius:22px; padding:34px 28px; box-shadow:var(--shadow); position:relative; overflow:hidden; margin-bottom:18px}
.hero::after{content:""; position:absolute; right:-60px; top:-60px; width:220px; height:220px; border-radius:50%; background:radial-gradient(circle at 30% 30%,#39c0dc55,transparent 70%)}
.hero h1{margin:0 0 8px; font-size:26px; font-weight:800; letter-spacing:.5px; position:relative}
.hero p{margin:0; color:#cbd5e1; font-size:14px; max-width:640px; position:relative}
.hero .badges{margin-top:16px; display:flex; gap:8px; flex-wrap:wrap; position:relative}
.hero .badges span{background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.15); padding:5px 12px; border-radius:999px; font-size:12px; color:#e2e8f0}

/* ---------- 入口卡（门户） ---------- */
.entry{display:grid; gap:14px; grid-template-columns:repeat(auto-fill,minmax(240px,1fr))}
.entry .product{border:1px solid var(--line); border-radius:16px; padding:18px; background:#fff; display:flex; flex-direction:column; gap:10px; box-shadow:var(--shadow-sm); transition:.18s; cursor:pointer; text-decoration:none; color:inherit}
.entry .product:hover{transform:translateY(-3px); box-shadow:var(--shadow); border-color:#cbd5e1}
.entry .product .ico{width:44px; height:44px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:22px; background:linear-gradient(135deg,#e6f5fa,#c5e9f3); color:var(--pri-d)}
.entry .product .ico svg.i{width:22px; height:22px}
.entry .product .name{font-weight:800; font-size:16px; color:var(--ink-2)}
.entry .product .meta{font-size:12.5px; color:var(--muted); line-height:1.6}
.entry .product .pill{align-self:flex-start}

/* ---------- 商品卡 ---------- */
.product{border:1px solid var(--line); border-radius:14px; padding:14px; background:#fff; display:flex; flex-direction:column; gap:8px; box-shadow:var(--shadow-sm); transition:.18s; position:relative; overflow:hidden}
.product:hover{transform:translateY(-3px); box-shadow:var(--shadow); border-color:#cbd5e1}
.product .name{font-weight:700; font-size:15px; color:var(--ink-2)}
.product .meta{font-size:12.5px; color:var(--muted); line-height:1.6}
.price-tag{position:absolute; top:12px; right:12px; background:linear-gradient(180deg,var(--pri),var(--pri-d)); color:#fff; font-weight:800; font-size:13px; padding:4px 10px; border-radius:9px; box-shadow:0 4px 10px -4px rgba(10,126,164,.5)}
.prod-icon{width:42px; height:42px; border-radius:12px; background:linear-gradient(135deg,#c5e9f3,#9ed8ea); display:flex; align-items:center; justify-content:center; font-size:20px; margin-bottom:2px; color:var(--pri-d)}
.prod-icon svg.i{width:20px; height:20px}

/* ---------- 弹窗 ---------- */
.modal-mask{position:fixed; inset:0; background:rgba(15,23,42,.5); backdrop-filter:blur(3px); z-index:200; display:flex; align-items:center; justify-content:center; padding:18px; opacity:0; pointer-events:none; transition:.2s}
.modal-mask.show{opacity:1; pointer-events:auto}
.modal{background:#fff; border-radius:18px; width:100%; max-width:440px; box-shadow:var(--shadow-pop); transform:translateY(12px) scale(.98); transition:.2s; overflow:hidden}
.modal-mask.show .modal{transform:translateY(0) scale(1)}
.modal .m-head{display:flex; align-items:center; justify-content:space-between; padding:16px 18px; border-bottom:1px solid var(--line-2)}
.modal .m-head h3{font-size:16px}
.modal .m-close{border:none; background:transparent; font-size:22px; color:var(--muted); cursor:pointer; line-height:1}
.modal .m-body{padding:18px}
.modal .m-foot{padding:14px 18px; border-top:1px solid var(--line-2); display:flex; gap:10px; justify-content:flex-end; background:#fbfdff}

/* ---------- 骨架屏加载 ---------- */
.skeleton{background:linear-gradient(90deg,#eef2f7 25%,#e2e8f0 37%,#eef2f7 63%); background-size:400% 100%; animation:sk 1.3s ease infinite; border-radius:8px}
@keyframes sk{0%{background-position:100% 0}100%{background-position:-100% 0}}
.sk-line{height:12px; margin:8px 0}
.sk-block{height:120px; margin-bottom:14px; border-radius:14px}

/* ---------- 空 / 错误状态 ---------- */
.state{text-align:center; padding:36px 16px; color:#94a3b8}
.state .ico{display:flex; width:54px; height:54px; border-radius:18px; margin:0 auto 12px;
  background:#f4f7fb; border:1px solid #e9eff7; color:#9aabc0}
.state .ico svg.i{width:24px; height:24px; stroke-width:1.6}
.state.is-error .ico{background:var(--err-bg); border-color:#f7d9d9; color:var(--err)}
.state.is-loading .ico svg.i{animation:spin 3s linear infinite; transform-origin:50% 50%}
@keyframes spin{to{transform:rotate(360deg)}}
.state .t{font-size:14px; font-weight:700; color:#64748b}
.state .d{font-size:12.5px; margin-top:4px; max-width:420px; margin-left:auto; margin-right:auto}
.state .act{margin-top:14px}

/* ---------- Toast ---------- */
.toast{position:fixed; left:50%; bottom:30px; transform:translateX(-50%) translateY(10px); background:#0f172a; color:#fff; padding:11px 18px; border-radius:12px; font-size:13.5px; z-index:300; opacity:0; transition:.25s; pointer-events:none; max-width:92vw; box-shadow:0 10px 30px -10px rgba(0,0,0,.5)}
.toast.show{opacity:1; transform:translateX(-50%) translateY(0)}
.toast.err{background:#7f1d1d}

/* ---------- 登录视图（居中卡） ---------- */
.auth-wrap{min-height:calc(100vh - 56px); display:flex; align-items:center; justify-content:center; padding:24px}
.auth-card{background:#fff; border:1px solid var(--line); border-radius:20px; padding:28px; width:100%; max-width:400px; box-shadow:var(--shadow)}
.auth-card .logo{width:48px; height:48px; border-radius:14px; background:linear-gradient(135deg,var(--pri-l),var(--pri-d));
  display:flex; align-items:center; justify-content:center; color:#fff; margin-bottom:14px;
  box-shadow:0 8px 20px -10px rgba(10,126,164,.85)}
.auth-card .logo svg.i{width:24px; height:24px; stroke-width:2}
.auth-card h2{font-size:20px; margin-bottom:4px}
.auth-card .sub{color:var(--muted); font-size:13px; margin-bottom:18px}

/* ---------- 页脚 ---------- */
footer{text-align:center; color:#94a3b8; font-size:12px; padding:28px 16px}

/* ============================================================
   响应式断点
   ============================================================ */
/* 桌面：显示左侧栏 */
@media (min-width:1024px){
  .sidenav{display:block}
  .bottomnav{display:none !important}
  .main{padding:26px 30px 34px}
}
/* 平板 / 手机：隐藏侧栏，显示底部标签栏 */
@media (max-width:1023px){
  .sidenav{display:none}
  .layout{display:block}
  .main{padding:16px 14px 86px}
  .bottomnav{display:flex; position:fixed; left:0; right:0; bottom:0; background:rgba(255,255,255,.94); backdrop-filter:blur(10px);
    border-top:1px solid var(--line); z-index:60; justify-content:space-around; padding:8px 0; box-shadow:0 -6px 20px -12px rgba(15,23,42,.3);
    overflow-x:auto; scrollbar-width:none; -webkit-overflow-scrolling:touch}
  .bottomnav::-webkit-scrollbar{display:none}
  .bottomnav .navitem{display:flex; flex-direction:column; align-items:center; gap:2px; flex:1 0 60px; color:var(--muted); font-size:11px; font-weight:600; padding:4px 0; border-radius:0}
  .bottomnav .navitem .ico{font-size:18px}
  .bottomnav .navitem .ico svg.i{width:21px; height:21px; stroke-width:1.85}
  .bottomnav .navitem.active .ico svg.i{stroke-width:2.1}
  .bottomnav .navitem.active{color:var(--pri); background:transparent}
  .bottomnav .navitem.active::before{content:""; display:block; width:24px; height:3px; border-radius:3px; background:var(--pri); margin:0 auto 3px}
  .bottomnav .navitem.active::before{margin-bottom:-3px}
  .bottomnav .navitem .lbl{margin-top:0}
}
/* 移动端 H5：无论视口多宽都保留底部标签栏（H5 是独立移动端入口） */
@media (min-width:1024px){
  body.h5 .bottomnav{display:flex !important; position:fixed; left:0; right:0; bottom:0; z-index:60;
    background:rgba(255,255,255,.96); border-top:1px solid var(--line); padding:8px 0;
    justify-content:space-around; box-shadow:0 -6px 20px -12px rgba(15,23,42,.3)}
  body.h5 .bottomnav .navitem{display:flex; flex-direction:column; align-items:center; gap:2px; flex:1 0 60px;
    color:var(--muted); font-size:11px; font-weight:600; padding:4px 0}
  body.h5 .bottomnav .navitem .ico{font-size:18px}
  body.h5 .bottomnav .navitem .ico svg.i{width:21px; height:21px; stroke-width:1.85}
  body.h5 .bottomnav .navitem.active .ico svg.i{stroke-width:2.1}
  body.h5 .bottomnav .navitem.active{color:var(--pri); background:transparent}
}
@media (max-width:640px){
  .hero{padding:24px 18px}
  .hero h1{font-size:21px}
  .grid{grid-template-columns:1fr 1fr}
  .stats{grid-template-columns:1fr 1fr}
  .main{padding:14px 12px 86px}
  .card{padding:15px}
  .section-title{font-size:16px}
  /* 批次条在窄屏改为两行：主体一行、金额一行 */
  .dash-batch{flex-wrap:wrap; padding:14px 15px; gap:11px}
  .dash-batch .db-metrics{width:100%; gap:0; justify-content:space-between;
    padding:11px 0 0; border-left:0; border-top:1px solid rgba(255,255,255,.1)}
  .dash-batch.is-empty .db-metrics{display:none}
  .quick{grid-template-columns:1fr}
}
@media (max-width:380px){
  .grid{grid-template-columns:1fr}
}

/* ===== 商品图片：列表缩略图 + 后台上传控件 ===== */
.thumb{width:44px; height:44px; border-radius:10px; object-fit:cover; background:#f1f5f9;
  border:1px solid var(--line); display:block; flex:0 0 auto}
.thumb.lg{width:64px; height:64px}
.ph{display:inline-flex; align-items:center; justify-content:center; width:44px; height:44px;
  border-radius:10px; background:#eef2f7; color:var(--muted); font-size:11px; font-weight:600;
  border:1px dashed #d7dee8; flex:0 0 auto}
.ph.lg{width:64px; height:64px; font-size:12px}
.cell-media{display:flex; align-items:center; gap:10px; min-width:150px}
.cell-media .nm{font-weight:600; line-height:1.3}
.cell-media .sub{font-size:11.5px; color:var(--muted)}

/* 主图上传位 */
.up-main{width:124px; height:124px; border-radius:14px; border:1px dashed #cbd5e1; background:#f8fafc;
  display:flex; align-items:center; justify-content:center; overflow:hidden; color:var(--muted); font-size:12px}
.up-main img{width:100%; height:100%; object-fit:cover}
.up-row{display:flex; gap:16px; align-items:flex-start; flex-wrap:wrap; margin-top:8px}
.up-actions{display:flex; flex-direction:column; gap:8px}
/* 详情图多图 */
.up-grid{display:grid; grid-template-columns:repeat(auto-fill, minmax(92px, 1fr)); gap:10px; margin:10px 0}
/* 空态文案横跨整行，否则会被压进 92px 的格子里竖排成一列字 */
.up-grid > .up-tip{grid-column:1 / -1}
.up-item{position:relative; aspect-ratio:1/1; border-radius:12px; overflow:hidden;
  border:1px solid var(--line); background:#f8fafc}
.up-item img{width:100%; height:100%; object-fit:cover; display:block}
.up-item .x{position:absolute; top:4px; right:4px; width:22px; height:22px; border-radius:50%; border:none;
  background:rgba(15,23,42,.72); color:#fff; cursor:pointer; font-size:13px; line-height:1; padding:0}
.up-item .x:hover{background:var(--err)}
.up-tip{font-size:12px; color:var(--muted); line-height:1.6}
.uploading{opacity:.55; pointer-events:none}

/* 用户管理：来源 tab 角标与详情抽屉 */
.tabs .cnt{display:inline-block; margin-left:6px; padding:0 7px; border-radius:999px;
  background:#eef2f7; color:var(--muted); font-size:11px; font-weight:700}
.tabs button.active .cnt{background:rgba(255,255,255,.22); color:#fff}
.u-detail-grid{display:grid; grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); gap:10px}
.u-detail-grid .box{border:1px solid var(--line); border-radius:12px; padding:12px; background:#fbfcfe}
.u-detail-grid .box .k{font-size:12px; color:var(--muted)}
.u-detail-grid .box .v{font-size:17px; font-weight:700; margin-top:4px}
.drawer-sec{margin-top:16px}
.drawer-sec h4{margin:0 0 8px; font-size:13px; color:var(--muted)}
.prod-img{width:100%; aspect-ratio:4/3; object-fit:cover; border-radius:12px; margin-bottom:6px; background:#f1f5f9}
.stat .value.purple{color:#7c3aed}

/* ============================================================
   第三方接口文档页（api-docs.html）
   ============================================================ */
.docwrap{display:flex; align-items:flex-start; min-height:calc(100vh - 56px)}
.docnav{display:none; flex:0 0 244px; width:244px; position:sticky; top:56px; height:calc(100vh - 56px);
  overflow-y:auto; padding:18px 10px 40px; background:#fff; border-right:1px solid var(--line)}
.docnav-t{font-size:11.5px; font-weight:800; color:var(--muted); letter-spacing:.08em; padding:0 10px 8px}
.docnav-t2{font-size:11.5px; font-weight:800; color:var(--muted); letter-spacing:.08em; padding:10px 10px 6px}
.docnav-sep{height:1px; background:var(--line); margin:10px 10px}
.docnav-a{display:block; padding:7px 10px; border-radius:9px; font-size:13px; color:var(--ink-2); font-weight:600;
  transition:.14s; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.docnav-a:hover{background:#f1f5f9; color:var(--fg)}
.docnav-a.active{background:var(--pri-bg); color:var(--pri-d)}
.docnav-a.sub{font-size:12.5px; font-weight:500; font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
.docchips{position:sticky; top:56px; z-index:30; display:flex; gap:8px; overflow-x:auto; padding:9px 12px;
  background:rgba(255,255,255,.94); backdrop-filter:blur(8px); border-bottom:1px solid var(--line)}
.docchips a{flex:0 0 auto; padding:5px 12px; border-radius:999px; background:#f1f5f9; color:var(--ink-2);
  font-size:12.5px; font-weight:600; border:1px solid var(--line)}
.docchips a.active{background:var(--pri); color:#fff; border-color:var(--pri)}
.docmain{flex:1; min-width:0}
.doccontent{max-width:920px; margin:0 auto; padding:20px 18px 60px}
.docsec{margin-bottom:6px; scroll-margin-top:76px}
.doc-h2{font-size:19px; margin:26px 0 12px; display:flex; align-items:baseline; gap:9px; flex-wrap:wrap}
.doc-h2 small{font-size:12px; color:var(--muted); font-weight:500}
.doc-h4{font-size:12.5px; color:var(--muted); font-weight:700; margin:16px 0 7px; letter-spacing:.02em}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,"Courier New",monospace; font-size:12.5px}

/* hero */
.doc-hero{display:grid; gap:18px; grid-template-columns:1.35fr 1fr; background:
  radial-gradient(120% 140% at 0% 0%, #eef8fc 0%, #ffffff 58%);}
.doc-hero h1{font-size:22px; letter-spacing:.2px; margin-bottom:8px}
.doc-hero p{margin:0 0 12px; font-size:13px; line-height:1.7}
.doc-badges{display:flex; gap:7px; flex-wrap:wrap}
.doc-hero-r{border-left:1px dashed var(--line); padding-left:18px}
.doc-hero-r .k{font-size:11.5px; color:var(--muted); font-weight:700}
.doc-hero-r .v{word-break:break-all; font-weight:700; color:var(--pri-d); margin:4px 0 6px; line-height:1.5}
.doc-hint{font-size:11.5px; color:var(--muted); line-height:1.6}
.doc-hero-act{display:flex; gap:8px; margin-top:10px; flex-wrap:wrap}

/* 流程 */
.doc-step{display:flex; gap:13px; padding:11px 0; border-bottom:1px dashed var(--line)}
.doc-step:last-child{border-bottom:none; padding-bottom:0}
.doc-step .n{flex:0 0 26px; width:26px; height:26px; border-radius:9px; background:var(--pri-bg); color:var(--pri-d);
  font-weight:800; font-size:13px; display:flex; align-items:center; justify-content:center}
.doc-step .t{font-weight:700; font-size:13.5px}
.doc-step .d{font-size:12.5px; color:var(--muted); line-height:1.65; margin-top:2px}

/* 模式卡 */
.mode-grid{display:grid; gap:14px; grid-template-columns:repeat(auto-fit,minmax(300px,1fr))}
.mode-card{background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:16px; box-shadow:var(--shadow)}
.mode-card .mode-h{display:flex; align-items:center; gap:9px; margin-bottom:8px}
.mode-card p{font-size:12.5px; line-height:1.7; margin:0 0 10px}
.mode-kv{display:flex; gap:10px; justify-content:space-between; font-size:12.5px; padding:6px 0; border-top:1px dashed var(--line)}
.mode-kv span{color:var(--muted); flex:0 0 auto}
.mode-kv b{text-align:right; font-weight:700; word-break:break-all}

/* 接口卡 */
.ep{padding:16px 18px}
.ep-h{display:flex; align-items:center; gap:9px; flex-wrap:wrap; margin-bottom:9px}
.ep-h .spacer{flex:1}
.ep-path{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:13px; font-weight:700;
  color:var(--fg); background:#f1f5f9; padding:4px 9px; border-radius:8px; border:1px solid var(--line)}
.ep-t{font-size:15px; font-weight:800; margin-bottom:4px}
.ep-s{font-size:12.5px; color:var(--muted); line-height:1.7; margin:0 0 12px}
.meth{display:inline-block; padding:4px 9px; border-radius:8px; font-size:11.5px; font-weight:800; letter-spacing:.04em;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
.meth-get{background:var(--acc-bg); color:var(--acc-d)}
.meth-post{background:#dcfce7; color:#15803d}
.meth-put{background:var(--warn-bg); color:#b45309}
.meth-del{background:var(--err-bg); color:#b91c1c}

/* 表格（文档内） */
table.t.doc-t th{font-size:11.5px; text-transform:none; letter-spacing:0}
table.t.doc-t td{font-size:12.5px; vertical-align:top; line-height:1.65}
table.t.doc-t .t-k{font-weight:700; color:var(--pri-d)}

/* 代码块（浅色，贴合整站风格） */
.code-grid{display:grid; gap:12px; grid-template-columns:1fr 1fr; margin-top:14px}
.codeblock{border:1px solid var(--line); border-radius:12px; overflow:hidden; background:#fbfcfe}
.cb-h{display:flex; align-items:center; justify-content:space-between; gap:8px; padding:7px 10px;
  background:#f1f5f9; border-bottom:1px solid var(--line); font-size:11.5px; font-weight:700; color:var(--muted)}
.codeblock pre{margin:0; padding:11px 12px; overflow-x:auto; max-height:340px}
.codeblock code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:12px; line-height:1.65;
  color:var(--fg); white-space:pre}
.j-k{color:var(--acc-d); font-weight:700}
.j-s{color:#0f766e}
.j-n{color:#b45309}
.j-b{color:#7c3aed}

/* 提示块 */
.doc-note{margin-top:14px; border:1px solid var(--line); border-left:3px solid var(--pri); border-radius:10px;
  padding:11px 13px; background:#f8fcfd; font-size:12.5px; line-height:1.7}
.doc-note b{display:block; margin-bottom:4px; font-size:12.5px}
.doc-note ul{margin:0; padding-left:18px}
.doc-note li{margin:2px 0}
.doc-note.warn{border-left-color:var(--warn); background:var(--warn-bg)}
.doc-note.err{border-left-color:var(--err); background:var(--err-bg)}
.doc-note .pill{font-size:11px; padding:2px 8px}

/* 变更记录 */
.cl-row{display:flex; gap:14px; padding:10px 0; border-bottom:1px dashed var(--line); font-size:12.5px}
.cl-row:last-child{border-bottom:none}
.cl-v{flex:0 0 108px; display:flex; flex-direction:column; gap:2px}
.cl-row ul{margin:0; padding-left:16px; line-height:1.7}
.doc-foot{margin-top:14px; font-size:11.5px; color:var(--muted); line-height:1.7; text-align:center}
.sb-id{margin:8px 0 6px; font-size:12.5px}

/* 响应式 */
@media (max-width:1023px){
  .doc-hero{grid-template-columns:1fr}
  .doc-hero-r{border-left:none; border-top:1px dashed var(--line); padding-left:0; padding-top:14px}
  .code-grid{grid-template-columns:1fr}
}
@media (min-width:1024px){
  .docnav{display:block}
  .docchips{display:none}
}
@media print{
  .topbar,.docnav,.docchips,.doc-hero-act,.cb-h button,.ep-h .spacer{display:none!important}
  body{background:#fff}
  .card,.mode-card{box-shadow:none; break-inside:avoid}
  .codeblock pre{max-height:none; white-space:pre-wrap; word-break:break-all}
  .doccontent{max-width:100%; padding:0}
}

/* ===========================================================================
   顶栏手机端（≤640px）
   问题：品牌名 / 角色胶囊 / 门户 / 退出 在 390px 上会被逐字折行，
   实际渲染成「消费分\n红平台」「门\n户」「退\n出」，很难看。
   处理：品牌不换行、副标与角色胶囊让位给导航，操作项统一 nowrap。
   =========================================================================== */
@media (max-width:640px){
  .topbar{height:52px; padding:0 11px; gap:6px}
  .topbar .brand{font-size:14px; gap:7px; white-space:nowrap; flex:none}
  .topbar .brand::before{width:9px; height:9px; border-radius:2.5px; box-shadow:none}
  .topbar .sub{display:none}
  /* rolePill 的 display 由 JS 写在内联 style 上，普通类规则压不住，必须 !important；
     但后台管理员需要知道自己是谁，所以不隐藏、改成截断显示。 */
  /* 132px 是量出来的：会员端「139****0001 · 已实名」需要约 82px 内容宽，
     再留出内边距与省略号余量；再窄就会把「已实名」整个吃掉，而它是提现的前置条件。 */
  .topbar .role{max-width:132px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
    font-size:11px; padding:3px 7px; line-height:1.3}
  .topbar a.link{padding:6px 7px; font-size:12px; white-space:nowrap; flex:none}
  .topbar .logout{padding:5px 8px; font-size:12px; white-space:nowrap; flex:none}
  .topbar .spacer{min-width:0}
}

/* 窄屏标题行：`.section-title` 里是「标题 + <small> + spacer + 按钮」，
   390px 下四者互相挤压，标题会被压成两行。改成两行栅格：第一行标题+按钮，第二行副标整行。 */
@media (max-width:640px){
  .section-title{display:grid; grid-template-columns:auto 1fr auto; align-items:center;
    gap:5px 8px; font-size:16px; margin:2px 2px 12px}
  .section-title > span[style*="flex:1"]{display:none}
  .section-title small{grid-column:1 / -1; font-size:11px; line-height:1.45; font-weight:500}
  /* 显式钉在第一行第三列：<small> 占掉整行后，按钮会被自动放置挤到第三行 */
  .section-title .btn{grid-column:3; grid-row:1; justify-self:end;
    font-size:11.5px; padding:5px 9px; height:auto; white-space:nowrap}

  /* 底栏保持「每项定宽 + 横向滚动」。曾试过 flex:1 1 0 均分，
     结果是后台 18 个入口被压成 21px 宽的小图标，完全没法点——不要改回均分。 */
  .bottomnav .navitem{flex:0 0 auto; min-width:64px; font-size:10.5px}
  .bottomnav .navitem .lbl{max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
}
