:root {
  color-scheme: dark;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* 主色调 - 专业蓝紫渐变 */
  --color-primary: #6366f1;
  --color-primary-hover: #818cf8;
  --color-primary-soft: rgba(99, 102, 241, 0.15);
  --color-secondary: #8b5cf6;
  --color-accent: #06b6d4;

  /* 表面颜色 */
  --color-surface: #0f172a;
  --color-surface-elevated: #1e293b;
  --color-surface-hover: #334155;
  --color-bg: #020617;
  --color-bg-alt: #0a0f1e;

  /* 文字颜色 */
  --color-text: #f1f5f9;
  --color-text-secondary: #cbd5e1;
  --color-muted: #64748b;

  /* 边框 */
  --color-border: rgba(148, 163, 184, 0.1);
  --color-border-strong: rgba(148, 163, 184, 0.2);

  /* 状态颜色 */
  --color-success: #10b981;
  --color-success-soft: rgba(16, 185, 129, 0.15);
  --color-warning: #f59e0b;
  --color-warning-soft: rgba(245, 158, 11, 0.15);
  --color-danger: #ef4444;
  --color-danger-soft: rgba(239, 68, 68, 0.15);
  --color-info: #3b82f6;
  --color-info-soft: rgba(59, 130, 246, 0.15);

  /* 圆角和阴影 */
  --radius: 16px;
  --radius-sm: 8px;
  --radius-lg: 24px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, 0.6);
}

/* 浅色主题 */
[data-theme="light"] {
  color-scheme: light;

  /* 主色调保持不变 */
  --color-primary: #6366f1;
  --color-primary-hover: #4f46e5;
  --color-primary-soft: rgba(99, 102, 241, 0.1);
  --color-secondary: #8b5cf6;
  --color-accent: #06b6d4;

  /* 表面颜色 - 浅色 */
  --color-surface: #ffffff;
  --color-surface-elevated: #f8fafc;
  --color-surface-hover: #f1f5f9;
  --color-bg: #f1f5f9;
  --color-bg-alt: #e2e8f0;

  /* 文字颜色 - 深色 */
  --color-text: #0f172a;
  --color-text-secondary: #475569;
  --color-muted: #94a3b8;

  /* 边框 */
  --color-border: rgba(148, 163, 184, 0.2);
  --color-border-strong: rgba(148, 163, 184, 0.3);

  /* 状态颜色 */
  --color-success: #059669;
  --color-success-soft: rgba(5, 150, 105, 0.1);
  --color-warning: #d97706;
  --color-warning-soft: rgba(217, 119, 6, 0.1);
  --color-danger: #dc2626;
  --color-danger-soft: rgba(220, 38, 38, 0.1);
  --color-info: #2563eb;
  --color-info-soft: rgba(37, 99, 235, 0.1);

  /* 阴影 */
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 20px 50px -20px rgba(0, 0, 0, 0.2);
}

html {
  background: var(--color-bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 0% -20%, rgba(99, 102, 241, 0.12), transparent 58%),
    radial-gradient(circle at 90% -10%, rgba(139, 92, 246, 0.15), transparent 60%),
    var(--color-bg);
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease, opacity 0.2s ease-out;
  opacity: 0;
  animation: fadeIn 0.25s ease-out forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

body.page-transitioning {
  opacity: 0;
}

[data-theme="light"] body {
  background: radial-gradient(circle at 20% 10%, rgba(99, 102, 241, 0.08), transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.06), transparent 50%),
    var(--color-bg);
}

/* SVG 图标通用样式 */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25em;
  height: 1.25em;
  flex-shrink: 0;
}

.icon-sm {
  width: 1em;
  height: 1em;
}

.icon svg {
  width: 100%;
  height: 100%;
}

.icon-lg {
  width: 2em;
  height: 2em;
}

.icon-xl {
  width: 3em;
  height: 3em;
}

a {
  color: #93c5fd;
  text-decoration: none;
}

.layout {
  width: min(1600px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 28px;
  padding: 32px 20px 40px;
  flex: 1;
  animation: slideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1) 0.1s both;
  box-sizing: border-box;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sidebar {
  background: linear-gradient(200deg, rgba(11, 19, 36, 0.96), rgba(8, 13, 24, 0.88));
  color: rgba(226, 232, 240, 0.96);
  padding: 36px 30px 42px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  border-radius: 32px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 44px 90px -52px rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(12px);
  transition: all 0.3s ease;
  height: 100vh;
  overflow: hidden;
}

[data-theme="light"] .sidebar {
  background: linear-gradient(200deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  color: var(--color-text);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 10px 40px -20px rgba(0, 0, 0, 0.1);
}

.sidebar h1 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.sidebar p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--color-muted);
  line-height: 1.7;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  font-size: 0.85rem;
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-footer #user-display {
  color: var(--color-text);
}

.sidebar-footer #user-display strong {
  color: var(--color-text);
  opacity: 1;
}

.sidebar-footer #user-display > div {
  color: var(--color-muted);
  opacity: 0.85;
}

.sidebar-footer__logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: rgba(248, 113, 113, 0.95);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  box-sizing: border-box;
}

.sidebar-footer__logout svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sidebar-footer__logout:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  transform: translateX(2px);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.sidebar-footer__logout:active {
  transform: translateX(1px);
  box-shadow: 0 1px 4px rgba(239, 68, 68, 0.15);
}

[data-theme="light"] .sidebar-footer__logout {
  background: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.2);
  color: #dc2626;
}

