:root{
  --bg:#f2f6f4;
  --bg2:#e9f0ec;
  --card:#ffffff;
  --card2:#f6f9f7;
  --line:#dfe8e2;
  --text:#1f2937;
  --muted:#6b7280;
  --green:#16a34a;
  --green2:#22c55e;
  --green-lite:#e7f5ec;
  --gold:#f5a623;
  --red:#ef4444;
  --radius:12px;
}
*{margin:0;padding:0;box-sizing:border-box}
body{
  font-family:-apple-system,"PingFang SC","Microsoft YaHei",Segoe UI,sans-serif;
  background:var(--bg);color:var(--text);min-height:100vh;
}
a{color:inherit;text-decoration:none}
img{max-width:100%}

/* 顶部导航 */
.topbar{position:sticky;top:0;z-index:50;background:#fff;border-bottom:1px solid var(--line);box-shadow:0 1px 6px rgba(0,0,0,.04)}
.topbar-inner{max-width:1200px;margin:0 auto;padding:0 16px;height:60px;display:flex;align-items:center;gap:22px}
.logo{display:flex;align-items:center;gap:9px;font-weight:800;font-size:20px;letter-spacing:.5px;color:#111827}
.logo .mark{width:34px;height:34px;border-radius:9px;object-fit:cover;box-shadow:0 3px 12px rgba(0,0,0,.2)}}
.logo b{color:#0f7a4e}
.nav{display:flex;gap:4px;flex:1}
.nav a{padding:8px 14px;border-radius:8px;font-weight:600;color:var(--muted);transition:.15s}
.nav a:hover{color:var(--green);background:var(--green-lite)}
.nav a.active{color:var(--green);background:var(--green-lite)}
.userbox{display:flex;align-items:center;gap:10px}
.avatar{width:32px;height:32px;border-radius:50%;background:linear-gradient(135deg,var(--green2),#0d9668);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:14px}
.btn{display:inline-flex;align-items:center;gap:6px;padding:8px 16px;border-radius:8px;border:1px solid var(--line);background:#fff;color:var(--text);font-weight:600;cursor:pointer;font-size:14px;transition:.15s}
.btn:hover{border-color:var(--green);color:var(--green)}
.btn.primary{background:linear-gradient(135deg,var(--green2),#0fa968);color:#fff;border:none;font-weight:700}
.btn.primary:hover{filter:brightness(1.05);color:#fff}
.btn.accent{background:linear-gradient(135deg,var(--gold),#f59e0b);color:#fff;border:none;font-weight:700}
.btn.danger{background:#fff;border-color:#fca5a5;color:var(--red)}
.btn.ghost{background:transparent}
.btn.sm{padding:4px 10px;font-size:12px;border-radius:6px}
.btn[disabled]{opacity:.5;cursor:not-allowed}

.wrap{max-width:1200px;margin:0 auto;padding:22px 16px 60px}

/* 卡片 */
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:18px}
.grid{display:grid;gap:16px}
.grid.cols-3{grid-template-columns:repeat(3,1fr)}
.grid.cols-4{grid-template-columns:repeat(4,1fr)}
@media(max-width:960px){.grid.cols-3,.grid.cols-4{grid-template-columns:repeat(2,1fr)}}
@media(max-width:600px){.grid.cols-3,.grid.cols-4{grid-template-columns:1fr}}

/* ===== 叶子游戏风格：排序栏 ===== */
.sort-bar{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:12px 14px;display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-bottom:16px}
.sort-bar .lbl{font-size:13px;color:var(--muted);margin-right:4px;font-weight:600}
.sort-tab{padding:6px 14px;border-radius:8px;font-size:14px;cursor:pointer;color:var(--text);border:1px solid var(--line);background:#fff;transition:.15s;font-weight:500}
.sort-tab:hover{border-color:var(--green);color:var(--green)}
.sort-tab.active{background:var(--green);border-color:var(--green);color:#fff}

/* ===== 叶子游戏风格：商品列表卡片 ===== */
.item-row{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:14px 16px;margin-bottom:12px;display:flex;align-items:center;gap:14px;transition:.15s}
.item-row:hover{border-color:var(--green);box-shadow:0 4px 14px rgba(22,163,74,.08)}
.item-row .ic{width:64px;height:64px;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0;box-shadow:inset 0 2px 4px rgba(255,255,255,.6),0 4px 12px rgba(0,0,0,.08)}
.item-row .ic.cat-哈夫币{background:linear-gradient(135deg,#fef3c7,#fde68a)}
.item-row .ic.cat-AWM{background:linear-gradient(135deg,#d1fae5,#a7f3d0)}
.item-row .ic.cat-6头{background:linear-gradient(135deg,#ede9fe,#ddd6fe)}
.item-row .ic.cat-6甲{background:#fef3c7}
.item-main{flex:1;min-width:0}
.item-row .no{font-size:12px;color:var(--muted);margin-bottom:3px}
.item-row .no b{color:var(--green);font-weight:600}
.item-row .t{font-weight:700;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.item-row .t .cat{display:inline-block;font-size:11px;font-weight:600;padding:1px 7px;border-radius:5px;margin-right:6px;vertical-align:1px}
.item-row .t .cat.哈夫币{background:#fef3c7;color:#b45309}
.item-row .t .cat.AWM{background:#d1fae5;color:#047857}
.item-row .t .cat.6头{background:#ede9fe;color:#6d28d9}
.item-row .t .cat.6甲{background:#fef3c7;color:#b45309}
.item-row .t .cat.其他{background:#e5e7eb;color:#374151}
.prop-grid{display:flex;flex-wrap:wrap;gap:6px 16px;margin-top:7px}
.prop{font-size:13px;color:var(--text)}
.prop .k{color:var(--muted)}
.prop .v{font-weight:600}
.prop .v.gold{color:var(--gold)}
.prop .v.green{color:var(--green)}
.item-row .side{text-align:right;flex-shrink:0;min-width:150px}
.item-row .price{font-size:20px;font-weight:800;color:var(--green)}
.item-row .price small{font-size:12px;color:var(--muted);font-weight:500}
.item-row .stock{font-size:12px;color:var(--muted);margin:4px 0 8px}
.item-row .merchant{font-size:12px;color:var(--muted)}

/* 表格式商品（后台/店铺复用） */
.table{width:100%;border-collapse:collapse;font-size:13px}
.table th{text-align:left;padding:9px 12px;color:var(--muted);font-weight:600;border-bottom:1px solid var(--line);white-space:nowrap;background:var(--card2)}
.table td{padding:9px 12px;border-bottom:1px solid var(--line)}
.table tr:hover td{background:#fafdfb}
.table .op{display:flex;gap:6px;flex-wrap:wrap}

/* 表单 */
.field{margin-bottom:14px}
.field label{display:block;font-size:13px;color:var(--muted);margin-bottom:6px;font-weight:600}
.input,select.input,textarea.input{width:100%;padding:10px 13px;border-radius:8px;border:1px solid var(--line);background:#fff;color:var(--text);font-size:14px;outline:none;transition:.15s}
.input:focus{border-color:var(--green);box-shadow:0 0 0 3px rgba(34,197,94,.12)}
textarea.input{resize:vertical;min-height:80px}
.row{display:flex;gap:12px}
.row>*{flex:1}

/* 统计卡 */
.stat{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:16px}
.stat .num{font-size:26px;font-weight:800;margin-top:5px;color:var(--green)}
.stat .lbl{color:var(--muted);font-size:13px}

/* 聊天 */
.chat-wrap{display:flex;gap:16px;height:calc(100vh - 150px);min-height:460px}
.chat-panel{flex:1;display:flex;flex-direction:column;background:#fff;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden}
.chat-head{padding:13px 18px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:10px}
.chat-head .dot{width:8px;height:8px;border-radius:50%;background:var(--green);box-shadow:0 0 8px var(--green)}
.chat-msgs{flex:1;overflow-y:auto;padding:15px 18px;display:flex;flex-direction:column;gap:11px}
.msg{display:flex;gap:10px}
.msg .ava{width:30px;height:30px;border-radius:50%;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:12px;background:linear-gradient(135deg,var(--green2),#0d9668);color:#fff}
.msg .bubble{background:var(--card2);padding:8px 12px;border-radius:12px;font-size:14px;line-height:1.5;max-width:72%}
.msg .meta{font-size:12px;color:var(--muted);margin-bottom:3px;display:flex;gap:8px}
.msg .meta .role{font-size:10px;background:var(--green);color:#fff;padding:0 6px;border-radius:4px}
.msg.system{align-items:center;justify-content:center}
.msg.system .bubble{background:transparent;color:var(--muted);font-size:12px}
.msg.me{align-items:flex-end}
.msg.me .meta{justify-content:flex-end}
.chat-input{border-top:1px solid var(--line);padding:11px 16px;display:flex;gap:10px}
.chat-input .input{flex:1}
.online-list{width:230px;background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:14px}
.online-list h4{font-size:13px;color:var(--muted);margin-bottom:10px}
.online-list .u{display:flex;align-items:center;gap:8px;padding:7px 4px;font-size:14px}
.online-list .dot{width:7px;height:7px;border-radius:50%;background:var(--green)}

/* 弹窗 */
.modal-mask{position:fixed;inset:0;background:rgba(17,24,39,.45);display:none;align-items:center;justify-content:center;z-index:100}
.modal-mask.show{display:flex}
.modal{background:#fff;border:1px solid var(--line);border-radius:16px;padding:22px;width:100%;max-width:460px;max-height:90vh;overflow-y:auto;box-shadow:0 20px 50px rgba(0,0,0,.15)}
.modal h3{font-size:18px;margin-bottom:14px}
.modal .close{float:right;cursor:pointer;color:var(--muted);font-size:20px}

/* 其他 */
.badge{font-size:11px;padding:2px 8px;border-radius:6px;font-weight:600}
.badge.pending{background:#fef3c7;color:#b45309}
.badge.on_sale,.badge.done,.badge.paid{background:#d1fae5;color:#047857}
.badge.off_sale,.badge.rejected,.badge.cancelled{background:#fee2e2;color:#b91c1c}
.badge.user{background:#e5e7eb;color:#374151}
.badge.merchant{background:#d1fae5;color:#047857}
.badge.admin{background:#ede9fe;color:#6d28d9}
.badge.active{background:#d1fae5;color:#047857}
.empty{text-align:center;color:var(--muted);padding:50px 0;font-size:15px}
.page-title{font-size:20px;font-weight:800;margin-bottom:16px}
.muted{color:var(--muted)}.small{font-size:13px}
.flex{display:flex;align-items:center;gap:10px}
.between{justify-content:space-between}
.mt{margin-top:14px}.mb{margin-bottom:14px}
.hidden{display:none!important}
.toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:16px}
.toolbar .spacer{flex:1}
.toast{position:fixed;top:18px;left:50%;transform:translateX(-50%);background:#111827;color:#fff;padding:10px 20px;border-radius:9px;z-index:200;font-size:14px;box-shadow:0 8px 30px rgba(0,0,0,.25);opacity:0;transition:.25s}
.toast.show{opacity:1}
.toast.error{border-left:4px solid var(--red)}
.toast.ok{border-left:4px solid var(--green)}

/* 登录页 */
.auth-page{min-height:100vh;display:flex;align-items:center;justify-content:center;background:linear-gradient(160deg,#e7f5ec,#d8efe3)}
.auth-card{width:100%;max-width:400px;padding:34px;background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:0 16px 50px rgba(0,0,0,.08)}
.auth-card .logo{margin-bottom:24px;justify-content:center;font-size:22px}
.auth-tabs{display:flex;margin-bottom:20px;background:var(--bg2);border-radius:9px;padding:4px;gap:4px}
.auth-tabs button{flex:1;padding:9px;border:none;background:transparent;color:var(--muted);font-weight:700;border-radius:7px;cursor:pointer;font-size:14px}
.auth-tabs button.active{background:#fff;color:var(--green);box-shadow:0 1px 4px rgba(0,0,0,.08)}
.auth-foot{text-align:center;margin-top:16px;color:var(--muted);font-size:13px}
.auth-foot a{color:var(--green);cursor:pointer}

/* 详情弹窗缩略图 */
.item-thumb{border-radius:12px;display:flex;align-items:center;justify-content:center;background:var(--bg2)}
.item-thumb.cat-哈夫币{background:#fef3c7}
.item-thumb.cat-AWM{background:#d1fae5}
.item-thumb.cat-6头{background:#ede9fe}
.item-thumb.cat-6甲{background:#fef3c7}

/* 群聊三栏布局 */
.chat-layout{display:grid;grid-template-columns:230px 1fr 250px;gap:16px;height:calc(100vh - 140px);min-height:480px}
@media(max-width:960px){.chat-layout{grid-template-columns:1fr;height:auto}.group-list{order:0}.chat-panel{order:1;height:62vh;min-height:420px}.group-info{order:2}}
.chat-panel,.group-list,.group-info{display:flex;flex-direction:column}
.group-list-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.group-list-body{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:8px}
.group-item{border:1px solid var(--line);border-radius:9px;padding:10px 12px;cursor:pointer;transition:.15s}
.group-item:hover{border-color:var(--green)}
.group-item.active{border-color:var(--green);background:var(--green-lite)}
.gi-name{font-weight:700;font-size:14px}
.gi-sub{font-size:12px;color:var(--muted);margin-top:3px}
.order-banner{background:var(--green-lite);border-bottom:1px solid #cde7d5;padding:10px 18px;font-size:13px;color:#14532d}
.order-banner .gold{color:var(--gold)}
.order-info{font-size:14px;line-height:1.7}
.member-list{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:8px}
.member{display:flex;align-items:center;gap:8px;font-size:14px}
.mrole{margin-left:auto;font-size:11px;background:var(--green-lite);color:var(--green);padding:1px 7px;border-radius:5px;font-weight:600}
.gold{color:var(--gold)}

/* 商品图片 */
.item-row .ic.has-img{background:transparent;padding:0}
.item-row .ic img{width:100%;height:100%;object-fit:cover;border-radius:10px}
.img-prev{margin-top:8px}
.thumb-preview{width:84px;height:84px;object-fit:cover;border-radius:9px;border:1px solid var(--line);background:var(--bg2)}

/* ===== 手机端适配 ===== */
@media (max-width:640px){
  .topbar-inner{height:54px;padding:0 10px;gap:10px}
  .logo{font-size:17px}.logo .mark{width:30px;height:30px;font-size:15px}
  .nav{gap:2px}.nav a{padding:6px 9px;font-size:13px}
  .userbox .small{display:none}
  .wrap{padding:14px 10px 50px}
  .sort-bar{padding:10px;gap:5px}
  .sort-tab{padding:5px 10px;font-size:13px;white-space:nowrap}
  .item-row{flex-wrap:wrap;gap:10px;padding:11px}
  .item-row .ic{width:48px;height:48px;font-size:24px}
  .item-main{flex:1 1 0;min-width:150px}
  .item-row .t{font-size:14px}
  .item-row .no{font-size:11px}
  .item-row .side{min-width:0;flex:1 0 100%;display:flex;align-items:center;gap:10px;text-align:left}
  .item-row .side .price{font-size:17px}
  .item-row .side .stock{margin:0;font-size:11px;flex:1}
  .item-row .side .btn{flex-shrink:0}
  .item-row .merchant{font-size:11px}
  .prop-grid{gap:4px 10px}
  .toolbar .input{max-width:none!important}
  .chat-layout{height:calc(100vh - 130px)}
  .group-info{padding:14px}
  .table th,.table td{padding:7px 8px;font-size:12px}
  .toolbar{gap:8px}
  .btn{padding:7px 12px;font-size:13px}
}

/* 浮动在线客服 */
.float-service{
  position:fixed;right:16px;bottom:90px;z-index:99;
  display:flex;align-items:center;gap:8px;
  background:#fff;border-radius:24px;padding:8px 14px 8px 8px;
  box-shadow:0 4px 16px rgba(0,0,0,.12);cursor:pointer;
  border:1px solid #f0f0f0;
}
.float-service .svc-ava{width:36px;height:36px;border-radius:50%;object-fit:cover}
.float-service .svc-text{font-size:14px;font-weight:600;color:#16a34a}

/* 底部导航栏 */
.bottom-nav{
  position:fixed;bottom:0;left:0;right:0;z-index:98;
  background:#fff;border-top:1px solid #eee;
  display:flex;align-items:center;justify-content:space-around;
  padding:8px 0 calc(8px + env(safe-area-inset-bottom));
}
.bottom-nav a{
  flex:1;text-align:center;text-decoration:none;color:#999;
  font-size:11px;display:flex;flex-direction:column;align-items:center;gap:2px;
}
.bottom-nav a.active{color:#16a34a}
.bottom-nav a span{font-size:11px}
.bottom-nav .nav-center{position:relative}
.bottom-nav .center-logo{
  width:48px;height:48px;border-radius:50%;object-fit:cover;
  margin-top:-24px;border:3px solid #fff;box-shadow:0 4px 12px rgba(0,0,0,.15);
}
.wrap{padding-bottom:100px}
.topbar{top:0!important}

/* ===== 高级按钮风格（仿叶子游戏） ===== */
.btn{
  border-radius:999px !important;
  padding:10px 22px !important;
  font-weight:600 !important;
  border:none !important;
  box-shadow:0 4px 14px rgba(22,163,74,.25) !important;
  transition:all .2s !important;
}
.btn:active{transform:scale(.97)}
.btn.primary{
  background:linear-gradient(135deg,#22c55e,#16a34a) !important;
  color:#fff !important;
}
.btn.sm{padding:7px 16px !important;font-size:13px !important}
.btn.ghost{
  background:#fff !important;
  color:#666 !important;
  box-shadow:0 2px 8px rgba(0,0,0,.08) !important;
}
.btn.danger{
  background:#fff !important;
  color:#e53935 !important;
  box-shadow:0 2px 8px rgba(229,57,53,.15) !important;
}
.btn.accent{
  background:linear-gradient(135deg,#3b82f6,#2563eb) !important;
  color:#fff !important;
  box-shadow:0 4px 14px rgba(59,130,246,.25) !important;
}

/* 分类图标：彩色渐变圆角方块，不用emoji */
.item-row .ic{
  border-radius:14px !important;
  font-size:12px !important;
  font-weight:800 !important;
  color:#fff !important;
  text-shadow:0 1px 3px rgba(0,0,0,.2) !important;
}
.ic.cat-哈夫币{background:linear-gradient(135deg,#fbbf24,#f59e0b) !important}
.ic.cat-AWM{background:linear-gradient(135deg,#34d399,#10b981) !important}
.ic.cat-6头{background:linear-gradient(135deg,#a78bfa,#8b5cf6) !important}
.ic.cat-6甲{background:linear-gradient(135deg,#60a5fa,#3b82f6) !important}
.ic.cat-其他{background:linear-gradient(135deg,#94a3b8,#64748b) !important}

/* 分类标签 */
.cat{
  border-radius:6px !important;
  padding:2px 8px !important;
  font-size:11px !important;
  font-weight:700 !important;
}
.cat-哈夫币{background:#fef3c7;color:#d97706 !important}
.cat-AWM{background:#d1fae5;color:#059669 !important}
.cat-6头{background:#ede9fe;color:#7c3aed !important}
.cat-6甲{background:#dbeafe;color:#2563eb !important}

/* 搜索框圆角 */
.input,.toolbar .input{border-radius:999px !important}

/* 卡片阴影更柔和 */
.card{box-shadow:0 2px 16px rgba(0,0,0,.05) !important;border-radius:16px !important}
.item-row{border-radius:14px !important;transition:all .2s}
.item-row:active{transform:scale(.99)}
.img-prev span{display:inline-block !important;margin:4px !important;}
.img-prev img{width:80px !important;height:80px !important;object-fit:cover !important;border-radius:8px !important;}.item-row{display:flex !important;align-items:center !important;gap:12px !important;}
.item-row .ic{flex-shrink:0 !important;}
.item-row .item-main{flex:1 !important;min-width:0 !important;}.chat-page{padding-bottom:80px !important}
.side-panel{padding-bottom:20px !important}
/* 群聊页面底部留出导航空间 */
.wrap{padding-bottom:90px !important}
.group-info{padding-bottom:30px !important}
.group-list{padding-bottom:30px !important}
