/* ==========================================================================
   Heman 后台管理系统 —— 全量样式（零依赖，无外部字体/图标/图片）
   设计变量：主色 #2B7FFF 强调 #FF6B35 成功 #22C55E 危险 #EF4444
   ========================================================================== */

:root {
  --primary: #2B7FFF;
  --primary-dark: #1E6BEB;
  --primary-soft: #EAF2FF;
  --accent: #FF6B35;
  --accent-soft: #FFF0EA;
  --success: #22C55E;
  --success-soft: #E8F9EF;
  --danger: #EF4444;
  --danger-soft: #FDECEC;
  --warning: #F59E0B;
  --warning-soft: #FFF6E5;
  --text: #1F2430;
  --text-sub: #6B7280;
  --text-mute: #9AA1AC;
  --bg: #F5F6FA;
  --card: #FFFFFF;
  --border: #E6E8EF;
  --border-strong: #D6DAE4;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(31, 36, 48, .06), 0 4px 14px rgba(31, 36, 48, .05);
  --shadow-hover: 0 4px 10px rgba(31, 36, 48, .09), 0 10px 26px rgba(31, 36, 48, .08);
  --shadow-modal: 0 18px 50px rgba(15, 20, 32, .28);
  --sidebar-w: 224px;
  --topbar-h: 60px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
.hidden { display: none !important; }
.mono { font-family: Consolas, "SFMono-Regular", Menlo, monospace; }
.text-sub { color: var(--text-sub); }
.text-danger { color: var(--danger); }
.mt-12 { margin-top: 12px; }

/* 通用滚动条（WebKit） */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #D3D8E3; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #BDC4D2; }
::-webkit-scrollbar-track { background: transparent; }

/* ==========================================================================
   1. 登录页
   ========================================================================== */
.login-wrap {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  background:
    radial-gradient(900px 420px at 12% -10%, #E4EEFF 0%, rgba(245, 246, 250, 0) 62%),
    radial-gradient(760px 380px at 92% 108%, #FFEDE5 0%, rgba(245, 246, 250, 0) 60%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 18px rgba(31, 36, 48, .07), 0 22px 60px rgba(31, 36, 48, .09);
  padding: 34px 32px 26px;
  text-align: center;
}

.login-logo {
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4E97FF 0%, var(--primary) 55%, #1E63D8 100%);
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  line-height: 58px;
  letter-spacing: .5px;
  box-shadow: 0 8px 20px rgba(43, 127, 255, .32);
  user-select: none;
}

.login-title {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .3px;
}

.login-sub {
  margin: 4px 0 22px;
  font-size: 12px;
  color: var(--text-mute);
  letter-spacing: .6px;
}

.login-card .form-item { text-align: left; }
.login-card .btn-block { margin-top: 20px; }

.login-tip {
  margin: 16px 0 0;
  font-size: 12px;
  color: var(--text-mute);
}

/* ==========================================================================
   2. 主布局：侧边栏 + 主体
   ========================================================================== */
.layout {
  display: flex;
  min-height: 100%;
}

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--text);
  color: #C8CEDA;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.brand-logo {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #4E97FF, var(--primary));
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  line-height: 32px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(43, 127, 255, .35);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; overflow: hidden; }
.brand-name { color: #fff; font-size: 14px; font-weight: 600; letter-spacing: .4px; }
.brand-sub { color: #8B93A3; font-size: 11px; }

.menu { flex: 1; padding: 12px 10px; overflow-y: auto; }

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  margin-bottom: 4px;
  border-radius: var(--radius-sm);
  color: #B9C0CE;
  font-size: 13px;
  transition: background .16s, color .16s;
  position: relative;
}

.menu-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }

.menu-item.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(43, 127, 255, .35);
}