[data-theme="light"] .sidebar-footer__logout:hover {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.35);
  color: #b91c1c;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.15);
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-right: 8px;
  margin-right: -8px;
}

/* 美化滚动条 */
.menu::-webkit-scrollbar {
  width: 6px;
}

.menu::-webkit-scrollbar-track {
  background: rgba(148, 163, 184, 0.08);
  border-radius: 3px;
}

.menu::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 3px;
}

.menu::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.4);
}

[data-theme="light"] .menu::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.3);
}

[data-theme="light"] .menu::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.5);
}

.menu a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius);
  color: rgba(226, 232, 240, 0.86);
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.12);
  transition: transform 0.25s ease, border 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
  font-weight: 500;
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
}

.menu a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
  transition: left 0.5s ease;
}

.menu a:active::before {
  left: 100%;
}

[data-theme="light"] .menu a {
  color: var(--color-text-secondary);
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.15);
}

.menu a:hover,
.menu a.active {
  transform: translateX(8px);
  border-color: rgba(59, 130, 246, 0.45);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.38), rgba(14, 165, 233, 0.22));
  color: #f8fafc;
  box-shadow: 0 18px 32px -20px rgba(59, 130, 246, 0.55);
}

[data-theme="light"] .menu a:hover,
[data-theme="light"] .menu a.active {
  color: var(--color-primary);
  background: var(--color-primary-soft);
  border-color: var(--color-primary);
  box-shadow: 0 8px 20px -10px rgba(99, 102, 241, 0.4);
}

.content {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  border-radius: 32px;
  background: linear-gradient(170deg, rgba(15, 23, 42, 0.82), rgba(5, 12, 26, 0.92));
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  transition: all 0.3s ease;
  animation: fadeInScale 0.35s cubic-bezier(0.4, 0, 0.2, 1) 0.15s both;
  overflow: visible;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.99);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

[data-theme="light"] .content {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 10px 40px -20px rgba(0, 0, 0, 0.1);
}

.topbar {
  padding: 36px 48px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar h2 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: 0.04em;
}

.topbar p {
  margin: 8px 0 0;
  color: var(--color-muted);
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar__actions > * {
  flex-shrink: 0;
}

@media (max-width: 980px) {
  .topbar__actions {
    justify-content: flex-start;
    width: 100%;
  }
}

.topbar .user {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 0.95rem;
  color: var(--color-muted);
}

.main {
  padding: 44px 48px 52px;
  background: transparent;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
}

.main > * {
  min-width: 0;
}

.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  font-size: 0.85rem;
  color: var(--color-muted);
  padding: 0 4px;
}

.page-meta__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.08);
  color: var(--color-text-secondary);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.metric-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 18px 42px -28px rgba(2, 6, 23, 0.6);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 26px 60px -42px rgba(99, 102, 241, 0.45);
}

.metric-card--primary {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(14, 165, 233, 0.18));
  border-color: rgba(129, 140, 248, 0.5);
  box-shadow: 0 26px 68px -40px rgba(99, 102, 241, 0.55);
}

.metric-card__label {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.metric-card__value {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--color-text);
}

.metric-card__hint {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
}

[data-theme="light"] .page-meta__item {
  background: rgba(148, 163, 184, 0.18);
  color: #475569;
}

[data-theme="light"] .metric-card {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(148, 163, 184, 0.24);
  box-shadow: 0 18px 42px -24px rgba(15, 23, 42, 0.18);
}

[data-theme="light"] .metric-card:hover {
  box-shadow: 0 24px 56px -26px rgba(99, 102, 241, 0.25);
}

[data-theme="light"] .metric-card--primary {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(14, 165, 233, 0.12));
  border-color: rgba(129, 140, 248, 0.5);
}

.card {
  background: var(--color-surface-elevated);
  border-radius: 24px;
  box-shadow: 0 26px 60px -44px rgba(2, 6, 23, 0.7);
  padding: 32px;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.card h2 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.2rem;
}

/* Table wrapper for horizontal scroll */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  margin: 0;
  -webkit-overflow-scrolling: touch;
}

.table-wrapper::-webkit-scrollbar {
  height: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
  background: var(--color-surface);
  border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--color-muted);
}

table {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
  color: var(--color-text);
}

@media (max-width: 1200px) {
  table {
    min-width: 100%;
  }
}

/* Specific column widths for better layout */
table th:first-child,
table td:first-child {
  min-width: 100px;
}

table.data-table--deposits {
  min-width: 100%;
}

table th:last-child,
table td:last-child {
  min-width: 280px;
  text-align: right;
  white-space: nowrap;
  padding-right: 20px;
}

/* Ensure buttons don't wrap */
table td:last-child {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
}

table.data-table--deposits th:last-child,
table.data-table--deposits td:last-child {
  min-width: 180px;
  text-align: center;
  padding-right: 18px;
}

table.data-table--deposits td:last-child {
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

table.data-table--deposits td:last-child button {
  min-width: 68px;
}

thead {
  background: rgba(148, 163, 184, 0.08);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
}

th,
td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: none;
}

td .badge {
  margin-right: 6px;
  margin-bottom: 0;
}

td .badge:last-child {
  margin-right: 0;
}

form {
  display: grid;
  gap: 18px;
}

form label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  gap: 8px;
  color: var(--color-text);
  font-size: 0.9rem;
}

form label > span {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

input,
select,
button,
textarea {
  font: inherit;
}

input,
select,
textarea {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--color-border-strong);
  background-color: var(--color-surface);
  background-image: none;
  color: var(--color-text);
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

input::placeholder,
textarea::placeholder {
  color: var(--color-muted);
  opacity: 0.7;
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  background: var(--color-surface-elevated);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--color-surface-hover);
}

