/* ================================================================
 * 激活码管理系统 · 设计系统
 * 主色 #2563eb（蓝），辅助绿/橙/红，浅灰底，白底卡片
 * ================================================================ */

/* ---------- CSS 变量 ---------- */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #dbeafe;
  --primary-lighter: #eff6ff;
  --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #1e40af 100%);

  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #0ea5e9;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-faint: #94a3b8;

  --bg-page: #f1f5f9;
  --bg-card: #ffffff;
  --bg-muted: #f8fafc;
  --bg-slate: #f1f5f9;

  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --border-dark: #cbd5e1;

  --sidebar-bg: #1f2937;
  --sidebar-bg-hover: #111827;
  --sidebar-text: #cbd5e1;
  --sidebar-text-dim: #94a3b8;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
  --shadow-xl: 0 20px 40px -12px rgba(15, 23, 42, 0.12);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 9999px;

  --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- 重置 ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
button { font-family: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, h5, h6 { margin: 0; color: var(--text-primary); font-weight: 600; }

/* ---------- 通用隐藏 ---------- */
.hidden { display: none !important; }

/* ---------- 布局辅助 ---------- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.ml-2 { margin-left: 0.5rem; }
.pt-3 { padding-top: 0.75rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.w-full { width: 100%; }
.w-10 { width: 2.5rem; }
.h-10 { height: 2.5rem; }
.w-9 { width: 2.25rem; }
.h-9 { height: 2.25rem; }
.w-5 { width: 1.25rem; }
.h-5 { height: 1.25rem; }
.w-8 { width: 2rem; }
.h-8 { height: 2rem; }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-full { border-radius: var(--radius-pill); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.min-h-screen { min-height: 100vh; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }

/* ---------- 文字工具 ---------- */
.text-sm { font-size: 0.8125rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-slate-400 { color: var(--text-faint); }
.text-slate-500 { color: var(--text-muted); }
.text-slate-600 { color: var(--text-secondary); }
.text-slate-700 { color: var(--text-secondary); }
.text-slate-800 { color: var(--text-primary); }
.text-red-600 { color: var(--danger); }
.text-white { color: #fff; }

.bg-slate-50 { background: #f8fafc; }
.bg-slate-100 { background: var(--bg-slate); }
.bg-red-50 { background: var(--danger-light); }

.border-slate-200 { border-color: var(--border); }
.border-slate-100 { border-color: var(--border-light); }

/* ---------- 栅格系统 ---------- */
.grid { display: grid; gap: 1rem; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-1 { grid-template-columns: minmax(0, 1fr); }

@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .md\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .md\:col-span-2 { grid-column: span 2; }
  .md\:col-span-3 { grid-column: span 3; }
  .md\:col-span-4 { grid-column: span 4; }
  .md\:col-span-12 { grid-column: span 12; }
}
@media (min-width: 1024px) {
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\:col-span-2 { grid-column: span 2; }
}

/* ---------- 登录页 ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 35%, #2563eb 70%, #3b82f6 100%);
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: "";
  position: absolute;
  top: -20%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(147, 197, 253, 0.25), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.login-page::after {
  content: "";
  position: absolute;
  bottom: -20%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.3), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.login-hero {
  flex: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 4rem;
  color: #fff;
  position: relative;
  z-index: 2;
}
.login-hero-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}
.login-hero-icon {
  width: 3.25rem;
  height: 3.25rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}
.login-hero-title {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.login-hero-subtitle {
  font-size: 0.75rem;
  opacity: 0.75;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}
.login-hero h1 {
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: #fff;
}
.login-hero .hero-desc {
  font-size: 1.0625rem;
  line-height: 1.7;
  opacity: 0.9;
  max-width: 520px;
}
.login-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 2.5rem;
  max-width: 520px;
}
.login-feature {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  backdrop-filter: blur(8px);
}
.login-feature-icon {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.login-feature-text .t {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.125rem;
}
.login-feature-text .d {
  font-size: 0.75rem;
  opacity: 0.75;
}

.login-card-wrap {
  flex: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  z-index: 2;
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-xl);
}
.login-card-head {
  text-align: center;
  margin-bottom: 2rem;
}
.login-card-head .brand {
  width: 3.5rem;
  height: 3.5rem;
  background: var(--primary-gradient);
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.45);
  margin-bottom: 1rem;
}
.login-card-head h2 {
  font-size: 1.5rem;
  color: var(--text-primary);
}
.login-card-head p {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.form-group { margin-bottom: 1.125rem; }
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}
.input-with-icon {
  position: relative;
}
.input-with-icon .icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.input-with-icon .icon.right {
  left: auto;
  right: 0.875rem;
  cursor: pointer;
  color: var(--text-muted);
}
.input-with-icon .icon.right:hover { color: var(--primary); }
.input-with-icon input {
  padding-left: 2.5rem;
}
.input-with-icon input.has-right {
  padding-right: 2.5rem;
}

.form-input {
  width: 100%;
  height: 2.75rem;
  padding: 0 0.875rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  font-family: inherit;
}
.form-input:hover { border-color: var(--border-dark); }
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.form-input::placeholder { color: var(--text-faint); }

.form-error {
  font-size: 0.8125rem;
  color: var(--danger);
  background: var(--danger-light);
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-login {
  width: 100%;
  height: 2.75rem;
  border: none;
  background: var(--primary-gradient);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  box-shadow: 0 8px 20px -8px rgba(37, 99, 235, 0.55);
  margin-top: 0.5rem;
}
.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -8px rgba(37, 99, 235, 0.65);
}
.btn-login:active { transform: translateY(0); }
.btn-login:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.login-footer {
  text-align: center;
  margin-top: 1.75rem;
  font-size: 0.75rem;
  color: var(--text-faint);
}

/* ---------- 主界面布局 ---------- */
.app-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg-page);
}

/* 侧边栏 */
.sidebar {
  width: 240px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  box-shadow: 1px 0 0 rgba(0, 0, 0, 0.15);
  z-index: 40;
  transition: transform var(--transition);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar-brand-logo {
  width: 2.25rem;
  height: 2.25rem;
  background: var(--primary-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 6px 12px -4px rgba(37, 99, 235, 0.5);
}
.sidebar-brand-text .t {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}
.sidebar-brand-text .s {
  font-size: 0.6875rem;
  color: var(--sidebar-text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.nav-menu {
  padding: 0.75rem 0.625rem;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--sidebar-text);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition), color var(--transition);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.nav-item .nav-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  color: currentColor;
}
.nav-item.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.95), rgba(30, 64, 175, 0.95));
  color: #fff;
  box-shadow: 0 4px 12px -2px rgba(37, 99, 235, 0.5);
}
.nav-section {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.nav-item.logout:hover {
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
}

/* 主内容区 */
.main-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* 顶部导航栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0.875rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}
.topbar-left { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 1rem; }
.sidebar-toggle {
  display: none;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.sidebar-toggle:hover { background: var(--bg-muted); }
.page-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.user-name {
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.user-avatar {
  width: 2.25rem;
  height: 2.25rem;
  background: var(--primary-gradient);
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 600;
  box-shadow: 0 4px 8px -2px rgba(37, 99, 235, 0.35);
}

/* 内容容器 */
.content {
  flex: 1;
  padding: 1.5rem;
}

/* ---------- 卡片 ---------- */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 1.25rem; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}
.card-title.sm { font-size: 0.875rem; }
.card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---------- 数据统计卡（仪表盘） ---------- */
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stat-card .top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
}
.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.stat-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.stat-icon.blue   { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.stat-icon.green  { background: linear-gradient(135deg, #10b981, #059669); }
.stat-icon.cyan   { background: linear-gradient(135deg, #06b6d4, #0284c7); }
.stat-icon.red    { background: linear-gradient(135deg, #ef4444, #dc2626); }
.stat-icon.amber  { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-icon.teal   { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.stat-icon.sky    { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.stat-icon.orange { background: linear-gradient(135deg, #f97316, #ea580c); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  background: transparent;
  line-height: 1.4;
  font-family: inherit;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 10px -2px rgba(37, 99, 235, 0.35);
}
.btn-primary:hover {
  box-shadow: 0 6px 14px -2px rgba(37, 99, 235, 0.5);
  transform: translateY(-1px);
}

.btn-ghost {
  background: #fff;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--bg-muted);
  border-color: var(--border-dark);
  color: var(--text-primary);
}

.btn-success {
  background: var(--success-light);
  color: #065f46;
  border-color: #a7f3d0;
}
.btn-success:hover { background: #bbf7d0; }

.btn-danger {
  background: var(--danger-light);
  color: #991b1b;
  border-color: #fecaca;
}
.btn-danger:hover { background: #fecaca; }

.btn-warning {
  background: var(--warning-light);
  color: #92400e;
  border-color: #fde68a;
}
.btn-warning:hover { background: #fde68a; }

/* ---------- 表单字段 ---------- */
.form-field { margin-bottom: 0.875rem; }
.field-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
}
.field-input,
.field-select {
  width: 100%;
  height: 2.25rem;
  padding: 0 0.75rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
}
.field-input:hover,
.field-select:hover { border-color: var(--border-dark); }
.field-input:focus,
.field-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.field-input::placeholder { color: var(--text-faint); }

/* ---------- 表格 ---------- */
.table-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table thead {
  background: var(--bg-muted);
}
.data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.data-table td {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  white-space: nowrap;
}
.data-table tbody tr:nth-child(even) {
  background: #fafbfc;
}
.data-table tbody tr {
  transition: background-color var(--transition);
}
.data-table tbody tr:hover {
  background: var(--primary-lighter);
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}
.table-actions {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ---------- 状态 / Badge ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.4;
  background: #f1f5f9;
  color: var(--text-muted);
}
.badge-blue   { background: var(--primary-light); color: var(--primary); }
.badge-green  { background: var(--success-light); color: #047857; }
.badge-red    { background: var(--danger-light); color: #b91c1c; }
.badge-orange { background: var(--warning-light); color: #b45309; }
.badge-gray   { background: #e2e8f0; color: #475569; }

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.4;
}
.status-badge::before {
  content: "";
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  margin-right: 0.35rem;
  background: currentColor;
  opacity: 0.8;
}
.status-active  { background: var(--success-light); color: #047857; }
.status-normal  { background: var(--primary-light); color: var(--primary); }
.status-unused  { background: #e2e8f0; color: #475569; }
.status-banned  { background: var(--danger-light); color: #b91c1c; }
.status-expired { background: var(--warning-light); color: #b45309; }
.status-unbound { background: #e2e8f0; color: #475569; }

/* ---------- 代码 / 激活码 ---------- */
.code-text {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, "Courier New", monospace;
  font-size: 0.8125rem;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  word-break: break-all;
}

.code-copy {
  background: transparent;
  border: none;
  padding: 0.125rem 0.25rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  color: var(--text-secondary);
  font-family: inherit;
  text-align: left;
}
.code-copy:hover {
  background: var(--primary-light);
  color: var(--primary);
}

/* ---------- 分页 ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.375rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding: 0.5rem 0;
}
.pagination .page-info {
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 0.375rem 0.625rem;
}
.pagination button {
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  background: #fff;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.pagination button:hover:not(:disabled) {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}
.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.pagination input {
  width: 3.5rem;
  height: 1.875rem;
  padding: 0 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-primary);
  font-family: inherit;
}
.pagination input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ---------- 搜索 / 筛选条 ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  align-items: center;
}
.filter-bar > * { min-width: 0; }
.filter-bar .grow { flex: 1; min-width: 180px; }
.filter-bar .fixed { width: 9rem; flex-shrink: 0; }
.filter-bar input,
.filter-bar select {
  height: 2.25rem;
  padding: 0 0.75rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--text-primary);
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.filter-bar input:focus,
.filter-bar select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* ---------- Toast ---------- */
.toast {
  min-width: 220px;
  max-width: 360px;
  padding: 0.75rem 1rem;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  color: var(--text-primary);
  border-left: 4px solid var(--primary);
  animation: slideInRight 0.25s ease-out;
  margin-bottom: 0.5rem;
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.info    { border-left-color: var(--primary); }
.toast.warning { border-left-color: var(--warning); }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.18s ease-out;
}
.modal-card {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 820px;
  max-height: 88vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.22s ease-out;
}
.modal-card-sm { max-width: 480px; }
.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
}
.modal-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
  background: #fff;
}
.modal-body h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.modal-footer {
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  background: var(--bg-muted);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 关闭按钮 */
.icon-btn {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  padding: 0;
}
.icon-btn:hover { background: var(--bg-muted); color: var(--text-primary); }

/* ---------- 空状态 ---------- */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-faint);
  font-size: 0.875rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.empty-state::before {
  content: "";
  width: 3rem;
  height: 3rem;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='16' rx='2'/><line x1='3' y1='10' x2='21' y2='10'/><line x1='8' y1='15' x2='16' y2='15'/></svg>");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.8;
  margin-bottom: 0.25rem;
}

/* ---------- 详情行 ---------- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 1.25rem;
  font-size: 0.875rem;
}
.info-grid .full { grid-column: 1 / -1; }
.info-grid .label { color: var(--text-muted); }
.info-grid .val { color: var(--text-primary); }

/* ---------- 响应式 ---------- */
@media (max-width: 992px) {
  .login-hero { padding: 2.5rem 2.5rem; flex: 1.5; }
  .login-hero h1 { font-size: 2.25rem; }
  .login-features { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .login-page { flex-direction: column; }
  .login-hero {
    padding: 2rem 1.5rem 1rem;
    text-align: center;
    align-items: center;
  }
  .login-hero-brand { justify-content: center; margin-bottom: 1.5rem; }
  .login-hero h1 { font-size: 1.75rem; }
  .login-hero .hero-desc { font-size: 0.9375rem; }
  .login-features { display: none; }
  .login-card-wrap { padding: 0.75rem 1rem 2rem; flex: none; }
  .login-card { padding: 1.75rem 1.5rem; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
  }
  body.sidebar-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 35;
  }
  .sidebar-toggle { display: inline-flex; }
  .topbar { padding: 0.75rem 1rem; }
  .user-name { display: none; }
  .content { padding: 1rem; }

  .data-table th,
  .data-table td {
    padding: 0.6rem 0.75rem;
    font-size: 0.8125rem;
  }

  .info-grid { grid-template-columns: 1fr; }

  .filter-bar .fixed { width: 100%; }
}
@media (max-width: 480px) {
  .login-hero h1 { font-size: 1.5rem; }
  .page-title { font-size: 1rem; }
  .btn { padding: 0.45rem 0.75rem; font-size: 0.8125rem; }
}

/* ---------- 滚动条美化 ---------- */
.sidebar::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}
.modal-body::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

/* ---------- 小标签 tag ---------- */
.tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: var(--bg-muted);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
}

/* ---------- 图表容器 ---------- */
.chart-box {
  position: relative;
  width: 100%;
  height: 320px;
}
.chart-box.sm { height: 300px; }
@media (max-width: 600px) {
  .chart-box { height: 260px; }
}
