/* ============ C2C管理后台样式 ============ */
:root{
  --pri:#2563eb; --pri-d:#1d4ed8; --acc:#06b6d4; --gold:#f59e0b; --danger:#ef4444; --ok:#10b981;
  --sidebar:#0f172a; --sidebar-w:230px;
  --ink:#111827; --gray:#6b7280; --bg:#f3f4f6; --card:#fff; --line:#eef0f4;
}
*{margin:0;padding:0;box-sizing:border-box}
body{font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;background:var(--bg);color:var(--ink);font-size:14px}
a{text-decoration:none;color:inherit}
input,select,textarea,button{font-family:inherit;font-size:14px;outline:none}
button{cursor:pointer}
ul{list-style:none}
img{max-width:100%}

/* 布局 */
.layout{display:flex;min-height:100vh}
.sidebar{width:var(--sidebar-w);background:var(--sidebar);color:#94a3b8;position:fixed;top:0;bottom:0;left:0;overflow-y:auto;z-index:50;transition:transform .3s}
.main{margin-left:var(--sidebar-w);flex:1;min-width:0}
.side-logo{display:flex;align-items:center;gap:10px;padding:20px 18px;color:#fff;border-bottom:1px solid rgba(255,255,255,.08)}
.side-logo .badge{width:38px;height:38px;border-radius:10px;background:linear-gradient(135deg,var(--pri),var(--acc));display:flex;align-items:center;justify-content:center;flex-shrink:0}
.side-logo .badge svg{width:22px;height:22px}
.side-logo .name{font-size:16px;font-weight:800}
.side-logo .sub{font-size:11px;color:#64748b;margin-top:2px}
.side-nav{padding:10px 0}
.side-nav .group{font-size:11px;color:#475569;padding:14px 20px 6px;letter-spacing:1px}
.side-nav .item{display:flex;align-items:center;gap:12px;padding:12px 20px;font-size:14px;cursor:pointer;transition:all .2s;border-left:3px solid transparent}
.side-nav .item svg{width:19px;height:19px;flex-shrink:0}
.side-nav .item:hover{background:rgba(255,255,255,.05);color:#e2e8f0}
.side-nav .item.on{background:rgba(37,99,235,.18);color:#fff;border-left-color:var(--pri)}
.side-nav .item .bdg{margin-left:auto;background:var(--danger);color:#fff;font-size:11px;min-width:18px;height:18px;border-radius:9px;display:flex;align-items:center;justify-content:center;padding:0 5px}

/* 顶部 */
.topbar{background:#fff;height:60px;display:flex;align-items:center;padding:0 22px;justify-content:space-between;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:40}
.topbar h2{font-size:18px;font-weight:800}
.topbar .right{display:flex;align-items:center;gap:14px}
.topbar .user{display:flex;align-items:center;gap:8px;font-size:13px}
.topbar .user .ava{width:32px;height:32px;border-radius:50%;background:linear-gradient(135deg,var(--pri),var(--acc));color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:14px}
.menu-btn{display:none;width:36px;height:36px;border-radius:8px;background:#f3f4f6;align-items:center;justify-content:center}

/* 内容 */
.content{padding:22px}
.page-title{font-size:15px;color:var(--gray);margin-bottom:16px}

/* 统计卡片 */
.stat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:20px}
.stat-card{background:#fff;border-radius:14px;padding:18px 20px;display:flex;align-items:center;gap:14px;box-shadow:0 1px 3px rgba(17,24,39,.04)}
.stat-card .ic{width:48px;height:48px;border-radius:12px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.stat-card .ic svg{width:24px;height:24px}
.stat-card .num{font-size:24px;font-weight:800;line-height:1.2}
.stat-card .lbl{font-size:12px;color:var(--gray);margin-top:2px}

/* 面板 */
.panel{background:#fff;border-radius:14px;padding:20px;margin-bottom:18px;box-shadow:0 1px 3px rgba(17,24,39,.04)}
.panel h3{font-size:16px;font-weight:700;margin-bottom:16px;display:flex;align-items:center;gap:8px}
.panel h3 .dot{width:4px;height:16px;border-radius:2px;background:var(--pri)}

/* 表格 */
.tbl-wrap{overflow-x:auto}
table{width:100%;border-collapse:collapse;min-width:720px}
th{background:#f8fafc;padding:12px 14px;text-align:left;font-size:12.5px;color:var(--gray);font-weight:600;border-bottom:1px solid var(--line);white-space:nowrap}
td{padding:12px 14px;border-bottom:1px solid var(--line);font-size:13px;vertical-align:middle}
tr:hover td{background:#fafbfc}
td .th-ava{width:34px;height:34px;border-radius:50%;object-fit:cover}
.pill{display:inline-block;padding:3px 10px;border-radius:8px;font-size:11.5px;font-weight:600}
.pill.blue{background:#eff6ff;color:#2563eb}
.pill.green{background:#ecfdf5;color:#059669}
.pill.gold{background:#fffbeb;color:#b45309}
.pill.red{background:#fef2f2;color:#dc2626}
.pill.gray{background:#f3f4f6;color:#6b7280}
.pill.purple{background:#f5f3ff;color:#7c3aed}
.btn{padding:6px 14px;border-radius:8px;font-size:12.5px;font-weight:600;border:none;cursor:pointer;transition:all .2s}
.btn.blue{background:var(--pri);color:#fff}
.btn.blue:hover{background:var(--pri-d)}
.btn.green{background:#059669;color:#fff}
.btn.red{background:#fee2e2;color:#dc2626}
.btn.gray{background:#f3f4f6;color:var(--gray)}
.btn.gold{background:#fff7ed;color:#c2410c}
.btn.outline{border:1px solid #d1d5db;background:#fff;color:var(--ink)}
.btn-sm{padding:4px 10px;font-size:12px}
.btn:disabled{opacity:.5;cursor:not-allowed}

/* 搜索/筛选栏 */
.toolbar{display:flex;gap:10px;margin-bottom:16px;flex-wrap:wrap;align-items:center}
.toolbar input[type=text],.toolbar select{padding:9px 14px;border:1px solid var(--line);border-radius:10px;background:#fff;min-width:180px}
.toolbar .btn{padding:9px 18px;border-radius:10px}

/* 分页 */
.pager{display:flex;gap:6px;align-items:center;justify-content:flex-end;margin-top:14px}
.pager button{padding:6px 12px;border-radius:8px;border:1px solid var(--line);background:#fff;font-size:12.5px}
.pager button.on{background:var(--pri);color:#fff;border-color:var(--pri)}
.pager .info{font-size:12px;color:var(--gray);margin-right:8px}

/* 仪表盘趋势 */
.trend-bars{display:flex;align-items:flex-end;gap:8px;height:150px;padding-top:10px}
.trend-bars .col{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:6px;height:100%}
.trend-bars .bar{width:100%;max-width:40px;background:linear-gradient(180deg,var(--pri),var(--acc));border-radius:6px 6px 0 0;min-height:3px;position:relative;transition:height .4s}
.trend-bars .bar span{position:absolute;top:-20px;left:50%;transform:translateX(-50%);font-size:10.5px;color:var(--gray);white-space:nowrap}
.trend-bars .lbl{font-size:11px;color:var(--gray)}
.cat-bars{display:flex;flex-direction:column;gap:10px}
.cat-bars .row{display:flex;align-items:center;gap:10px}
.cat-bars .nm{width:90px;font-size:13px;color:var(--gray);text-align:right;flex-shrink:0}
.cat-bars .track{flex:1;height:16px;background:#f3f4f6;border-radius:8px;overflow:hidden}
.cat-bars .fill{height:100%;background:linear-gradient(90deg,var(--pri),var(--acc));border-radius:8px;min-width:4px}
.cat-bars .val{width:60px;font-size:12px;color:var(--ink);font-weight:600}

/* 表单 */
.f-form{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.f-form .full{grid-column:1/-1}
.f-field label{display:block;font-size:13px;color:var(--gray);margin-bottom:6px;font-weight:500}
.f-field input,.f-field select,.f-field textarea{width:100%;padding:10px 13px;border:1px solid var(--line);border-radius:10px;background:#fff}
.f-field textarea{min-height:80px;resize:vertical}
.f-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:16px}
.f-actions .btn{padding:10px 26px;border-radius:10px;font-size:14px}

/* 弹层 */
.modal-mask{position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:100;display:none;align-items:center;justify-content:center;padding:20px}
.modal-mask.on{display:flex}
.modal{background:#fff;border-radius:16px;width:100%;max-width:480px;max-height:88vh;overflow-y:auto;padding:22px;box-shadow:0 20px 60px rgba(0,0,0,.2)}
.modal h3{font-size:17px;font-weight:800;margin-bottom:18px;display:flex;justify-content:space-between;align-items:center}
.modal h3 .x{color:#9ca3af;cursor:pointer;font-size:20px;width:28px;height:28px;display:flex;align-items:center;justify-content:center}

/* 登录页 */
.login-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;background:linear-gradient(150deg,#0b1b33,#123a6e 60%,#0e7490);padding:20px}
.login-card{background:#fff;border-radius:18px;padding:36px 34px;width:100%;max-width:400px;box-shadow:0 30px 70px rgba(0,0,0,.4)}
.login-logo{display:flex;align-items:center;gap:12px;justify-content:center;margin-bottom:8px}
.login-logo .badge{width:52px;height:52px;border-radius:14px;background:linear-gradient(135deg,var(--pri),var(--acc));display:flex;align-items:center;justify-content:center;box-shadow:0 8px 20px rgba(37,99,235,.35)}
.login-logo .badge svg{width:28px;height:28px}
.login-card h1{text-align:center;font-size:20px;font-weight:800;margin-bottom:4px}
.login-card .sub{text-align:center;color:var(--gray);font-size:13px;margin-bottom:26px}
.login-card .field{display:flex;align-items:center;gap:10px;background:#f8fafc;border:1.5px solid var(--line);border-radius:12px;padding:13px 15px;margin-bottom:14px}
.login-card .field:focus-within{border-color:var(--pri)}
.login-card .field svg{width:19px;height:19px;color:#9ca3af}
.login-card .field input{flex:1;background:none;color:var(--ink)}
.login-card .login-btn{width:100%;padding:14px;border-radius:12px;background:linear-gradient(135deg,var(--pri),var(--acc));color:#fff;font-size:15px;font-weight:700;box-shadow:0 8px 20px rgba(37,99,235,.3)}
.login-card .tip{text-align:center;color:var(--gray);font-size:12px;margin-top:16px}

/* 空/加载 */
.empty{padding:50px;text-align:center;color:#9ca3af}
.spinner{width:26px;height:26px;border:3px solid #e5e7eb;border-top-color:var(--pri);border-radius:50%;margin:0 auto 10px;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

/* 响应式 */
@media(max-width:900px){
  .sidebar{transform:translateX(-100%)}
  .sidebar.on{transform:none}
  .main{margin-left:0}
  .menu-btn{display:flex}
  .stat-grid{grid-template-columns:1fr 1fr}
  .f-form{grid-template-columns:1fr}
}
@media(max-width:560px){
  .stat-grid{grid-template-columns:1fr 1fr;gap:10px}
  .stat-card{padding:14px;flex-direction:column;text-align:center}
  .content{padding:14px}
  .toolbar input[type=text]{min-width:120px;flex:1}
}
