/* PyPackager 管理后台样式：纯原生 CSS，无第三方依赖 */
:root {
  --bg: #eef3fb;
  --bg-deep: #dfe9f7;
  --card: #ffffff;
  --text: #17233d;
  --text-soft: #5b6a85;
  --text-faint: #8593aa;
  --border: #dbe4f2;
  --primary: #2f63e6;
  --primary-deep: #1e4ecb;
  --primary-soft: #e8eefe;
  --success: #0f9f6e;
  --success-soft: #e4f7ef;
  --danger: #d64045;
  --danger-soft: #fdecec;
  --warning: #b7791f;
  --warning-soft: #fff4e0;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --shadow: 0 18px 50px rgba(28, 50, 95, 0.12);
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

/* 作者样式中的 display 会覆盖浏览器对 [hidden] 的默认处理，必须显式兜底 */
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  background:
    radial-gradient(900px 500px at 10% 0%, #ffffff 0%, transparent 60%),
    radial-gradient(800px 600px at 95% 100%, #dce7ff 0%, transparent 55%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-deep) 100%);
}

h1, h2, p { margin: 0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 品牌 */
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 15px;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(145deg, #4f82ff, var(--primary-deep));
  box-shadow: 0 10px 24px rgba(47, 99, 230, 0.32);
}
.brand-text h1 { font-size: 24px; letter-spacing: 0.2px; }
.brand-text p { margin-top: 4px; color: var(--text-soft); font-size: 13px; }
.brand-small .brand-mark { width: 42px; height: 42px; font-size: 20px; }
.brand-small .brand-text h1 { font-size: 20px; }

/* 登录 */
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}
.login-card {
  width: min(440px, 100%);
  padding: 34px 36px 28px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  animation: rise 0.35s ease both;
}
.login-card .form { margin-top: 26px; }
.login-hint {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
  color: var(--text-faint);
  font-size: 12px;
  text-align: center;
}

/* 表单 */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-soft); }
input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  background: #f8faff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
input::placeholder { color: #a2aec2; }
input:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 99, 230, 0.14);
}
input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(214, 64, 69, 0.12);
}
.form-error { color: var(--danger); font-size: 12.5px; line-height: 1.5; }

