:root {
  --bg: #eef2f7;
  --side: #1f2d3d;
  --side-2: #273849;
  --accent: #409eff;
  --text: #303133;
  --muted: #909399;
  --line: #ebeef5;
  --ok: #67c23a;
  --danger: #f56c6c;
  --warn: #e6a23c;
}
* { box-sizing: border-box; }
html, body, #app { margin: 0; min-height: 100%; font-family: "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--text); background: var(--bg); }
button, input, select, textarea { font: inherit; }
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #c9d4f0 0%, #6d6bb3 100%);
}
.login-card {
  width: min(420px, calc(100vw - 32px));
  background: #fff;
  border-radius: 12px;
  padding: 36px 32px 28px;
  box-shadow: 0 18px 50px rgba(40, 40, 80, .18);
}
.login-card h1 { margin: 0; text-align: center; font-size: 28px; }
.login-card p { margin: 8px 0 24px; text-align: center; color: var(--muted); font-size: 13px; }
.login-card label { display: block; margin-bottom: 14px; }
.login-card input, .toolbar input, .filters input, .filters select, .range-bar input, .modal input, .modal select, .modal textarea, .pager select, .info-grid input {
  height: 36px;
  padding: 0 10px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  background: #fff;
}
.login-card input { width: 100%; height: 42px; }
.login-card button, .primary, .btn {
  height: 36px;
  border: 0;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  padding: 0 14px;
  white-space: nowrap;
}
.login-card button { width: 100%; height: 42px; }
.btn.ghost { background: #fff; color: var(--text); border: 1px solid #dcdfe6; }
.btn.warn { background: var(--warn); }
.btn.ok { background: var(--ok); }
.btn.danger { background: var(--danger); }
.btn.sm { height: 28px; padding: 0 8px; font-size: 12px; margin: 0 2px 2px 0; }
.err { color: var(--danger); min-height: 20px; font-size: 13px; }
.layout { display: flex; min-height: 100vh; }
.side { width: 220px; background: var(--side); color: #fff; flex-shrink: 0; }
.side h2 { margin: 0; padding: 22px 18px 8px; font-size: 18px; }
.side .who { padding: 0 18px 16px; color: #9fb2c7; font-size: 12px; }
.side button {
  display: block; width: 100%; text-align: left; background: transparent;
  color: #dbe7f3; border: 0; padding: 11px 18px 11px 28px; cursor: pointer;
}
.side button.active, .side button:hover { background: var(--side-2); color: #fff; }
.side .group {
  padding: 12px 18px 4px;
  color: #7f93a8;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
}
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.top {
  height: 56px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 20px; gap: 12px;
}
.top b { font-size: 16px; }
.crumbs { color: var(--muted); font-size: 12px; font-weight: 400; margin-left: 8px; }
.top .out { width: auto; padding: 0 14px; height: 32px; background: #f56c6c; }
.content { padding: 16px 20px 32px; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.cards.three { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cards article, .panel { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 16px; }
.cards span { color: var(--muted); font-size: 12px; }
.cards b { display: block; margin-top: 8px; font-size: 22px; }
.cards em { display: block; margin-top: 4px; font-style: normal; color: var(--muted); font-size: 12px; }
.panel { margin-bottom: 12px; overflow: auto; }
.panel h3 { margin: 0 0 12px; font-size: 15px; }
.section-title { margin: 4px 0 10px; font-size: 14px; color: #606266; }
.toolbar, .filters, .range-bar, .pager {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px;
}
.filters label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.filters input, .filters select { width: 150px; }
.hint { color: var(--muted); font-size: 12px; margin: 0 0 10px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-weight: 600; background: #fafafa; white-space: nowrap; }
td { white-space: nowrap; }
.info-grid { display: grid; grid-template-columns: 120px 1fr 120px 1fr; gap: 10px 16px; align-items: center; }
.info-grid span { color: var(--muted); }
.info-grid .wide { grid-column: 2 / -1; display: flex; gap: 8px; align-items: center; }
.info-grid .invite-edit { display: flex; gap: 8px; align-items: center; }
.info-grid .invite-edit input { width: 132px; letter-spacing: 2px; font-family: ui-monospace, Menlo, monospace; }
.invite { font-family: ui-monospace, Menlo, monospace; font-size: 13px; word-break: break-all; white-space: normal; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; background: #ecf5ff; color: #409eff; }
.badge.lock { background: #fef0f0; color: #f56c6c; }
.badge.ok { background: #f0f9eb; color: #67c23a; }
.badge.warn { background: #fdf6ec; color: #e6a23c; }
.badge.done { background: #fdf6ec; color: #b88230; }
.muted { color: #909399; font-size: 12px; margin-top: 4px; }
.draw-result { margin-top: 6px; font-size: 12px; color: #409eff; font-weight: 600; }
.wrap { white-space: normal; max-width: 280px; display: inline-block; line-height: 1.45; }
.tag { display: inline-block; margin-right: 4px; padding: 1px 6px; border-radius: 3px; background: #f4f4f5; color: #606266; font-size: 12px; }
.tag.win { background: #fef0f0; color: #f56c6c; }
.tag.lose { color: #909399; }
.tag.pending { background: #fdf6ec; color: #e6a23c; }
.range-bar label { display: flex; align-items: center; gap: 4px; font-size: 13px; cursor: pointer; }
.range-bar input[type="date"] { width: 140px; height: 32px; }
.stats-bar { display: flex; flex-wrap: wrap; gap: 16px; padding: 10px 12px; background: #f8fafc; border: 1px solid var(--line); border-radius: 4px; margin-bottom: 12px; font-size: 13px; }
.stats-bar b { color: #409eff; }
.bet-filters { align-items: center; }
.range-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 32px; padding: 0 12px; border: 1px solid #dcdfe6; background: #fff; color: #606266; border-radius: 4px; font-size: 13px; }
.chip.on { background: #409eff; border-color: #409eff; color: #fff; }
.bet-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
.bet-stats article { background: #fff; border: 1px solid #ebeef5; border-radius: 6px; padding: 10px 12px; border-left-width: 3px; border-left-style: solid; }
.bet-stats span { display: block; color: #909399; font-size: 12px; }
.bet-stats b { display: block; margin-top: 4px; font-size: 18px; font-variant-numeric: tabular-nums; }
.st-bet { border-left-color: #409eff; } .st-bet b { color: #409eff; }
.st-win { border-left-color: #67c23a; } .st-win b { color: #67c23a; }
.st-diff { border-left-color: #e6a23c; } .st-diff b { color: #e6a23c; }
.st-count { border-left-color: #909399; } .st-count b { color: #606266; }
.st-winc { border-left-color: #13c2c2; } .st-winc b { color: #13c2c2; }
.st-cdiff { border-left-color: #722ed1; } .st-cdiff b { color: #722ed1; }
.st-cancel { border-left-color: #f56c6c; } .st-cancel b { color: #f56c6c; }
.st-pend { border-left-color: #fa8c16; } .st-pend b { color: #fa8c16; }
.st-expect { border-left-color: #2f54eb; } .st-expect b { color: #2f54eb; }
.st-clock { border-left-color: #c41d7f; } .st-clock b { color: #c41d7f; }
@media (max-width: 1100px) { .bet-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pager { justify-content: flex-end; color: var(--muted); font-size: 12px; }
.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 50; padding: 16px;
}
.modal {
  width: min(560px, 100%);
  background: #fff;
  border-radius: 6px;
  padding: 18px 20px 16px;
  max-height: 90vh;
  overflow: auto;
}
.modal.wide { width: min(860px, 100%); }
.modal h3 { margin: 0 0 14px; }
.modal .row { display: grid; grid-template-columns: 120px 1fr; gap: 8px; align-items: center; margin-bottom: 10px; }
.modal .row input, .modal .row select, .modal .row textarea { width: 100%; }
.modal textarea { min-height: 72px; padding: 8px 10px; height: auto; resize: vertical; }
.draw-cell { white-space: normal; min-width: 280px; }
.draw-hint { margin-top: 8px; padding: 8px 10px; border-radius: 6px; background: #f4f8ff; border: 1px solid #d9ecff; color: #303133; font-size: 13px; font-weight: 700; line-height: 1.55; }
.draw-hint.wait, .draw-hint.mid { font-weight: 600; color: #606266; background: #f5f7fa; border-color: #ebeef5; }
.draw-formula { margin-right: 8px; }
.draw-sum { margin-right: 8px; color: #409eff; }
.draw-tag { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 10px; font-size: 12px; }
.draw-tag.hi { background: #fef0f0; color: #f56c6c; }
.draw-tag.lo { background: #ecf5ff; color: #409eff; }
.draw-tag.odd { background: #fdf6ec; color: #e6a23c; }
.draw-tag.even { background: #f4f4f5; color: #606266; }
.modal input[readonly] { background: #f5f7fa; color: #606266; }
button.link-bal {
  height: auto;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
button.link-bal:hover { color: #1d7fd4; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  background: #303133; color: #fff; padding: 8px 16px; border-radius: 4px; z-index: 80; font-size: 13px;
}
@media (max-width: 1100px) {
  .cards, .cards.three, .mini-grid, .info-grid { grid-template-columns: 1fr 1fr; }
  .info-grid .wide { grid-column: auto; }
}
@media (max-width: 960px) {
  .layout { flex-direction: column; }
  .side { width: 100%; }
}