.menu-item.active .menu-icon { opacity: 1; }
.menu-icon { display: inline-flex; width: 16px; height: 16px; opacity: .9; }
.menu-icon svg { display: block; }
.menu-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-foot {
  padding: 12px 18px 16px;
  font-size: 11px;
  color: #6E7686;
  border-top: 1px solid rgba(255, 255, 255, .07);
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  flex: 0 0 var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.page-title { margin: 0; font-size: 16px; font-weight: 600; }

.topbar-right { display: flex; align-items: center; gap: 14px; }

.admin-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}

.admin-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
  font-size: 12px;
  line-height: 28px;
  text-align: center;
  text-transform: uppercase;
}

.content { flex: 1; padding: 18px 20px 28px; min-width: 0; }

/* ==========================================================================
   3. 卡片 / 面板
   ========================================================================== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card + .card { margin-top: 16px; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}

.card-title { margin: 0; font-size: 14px; font-weight: 600; }
.card-title .sub { margin-left: 8px; font-size: 12px; font-weight: 400; color: var(--text-mute); }
.card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-body { padding: 16px; }

/* 统计卡片栅格 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 15px 16px;
  position: relative;
  overflow: hidden;
  transition: box-shadow .18s, transform .18s;
}

.stat-card::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
  opacity: .85;
}

.stat-card.accent::after { background: var(--accent); }
.stat-card.success::after { background: var(--success); }
.stat-card.warning::after { background: var(--warning); }

.stat-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.stat-label { font-size: 12px; color: var(--text-sub); margin-bottom: 6px; }
.stat-value {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -.4px;
  line-height: 1.15;
  word-break: break-all;
}
.stat-value .unit { font-size: 14px; font-weight: 600; margin-right: 1px; }
.stat-foot { margin-top: 7px; font-size: 12px; color: var(--text-mute); }
.stat-foot .hl { color: var(--success); font-weight: 600; }

/* ==========================================================================
   4. 按钮
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background .16s, border-color .16s, color .16s, box-shadow .16s;
  user-select: none;
}

.btn:hover { border-color: var(--primary); color: var(--primary); background: #FAFCFF; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn:disabled:hover { border-color: var(--border-strong); color: var(--text); background: var(--card); }

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(43, 127, 255, .25);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-primary:disabled:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, .22);
}
.btn-danger:hover { background: #DC2626; border-color: #DC2626; color: #fff; }

.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text-sub); }
.btn-ghost:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }

.btn-sm { height: 26px; padding: 0 10px; font-size: 12px; border-radius: 5px; }
.btn-block { width: 100%; height: 38px; font-size: 14px; }
.btn-link {
  background: none;
  border: none;
  padding: 0 2px;
  height: auto;
  color: var(--primary);
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
}
.btn-link:hover { text-decoration: underline; color: var(--primary-dark); }

/* ==========================================================================
   5. 表单控件
   ========================================================================== */
.form-item { margin-bottom: 14px; }
.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-sub);
}
.form-label .req { color: var(--danger); margin-left: 2px; }

.input, .select, .textarea {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .16s, box-shadow .16s;
}

.textarea { height: auto; min-height: 70px; padding: 8px 10px; resize: vertical; line-height: 1.5; }

.input::placeholder, .textarea::placeholder { color: var(--text-mute); }

.input:hover, .select:hover, .textarea:hover { border-color: #BFC6D4; }

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(43, 127, 255, .14);
}

.input.invalid, .select.invalid { border-color: var(--danger); }
.input.invalid:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, .15); }

.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 26px;
  background-image: linear-gradient(45deg, transparent 50%, #8A92A2 50%),
                    linear-gradient(135deg, #8A92A2 50%, transparent 50%);
  background-position: calc(100% - 14px) 14px, calc(100% - 9px) 14px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

/* 筛选栏 */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}

.filter-bar .filter-field { display: flex; align-items: center; gap: 7px; }
.filter-bar .filter-label { font-size: 12px; color: var(--text-sub); white-space: nowrap; }
.filter-bar .input { width: 210px; }
.filter-bar .select { width: 128px; }
.filter-spacer { flex: 1; }

/* 弹窗内两列表单 */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}
.form-grid .col-span-2 { grid-column: 1 / -1; }