/* 按钮 */
.btn {
  height: 42px;
  padding: 0 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s, background 0.15s, opacity 0.15s;
}
.btn:disabled { opacity: 0.62; cursor: not-allowed; }
.btn:not(:disabled):active { transform: translateY(1px); }
.btn-primary {
  color: #fff;
  background: linear-gradient(145deg, #4a7bff, var(--primary));
  box-shadow: 0 8px 18px rgba(47, 99, 230, 0.24);
}
.btn-primary:not(:disabled):hover { background: linear-gradient(145deg, #3d6ffa, var(--primary-deep)); }
.btn-ghost {
  color: var(--text-soft);
  background: #fff;
  border-color: var(--border);
}
.btn-ghost:not(:disabled):hover { background: #f3f7ff; border-color: #c5d3ea; }
.btn-block { width: 100%; }
.btn-small { height: 34px; padding: 0 12px; font-size: 13px; }
.icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-soft);
  background: #fff;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.icon-btn:hover { background: #f3f7ff; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* 后台布局 */
.dashboard {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 26px 22px 60px;
}
/* 侧边栏 */
.sidebar {
  position: sticky;
  top: 26px;
  flex: 0 0 232px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: calc(100vh - 112px);
  padding: 20px 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px rgba(28, 50, 95, 0.08);
  backdrop-filter: blur(12px);
}
.sidebar-brand .brand-text h1 { font-size: 16px; }
.side-nav { display: flex; flex-direction: column; gap: 6px; }
.side-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 42px;
  padding: 0 12px;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.side-nav-item:hover { color: var(--text); background: #f2f7ff; }
.side-nav-item.is-active { color: var(--primary-deep); background: var(--primary-soft); }
.side-nav-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  color: var(--primary);
  background: #fff;
  font-size: 13px;
}
.sidebar-foot { display: grid; gap: 10px; margin-top: auto; }
.sidebar-foot .admin-chip { text-align: center; }
.workspace { flex: 1; min-width: 0; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px rgba(28, 50, 95, 0.08);
  backdrop-filter: blur(12px);
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.admin-chip {
  padding: 7px 12px;
  color: var(--primary-deep);
  background: var(--primary-soft);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
}
.main { display: grid; gap: 18px; margin-top: 18px; }
.panel {
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 28px rgba(28, 50, 95, 0.06);
}
.panel-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.panel-head h2 { font-size: 16px; }
.panel-head p { margin-top: 4px; color: var(--text-faint); font-size: 12.5px; }
.searchbar { display: flex; gap: 10px; }
.searchbar input { flex: 1; height: 44px; }

/* 用户表格 */
.table-wrap { overflow-x: auto; }
.user-table { width: 100%; border-collapse: collapse; min-width: 1240px; }
.user-table th, .user-table td {
  padding: 13px 14px;
  text-align: left;
  border-bottom: 1px solid #eef2f9;
  font-size: 13.5px;
  white-space: nowrap;
}
.user-table th {
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #f8faff;
}
.user-table th:first-child { border-top-left-radius: 10px; }
.user-table th:last-child { border-top-right-radius: 10px; }
.user-table tbody tr:hover { background: #fafcff; }
.user-table .num { text-align: right; }
.user-table .action { text-align: right; }
.user-table td.num { font-weight: 700; color: var(--primary-deep); }
.user-table td.action { text-align: right; }
.user-table .muted { color: var(--text-faint); }
.empty { padding: 44px 16px !important; text-align: center !important; color: var(--text-faint); }
.points-pill {
  display: inline-block;
  min-width: 54px;
  padding: 4px 10px;
  text-align: center;
  color: var(--primary-deep);
  background: var(--primary-soft);
  border-radius: 999px;
  font-weight: 700;
}

/* 弹窗 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 34, 63, 0.42);
  backdrop-filter: blur(3px);
}
.modal-card {
  position: relative;
  width: min(480px, 100%);
  padding: 24px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 26px 70px rgba(20, 34, 63, 0.28);
  animation: rise 0.22s ease both;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head h2 { font-size: 18px; }
.modal-user {
  margin: 16px 0 20px;
  padding: 13px 15px;
  background: #f8faff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.7;
}
.modal-user strong { color: var(--text); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

/* Toast */
.toast-host {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 60;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 14px 34px rgba(28, 50, 95, 0.16);
  font-size: 13px;
  line-height: 1.55;
  animation: slideIn 0.28s ease both;
}
.toast.success { border-color: #b7e8d5; background: var(--success-soft); color: #096c4c; }
.toast.error { border-color: #f6c9ca; background: var(--danger-soft); color: #a72c31; }
.toast.info { border-color: #c7d7f8; background: var(--primary-soft); color: var(--primary-deep); }

/* 动效与响应式 */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
@media (max-width: 720px) {
  .login-card { padding: 26px 22px; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .topbar-actions { width: 100%; justify-content: space-between; }
  .panel { padding: 18px 16px; }
  .searchbar { flex-direction: column; }
  .searchbar .btn { width: 100%; }
  .toast-host { top: 12px; right: 12px; }
}

/* ============================================================
   用户管理增强：筛选、批量、状态、会员、时间线
   ============================================================ */
select {
  width: 100%;
  height: 42px;
  padding: 0 34px 0 13px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  background: #f8faff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-soft) 50%),
                    linear-gradient(135deg, var(--text-soft) 50%, transparent 50%);
  background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
select:focus {
  background-color: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 99, 230, 0.14);
}
select:disabled { opacity: 0.62; cursor: not-allowed; }

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) repeat(4, minmax(140px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}
.filters .field { min-width: 0; }
.filters input, .filters select { height: 42px; }
.filter-actions { display: flex; gap: 8px; }

.bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: var(--primary-soft);
  border: 1px solid #c9d8fb;
  border-radius: var(--radius-md);
}
.bulk-count { color: var(--primary-deep); font-size: 13px; font-weight: 700; }
.bulk-bar.is-empty { background: #f8faff; border-color: var(--border); }
.bulk-bar.is-empty .bulk-count { color: var(--text-faint); font-weight: 600; }
.bulk-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.user-table th.pick, .user-table td.pick { width: 38px; text-align: center; }
.user-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}
.user-table tbody tr.selected { background: #f2f7ff; }
.user-name { display: block; font-size: 13.5px; }
.user-email { margin-top: 2px; font-size: 12px; }

.status-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.status-active { color: #096c4c; background: var(--success-soft); }
.status-disabled { color: #a72c31; background: var(--danger-soft); }

.device-cell {
  min-width: 220px;
  max-width: 300px;
  line-height: 1.5;
  font-size: 12.5px;
  white-space: normal;
}
.device-os { color: var(--text-soft); }
.device-sub { color: var(--text-faint); font-size: 12px; }

.member-cell { white-space: normal; min-width: 210px; }
.m-chip {
  display: inline-block;
  margin: 2px 4px 2px 0;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}
.m-chip.day.active { color: #0b5f8a; background: #e2f3fd; border-color: #bfe2f6; }
.m-chip.month.active { color: #096c4c; background: var(--success-soft); border-color: #b7e8d5; }
.m-chip.year.active { color: #7a4a00; background: var(--warning-soft); border-color: #f0d9ac; }
.m-chip.lifetime.active { color: #4a2ea8; background: #eee9ff; border-color: #d8cef8; }
.m-chip.off { color: var(--text-faint); background: #f5f7fb; border-color: #e6ebf4; }
.m-chip.expired { color: #a72c31; background: var(--danger-soft); border-color: #f6c9ca; }

.user-table th.action, .user-table td.action {
  width: 210px;
  min-width: 210px;
  white-space: normal;
}
.action-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  width: 100%;
}
.action-group .btn-small { height: 30px; padding: 0 9px; font-size: 12.5px; }
.btn-danger {
  color: #fff;
  background: linear-gradient(145deg, #ef5b60, var(--danger));
  box-shadow: 0 8px 18px rgba(214, 64, 69, 0.22);
}
.btn-danger:not(:disabled):hover { background: linear-gradient(145deg, #e34d52, #bd3238); }

.modal-card.wide { width: min(720px, 100%); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-hint { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.required-mark { color: var(--danger); font-size: 12px; margin-left: 2px; }
.form-result { margin: 14px 0; padding: 12px 14px; background: rgba(40, 167, 69, 0.08); border-radius: 8px; }
.form-result .result-success { margin: 0 0 10px; color: var(--success); font-weight: 600; }
.code-list { margin: 8px 0 0; padding-left: 18px; }
.code-list li { margin: 4px 0; line-height: 1.8; }
.code-list code { background: rgba(0,0,0,0.06); padding: 2px 8px; border-radius: 4px; font-size: 13px; }
.form-success { color: var(--success); font-size: 12.5px; line-height: 1.5; }

/* 邮件诊断 */
.diag-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin: 0 0 16px;
  padding: 12px 14px;
  background: #f7f9fd;
  border-radius: 10px;
}
.diag-item { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; }
.diag-label { flex: 0 0 auto; color: var(--muted); }
.diag-value { color: var(--text); word-break: break-all; }
.diag-ok { color: var(--success); }
.diag-bad { color: var(--danger); }
.diag-section h3 { margin: 0 0 8px; font-size: 13.5px; }
.diag-list {
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid #e7edf7;
  border-radius: 10px;
}
.diag-mail-row { padding: 8px 0; border-bottom: 1px dashed #e7edf7; }
.diag-mail-row:last-child { border-bottom: 0; }
.diag-mail-head { font-size: 12.5px; font-weight: 600; word-break: break-all; }
.diag-mail-meta { margin-top: 2px; color: var(--muted); font-size: 11.5px; }
.diag-mail-error { margin-top: 4px; color: var(--danger); font-size: 11.5px; word-break: break-all; }
.diag-test { margin-top: 6px; }
@media (max-width: 560px) {
  .diag-grid { grid-template-columns: 1fr; }
}
.skip-list li { color: var(--muted); }

.member-current {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 14px 0 18px;
}
.member-current-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  background: #f8faff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}
.member-current-label { color: var(--text-soft); font-weight: 700; }
.member-current-value { color: var(--text-faint); text-align: right; }
.member-current-value.on { color: var(--success); font-weight: 600; }

.timeline-meta { margin: 14px 0 12px; color: var(--text-faint); font-size: 12.5px; }
.timeline {
  max-height: min(56vh, 520px);
  overflow-y: auto;
  padding-right: 4px;
  display: grid;
  gap: 10px;
}
.tl-item {
  padding: 11px 13px;
  background: #f8faff;
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
}
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-title { font-size: 13.5px; color: var(--text); }
.tl-time { margin-left: auto; color: var(--text-faint); font-size: 11.5px; }
.tl-cat {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-deep);
  background: var(--primary-soft);
}
.tl-cat.register { color: #096c4c; background: var(--success-soft); }
.tl-cat.logout { color: var(--text-faint); background: #eef1f7; }
.tl-cat.points { color: #7a4a00; background: var(--warning-soft); }
.tl-cat.admin { color: #4a2ea8; background: #eee9ff; }
.tl-cat.security { color: #a72c31; background: var(--danger-soft); }
.tl-meta { margin-top: 5px; color: var(--text-soft); font-size: 12px; line-height: 1.5; }
.tl-detail { margin-top: 4px; color: var(--text-faint); font-size: 12px; line-height: 1.55; }
.tl-empty { padding: 28px 12px; text-align: center; color: var(--text-faint); }

.confirm-warning {
  margin: 14px 0 18px;
  padding: 12px 14px;
  background: var(--danger-soft);
  border: 1px solid #f6c9ca;
  border-radius: var(--radius-md);
  color: #8c2429;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-line;
}
.confirm-warning.neutral {
  background: var(--primary-soft);
  border-color: #c9d8fb;
  color: var(--primary-deep);
}

@media (max-width: 1080px) {
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .keyword-field { grid-column: span 2; }
  .filter-actions { grid-column: span 3; justify-content: flex-end; }
}
@media (max-width: 720px) {
  .filters { grid-template-columns: 1fr; }
  .keyword-field, .filter-actions { grid-column: auto; }
  .filter-actions { justify-content: stretch; }
  .filter-actions .btn { flex: 1; }
  .member-current, .form-row { grid-template-columns: 1fr; }
  .tl-time { margin-left: 0; width: 100%; }
}
/* ============================================================
   移动端适配：表格转卡片、筛选与弹窗自适应
   ============================================================ */
@media (max-width: 1024px) {
  .dashboard { padding: 14px 10px 40px; }
  .topbar { flex-direction: column; align-items: stretch; }
  .topbar-actions { width: 100%; justify-content: space-between; }
  .panel { padding: 16px 12px; }
  .panel-head { flex-wrap: wrap; align-items: center; }
  .panel-head .btn { flex: none; }
  .bulk-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .bulk-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .bulk-actions .btn { width: 100%; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .keyword-field { grid-column: span 2; }
  .filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    grid-column: span 2;
    align-items: stretch;
  }
  .filter-actions .btn { width: 100%; height: 44px; min-height: 44px; }
  .filter-actions .btn-ghost {
    background: #fff;
    box-shadow: 0 2px 8px rgba(28, 50, 95, 0.06);
  }

  .table-wrap { overflow-x: visible; }
  .user-table { min-width: 0; display: block; }
  .user-table thead { display: none; }
  .user-table tbody { display: block; }
  .user-table tbody tr {
    position: relative;
    display: block;
    margin-bottom: 12px;
    padding: 12px 42px 12px 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 6px 18px rgba(28, 50, 95, 0.05);
  }
  .user-table tbody tr:last-child { margin-bottom: 0; }
  .user-table tbody tr:hover { background: #fff; }
  .user-table tbody tr.selected { background: #f2f7ff; border-color: #b9ccf6; }
  .user-table td {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: auto;
    min-width: 0;
    max-width: none;
    padding: 5px 0;
    border: 0;
    text-align: left;
    white-space: normal;
    font-size: 13px;
    line-height: 1.55;
  }
  .user-table td::before {
    content: attr(data-label);
    flex: 0 0 64px;
    color: var(--text-faint);
    font-size: 12px;
    line-height: 1.6;
  }
  .user-table td.pick {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    padding: 0;
  }
  .user-table td.pick::before { display: none; }
  .user-table td.pick input { width: 18px; height: 18px; }
  .user-table td.user-cell { display: block; padding-top: 0; }
  .user-table td.user-cell::before { display: none; }
  .user-table td.user-cell .user-name { font-size: 15px; }
  .user-table td.user-cell .user-email { margin-top: 3px; }
  .user-table td.device-cell { display: block; }
  .user-table td.device-cell::before { display: block; margin-bottom: 2px; }
  .user-table td.member-cell {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .user-table td.member-cell::before {
    display: block;
    grid-column: 1 / -1;
    margin-bottom: 2px;
  }
  .user-table td.num { text-align: left; }
  .user-table td.action {
    display: block;
    width: auto;
    min-width: 0;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
  }
  .user-table td.action::before { display: block; margin-bottom: 6px; }
  .user-table .action-group {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }
  .user-table .action-group .btn-small {
    width: 100%;
    height: auto;
    min-height: 44px;
    padding: 0 6px;
  }
  .user-table td.empty { display: block; padding: 32px 8px; text-align: center; }
  .user-table td.empty::before { display: none; }
  .member-cell .m-chip { margin: 0; max-width: 100%; width: 100%; text-align: center; }
  .member-cell { overflow-wrap: anywhere; }
  .user-email { font-size: 14px; }
  .user-name, .user-email, .device-os, .device-sub { overflow-wrap: anywhere; }
  .bulk-bar { margin-bottom: 16px; }

  .modal { padding: 12px; }
  .modal-card, .modal-card.wide {
    width: 100%;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    padding: 20px 16px;
  }
  .toast-host { top: 12px; left: 12px; right: 12px; width: auto; }
  .toast { width: 100%; }
  .filters input, .filters select, .form input, .form select { font-size: 16px; }
  .btn, .btn-small, select, input { min-height: 40px; }
}

@media (max-width: 720px) {
  .filters { grid-template-columns: 1fr; }
  .keyword-field, .filter-actions { grid-column: auto; }
  .filter-actions .btn { flex: 1; }
}

@media (max-width: 520px) {
  .brand-text h1 { font-size: 17px; }
  .brand-text p { display: none; }
  .bulk-actions { grid-template-columns: 1fr; }
  .admin-chip { max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; }
  .tl-head .tl-time { margin-left: 0; }
}

/* ============================================================
   积分兑换管理
   ============================================================ */
/* 侧边栏的响应式折叠 */
@media (max-width: 960px) {
  .dashboard { flex-direction: column; padding: 16px 14px 40px; }
  .sidebar {
    position: static;
    flex: none;
    width: 100%;
    min-height: 0;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 14px;
  }
  .sidebar-brand { display: none; }
  .side-nav { flex: 1; flex-direction: row; }
  .side-nav-item { width: auto; height: 36px; padding: 0 12px; }
  .sidebar-foot { display: flex; align-items: center; gap: 8px; margin-top: 0; margin-left: auto; }
}
.panel-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mail-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 14px;
  padding: 10px 14px;
  color: var(--text-soft);
  background: #f7faff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.mail-stats strong { color: var(--text); }
.mail-stats .mail-alert { color: var(--danger); font-weight: 700; }
.redeem-table { min-width: 980px; }
.redeem-code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.4px;
  word-break: break-all;
}
.redeem-plan { font-weight: 700; }
.redeem-plan small { display: block; margin-top: 2px; color: var(--text-faint); font-weight: 400; }
.status-issued { color: #4a5568; background: #f1f4fa; }
.status-submitted { color: var(--warning); background: var(--warning-soft); }
.status-verified { color: var(--primary-deep); background: var(--primary-soft); }
.status-used { color: #096c4c; background: var(--success-soft); }
.status-revoked { color: var(--danger); background: var(--danger-soft); }
.mail-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.mail-sent { color: #096c4c; background: var(--success-soft); }
.mail-pending { color: var(--warning); background: var(--warning-soft); }
.mail-failed { color: var(--danger); background: var(--danger-soft); }
.mail-none { color: var(--text-faint); background: #f5f7fb; }

@media (max-width: 1024px) {
  .topbar-actions { flex-wrap: wrap; }
  .view-tabs { order: -1; width: 100%; }
  .btn-tab { flex: 1; }
}
