/* 支付后台 — 统一视觉 */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --font: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --bg: #0c0f14;
  --bg-elevated: #12161e;
  --surface: #161b24;
  --surface-2: #1c2230;
  --sidebar-bg: linear-gradient(165deg, #111827 0%, #0f172a 45%, #0c1222 100%);
  --border: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.2);
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --muted: #64748b;
  --accent: #38bdf8;
  --accent-dim: rgba(56, 189, 248, 0.14);
  --accent-strong: #0ea5e9;
  --violet: #a78bfa;
  --success: #4ade80;
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.45);
  --glow: 0 0 40px rgba(56, 189, 248, 0.15);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: #7dd3fc;
  text-decoration: none;
}

/* ——— 后台布局 ——— */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 268px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
}

.sidebar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 0% 0%, rgba(56, 189, 248, 0.08), transparent 55%);
  pointer-events: none;
}

.sidebar-brand {
  position: relative;
  padding: 26px 22px 22px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--violet) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: #0f172a;
  letter-spacing: -0.03em;
  box-shadow: var(--glow);
  margin-bottom: 14px;
}

.sidebar-brand h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.sidebar-brand p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.sidebar-nav {
  position: relative;
  padding: 14px 12px;
  flex: 1;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  margin-bottom: 4px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 13.5px;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.sidebar-nav a.active {
  color: var(--text);
  background: var(--accent-dim);
  border-color: rgba(56, 189, 248, 0.25);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.06);
}

.nav-ico {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  opacity: 0.88;
  color: var(--text-secondary);
}

.sidebar-nav a.active .nav-ico {
  opacity: 1;
  color: var(--accent);
}

.sidebar-foot {
  position: relative;
  padding: 16px 18px 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.sidebar-foot strong {
  color: var(--text-secondary);
  font-weight: 600;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: radial-gradient(ellipse 70% 40% at 70% -10%, rgba(56, 189, 248, 0.06), transparent),
    radial-gradient(ellipse 50% 30% at 100% 50%, rgba(167, 139, 250, 0.05), transparent),
    var(--bg);
}

.topbar {
  min-height: 64px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(18, 22, 30, 0.72);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topbar-title .eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.topbar-title .name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-actions .btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.topbar-actions .btn-logout:hover {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.content {
  padding: 28px 28px 40px;
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

h1.page-title {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.subtitle {
  color: var(--text-secondary);
  margin: 0 0 24px;
  font-size: 14px;
}

.subtitle a {
  font-weight: 500;
}

/* 卡片 */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 18px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* 统计 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.stat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--violet));
  opacity: 0.85;
}

.stat .label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat .value {
  font-size: 28px;
  font-weight: 700;
  margin-top: 8px;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #f8fafc, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 表格 */
table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}

table.data th,
table.data td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

table.data th {
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(0, 0, 0, 0.2);
}

table.data tbody tr:last-child td {
  border-bottom: none;
}

table.data tbody tr {
  transition: background 0.12s ease;
}

table.data tbody tr:hover td {
  background: rgba(56, 189, 248, 0.04);
}

table.data code {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--accent);
}

/* 徽章 */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-paid {
  background: rgba(74, 222, 128, 0.15);
  color: var(--success);
  border: 1px solid rgba(74, 222, 128, 0.25);
}

.badge-pending {
  background: rgba(251, 191, 36, 0.12);
  color: var(--warn);
  border: 1px solid rgba(251, 191, 36, 0.25);
}

.badge-failed {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.25);
}

.badge-muted {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-strong) 0%, #0284c7 100%);
  border-color: transparent;
  color: #0f172a;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
}

.btn-primary:hover {
  filter: brightness(1.06);
  color: #0f172a;
}

.btn-danger {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.4);
  color: #fecaca;
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.2);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
  text-align: center;
  padding: 12px 16px;
}

form.inline-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 18px;
}

label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

input[type='text'],
input[type='password'],
input[type='number'],
select,
textarea {
  width: 100%;
  max-width: 400px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 0.75;
}

textarea {
  max-width: 100%;
  min-height: 120px;
  resize: vertical;
}

.form-row {
  margin-bottom: 16px;
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
}

.alert-error {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.alert-ok {
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: #bbf7d0;
}

.pagination {
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}

.pagination a {
  display: inline-block;
  margin-right: 10px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-weight: 600;
}

.pagination a:hover {
  background: var(--accent-dim);
  border-color: rgba(56, 189, 248, 0.3);
}

/* ——— 登录页 ——— */
body.login-page {
  min-height: 100vh;
  margin: 0;
  position: relative;
  overflow-x: hidden;
}

.login-bg {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 0;
}

.login-bg::before {
  content: '';
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 20% 30%, rgba(56, 189, 248, 0.18) 0%, transparent 42%),
    radial-gradient(circle at 85% 20%, rgba(167, 139, 250, 0.16) 0%, transparent 40%),
    radial-gradient(circle at 70% 80%, rgba(14, 165, 233, 0.1) 0%, transparent 45%);
  filter: blur(2px);
}

.login-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2394a3b8' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.9;
  pointer-events: none;
}

.login-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  max-width: 1040px;
  margin: 0 auto;
  padding: 48px 24px;
}

.login-hero {
  flex: 1;
  max-width: 440px;
  padding: 48px 40px 48px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  width: fit-content;
  margin-bottom: 22px;
}

.login-hero h1 {
  margin: 0 0 16px;
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
  color: var(--text);
}

.login-hero .lead {
  margin: 0 0 32px;
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 360px;
  line-height: 1.65;
}

.login-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

.login-features li::before {
  content: '';
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
}

.login-panel {
  flex: 0 1 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 36px 32px 32px;
  border-radius: calc(var(--radius) + 4px);
  background: rgba(22, 27, 36, 0.75);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg), var(--glow);
  backdrop-filter: blur(20px);
}

.login-card-header {
  margin-bottom: 28px;
}

.login-card-header h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login-card-header p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.login-card form label {
  margin-top: 4px;
}

.login-card form input {
  max-width: none;
  margin-bottom: 2px;
}

.login-card .btn-block {
  margin-top: 22px;
}

.login-card .hint {
  margin: 22px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.login-card code {
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--accent);
}

.login-card strong {
  color: var(--text-secondary);
}

@media (max-width: 900px) {
  .login-wrap {
    flex-direction: column;
    padding: 32px 20px 48px;
  }

  .login-hero {
    max-width: none;
    padding: 0 0 32px;
    text-align: center;
    align-items: center;
  }

  .login-hero .lead {
    max-width: none;
  }

  .login-features {
    display: none;
  }

  .login-panel {
    flex: 1;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .layout {
    flex-direction: column;
  }

  .sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-bottom: 8px;
  }

  .sidebar-nav a {
    flex: 1 1 auto;
    min-width: calc(50% - 6px);
    justify-content: center;
    font-size: 12px;
    padding: 10px 8px;
  }

  .nav-ico {
    display: none;
  }

  .content {
    padding: 20px 16px 32px;
  }

  h1.page-title {
    font-size: 22px;
  }
}