select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-color: var(--color-surface) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 14px !important;
  padding-right: 42px !important;
  cursor: pointer;
}

select::-ms-expand {
  display: none;
}

select:focus {
  background-color: var(--color-surface-elevated) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
}


[data-theme="light"] select {
  background-color: var(--color-surface) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

[data-theme="light"] select:focus {
  background-color: var(--color-surface-elevated) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

button {
  padding: 11px 20px;
  border-radius: 10px;
  border: 1px solid var(--color-primary);
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.9rem;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -8px var(--color-primary);
  border-color: var(--color-primary-hover);
  filter: brightness(1.1);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px -8px var(--color-primary);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

button .icon {
  width: 1.1em;
  height: 1.1em;
}

button svg {
  width: 18px;
  height: 18px;
}

.btn-sm {
  padding: 8px 14px;
  min-height: 34px;
  min-width: 88px;
  border-radius: 12px;
  font-size: 0.85rem;
  gap: 6px;
  line-height: 1.1;
}

.btn-sm svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border-color: var(--color-primary);
  color: #ffffff;
}

.btn-ghost {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.25);
  color: var(--color-primary);
  box-shadow: none;
}

.btn-ghost:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  color: #e0e7ff;
  filter: none;
}

.btn-ghost:active {
  transform: translateY(0);
  box-shadow: none;
}

[data-theme="light"] .btn-ghost {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.25);
  color: var(--color-primary);
}

[data-theme="light"] .btn-ghost:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.35);
  color: var(--color-primary);
}

.btn-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.92), rgba(16, 185, 129, 0.78));
  border-color: rgba(16, 185, 129, 0.6);
  color: #ecfdf5;
}

.btn-success:hover {
  filter: none;
  border-color: rgba(16, 185, 129, 0.75);
}

.btn-danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.92), rgba(239, 68, 68, 0.78));
  border-color: rgba(239, 68, 68, 0.6);
  color: #fee2e2;
}

.btn-danger:hover {
  filter: none;
  border-color: rgba(239, 68, 68, 0.75);
}

[data-theme="light"] .btn-success {
  color: #065f46;
}

[data-theme="light"] .btn-danger {
  color: #7f1d1d;
}


/* Topbar 按钮样式 */
.topbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  min-height: 38px;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  border: 1.5px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.6);
  color: rgba(226, 232, 240, 0.95);
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}

.topbar-btn:hover {
  transform: translateY(-1px);
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.5);
  color: #e0f2fe;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.topbar-btn:active {
  transform: translateY(0);
}

.topbar-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.topbar-btn--theme,
.topbar-btn--logout,
.topbar-btn--primary {
  min-width: 90px;
}

.topbar-btn--ghost {
  min-width: 120px;
  background: rgba(148, 163, 184, 0.04);
  border-color: rgba(148, 163, 184, 0.25);
  color: var(--color-text-secondary);
}

.topbar-btn--ghost:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
}

.topbar-btn--primary {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
}

.topbar-btn--primary:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.5);
  color: #c7d2fe;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.topbar-btn--logout {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.topbar-btn--logout:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

/* 浅色主题下的按钮样式 */
[data-theme="light"] .topbar-btn {
  background: #ffffff;
  border-color: rgba(203, 213, 225, 0.6);
  color: #475569;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .topbar-btn:hover {
  background: rgba(99, 102, 241, 0.06);
  border-color: rgba(99, 102, 241, 0.4);
  color: #6366f1;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

[data-theme="light"] .topbar-btn--primary {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.35);
  color: #6366f1;
}

[data-theme="light"] .topbar-btn--ghost {
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.35);
  color: #475569;
}

[data-theme="light"] .topbar-btn--ghost:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.35);
  color: #4338ca;
}

[data-theme="light"] .topbar-btn--primary:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.5);
  color: #4f46e5;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

[data-theme="light"] .topbar-btn--logout {
  background: #ffffff;
  border-color: rgba(220, 38, 38, 0.25);
  color: #dc2626;
}

[data-theme="light"] .topbar-btn--logout:hover {
  background: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.4);
  color: #b91c1c;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.15);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

/* 表格按钮样式 */
.table-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 10px;
  min-height: 32px;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1;
  border-radius: 8px;
  border: 1px solid;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-right: 6px;
  white-space: nowrap;
}

.table-btn:last-child {
  margin-right: 0;
}

.table-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.table-btn--edit {
  background: rgba(59, 130, 246, 0.06);
  border-color: rgba(59, 130, 246, 0.25);
  color: #60a5fa;
}

.table-btn--edit:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.4);
  color: #93c5fd;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.2);
  transform: translateY(-1px);
}

.table-btn--info {
  background: rgba(99, 102, 241, 0.06);
  border-color: rgba(99, 102, 241, 0.25);
  color: #818cf8;
}

.table-btn--info:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.4);
  color: #a5b4fc;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.2);
  transform: translateY(-1px);
}

.table-btn--success {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.25);
  color: #34d399;
}

.table-btn--success:hover {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.2);
  transform: translateY(-1px);
}

.table-btn--warning {
  background: rgba(245, 158, 11, 0.06);
  border-color: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
}

.table-btn--warning:hover {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fcd34d;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.2);
  transform: translateY(-1px);
}

.table-btn--delete {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.25);
  color: #f87171;
}

.table-btn--delete:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.2);
  transform: translateY(-1px);
}

