/* 极简后台风格：浅色背景 + 近黑点缀 */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif;
  background: #f5f6f8;
  color: #1a1a1a;
  font-size: 14px;
}

.btn {
  height: 38px;
  padding: 0 20px;
  border: none;
  border-radius: 6px;
  background: #1a1a1a;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; }
.btn-block { width: 100%; margin-top: 12px; height: 42px; }
.btn-ghost { background: #fff; color: #1a1a1a; border: 1px solid #e5e7eb; }
.btn-danger { background: #fff; color: #c0392b; border: 1px solid #f0d5d2; }

.input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  outline: none;
}
.input:focus { border-color: #1a1a1a; }
.input-sm { width: auto; height: 32px; font-size: 13px; }

/* ===== 登录 ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  width: 360px;
  background: #fff;
  padding: 40px 32px;
  border-radius: 12px;
  border: 1px solid #eceef1;
}
.login-title {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
}
.login-sub {
  text-align: center;
  color: #9aa0aa;
  font-size: 13px;
  margin: 6px 0 28px;
}
.login-err {
  margin-top: 14px;
  color: #c0392b;
  font-size: 13px;
  text-align: center;
  min-height: 18px;
}

/* ===== 布局 ===== */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 200px;
  background: #fff;
  border-right: 1px solid #eceef1;
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: fixed;
  top: 0; bottom: 0; left: 0;
}
.logo {
  font-size: 17px;
  font-weight: 700;
  padding: 0 24px 24px;
  border-bottom: 1px solid #f0f1f3;
  margin-bottom: 16px;
}
.nav { flex: 1; }
.nav-item {
  display: block;
  padding: 12px 24px;
  color: #6b7280;
  cursor: pointer;
  font-size: 14px;
  border-left: 2px solid transparent;
}
.nav-item:hover { background: #fafafa; }
.nav-item.active {
  color: #1a1a1a;
  font-weight: 600;
  border-left-color: #1a1a1a;
  background: #fafafa;
}
.sidebar-foot {
  padding: 16px 24px 0;
  border-top: 1px solid #f0f1f3;
}
.admin-name {
  font-size: 13px;
  color: #9aa0aa;
  margin-bottom: 10px;
}

.content {
  flex: 1;
  margin-left: 200px;
  padding: 32px;
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 24px;
}

/* ===== 统计卡 ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border: 1px solid #eceef1;
  border-radius: 10px;
  padding: 24px;
}
.stat-num {
  font-size: 30px;
  font-weight: 700;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
}
.stat-label {
  margin-top: 6px;
  font-size: 13px;
  color: #6b7280;
}
.stat-sub {
  margin-top: 4px;
  font-size: 12px;
  color: #9aa0aa;
}

/* ===== 面板 ===== */
.panel {
  background: #fff;
  border: 1px solid #eceef1;
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 24px;
}
.panel-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 20px;
}

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

/* ===== 表格 ===== */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  color: #9aa0aa;
  font-weight: 500;
  border-bottom: 1px solid #eceef1;
  white-space: nowrap;
}
.table td {
  padding: 12px;
  border-bottom: 1px solid #f5f6f8;
  font-size: 13px;
  vertical-align: middle;
}
.table tr:hover td { background: #fafafa; }
.mono { font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 12px; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  background: #f0f1f3;
  color: #6b7280;
}
.badge-vip { background: #1a1a1a; color: #fff; }
.badge-green { background: #e6f4ec; color: #0a7d3f; }
.badge-orange { background: #fff7ed; color: #b45309; }
.badge-red { background: #fdecea; color: #c0392b; }

.link-btn {
  color: #1a73c8;
  cursor: pointer;
  font-size: 12px;
  margin-right: 10px;
}
.link-btn.danger { color: #c0392b; }

/* ===== 分页 ===== */
.pager {
  margin-top: 20px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  font-size: 13px;
  color: #9aa0aa;
}

/* ===== 图表 ===== */
.chart {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  height: 200px;
  padding-top: 20px;
}
.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
}
.chart-bar {
  width: 100%;
  max-width: 48px;
  background: #1a1a1a;
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: height 0.3s;
}
.chart-val {
  font-size: 11px;
  color: #6b7280;
  font-family: 'SF Mono', Menlo, monospace;
}
.chart-label {
  font-size: 11px;
  color: #9aa0aa;
}

/* ===== 弹窗 ===== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  width: 420px;
  max-width: 90vw;
}
.modal-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 20px;
}
.modal-body { margin-bottom: 24px; }
.modal-body label {
  display: block;
  font-size: 13px;
  color: #6b7280;
  margin: 14px 0 6px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  background: #1a1a1a;
  color: #fff;
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 13px;
  opacity: 0;
  transition: all 0.25s;
  z-index: 200;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: #c0392b; }

@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .sidebar { width: 160px; }
  .content { margin-left: 160px; }
}
