:root {
  --bg-main: #0b0f19;
  --bg-card: rgba(22, 30, 49, 0.75);
  --bg-card-hover: rgba(30, 41, 67, 0.85);
  --bg-secondary: rgba(15, 23, 42, 0.6);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: rgba(37, 99, 235, 0.4);
  --accent-blue: #3b82f6;
  --accent-emerald: #10b981;
  --accent-red: #ef4444;
  --accent-amber: #f59e0b;
  --accent-purple: #8b5cf6;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --glass-blur: blur(12px);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
body { background: var(--bg-main); color: var(--text-main); min-height: 100vh; padding: 24px; }
.app-container { max-width: 1380px; margin: 0 auto; }

/* 头部导航 */
header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding: 16px 24px; background: var(--bg-card); backdrop-filter: var(--glass-blur); border: 1px solid var(--border-color); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.header-brand { display: flex; align-items: center; gap: 14px; }
.logo-badge { width: 44px; height: 44px; background: linear-gradient(135deg, #ef4444, #f59e0b); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 900; box-shadow: 0 0 15px rgba(239, 68, 68, 0.4); }
.brand-title { font-size: 18px; font-weight: 800; letter-spacing: -0.5px; }
.brand-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.user-status { display: flex; align-items: center; gap: 12px; }

/* 导航 Tabs */
.nav-tabs { display: flex; gap: 8px; margin-bottom: 20px; overflow-x: auto; padding-bottom: 6px; }
.tab-btn { background: var(--bg-card); color: var(--text-muted); border: 1px solid var(--border-color); padding: 10px 18px; border-radius: var(--radius-md); font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; white-space: nowrap; }
.tab-btn:hover { background: var(--bg-card-hover); color: var(--text-main); }
.tab-btn.active { background: linear-gradient(135deg, #2563eb, #3b82f6); color: #fff; border-color: #3b82f6; box-shadow: 0 0 12px rgba(37, 99, 235, 0.4); }

/* 网格与卡片 */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 20px; }
.card { background: var(--bg-card); backdrop-filter: var(--glass-blur); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 20px; box-shadow: var(--shadow-lg); transition: border-color 0.2s; }
.card:hover { border-color: var(--border-active); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.card-title { font-size: 15px; font-weight: 700; color: var(--text-main); }
.metric-value { font-size: 28px; font-weight: 900; margin: 8px 0; }
.metric-sub { font-size: 12px; color: var(--text-muted); }

/* 标签 Tags */
.tag-danger { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); padding: 4px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.tag-success { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); padding: 4px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.tag-warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); padding: 4px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.tag-info { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); padding: 4px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }

/* 表格与表单 */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border-color); }
.data-table th { color: var(--text-muted); font-weight: 600; background: var(--bg-secondary); }
.data-table tr:hover td { background: rgba(255, 255, 255, 0.02); }
.btn-primary { background: linear-gradient(135deg, #2563eb, #3b82f6); color: #fff; border: none; padding: 10px 20px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; transition: 0.2s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.form-input { width: 100%; padding: 10px 14px; background: rgba(15, 23, 42, 0.8); border: 1px solid var(--border-color); border-radius: var(--radius-sm); color: var(--text-main); font-size: 13px; outline: none; margin-bottom: 12px; }
.form-input:focus { border-color: var(--accent-blue); box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2); }

/* 模态框与面板 */
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* 登录浮层 */
#login-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.85); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.login-box { width: 420px; background: #161e31; border: 1px solid rgba(255,255,255,0.12); border-radius: var(--radius-lg); padding: 32px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.8); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