/* 浅色主题下的表格按钮 */
[data-theme="light"] .table-btn--info {
  background: #ffffff;
  border-color: rgba(99, 102, 241, 0.3);
  color: #6366f1;
}

[data-theme="light"] .table-btn--info:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.5);
  color: #4f46e5;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.15);
}

[data-theme="light"] .table-btn--edit {
  background: #ffffff;
  border-color: rgba(59, 130, 246, 0.3);
  color: #2563eb;
}

[data-theme="light"] .table-btn--edit:hover {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.5);
  color: #1d4ed8;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.15);
}

[data-theme="light"] .table-btn--success {
  background: #ffffff;
  border-color: rgba(16, 185, 129, 0.3);
  color: #059669;
}

[data-theme="light"] .table-btn--success:hover {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.5);
  color: #047857;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.15);
}

[data-theme="light"] .table-btn--warning {
  background: #ffffff;
  border-color: rgba(245, 158, 11, 0.3);
  color: #d97706;
}

[data-theme="light"] .table-btn--warning:hover {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.5);
  color: #b45309;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.15);
}

[data-theme="light"] .table-btn--delete {
  background: #ffffff;
  border-color: rgba(220, 38, 38, 0.3);
  color: #dc2626;
}

[data-theme="light"] .table-btn--delete:hover {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.5);
  color: #b91c1c;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.15);
}

#settings-message,
#form-message {
  color: var(--color-muted);
  font-size: 0.9rem;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  text-align: center;
}

#form-message:empty,
#settings-message:empty {
  display: none;
}

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: 260px minmax(0, 1fr);
    padding: 32px 16px 40px;
  }
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
    padding: 24px 16px 32px;
  }

  .content {
    min-height: auto;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .topbar .user {
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  .layout {
    padding: 32px 20px 52px;
  }

  .sidebar {
    padding: 28px 24px 32px;
  }

  .main {
    padding: 32px 28px 40px;
  }
}

/* Login page */
body.login-body {
  color-scheme: light;
  display: block;
  min-height: 100vh;
  background: radial-gradient(circle at 20% -10%, rgba(59, 130, 246, 0.18), transparent 55%),
    radial-gradient(circle at 80% 0%, rgba(37, 99, 235, 0.25), transparent 60%),
    #0f172a;
  color: #e2e8f0;
  margin: 0;
}

.login-shell {
  display: grid;
  max-width: 1400px;
  margin: 0 auto;
  grid-template-columns: minmax(0, 520px) minmax(0, 1fr);
  min-height: 68vh;
  padding: clamp(24px, 4vw, 40px) clamp(20px, 5vw, 48px);
  box-sizing: border-box;
  gap: clamp(20px, 3.5vw, 32px);
}

.login-panel {
  background: #ffffff;
  color: #0f172a;
  border-radius: 24px;
  padding: clamp(32px, 4.5vw, 48px);
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3.5vw, 28px);
  box-shadow: 0 36px 72px -34px rgba(15, 23, 42, 0.4);
}

.login-panel__header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-panel__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.14);
  color: #2563eb;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  width: fit-content;
}

.login-panel__title {
  margin: 0;
  font-size: clamp(26px, 3.8vw, 34px);
  font-weight: 700;
  color: #0f172a;
}

.login-panel__subtitle {
  margin: 0;
  line-height: 1.65;
  color: rgba(15, 23, 42, 0.64);
  font-size: 0.92rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-form .form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-form .form-label {
  font-size: 0.95rem;
  color: rgba(15, 23, 42, 0.72);
  font-weight: 600;
}

.login-form .input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #f8fafc;
  padding: 10px 12px;
  transition: border 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.login-form .input-wrapper:focus-within {
  border-color: rgba(37, 99, 235, 0.6);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.login-form .input-icon {
  width: 20px;
  height: 20px;
  color: rgba(37, 99, 235, 0.8);
}

.login-form .input-icon svg {
  width: 100%;
  height: 100%;
}

.login-form .input-control {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1rem;
  color: #111827;
  outline: none;
}

.login-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.login-feedback {
  font-size: 0.9rem;
  color: rgba(37, 99, 235, 0.72);
}

.login-feedback--error {
  color: #b91c1c;
}

.login-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.04), rgba(139, 92, 246, 0.06));
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(99, 102, 241, 0.1);
}

.login-meta__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.login-meta__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-top: 5px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}

.login-meta__text {
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.7);
  line-height: 1.5;
  flex: 1;
}

.login-meta__text strong {
  color: #6366f1;
  font-weight: 600;
}

.login-aside {
  position: relative;
  border-radius: 24px;
  padding: clamp(28px, 4vw, 48px) clamp(30px, 5vw, 56px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(22px, 3.5vw, 36px);
  color: #e2e8f0;
  background: linear-gradient(140deg, rgba(15, 23, 42, 0.92), rgba(30, 64, 175, 0.86));
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.08), 0 32px 68px -40px rgba(15, 23, 42, 0.6);
}

.aside-header {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.aside-title {
  margin: 0;
  font-size: clamp(26px, 3.5vw, 34px);
  font-weight: 600;
}

.aside-subtitle {
  margin: 0;
  color: rgba(226, 232, 240, 0.82);
  line-height: 1.72;
}

.credit-card-wrapper {
  width: min(300px, 88%);
  margin: clamp(18px, 3vw, 36px) auto;
}

.credit-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1.7 / 1;
  border-radius: 22px;
  padding: 26px 30px;
  background: linear-gradient(135deg, #7c3aed, #2563eb 58%, #14b8a6 100%);
  box-shadow: 0 38px 80px -42px rgba(14, 116, 144, 0.6);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #ffffff;
  font-family: 'SF Mono', 'Consolas', 'Menlo', monospace;
  overflow: hidden;
}

.credit-card::after {
  content: '';
  position: absolute;
  inset: -35% 35% auto -35%;
  height: 140%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.25), transparent 60%);
  transform: rotate(18deg);
}