.radio-group { display: flex; align-items: center; gap: 16px; height: 32px; }
.radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}
.radio-group input { accent-color: var(--primary); cursor: pointer; }

/* ==========================================================================
   6. 表格
   ========================================================================== */
.table-wrap { width: 100%; overflow: auto; max-height: calc(100vh - 300px); }

.table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 900px; }

.table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #F8F9FC;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #F0F2F7;
  font-size: 13px;
  color: var(--text);
  vertical-align: middle;
}

.table tbody tr { transition: background .14s; }
.table tbody tr:hover td { background: #F7FAFF; }
.table tbody tr:last-child td { border-bottom: none; }

.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table th.num { text-align: right; }

.table th.nowrap, .table td.nowrap { white-space: nowrap; }

/* 长文本省略号 */
.cell-ellipsis {
  display: block;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cell-ellipsis.w-sm { max-width: 130px; }
.cell-ellipsis.w-lg { max-width: 260px; }

.cell-user { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.cell-user .u-main {
  font-weight: 500;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cell-user .u-sub {
  font-size: 11px;
  color: var(--text-mute);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.muted { color: var(--text-mute); }
.amount { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amount-accent { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.points-up { color: var(--success); font-weight: 600; font-variant-numeric: tabular-nums; }
.points-down { color: var(--danger); font-weight: 600; font-variant-numeric: tabular-nums; }

.table-loading, .table-empty {
  padding: 54px 16px;
  text-align: center;
  color: var(--text-mute);
  font-size: 13px;
}
.table-loading .spinner { margin-right: 8px; }

/* 复制按钮 */
.copy-btn {
  border: none;
  background: transparent;
  color: var(--text-mute);
  cursor: pointer;
  font-size: 11px;
  font-family: inherit;
  padding: 1px 4px;
  border-radius: 4px;
  margin-left: 4px;
  white-space: nowrap;
}
.copy-btn:hover { color: var(--primary); background: var(--primary-soft); }
.copy-btn.copied { color: var(--success); }

/* 表格内操作按钮组 */
.row-actions { display: flex; align-items: center; gap: 8px; white-space: nowrap; }

/* ==========================================================================
   7. 徽标 / 状态
   ========================================================================== */
.badge {
  display: inline-block;
  padding: 1px 9px;
  font-size: 12px;
  line-height: 18px;
  border-radius: 10px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-success { background: var(--success-soft); color: #15803D; border-color: #C7EFD6; }
.badge-danger { background: var(--danger-soft); color: #B91C1C; border-color: #F8D2D2; }
.badge-warning { background: var(--warning-soft); color: #B45309; border-color: #FBE3B8; }
.badge-primary { background: var(--primary-soft); color: #1D4ED8; border-color: #CFE0FF; }
.badge-accent { background: var(--accent-soft); color: #C2410C; border-color: #FFD9C9; }
.badge-default { background: #F1F3F8; color: var(--text-sub); border-color: var(--border); }

/* ==========================================================================
   8. 趋势柱状图（纯 div/CSS）
   ========================================================================== */
.tabs { display: inline-flex; padding: 3px; background: #F1F3F8; border-radius: var(--radius-sm); }
.tab {
  height: 26px;
  padding: 0 12px;
  border: none;
  background: transparent;
  border-radius: 5px;
  font-size: 12px;
  font-family: inherit;
  color: var(--text-sub);
  cursor: pointer;
  transition: background .16s, color .16s, box-shadow .16s;
}
.tab:hover { color: var(--primary); }
.tab.active { background: var(--card); color: var(--primary); font-weight: 600; box-shadow: 0 1px 3px rgba(31, 36, 48, .12); }

.chart-legend { display: flex; align-items: center; gap: 16px; font-size: 12px; color: var(--text-sub); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.legend-dot.c1 { background: var(--primary); }
.legend-dot.c2 { background: var(--accent); }
.legend-dot.c3 { background: var(--success); }

.chart-scroll { overflow-x: auto; padding: 4px 2px 0; }

.chart {
  display: flex;
  align-items: stretch;
  gap: 6px;
  min-width: 100%;
  padding: 4px 0 0;
}

.chart-col { display: flex; flex-direction: column; flex: 1 1 0; min-width: 34px; }

.chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 210px;
  padding: 0 2px;
  border-bottom: 1px solid var(--border);
}

.bar {
  flex: 1 1 0;
  max-width: 16px;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: var(--primary);
  transition: filter .16s, opacity .16s;
  opacity: .92;
}
.bar:hover { filter: brightness(1.08); opacity: 1; }
.bar.c1 { background: var(--primary); }
.bar.c2 { background: var(--accent); }
.bar.c3 { background: var(--success); }
.bar.zero { background: #DFE3EC; }

.chart-x {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-mute);
  text-align: center;
  white-space: nowrap;
}

.chart-tip {
  position: fixed;
  z-index: 999;
  pointer-events: none;
  background: rgba(31, 36, 48, .94);
  color: #fff;
  font-size: 12px;
  line-height: 1.6;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 20px rgba(15, 20, 32, .3);
  max-width: 240px;
}
.chart-tip .tip-title { font-weight: 600; margin-bottom: 2px; }
.chart-tip .tip-row { white-space: nowrap; }
.chart-tip .tip-dot { display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 5px; }

/* ==========================================================================
   9. 分页
   ========================================================================== */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.pager-info { font-size: 12px; color: var(--text-sub); }

.pager-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.pager-list { display: flex; align-items: center; gap: 4px; }

.page-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  font-size: 12px;
  font-family: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  cursor: pointer;
  transition: border-color .16s, color .16s, background .16s;
}
.page-btn:hover:not(:disabled):not(.active) { border-color: var(--primary); color: var(--primary); background: #FAFCFF; }
.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
  cursor: default;
}
.page-btn:disabled { opacity: .5; cursor: not-allowed; }
.page-ellipsis { padding: 0 2px; color: var(--text-mute); font-size: 12px; user-select: none; }

.pager-size { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-sub); }
.pager-size .select { width: 72px; height: 28px; font-size: 12px; background-position: calc(100% - 14px) 12px, calc(100% - 9px) 12px; }

/* ==========================================================================
   10. 加载动画
   ========================================================================== */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(43, 127, 255, .25);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   11. 模态框
   ========================================================================== */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(20, 25, 36, .45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 16px 40px;
  overflow: auto;
  animation: fadeIn .16s ease-out;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: none; } }

.modal {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  animation: popIn .18s ease-out;
  overflow: hidden;
}

.modal.modal-lg { max-width: 620px; }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.modal-title { margin: 0; font-size: 15px; font-weight: 600; }

.modal-x {
  border: none;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  color: var(--text-mute);
  cursor: pointer;
  padding: 0 2px;
  border-radius: 4px;
}
.modal-x:hover { color: var(--danger); }

.modal-body { padding: 18px; max-height: 62vh; overflow: auto; }
.modal-body .confirm-text { margin: 0; font-size: 14px; }
.modal-body .confirm-text + .confirm-note { margin: 8px 0 0; font-size: 12px; color: var(--text-sub); }

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--border);
  background: #FCFCFE;
}

/* ==========================================================================
   12. Toast 轻提示（右上角浮出）
   ========================================================================== */
.toast-root {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 190px;
  max-width: 350px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 26px rgba(31, 36, 48, .16);
  font-size: 13px;
  color: var(--text);
  animation: toastIn .22s ease-out;
  word-break: break-word;
}
.toast.leaving { animation: toastOut .2s ease-in forwards; }

.toast-icon { flex: 0 0 16px; font-size: 13px; line-height: 1.5; text-align: center; }
.toast-body { flex: 1; line-height: 1.5; }

.toast-success { border-left-color: var(--success); }
.toast-success .toast-icon { color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-error .toast-icon { color: var(--danger); }
.toast-info { border-left-color: var(--primary); }
.toast-info .toast-icon { color: var(--primary); }

@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px); } }

/* ==========================================================================
   13. 响应式（窄屏退回单列，侧边栏收窄）
   ========================================================================== */
@media (max-width: 1280px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 64px; }
  .brand-text, .menu-text, .sidebar-foot { display: none; }
  .brand { justify-content: center; padding: 16px 8px; }
  .menu-item { justify-content: center; padding: 0; }
  .content { padding: 14px 12px 22px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .filter-bar .input { width: 150px; }
  .table-wrap { max-height: none; }
}

/* ==========================================================================
   14. 权益核销页（#/redeem）—— 仅本页使用，沿用后台既有配色
   ========================================================================== */

/* 操作区说明文案 */
.redeem-hint {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--text-sub);
}

/* 大输入框 + 查询按钮 */
.redeem-search { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.redeem-input {
  flex: 1 1 320px;
  width: auto;
  max-width: 560px;
  height: 46px;
  padding: 0 14px;
  font-size: 17px;
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
  letter-spacing: 1.5px;
  border-radius: var(--radius);
}

.redeem-input:focus { box-shadow: 0 0 0 4px rgba(43, 127, 255, .16); }

.btn-lg { height: 46px; padding: 0 26px; font-size: 15px; border-radius: var(--radius); }

/* 结果区 */
.redeem-result { margin-top: 16px; }

.redeem-loading {
  padding: 26px 0;
  text-align: center;
  color: var(--text-mute);
  font-size: 13px;
}

/* 错误提示条（核销码不存在 / 接口报错等） */
.redeem-alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  background: var(--danger-soft);
  border: 1px solid #F8D2D2;
  border-left: 3px solid var(--danger);
  border-radius: var(--radius-sm);
  color: #B91C1C;
  font-size: 13px;
  line-height: 1.6;
}

.redeem-alert-icon { flex: 0 0 auto; font-weight: 700; }
.redeem-alert-text { flex: 1; min-width: 0; word-break: break-word; }

/* 结果卡片 */
.redeem-card {
  padding: 16px 18px;
  background: #FBFCFE;
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
}

.redeem-card.is-ok { background: #FAFCFF; border-color: #CFE0FF; border-left-color: var(--primary); }
.redeem-card.is-used { background: var(--success-soft); border-color: #C7EFD6; border-left-color: var(--success); }
.redeem-card.is-expired { background: var(--danger-soft); border-color: #F8D2D2; border-left-color: var(--danger); }

.redeem-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.redeem-service { font-size: 21px; font-weight: 700; letter-spacing: -.2px; line-height: 1.25; }

.redeem-code-line { margin-top: 4px; font-size: 12px; color: var(--text-sub); }
.redeem-code-line .mono { letter-spacing: .6px; }

.redeem-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 22px;
  margin-top: 14px;
}

.redeem-meta-row { display: flex; gap: 8px; min-width: 0; font-size: 13px; }
.redeem-meta-label { flex: 0 0 72px; color: var(--text-sub); }
.redeem-meta-value { flex: 1; min-width: 0; word-break: break-all; }

.redeem-msg {
  margin-top: 14px;
  padding: 9px 12px;
  background: var(--card);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  word-break: break-word;
}

.redeem-card.is-used .redeem-msg { border-color: #C7EFD6; color: #15803D; }
.redeem-card.is-expired .redeem-msg { border-color: #F8D2D2; color: #B91C1C; }

.redeem-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.redeem-actions-tip { font-size: 12px; color: var(--text-sub); }

@media (max-width: 900px) {
  .redeem-input { flex: 1 1 100%; max-width: none; font-size: 16px; }
  .redeem-search .btn-lg { flex: 1 1 100%; }
  .redeem-meta { grid-template-columns: minmax(0, 1fr); }
}
