/* ============================================
   游戏管理后台样式
   浅蓝科技风 · 大圆角卡片 · 毛玻璃质感 · 紧凑布局
   版本: 1.0.0
   ============================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #4A90D9;
  --primary-dark: #357ABD;
  --primary-light: #6BA5E7;
  --primary-bg: rgba(74, 144, 217, 0.08);
  --accent: #5B9BD5;
  --success: #52c41a;
  --warning: #faad14;
  --danger: #ff4d4f;
  --info: #1890ff;
  
  --bg-body: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --bg-nav: rgba(255, 255, 255, 0.85);
  
  --text-primary: #1a2236;
  --text-secondary: #5a6278;
  --text-muted: #9098b0;
  --text-light: #b0b8cc;
  
  --border-color: rgba(74, 144, 217, 0.12);
  --border-light: #e8ecf4;
  
  --shadow-sm: 0 1px 3px rgba(74, 144, 217, 0.06);
  --shadow-md: 0 4px 16px rgba(74, 144, 217, 0.08);
  --shadow-lg: 0 8px 32px rgba(74, 144, 217, 0.1);
  --shadow-card: 0 2px 12px rgba(74, 144, 217, 0.06), 0 0 1px rgba(74, 144, 217, 0.12);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --glass-blur: blur(12px) saturate(180%);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: #ffffff;
  background-attachment: fixed;
  min-height: 100vh;
}

/* ---- Top Navigation Bar ---- */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-nav);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 56px;
  gap: 4px;
}

@media (min-width: 1600px) {
  .nav-inner { padding: 0 48px; }
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 24px;
  flex-shrink: 0;
}

.brand-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-item:hover {
  color: var(--primary);
  background: var(--primary-bg);
}

.nav-item.active {
  color: var(--primary);
  background: var(--primary-bg);
  font-weight: 600;
}

/* ---- Nav Dropdown ---- */
.nav-dropdown-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-dropdown-toggle {
  cursor: pointer;
}

.nav-dropdown-toggle .dropdown-arrow {
  transition: transform 0.2s ease;
  margin-left: 2px;
}

.nav-dropdown-wrap:hover .dropdown-arrow {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 160px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 6px 0;
  z-index: 1001;
  animation: dropdownIn 0.15s ease;
}

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.nav-dropdown-wrap:hover .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-item {
  display: block;
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-dropdown-item:hover {
  color: var(--primary);
  background: var(--primary-bg);
}

.nav-dropdown-item.active {
  color: var(--primary);
  background: var(--primary-bg);
  font-weight: 600;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.role-tag {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--primary-bg);
  color: var(--primary);
  border-radius: 10px;
  font-weight: 500;
}

.nav-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--transition);
}

.nav-logout:hover {
  color: var(--danger);
  background: rgba(255, 77, 79, 0.08);
}