.credit-card__header,
.credit-card__footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.credit-card__chip {
  width: 46px;
  height: 32px;
  background: linear-gradient(135deg, rgba(255, 245, 157, 0.94), rgba(250, 204, 21, 0.94));
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 5px 7px;
}

.credit-card__chip-line {
  height: 2px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 2px;
}

.credit-card__network {
  width: 58px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.credit-card__network span {
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

.credit-card__network span:first-child {
  background: rgba(248, 113, 113, 0.95);
}

.credit-card__network span:last-child {
  background: rgba(251, 191, 36, 0.95);
  margin-left: -12px;
}

.credit-card__number {
  position: relative;
  z-index: 1;
  font-size: 1.15rem;
  letter-spacing: 0.38rem;
  display: flex;
  justify-content: space-between;
  margin-top: 26px;
}

.credit-card__footer {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  opacity: 0.92;
}

.credit-card__tag {
  margin-top: 6px;
  font-size: 0.66rem;
  letter-spacing: 0.35em;
  opacity: 0.8;
}

.aside-footnote {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: rgba(226, 232, 240, 0.78);
  font-size: 0.88rem;
}

@media (max-width: 1080px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-panel {
    border-radius: 24px;
    box-shadow: 0 24px 48px -28px rgba(15, 23, 42, 0.35);
  }

  .login-aside {
    display: none;
  }
}

@media (max-width: 640px) {
  .login-panel {
    padding: clamp(28px, 10vw, 40px);
  }

  .login-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-primary {
    width: 100%;
  }
}

/* Dashboard Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.stat-card {
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  min-width: 0;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  border-color: var(--color-primary);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.stat-card__title {
  font-size: 0.85rem;
  color: var(--color-muted);
  font-weight: 500;
  margin: 0;
  letter-spacing: 0.02em;
}

.stat-card__value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--color-text);
  margin: 0;
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-card__footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--color-muted);
}

.stat-card__change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.75rem;
}

.stat-card__change--positive {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.stat-card__change--negative {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.stat-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--color-primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  flex-shrink: 0;
}

.stat-card__icon svg {
  width: 22px;
  height: 22px;
}

.stat-card--users .stat-card__icon {
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
}

.stat-card--active .stat-card__icon {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.stat-card--admin .stat-card__icon {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

.stat-card--logs .stat-card__icon {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}

/* Table enhancements */
tbody tr {
  transition: background 0.2s ease;
}

tbody tr.row-status-pending {
  background: rgba(245, 158, 11, 0.08);
}

tbody tr.row-status-processing {
  background: rgba(59, 130, 246, 0.08);
}

tbody tr.row-status-completed {
  background: rgba(16, 185, 129, 0.08);
}

tbody tr.row-status-failed {
  background: rgba(239, 68, 68, 0.08);
}

tbody tr.row-status-cancelled {
  background: rgba(148, 163, 184, 0.08);
}

tbody tr:hover {
  background: rgba(59, 130, 246, 0.08);
}

tbody tr.row-status-pending:hover {
  background: rgba(245, 158, 11, 0.16);
}

tbody tr.row-status-processing:hover {
  background: rgba(59, 130, 246, 0.16);
}

tbody tr.row-status-completed:hover {
  background: rgba(16, 185, 129, 0.16);
}

tbody tr.row-status-failed:hover {
  background: rgba(239, 68, 68, 0.16);
}

tbody tr.row-status-cancelled:hover {
  background: rgba(148, 163, 184, 0.16);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid;
  transition: all 0.2s ease;
}

.badge--success {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.25);
}

[data-theme="light"] .badge--success {
  background: rgba(5, 150, 105, 0.1);
  color: #059669;
  border-color: rgba(5, 150, 105, 0.2);
}

.badge--warning {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.25);
}

[data-theme="light"] .badge--warning {
  background: rgba(217, 119, 6, 0.1);
  color: #d97706;
  border-color: rgba(217, 119, 6, 0.2);
}

.badge--danger {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.25);
}

[data-theme="light"] .badge--danger {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.2);
}

.badge--info {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.25);
}

[data-theme="light"] .badge--info {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.2);
}

.badge--ghost {
  background: rgba(148, 163, 184, 0.12);
  color: rgba(226, 232, 240, 0.85);
  border-color: rgba(148, 163, 184, 0.3);
}

[data-theme="light"] .badge--ghost {
  background: rgba(148, 163, 184, 0.1);
  color: #475569;
  border-color: rgba(148, 163, 184, 0.25);
}

/* Detail views */
.detail-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.detail-split {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 1fr);
  grid-template-areas: 'card preview';
  gap: 24px;
  align-items: flex-start;
}

.detail-preview {
  grid-area: preview;
}

.detail-section--card {
  grid-area: card;
}

@media (max-width: 1024px) {
  .detail-split {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'preview' 'card';
    gap: 20px;
  }
}

.detail-section {
  background: rgba(15, 23, 42, 0.55);
  border-radius: 20px;
  border: 1px solid var(--color-border);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

[data-theme="light"] .detail-section {
  background: rgba(248, 250, 252, 0.95);
}

.detail-section__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text);
}

