:root {
  --primary: #3E8EF7;
  --primary-d: #2F74D8;
  --bg: #f3f6fb;
  --card: #ffffff;
  --text: #1f2a3d;
  --muted: #8a96a8;
  --line: #e8edf3;
  --success: #2bb673;
  --warn: #f5a623;
  --danger: #e04848;
  --radius: 14px;
  --shadow: 0 6px 22px rgba(62, 142, 247, 0.10);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }
a { text-decoration: none; color: inherit; }

/* 登录 */
.login-mask { position: fixed; inset: 0; background: linear-gradient(135deg, #3E8EF7, #6FA8F5); display: flex; align-items: center; justify-content: center; }
.login-card { width: 340px; background: #fff; border-radius: 18px; padding: 36px 30px; box-shadow: 0 20px 60px rgba(0,0,0,.2); text-align: center; }
.login-logo { font-size: 22px; font-weight: 700; color: var(--primary-d); }
.login-sub { color: var(--muted); font-size: 12px; margin: 6px 0 22px; letter-spacing: 1px; }
.ipt { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; margin-bottom: 14px; font-size: 14px; outline: none; }
.ipt:focus { border-color: var(--primary); }
.btn-primary { width: 100%; height: 44px; background: var(--primary); color: #fff; border: none; border-radius: 10px; font-size: 15px; cursor: pointer; transition: .2s; }
.btn-primary:hover { background: var(--primary-d); }
.login-tip { margin-top: 14px; color: var(--muted); font-size: 12px; }
.lg-err { color: var(--danger); font-size: 13px; min-height: 18px; margin-bottom: 6px; }

/* 框架 */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 200px; background: #fff; border-right: 1px solid var(--line); padding: 20px 0; position: sticky; top: 0; height: 100vh; }
.side-logo { font-size: 17px; font-weight: 700; color: var(--primary-d); padding: 0 22px 18px; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 12px 22px; color: var(--text); font-size: 14px; border-left: 3px solid transparent; cursor: pointer; }
.side-nav a svg { width: 18px; height: 18px; stroke: var(--muted); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; transition: stroke .2s; }
.side-nav a:hover { background: #f5f8fd; }
.side-nav a:hover svg { stroke: var(--primary); }
.side-nav a.active { color: var(--primary-d); background: #eef5ff; border-left-color: var(--primary); font-weight: 600; }
.side-nav a.active svg { stroke: var(--primary-d); }
.main { flex: 1; display: flex; flex-direction: column; }
.topbar { height: 60px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 26px; position: sticky; top: 0; z-index: 5; }
.page-title { font-size: 18px; font-weight: 700; }
.top-right { display: flex; align-items: center; gap: 14px; }
.admin-name { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.role-badge { font-size: 11px; padding: 2px 8px; border-radius: 20px; font-weight: 600; }
.role-badge.super { background: #eaf6ff; color: #1f6fd6; }
.role-badge.pres { background: #fff3e0; color: #d9772b; }
.role-badge.club { background: #eafaf0; color: #1f9d57; }
.role-badge.custom { background: #f3edff; color: #7a4fd6; }
.role-badge.merchant { background: #e7f7f1; color: #0f9e75; }
.club-badge { font-size: 11px; padding: 2px 8px; border-radius: 20px; background: #fff3e6; color: #d9772b; font-weight: 600; }
.row2 { display: flex; gap: 12px; margin: 10px 0; }
.row2 .ipt { flex: 1; }
.row3 { display: flex; gap: 8px; margin: 8px 0; }
.row3 .ipt, .row3 select.ipt { flex: 1; min-width: 0; margin-bottom: 0; height: 40px; }
.addr-edit { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 10px 0 14px; background: #fafcff; }
.addr-edit .fld { margin-top: 10px; }
.addr-edit .fld:first-child { margin-top: 0; }
.emap { width: 100%; height: 320px; border-radius: 10px; margin-top: 10px; border: 1px solid var(--line); }
.emap-tip { font-size: 13px; color: var(--muted); padding: 30px 12px; text-align: center; line-height: 1.7; }
.perm-title { font-size: 13px; font-weight: 600; margin: 10px 0 8px; color: var(--muted); }
.perms { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px; }
.perms .perm { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); }
.perms .perm input { width: 15px; height: 15px; accent-color: var(--primary); }
.btn-ghost { border: 1px solid var(--line); background: #fff; color: var(--text); padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.content { padding: 24px 26px 56px; }

/* 卡片 / 统计 */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease; }
.stat .num { font-size: 28px; font-weight: 700; color: var(--primary-d); }
.stat .lbl { color: var(--muted); font-size: 13px; margin-top: 6px; }
.stat.clickable { cursor: pointer; position: relative; }
.stat.clickable:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(62,142,247,.18); }
.stat.clickable:hover .num { color: var(--primary); }
.stat.clickable::after { content: '›'; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 22px; color: #cfd8e3; transition: color .15s ease; }
.stat.clickable:hover::after { color: var(--primary); }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 20px; }
.panel { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 20px; }
.panel-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }
.chart-donut { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.chart-donut svg { flex: 0 0 auto; }
.chart-donut .legend { display: flex; flex-direction: column; gap: 8px; min-width: 110px; }
.chart-donut .lg { display: flex; align-items: center; font-size: 13px; color: var(--text); }
.chart-donut .lg .dot { width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; display: inline-block; }
.chart-donut .lg b { margin-left: auto; padding-left: 12px; color: var(--primary-d); }
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 84px 1fr 42px; align-items: center; gap: 10px; }
.bar-label { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { background: #eef1f5; border-radius: 8px; height: 12px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #6fb0ff); border-radius: 8px; transition: width .4s ease; }
.bar-val { font-size: 13px; font-weight: 600; color: var(--primary-d); text-align: right; }

/* 侧栏未读徽标 */
.nav-badge { margin-left: auto; background: #ff5b5b; color: #fff; font-size: 11px; line-height: 1; padding: 2px 6px; border-radius: 10px; font-weight: 600; }
/* 消息提醒 */
.note-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.ntab { font-size: 13px; color: var(--muted); padding: 5px 14px; border-radius: 16px; cursor: pointer; background: #f1f5fb; }
.ntab.on { background: var(--primary); color: #fff; }
.ntabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.note-list { display: flex; flex-direction: column; gap: 10px; }
.note-item { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid #eef1f6; border-radius: 10px; background: #fff; }
.note-item.unread { border-color: #cfe2ff; background: #f5f9ff; }
.note-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: 0 0 auto; background: #8998b9; }
.note-dot.warn { background: #ff9f43; }
.note-dot.ok { background: #5ad8a6; }
.note-dot.info { background: #3E8EF7; }
.note-dot.primary { background: #9270ca; }
.note-dot.muted { background: #8998b9; }
.note-main { flex: 1; min-width: 0; }
.note-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.note-type { font-size: 11px; padding: 1px 8px; border-radius: 8px; color: #fff; background: #8998b9; }
.note-type.warn { background: #ff9f43; }
.note-type.ok { background: #5ad8a6; }
.note-type.info { background: #3E8EF7; }
.note-type.primary { background: #9270ca; }
.note-type.muted { background: #8998b9; }
.note-title { font-weight: 600; font-size: 14px; color: var(--text); }
.note-new { font-size: 11px; color: #ff5b5b; border: 1px solid #ffd0d0; border-radius: 8px; padding: 0 6px; }
.note-body { font-size: 13px; color: #5b6573; margin: 6px 0 4px; line-height: 1.5; }
.note-time { font-size: 12px; }
.note-act { flex: 0 0 auto; align-self: center; }
.muted { color: var(--muted); }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; background: #fafcff; }
tr:hover td { background: #f7faff; }

/* 表头筛选栏 */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.filter-bar .ipt { margin-bottom: 0; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; }
.badge.s { background: #e8f7ef; color: var(--success); }
.badge.p { background: #fff3e0; color: #d9772b; }
.badge.w { background: #fdf2dc; color: var(--warn); }
.badge.d { background: #fdeaea; color: var(--danger); }
.badge.n { background: #eef1f5; color: var(--muted); }
.badge.m { background: #e7f7f1; color: #0f9e75; }
.badge.a { background: #e8f0fe; color: #3E8EF7; }

/* 按钮 */
.btn-sm { display: inline-flex; align-items: center; justify-content: center; padding: 5px 11px; border-radius: 7px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 12px; margin-right: 6px; white-space: nowrap; min-width: 44px; }
.btn-sm.ok { background: var(--success); color: #fff; border-color: var(--success); }
.btn-sm.no { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-sm:hover { opacity: .85; }

/* 表单 */
.form-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.form-row .ipt { width: auto; flex: 1; min-width: 160px; margin-bottom: 0; height: 40px; }
.form-row select.ipt { padding-right: 28px; appearance: auto; }
.fld-col { flex: 1; min-width: 160px; display: flex; flex-direction: column; }
.fld-col .ipt { width: 100%; }
.fld {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 6px;
}
textarea.ipt { height: 80px; padding: 10px 14px; resize: vertical; }

/* 模态 */
.modal-mask { position: fixed; inset: 0; background: rgba(20,30,50,.4); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { background: #fff; border-radius: 16px; padding: 24px; width: 460px; max-width: 92vw; max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.modal-wide { width: 900px; }
.modal.modal-product { width: 90vw; max-width: 1400px; height: 90vh; }
.modal #modal-body { overflow-y: auto; padding-right: 4px; flex: 1; min-height: 0; }
.modal h3 { margin-bottom: 16px; font-size: 16px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* 图片上传控件 */
.merchant-logo-preview { width: 96px; height: 96px; border-radius: 12px; border: 1px dashed var(--line); background: #f7f9fc; overflow: hidden; cursor: pointer; transition: border-color .2s; }
.merchant-logo-preview:hover { border-color: var(--primary); }
.img-upload { margin-bottom: 14px; }
.img-preview { width: 140px; height: 140px; border: 1px dashed var(--line); border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #f7f9fc; margin-bottom: 10px; }
.img-preview img { width: 100%; height: 100%; object-fit: cover; }
.img-ph { color: #97a3b6; font-size: 12px; }
.img-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.img-tip { color: #97a3b6; font-size: 12px; line-height: 1.4; margin-top: 6px; width: 100%; }
.cm-thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; vertical-align: middle; }

/* toast */
.toast { position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%); background: #1f2a3d; color: #fff; padding: 11px 20px; border-radius: 10px; font-size: 14px; z-index: 99; box-shadow: 0 8px 24px rgba(0,0,0,.3); }

/* 工信部备案号页脚 */
.site-footer { position: fixed; left: 0; right: 0; bottom: 0; height: 34px; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #97a3b6; background: rgba(255,255,255,0.9); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border-top: 1px solid rgba(0,0,0,0.06); z-index: 40; }
.site-footer a { color: #3E8EF7; text-decoration: none; transition: color .2s; }
.site-footer a:hover { text-decoration: underline; }

/* 车友会列表页顶部气泡横幅（待审提醒） */
.app-bubble-banner { display: flex; align-items: center; gap: 10px; background: linear-gradient(135deg,#fff7e8,#fff2d6); border: 1px solid #ffd98a; color: #9a6b16; padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-size: 14px; box-shadow: 0 4px 14px rgba(245,166,35,.12); }
.app-bubble-banner b { color: #d9772b; font-size: 15px; }
.app-bubble-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 0 rgba(245,166,35,.6); animation: bubblePulse 1.6s infinite; flex-shrink: 0; }
@keyframes bubblePulse { 0% { box-shadow: 0 0 0 0 rgba(245,166,35,.6); } 70% { box-shadow: 0 0 0 8px rgba(245,166,35,0); } 100% { box-shadow: 0 0 0 0 rgba(245,166,35,0); } }

/* 浮动气泡提醒层 */
.bubble-layer { position: fixed; top: 76px; right: 22px; z-index: 120; display: flex; flex-direction: column; gap: 12px; max-width: 320px; }
.bubble { position: relative; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: 12px; padding: 14px 36px 14px 16px; font-size: 13px; color: var(--text); box-shadow: 0 10px 30px rgba(0,0,0,.16); animation: bubbleIn .32s cubic-bezier(.2,.8,.3,1.1); }
.bubble b { font-size: 14px; color: #d9772b; }
.bubble-out { animation: bubbleOut .3s forwards; opacity: 0; transform: translateX(20px); }
.bubble-close { position: absolute; top: 6px; right: 10px; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
@keyframes bubbleIn { from { opacity: 0; transform: translateX(24px) scale(.96); } to { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes bubbleOut { to { opacity: 0; transform: translateX(24px) scale(.96); } }

.empty { color: var(--muted); text-align: center; padding: 30px; }
.detail-head { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.detail-head .logo { width: 56px; height: 56px; border-radius: 12px; background: linear-gradient(135deg,#3E8EF7,#6FA8F5); color:#fff; display:flex; align-items:center; justify-content:center; font-size:22px; font-weight:700; }
.back { cursor: pointer; color: var(--primary); font-size: 13px; margin-bottom: 12px; display: inline-block; }
.kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 28px; }
.kv > div { display: flex; gap: 8px; align-items: baseline; }
.kv .k { color: var(--muted); min-width: 72px; flex-shrink: 0; }
.kv span:last-child { color: var(--text); }

/* 角色权限管理 */
.role-card { background: #fafcff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.role-card .rc-head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.role-card .rc-ops { margin-top: 10px; }

/* 页面装修 · Banner 背景可视化上传 */
.bn-bg-block { margin-bottom: 14px; }
.bn-bg-label { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.bn-preview { width: 100%; height: 120px; border-radius: 12px; border: 1px solid var(--line); background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; overflow: hidden; background-color: #eef3fb; }
.bn-preview-tip { font-size: 13px; color: var(--muted); opacity: .8; }
.bn-bg-actions { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.bn-color-wrap { font-size: 13px; color: var(--muted); }

/* 页面装修 · 排序箭头按钮 */
.bn-arrow { width: 30px; height: 28px; line-height: 1; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--primary-d); cursor: pointer; font-size: 15px; font-weight: 700; margin-right: 4px; padding: 0; }
.bn-arrow:hover:not(:disabled) { border-color: var(--primary); background: #eef5ff; }
.bn-arrow:disabled { color: #c5cedb; cursor: not-allowed; opacity: .6; }

/* 侧边栏 · 菜单排序 */
.side-foot { padding: 14px 22px 18px; }
.side-sort-btn { width: 100%; border: 1px dashed var(--line); background: #fafcff; color: var(--muted); padding: 9px; border-radius: 10px; cursor: pointer; font-size: 13px; }
.side-sort-btn:hover { border-color: var(--primary); color: var(--primary); }
.side-nav.sorting a { background: #fff7e8 !important; border-left-color: var(--warn) !important; }
.side-nav.sorting a .nav-badge { display: none; }

/* 会员列表 · 账户余额列 */
td.money { text-align: right; font-variant-numeric: tabular-nums; font-family: 'SF Mono', 'Roboto Mono', Consolas, monospace; color: #c0392b; font-weight: 600; }
.panel .kv .money { color: #c0392b; font-weight: 600; font-variant-numeric: tabular-nums; }
.mn-ctrl { margin-left: auto; display: inline-flex; gap: 4px; }
.mn-arrow { width: 24px; height: 22px; line-height: 1; border-radius: 6px; border: 1px solid var(--line); background: #fff; color: var(--primary-d); cursor: pointer; font-size: 13px; font-weight: 700; padding: 0; }
.mn-arrow:hover { border-color: var(--primary); background: #eef5ff; }
.menu-sort-foot { padding: 12px 22px; display: flex; gap: 8px; }
.menu-sort-foot .btn-sm { flex: 1; text-align: center; }

/* 车友会详情 · 设定会长选择器 */
.pp-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.pp-search { margin-bottom: 8px; }
.pp-tip { font-size: 12px; margin-bottom: 10px; }
.pp-list { max-height: 360px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.pp-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pp-row:last-child { border-bottom: none; }
.pp-row:hover:not(.disabled) { background: #eef5ff; }
.pp-row.disabled { opacity: .5; cursor: not-allowed; }
.pp-row .pp-main { flex: 1; font-size: 14px; }
.pp-row .muted { font-size: 12px; }
.pp-row .pp-main .muted { margin-left: 6px; font-size: 12px; }

/* 商品多规格 SKU 编辑器 */
.sku-editor { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.sku-sec-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.sku-dim { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.sku-tbl { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 13px; }
.sku-tbl th, .sku-tbl td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: middle; }
.sku-tbl th { background: #f5f8fc; font-weight: 600; white-space: nowrap; }
.sku-tbl .ipt { padding: 4px 6px; }
.sku-img-prev { width: 56px; height: 56px; border-radius: 8px; overflow: hidden; background: #f0f3f7; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.sku-img-prev img { width: 100%; height: 100%; object-fit: cover; }
.sku-img-prev .img-ph { font-size: 11px; color: #9aa7b8; }