/* ---- Flash Message ---- */
.flash-message {
  width: 100%;
  margin: 16px 24px 0;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.flash-success { background: #f6ffed; border: 1px solid #b7eb8f; color: #389e0d; }
.flash-error { background: #fff2f0; border: 1px solid #ffccc7; color: #cf1322; }
.flash-warning { background: #fffbe6; border: 1px solid #ffe58f; color: #d48806; }

.flash-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  padding: 0 4px;
  line-height: 1;
}
.flash-close:hover { opacity: 1; }

/* ---- Main Content Area ---- */
.main-content {
  max-width: 100%;
  margin: 0 auto;
  padding: 24px;
  min-height: calc(100vh - 56px - 48px);
}

@media (min-width: 1600px) {
  .main-content { padding: 32px 48px; }
}

/* ---- Page Header ---- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.page-header-actions {
  display: flex;
  gap: 10px;
}

/* ---- Card Component ---- */
.card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  padding: 24px;
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* ---- Stat Cards (Dashboard) ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 20px 24px;
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  opacity: 0.06;
  transition: all var(--transition);
}

.stat-card:nth-child(1)::before { background: var(--primary); }
.stat-card:nth-child(2)::before { background: var(--success); }
.stat-card:nth-child(3)::before { background: var(--warning); }
.stat-card:nth-child(4)::before { background: var(--danger); }
.stat-card:nth-child(5)::before { background: #722ed1; }
.stat-card:nth-child(6)::before { background: var(--info); }
.stat-card:nth-child(7)::before { background: #13c2c2; }
.stat-card:nth-child(8)::before { background: #eb2f96; }
.stat-card:nth-child(9)::before { background: #2f54eb; }
.stat-card:nth-child(10)::before { background: #fa8c16; }
.stat-card:nth-child(11)::before { background: #a0d911; }
.stat-card:nth-child(12)::before { background: #f5222d; }

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card:hover::before { transform: scale(1.3); opacity: 0.1; }

.stat-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.stat-card:nth-child(1) .stat-card-icon { background: rgba(74, 144, 217, 0.12); color: var(--primary); }
.stat-card:nth-child(2) .stat-card-icon { background: rgba(82, 196, 26, 0.12); color: var(--success); }
.stat-card:nth-child(3) .stat-card-icon { background: rgba(250, 173, 20, 0.12); color: var(--warning); }
.stat-card:nth-child(4) .stat-card-icon { background: rgba(255, 77, 79, 0.12); color: var(--danger); }
.stat-card:nth-child(5) .stat-card-icon { background: rgba(114, 46, 209, 0.12); color: #722ed1; }
.stat-card:nth-child(6) .stat-card-icon { background: rgba(24, 144, 255, 0.12); color: var(--info); }
.stat-card:nth-child(7) .stat-card-icon { background: rgba(19, 194, 194, 0.12); color: #13c2c2; }
.stat-card:nth-child(8) .stat-card-icon { background: rgba(235, 47, 150, 0.12); color: #eb2f96; }
.stat-card:nth-child(9) .stat-card-icon { background: rgba(47, 84, 235, 0.12); color: #2f54eb; }
.stat-card:nth-child(10) .stat-card-icon { background: rgba(250, 140, 22, 0.12); color: #fa8c16; }
.stat-card:nth-child(11) .stat-card-icon { background: rgba(160, 217, 17, 0.12); color: #a0d911; }
.stat-card:nth-child(12) .stat-card-icon { background: rgba(245, 34, 45, 0.12); color: #f5222d; }

.stat-card-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-card-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.stat-card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---- Two Column Layout ---- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

/* ---- Table ---- */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead th {
  background: linear-gradient(180deg, #f8fafd 0%, #f0f4fa 100%);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 2px solid var(--border-light);
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}

tbody tr { transition: background var(--transition); }
tbody tr:hover { background: rgba(74, 144, 217, 0.03); }
tbody tr:last-child td { border-bottom: none; }

/* ---- Search / Filter Bar ---- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 16px 20px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  flex-wrap: wrap;
}

.filter-bar label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

/* ---- Form Controls ---- */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
  padding: 9px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-primary);
  background: #fff;
  transition: all var(--transition);
  outline: none;
  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

input::placeholder { color: var(--text-light); }

select {
  padding-right: 32px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239098b0' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1.4;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 2px 8px rgba(74, 144, 217, 0.25);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); box-shadow: 0 4px 14px rgba(74, 144, 217, 0.35); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-success {
  background: linear-gradient(135deg, #52c41a, #73d13d);
  color: #fff;
  box-shadow: 0 2px 8px rgba(82, 196, 26, 0.25);
}
.btn-success:hover { box-shadow: 0 4px 14px rgba(82, 196, 26, 0.35); transform: translateY(-1px); }

.btn-danger {
  background: linear-gradient(135deg, #ff4d4f, #ff7875);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 77, 79, 0.25);
}
.btn-danger:hover { box-shadow: 0 4px 14px rgba(255, 77, 79, 0.35); transform: translateY(-1px); }

.btn-warning {
  background: linear-gradient(135deg, #faad14, #ffc53d);
  color: #fff;
  box-shadow: 0 2px 8px rgba(250, 173, 20, 0.25);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--border-color);
}
.btn-outline:hover { background: var(--primary-bg); border-color: var(--primary); }

.btn-warning {
  background: #f59e0b !important;
  color: #fff !important;
  border: 1px solid #f59e0b !important;
}
.btn-warning:hover { background: #d97706 !important; border-color: #d97706 !important; }

.btn-success {
  background: #10b981;
  color: #fff;
  border: 1px solid #10b981;
}
.btn-success:hover { background: #059669; border-color: #059669; }

.btn-muted {
  background: #6b7280;
  color: #fff;
  border: 1px solid #6b7280;
}
.btn-muted:hover { background: #4b5563; border-color: #4b5563; }

.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.btn-xs { padding: 3px 10px; font-size: 11px; border-radius: 5px; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---- Badges ---- */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
}

.badge-success { background: #f6ffed; color: #389e0d; border: 1px solid #b7eb8f; }
.badge-warning { background: #fffbe6; color: #d48806; border: 1px solid #ffe58f; }
.badge-danger { background: #fff2f0; color: #cf1322; border: 1px solid #ffccc7; }
.badge-info { background: #e6f7ff; color: #096dd9; border: 1px solid #91d5ff; }
.badge-default { background: #fafafa; color: #8c8c8c; border: 1px solid #d9d9d9; }
.badge-secondary { background: #f5f5f5; color: #999; border: 1px solid #d9d9d9; }

/* ---- User Avatar ---- */
.user-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
}
.user-avatar-default {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4A90D9, #5B9BD5);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  vertical-align: middle;
}

/* ---- Pagination ---- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.pagination-info {
  font-size: 13px;
  color: var(--text-muted);
}

.pagination-btns {
  display: flex;
  gap: 4px;
}

.btn-page {
  padding: 6px 13px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  min-width: 36px;
  text-align: center;
}

.btn-page:hover { border-color: var(--primary); color: var(--primary); }
.btn-page.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---- Login Page ---- */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #ffffff;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(74, 144, 217, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(91, 155, 213, 0.10) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(24, 144, 255, 0.06) 0%, transparent 60%),
    radial-gradient(circle at 10% 40%, rgba(66, 133, 244, 0.08) 0%, transparent 40%);
  animation: bgFloat 20s ease-in-out infinite;
  z-index: 0;
}

@keyframes bgFloat {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(20px, -20px); }
  66% { transform: translate(-15px, 15px); }
}

.login-container {
  position: relative;
  z-index: 1;
  width: 420px;
}

.login-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(74, 144, 217, 0.18);
  padding: 44px 40px;
  box-shadow: 0 4px 24px rgba(74, 144, 217, 0.10), 0 20px 60px rgba(74, 144, 217, 0.08);
}

.login-logo {
  text-align: center;
  margin-bottom: 36px;
}

.login-logo-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(74, 144, 217, 0.30);
  color: #fff;
}

.login-logo h2 {
  font-size: 22px;
  font-weight: 700;
  color: #1a3a5c;
  letter-spacing: -0.3px;
}

.login-logo p {
  font-size: 13px;
  color: #6b8aaa;
  margin-top: 6px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #3d5a78;
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  background: #f7fafd;
  border: 1px solid #d4e2f0;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: #1a3a5c;
  transition: all var(--transition);
}

.form-group input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

.form-group input::placeholder { color: #b0c4d8; }

.btn-login {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #4A90D9, #3b7ec5);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(74, 144, 217, 0.35);
  margin-top: 8px;
  font-family: inherit;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(74, 144, 217, 0.45);
  background: linear-gradient(135deg, #5b9de0, #4a8ed5);
}

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

.login-error {
  background: #fff0f0;
  border: 1px solid #ffccc7;
  color: #cf1322;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 20px;
  text-align: center;
}

.login-footer {
  text-align: center;
  margin-top: 32px;
  font-size: 12px;
  color: #b0c4d8;
}

/* ---- Modal ---- */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 20, 40, 0.5);
  backdrop-filter: blur(4px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal {
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  min-width: 480px;
  max-width: 90vw;
  max-height: 85vh;
  overflow: hidden;
  animation: modalIn 0.25s ease;
}

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

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 { font-size: 16px; font-weight: 600; }

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.modal-close:hover { color: var(--text-primary); }

.modal-body { padding: 24px; max-height: 60vh; overflow-y: auto; }

/* 弹窗内表单样式（亮色背景覆盖登录页深色样式）—— 使用 !important 确保覆盖 */
.modal-body .form-group label {
  color: var(--text-secondary) !important;
}
.modal-body .form-group input,
.modal-body .form-group select,
.modal-body .form-group textarea {
  background: #fff !important;
  border: 1px solid #d0d5e0 !important;
  color: #1a2236 !important;
}
.modal-body .form-group input::placeholder {
  color: #9098b0 !important;
}
.modal-body .form-group input:focus,
.modal-body .form-group select:focus,
.modal-body .form-group textarea:focus {
  border-color: #4A90D9 !important;
  background: #fff !important;
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15) !important;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ---- 全屏弹窗 ---- */
.modal-fullscreen {
  max-width: 96vw !important;
  width: 96vw !important;
  min-width: auto !important;
  max-height: 100vh !important;
  height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  border-radius: var(--radius-lg) !important;
}
.modal-fullscreen .modal-body {
  flex: 1 !important;
  min-height: 0;
  max-height: none !important;
  overflow-y: auto !important;
}
.modal-fullscreen .modal-header {
  flex-shrink: 0;
}
.modal-fullscreen .modal-footer {
  flex-shrink: 0;
}

/* ---- Loading Spinner ---- */
.loading-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.6);
  z-index: 3000;
  align-items: center;
  justify-content: center;
}

.loading-overlay.active { display: flex; }

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

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

.empty-state svg { margin-bottom: 16px; opacity: 0.3; }
.empty-state p { font-size: 14px; }
.empty-state.error { color: var(--danger); }

/* ---- Clickable ---- */
.clickable { cursor: pointer; }

/* ---- Table Amount ---- */
.td-amount { font-weight: 600; }

/* ---- Footer ---- */
.main-footer {
  text-align: center;
  padding: 16px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.5);
}

/* ---- Toast Notification（居中） ---- */
.toast-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 4000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  animation: toastIn 0.25s ease;
  max-width: 400px;
  text-align: center;
  pointer-events: auto;
}

.toast-success { background: #f6ffed; color: #389e0d; border: 1px solid #b7eb8f; }
.toast-error { background: #fff2f0; color: #cf1322; border: 1px solid #ffccc7; }
.toast-warning { background: #fffbe6; color: #d48806; border: 1px solid #ffe58f; }
.toast-info { background: #e6f7ff; color: #096dd9; border: 1px solid #91d5ff; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast-out {
  animation: toastOut 0.25s ease forwards;
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(-10px) scale(0.95); }
}

/* 弹窗输入框 */
.prompt-input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1) !important;
}

/* ---- Responsive ---- */

/* 汉堡菜单按钮（默认隐藏） */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  gap: 5px;
  padding: 4px;
  margin-right: 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  flex-shrink: 0;
}
.nav-toggle:hover { background: var(--primary-bg); }
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all 0.3s ease;
}
.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ≥1400px 超大屏：优化padding */
@media (min-width: 1400px) {
  .main-content { padding: 32px 48px; }
  .nav-inner { padding: 0 48px; }
  .flash-message { margin: 16px 48px 0; }
}

/* 1200-1399px 大屏 */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 992px) {
  .profile-grid { grid-template-columns: 1fr; }
}

/* 992-1199px 中屏 */
@media (max-width: 992px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .modal { min-width: auto; width: 90vw; }
}

/* 768-991px 平板 */
@media (max-width: 768px) {
  /* 导航折叠为汉堡菜单 */
  .nav-toggle { display: flex; }
  .nav-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--bg-nav);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 16px;
    box-shadow: var(--shadow-md);
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    z-index: 999;
  }
  .nav-menu.open { display: flex; }
  .nav-item {
    padding: 10px 14px;
    width: 100%;
  }

  /* 移动端下拉菜单 */
  .nav-dropdown-wrap {
    width: 100%;
  }

  .nav-dropdown-wrap .nav-dropdown-toggle {
    width: 100%;
    justify-content: space-between;
  }

  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 0 0 4px 20px;
    background: transparent;
    animation: none;
  }

  .nav-dropdown-wrap:hover .nav-dropdown-menu {
    display: none;
  }

  .nav-dropdown-wrap.open .nav-dropdown-menu {
    display: block;
  }

  .nav-dropdown-item {
    padding: 8px 14px;
  }

  /* 统计卡片2列 */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* 表格→卡片视图 */
  .table-container { border: none; background: transparent; }
  table, thead, tbody, th, td, tr { display: block; }
  thead { display: none; }
  tbody tr {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
  }
  tbody td {
    padding: 6px 8px;
    text-align: right;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
  }
  tbody td:last-child { border-bottom: none; }
  tbody td::before {
    content: attr(data-label);
    float: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
  }
  tbody tr:hover { background: var(--bg-card-hover); }

  /* 模态框 */
  .modal {
    min-width: auto;
    width: 95vw;
    margin: 0 10px;
  }

  /* 登录页 */
  .login-container { width: 90vw; }
  .login-card { padding: 32px 28px; }

  /* 两列布局堆叠 */
  .two-col { grid-template-columns: 1fr; }
}

/* 576-767px 小屏 */
@media (max-width: 576px) {
  /* 统计卡片1列 */
  .stats-grid { 
    grid-template-columns: 1fr; 
    gap: 12px;
  }

  /* 页面内边距压缩 */
  .main-content { padding: 12px 16px; }
  .page-header h1 { font-size: 18px; }
  .card-header { padding: 14px 16px; }
  .card-body { padding: 16px; }
  .card-header h3 { font-size: 14px; }

  /* 筛选栏纵向 */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px;
  }
  .filter-bar label { margin-bottom: -4px; }

  /* 分页堆叠 */
  .pagination {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px;
  }

  /* 表单控件全宽 */
  input, select, textarea {
    width: 100%;
  }

  /* 按钮组 */
  .page-header-actions { flex-wrap: wrap; }
  .btn { padding: 8px 14px; font-size: 13px; }

  /* stat卡片压缩 */
  .stat-card {
    padding: 16px 18px;
  }
  .stat-card-value { font-size: 22px; }

  /* 模态框全宽 */
  .modal { width: 100vw; max-width: 100vw; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .modal-overlay.active { align-items: flex-end; }
  .modal-header { padding: 16px 18px; }
  .modal-body { padding: 16px 18px; }
  .modal-footer { padding: 12px 18px; flex-wrap: wrap; }
}

/* <400px 手机极端小屏 */
@media (max-width: 400px) {
  .main-content { padding: 8px 10px; }
  .nav-inner { gap: 2px; padding: 0 10px; }
  .brand-text { font-size: 15px; }
  .nav-user { font-size: 12px; }
  .role-tag { display: none; }
  .stat-card { padding: 12px 14px; }
  .stat-card-value { font-size: 20px; }
  .stat-card-icon { width: 32px; height: 32px; }
}

/* ---- Print Styles ---- */
@media print {
  .top-nav, .main-footer, .filter-bar, .btn, .pagination, .nav-toggle { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ccc; }
  body { background: #fff; }
}



/* ---- 代理资料页 卡片信息网格 ---- */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  max-width: 1200px;
}

.profile-grid .card {
  padding: 20px 24px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 0;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border-light);
  color: var(--text-primary);
}

.info-grid {
  display: flex;
  flex-direction: column;
  margin-top: 4px;
}

.info-row {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  flex: 0 0 100px;
  color: var(--text-muted);
  font-size: 13.5px;
  white-space: nowrap;
}

.info-value {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.info-value .badge {
  margin-left: 0;
}

.info-value.amount {
  color: var(--success);
}

.info-value.amount.primary {
  color: var(--primary);
}

.info-value.code {
  font-family: 'Courier New', monospace;
  letter-spacing: 0.5px;
}

.info-value.profit {
  color: var(--success);
}

.info-value.loss {
  color: var(--danger);
}

.card-full {
  grid-column: 1 / 3;
}

.pwd-form {
  max-width: 400px;
}

.pwd-form .form-group label {
  color: var(--text-secondary);
}

.pwd-form input[type="password"] {
  width: 100%;
}