.detail-section__header svg {
  width: 20px;
  height: 20px;
}

.detail-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-item--full {
  grid-column: 1 / -1;
}

.detail-item__label {
  font-size: 0.85rem;
  color: var(--color-muted);
}

.detail-item__value {
  font-weight: 600;
  color: var(--color-text);
  word-break: break-word;
}

.detail-item__value code {
  font-size: 1rem;
}

.detail-item__value--success {
  color: var(--color-success);
}

.detail-item__value--warning {
  color: var(--color-warning);
}

.detail-item__value--danger {
  color: var(--color-danger);
}

.detail-empty {
  padding: 24px;
  text-align: center;
  color: var(--color-muted);
}

.detail-stat-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.detail-stat {
  border-radius: 12px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(148, 163, 184, 0.12);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

[data-theme="light"] .detail-stat {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.24);
}

.detail-stat__label {
  font-size: 0.82rem;
  color: var(--color-muted);
}

.detail-stat__value {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-text);
}

.detail-stat--success {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
}

.detail-stat--danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
}

.detail-stat--info {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
}

.detail-preview {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  padding: 24px 20px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.55);
  box-shadow: 0 20px 60px -40px rgba(15, 23, 42, 0.9);
  overflow: hidden;
}

[data-theme="light"] .detail-preview {
  background: rgba(248, 250, 252, 0.95);
  border-color: rgba(148, 163, 184, 0.25);
  box-shadow: 0 18px 36px -28px rgba(15, 23, 42, 0.25);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(148, 163, 184, 0.16);
  color: rgba(226, 232, 240, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.28);
}

.status-pill--pending {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.32);
  color: #fbbf24;
}

.status-pill--processing {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.32);
  color: #60a5fa;
}

.status-pill--completed {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.32);
  color: #34d399;
}

.status-pill--failed {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.32);
  color: #f87171;
}

.status-pill--cancelled {
  background: rgba(148, 163, 184, 0.18);
  border-color: rgba(148, 163, 184, 0.32);
  color: rgba(226, 232, 240, 0.82);
}

.status-pill--unknown {
  background: rgba(148, 163, 184, 0.16);
  border-color: rgba(148, 163, 184, 0.28);
  color: rgba(226, 232, 240, 0.75);
}

[data-theme="light"] .status-pill {
  background: rgba(148, 163, 184, 0.18);
  color: #334155;
  border-color: rgba(148, 163, 184, 0.26);
}

[data-theme="light"] .status-pill--completed {
  color: #047857;
}

[data-theme="light"] .status-pill--failed {
  color: #b91c1c;
}

[data-theme="light"] .status-pill--pending {
  color: #b45309;
}

[data-theme="light"] .status-pill--processing {
  color: #1d4ed8;
}

[data-theme="light"] .status-pill--cancelled {
  color: #475569;
}

.deposit-detail {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.deposit-detail__summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px;
  border-radius: 20px;
  border: 1px solid rgba(129, 140, 248, 0.32);
  background: linear-gradient(140deg, rgba(99, 102, 241, 0.16), rgba(14, 165, 233, 0.12));
  box-shadow: 0 24px 60px -36px rgba(99, 102, 241, 0.45);
}

[data-theme="light"] .deposit-detail__summary {
  background: linear-gradient(140deg, rgba(99, 102, 241, 0.12), rgba(14, 165, 233, 0.08));
  border-color: rgba(99, 102, 241, 0.24);
  box-shadow: 0 16px 40px -28px rgba(99, 102, 241, 0.25);
}

.deposit-detail__summary-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.deposit-detail__amount {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

.deposit-detail__summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 0.84rem;
  color: var(--color-muted);
}

.deposit-detail__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.24);
}

[data-theme="light"] .deposit-detail__meta-item {
  background: rgba(148, 163, 184, 0.16);
  border-color: rgba(148, 163, 184, 0.26);
}

.deposit-detail__summary-tags {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.deposit-detail__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.32);
  color: rgba(226, 232, 240, 0.9);
}

.deposit-detail__chip--accent {
  background: rgba(14, 165, 233, 0.22);
  border-color: rgba(14, 165, 233, 0.36);
  color: #38bdf8;
}

[data-theme="light"] .deposit-detail__chip {
  background: rgba(99, 102, 241, 0.14);
  border-color: rgba(99, 102, 241, 0.22);
  color: var(--color-primary);
}

[data-theme="light"] .deposit-detail__chip--accent {
  background: rgba(14, 165, 233, 0.18);
  border-color: rgba(14, 165, 233, 0.3);
  color: #0284c7;
}

.deposit-detail__timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.deposit-detail__timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.deposit-detail__timeline-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.18);
  color: var(--color-primary);
  border: 1px solid rgba(99, 102, 241, 0.28);
  flex-shrink: 0;
}

[data-theme="light"] .deposit-detail__timeline-icon {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.2);
}

.deposit-detail__timeline-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.deposit-detail__timeline-label {
  font-size: 0.82rem;
  color: var(--color-muted);
}

.deposit-detail__timeline-value {
  font-size: 0.95rem;
  color: var(--color-text);
  font-weight: 600;
  word-break: break-word;
  font-family: 'SF Mono', 'Consolas', monospace;
}

@media (max-width: 640px) {
  .deposit-detail__summary {
    padding: 18px;
  }

  .deposit-detail__summary-tags {
    justify-content: flex-start;
  }
}

.credit-card--modal {
  width: 100%;
  max-width: 380px;
  height: auto;
  aspect-ratio: 16 / 10;
  margin: 0 auto;
  box-sizing: border-box;
}

