/* 自助消消乐 · 后台通用样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 14px; color: #262626; background: #f0f2f5;
}
a { color: #1677ff; text-decoration: none; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* 登录页 */
.login-body { background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #6c5ce7 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: #fff; border-radius: 14px; padding: 40px 44px; width: 380px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-card .sub { color: #8c8c8c; margin-bottom: 26px; font-size: 13px; }
.login-card label { display: block; color: #595959; margin: 14px 0 6px; }
.login-card input { width: 100%; padding: 11px 12px; border: 1px solid #d9d9d9; border-radius: 8px; font-size: 15px; outline: none; }
.login-card input:focus { border-color: #1677ff; box-shadow: 0 0 0 2px rgba(22,119,255,.15); }
.login-card button { width: 100%; padding: 12px; margin-top: 24px; background: #1677ff; color: #fff; border: 0; border-radius: 8px; font-size: 16px; cursor: pointer; }
.login-card button:hover { background: #4096ff; }
.login-card .err { color: #cf1322; margin-top: 12px; font-size: 13px; min-height: 18px; }
.login-foot { text-align: center; margin-top: 18px; font-size: 13px; color: #8c8c8c; }

/* 主布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 216px; background: #001529; color: #fff; flex-shrink: 0; display: flex; flex-direction: column; }
.sidebar .brand { padding: 18px 20px; font-size: 16px; font-weight: 700; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar .brand small { display: block; font-weight: 400; font-size: 11px; color: #8c9bab; margin-top: 3px; }
.sidebar nav a { display: block; padding: 12px 20px; color: #b7c3cc; font-size: 14px; border-left: 3px solid transparent; }
.sidebar nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.sidebar nav a.on { color: #fff; background: #1677ff; border-left-color: #69b1ff; }
.sidebar .side-foot { margin-top: auto; padding: 16px 20px; font-size: 12px; color: #8c9bab; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: #fff; padding: 0 24px; height: 56px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.topbar .crumb { font-size: 16px; font-weight: 600; }
.topbar .user { display: flex; align-items: center; gap: 12px; }
.topbar .user .nick { color: #595959; }
.content { padding: 20px 24px; flex: 1; }

/* 卡片/表格 */
.card { background: #fff; border-radius: 10px; padding: 18px 20px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.card h3 { font-size: 15px; margin-bottom: 14px; }
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th { background: #fafafa; text-align: left; padding: 10px 12px; color: #595959; font-weight: 600; border-bottom: 1px solid #f0f0f0; white-space: nowrap; }
table.tbl td { padding: 10px 12px; border-bottom: 1px solid #f5f5f5; vertical-align: middle; }
table.tbl tr:hover td { background: #fafcff; }
.pager { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 13px; color: #595959; }

/* 状态点 */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot.on { background: #52c41a; box-shadow: 0 0 0 3px rgba(82,196,26,.18); }
.dot.off { background: #ff4d4f; box-shadow: 0 0 0 3px rgba(255,77,79,.15); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; }
.badge.green { background: #f6ffed; color: #389e0d; border: 1px solid #b7eb8f; }
.badge.red { background: #fff1f0; color: #cf1322; border: 1px solid #ffa39e; }
.badge.blue { background: #e6f4ff; color: #0958d9; border: 1px solid #91caff; }
.badge.gray { background: #f5f5f5; color: #595959; border: 1px solid #d9d9d9; }
.badge.orange { background: #fff7e6; color: #d46b08; border: 1px solid #ffd591; }

/* 按钮/表单 */
.btn { display: inline-block; padding: 7px 16px; border-radius: 6px; font-size: 13px; cursor: pointer; border: 1px solid #d9d9d9; background: #fff; color: #262626; }
.btn:hover { border-color: #1677ff; color: #1677ff; }
.btn.primary { background: #1677ff; border-color: #1677ff; color: #fff; }
.btn.primary:hover { background: #4096ff; }
.btn.danger { color: #cf1322; border-color: #ffa39e; }
.btn.danger:hover { background: #fff1f0; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { padding: 8px 10px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 13px; outline: none; font-family: inherit; }
input:focus, select:focus, textarea:focus { border-color: #1677ff; }
.frm { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.frm .full { grid-column: 1 / -1; }
.frm label { display: block; color: #595959; margin-bottom: 6px; font-size: 13px; }
.frm label b { color: #cf1322; font-weight: 400; }
.frm input, .frm select, .frm textarea { width: 100%; }
.frm textarea { resize: vertical; min-height: 72px; }

/* 概览统计 */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.stat { background: #fff; border-radius: 10px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.stat .num { font-size: 26px; font-weight: 700; margin: 6px 0 2px; }
.stat .lbl { color: #8c8c8c; font-size: 13px; }
.stat .num.green { color: #52c41a; } .stat .num.red { color: #ff4d4f; } .stat .num.blue { color: #1677ff; }

/* 弹窗 */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: 12px; width: 560px; max-width: 94vw; max-height: 88vh; overflow: auto; padding: 22px 24px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h3 { margin: 0; }
.modal-x { background: none; border: none; font-size: 18px; line-height: 1; cursor: pointer; color: #999; padding: 4px 8px; border-radius: 6px; }
.modal-x:hover { background: #f0f0f0; color: #333; }
.modal .frm { grid-template-columns: 1fr 1fr; }
.modal-foot { margin-top: 20px; text-align: right; display: flex; gap: 10px; justify-content: flex-end; }

/* 图表 */
.chart-box { width: 100%; height: 260px; }
.msg-tip { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: #262626; color: #fff; padding: 9px 20px; border-radius: 6px; z-index: 200; font-size: 13px; }
.msg-tip.ok { background: #52c41a; } .msg-tip.err { background: #cf1322; }
.empty { text-align: center; color: #bfbfbf; padding: 40px 0; }
.help { color: #8c8c8c; font-size: 12px; margin-top: 6px; }
.kv { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed #f0f0f0; font-size: 13px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: #595959; } .kv .v { font-weight: 600; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2,1fr); } .frm { grid-template-columns: 1fr; } .sidebar { width: 64px; } .sidebar nav a { font-size: 0; padding: 14px 0; text-align: center; } }