.credit-card--modal .credit-card__number {
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  letter-spacing: clamp(0.25rem, 0.5vw, 0.32rem);
}

.credit-card__badges {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.credit-card__badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(15, 23, 42, 0.25);
  color: #f8fafc;
}

.credit-card__badge--visa {
  background: rgba(59, 130, 246, 0.36);
  border-color: rgba(59, 130, 246, 0.55);
}

.credit-card__badge--mastercard {
  background: rgba(251, 146, 60, 0.35);
  border-color: rgba(251, 191, 36, 0.6);
}

.credit-card__badge--type {
  text-transform: none;
  letter-spacing: 0.04em;
}

.detail-preview__meta {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
}

.detail-preview__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
  min-width: 0;
}

.detail-preview__label {
  font-size: 0.82rem;
  color: var(--color-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-preview__value {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text);
  word-break: break-word;
}

.detail-preview__value .badge {
  font-size: 0.75rem;
}

[data-theme="light"] .credit-card__badge {
  background: rgba(255, 255, 255, 0.85);
  color: #1f2937;
  border-color: rgba(148, 163, 184, 0.4);
}

[data-theme="light"] .credit-card__badge--visa {
  background: rgba(59, 130, 246, 0.16);
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.4);
}

[data-theme="light"] .credit-card__badge--mastercard {
  background: rgba(251, 146, 60, 0.18);
  color: #c2410c;
  border-color: rgba(251, 146, 60, 0.45);
}

.detail-profile {
  position: relative;
  border-radius: 20px;
  padding: 28px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.22), rgba(99, 102, 241, 0.24));
  color: #f1f5f9;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  overflow: hidden;
}

.detail-profile::after {
  content: '';
  position: absolute;
  inset: 18px 28px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  opacity: 0.5;
  pointer-events: none;
}

[data-theme="light"] .detail-profile {
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.1), rgba(59, 130, 246, 0.12));
  color: #0f172a;
}

.detail-profile__avatar {
  position: relative;
  z-index: 1;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 16px 34px -18px rgba(30, 64, 175, 0.7);
}

[data-theme="light"] .detail-profile__avatar {
  background: rgba(255, 255, 255, 0.9);
  color: #1f2937;
}

.detail-profile__name {
  position: relative;
  z-index: 1;
  font-size: 1.2rem;
  font-weight: 600;
}

.detail-profile__meta {
  position: relative;
  z-index: 1;
  color: rgba(241, 245, 249, 0.85);
  font-size: 0.9rem;
}

.detail-profile__meta.detail-profile__meta--muted {
  color: rgba(241, 245, 249, 0.65);
}

[data-theme="light"] .detail-profile__meta {
  color: var(--color-muted);
}

[data-theme="light"] .detail-profile__meta.detail-profile__meta--muted {
  color: var(--color-text-secondary);
}

.detail-profile__tags {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.detail-profile__tag {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(15, 23, 42, 0.2);
  color: #f8fafc;
}

.detail-profile__tag--success {
  background: rgba(16, 185, 129, 0.3);
  border-color: rgba(16, 185, 129, 0.5);
  color: #bbf7d0;
}

.detail-profile__tag--warning {
  background: rgba(245, 158, 11, 0.3);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fde68a;
}

.detail-profile__tag--danger {
  background: rgba(239, 68, 68, 0.32);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fecaca;
}

.detail-profile__tag--muted {
  background: rgba(148, 163, 184, 0.3);
  border-color: rgba(148, 163, 184, 0.45);
  color: rgba(226, 232, 240, 0.86);
}

[data-theme="light"] .detail-profile__tag {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(148, 163, 184, 0.4);
  color: #1f2937;
}

[data-theme="light"] .detail-profile__tag--success {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.35);
}

[data-theme="light"] .detail-profile__tag--warning {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.4);
}

[data-theme="light"] .detail-profile__tag--danger {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.4);
}

[data-theme="light"] .detail-profile__tag--muted {
  background: rgba(226, 232, 240, 0.7);
  color: #1f2937;
  border-color: rgba(203, 213, 225, 0.6);
}

.detail-profile__balance {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-profile__balance-label {
  font-size: 0.85rem;
  color: rgba(241, 245, 249, 0.8);
}

[data-theme="light"] .detail-profile__balance-label {
  color: var(--color-muted);
}

.detail-profile__balance-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: #22d3ee;
}

[data-theme="light"] .detail-profile__balance-value {
  color: #0891b2;
}

.detail-stack .table-wrapper {
  margin-top: 0;
}

.text-success {
  color: var(--color-success);
}

.text-danger {
  color: var(--color-danger);
}

.text-muted {
  color: var(--color-muted);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal.is-active {
  display: flex !important;
}

#detail-modal .modal__content {
  width: 720px !important;
  min-height: 400px !important;
}

.modal__content {
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.modal__content--wide {
  max-width: 720px;
}

@media (max-width: 768px) {
  .modal__content {
    padding: 24px;
    max-height: 95vh;
  }
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
}

.modal__title {
  font-size: 1.35rem;
  margin: 0;
  font-weight: 700;
  color: var(--color-text);
}

.modal__subtitle {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.modal__close {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 8px;
  font-size: 1.5rem;
  color: var(--color-muted);
  cursor: pointer;
  padding: 6px 10px;
  line-height: 1;
  transition: all 0.2s ease;
}

.modal__close:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
  transform: rotate(90deg);
  box-shadow: none;
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

/* Loading spinner */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 骨架屏加载样式 */
.skeleton-loader {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.skeleton-table {
  width: 100%;
  display: table;
  border-collapse: collapse;
}

.skeleton-row {
  display: table-row;
  animation: skeletonPulse 1.5s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.skeleton-row.skeleton-header {
  height: 40px;
  border-bottom: 1px solid var(--color-border-strong);
  opacity: 0.3;
}

.skeleton-cell {
  display: table-cell;
  padding: 16px 12px;
  vertical-align: middle;
}

.skeleton-box {
  height: 16px;
  background: linear-gradient(
    90deg,
    rgba(148, 163, 184, 0.1) 0%,
    rgba(148, 163, 184, 0.15) 50%,
    rgba(148, 163, 184, 0.1) 100%
  );
  background-size: 200% 100%;
  border-radius: 4px;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
}

.skeleton-box.skeleton-badge {
  height: 22px;
  width: 60%;
  border-radius: 12px;
}

@keyframes skeletonShimmer {
  0%, 100% { background-position: 0% 0%; }
  50% { background-position: 100% 0%; }
}

@keyframes skeletonPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

[data-theme="light"] .skeleton-box {
  background: linear-gradient(
    90deg,
    rgba(148, 163, 184, 0.08) 0%,
    rgba(148, 163, 184, 0.12) 50%,
    rgba(148, 163, 184, 0.08) 100%
  );
  background-size: 200% 100%;
}

/* 登录页验证码布局优化 */

.login-form .captcha-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: nowrap;
}

.login-form .captcha-row__input {
  flex: 1;
  min-width: 0;
}

.login-form .captcha-figure {
  position: relative;
  display: block;
  width: 160px;
  min-width: 160px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  overflow: hidden;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

.login-form .captcha-figure:hover {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.login-form .captcha-figure:focus-visible {
  outline: 2px solid rgba(99, 102, 241, 0.6);
  outline-offset: 2px;
}

.login-form .captcha-figure__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #ffffff;
  user-select: none;
  pointer-events: none;
}

.login-form .captcha-figure__refresh {
  display: none;
}

.login-form .captcha-figure__refresh svg {
  width: 22px;
  height: 22px;
}

.login-form .captcha-figure__refresh:hover {
  background: rgba(99, 102, 241, 0.9);
  color: #ffffff;
  border-color: rgba(99, 102, 241, 0.5);
  transform: scale(1.05);
}

.login-form .captcha-figure__refresh:focus-visible {
  outline: 2px solid rgba(99, 102, 241, 0.8);
  outline-offset: 2px;
}

.login-form .captcha-hint {
  margin-top: 6px;
  font-size: 12px;
  color: rgba(148, 163, 184, 0.7);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-muted);
}

.empty-state__icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  opacity: 0.4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state__icon svg {
  width: 100%;
  height: 100%;
}

.empty-state__text {
  font-size: 1rem;
  line-height: 1.6;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding: 20px 0;
}

.pagination__btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination__btn:hover:not(:disabled) {
  background: var(--color-surface-hover);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.pagination__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination__pages {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination__page {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination__page:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.pagination__page--active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

.pagination__page--active:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  color: white;
}

.pagination__ellipsis {
  padding: 0 8px;
  color: var(--color-muted);
  font-size: 1.2rem;
  line-height: 1;
}

.pagination__info {
  color: var(--color-muted);
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .pagination {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .pagination__btn span {
    display: none;
  }
  
  .pagination__page {
    min-width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }
}

.stat-card--cards-today .stat-card__icon {
  background: rgba(168, 85, 247, 0.12);
  color: #a855f7;
}

.stat-card--cards-total .stat-card__icon {
  background: rgba(139, 92, 246, 0.12);
  color: #8b5cf6;
}

.stat-card--recharge-today .stat-card__icon {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
}

.stat-card--recharge-total .stat-card__icon {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

/* ===== MODAL 修复核心 - 必须放最后覆盖所有之前样式 ===== */
.modal {
  display: none !important;
  position: fixed !important;
  inset: 0;
  width: 100vw !important;  /* 🔑 明确设置宽度 */
  height: 100vh !important;  /* 🔑 明确设置高度 */
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  padding: 20px;
  overflow-y: auto;
  z-index: 9000;
  pointer-events: auto !important;  /* 确保背景可以接收点击事件 */
  opacity: 1 !important;  /* 确保不透明 */
  visibility: visible !important;  /* 确保可见 */
}

.modal.is-active {
  display: flex !important;
}

/* 🔑 防止 modal 内容区域的点击事件冒泡到背景 */
.modal__inner {
  pointer-events: auto !important;  /* 内层容器接收点击事件 */
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 100vw !important;  /* 🔑 强制最小宽度为视口宽度 */
  min-height: 100vh !important;  /* 🔑 强制最小高度为视口高度 */
}

.modal__content {
  pointer-events: auto !important;  /* 内容区域接收点击事件 */
}

/* 优先级：详情 > 创建 */
/* 🔥 创建卡片模态框：强制固定定位和高层级 */
#card-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9500 !important;
  display: none !important;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.7);
}

#card-modal.is-active {
  display: flex !important;
}

/* 🔥 详情模态框：强制固定定位和最高层级 */
/* 修复原因：防止被父级 stacking context 限制，确保首次打开就正常显示 */
#detail-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 12000 !important;
  display: none !important;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.7);
}

#detail-modal.is-active {
  display: flex !important;
}

/* 滚动防遮挡（详情框） */
#detail-modal .modal__content {
  max-height: 90vh !important;
  overflow-y: auto !important;
}
