:root {
    --primary: #06B6D4;
    --primary-dark: #0891B2;
    --primary-light: #67E8F9;
    --success: #10B981;
    --warning: #F59E0B;
    --accent: #FBBF24;
    --danger: #EF4444;
    --teal: #14B8A6;
    --cyan: #06B6D4;
    --emerald: #10B981;
    --yellow: #FBBF24;
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #F0FDFA 0%, #ECFDF5 50%, #FEF9C3 100%);
    color: var(--gray-900);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* 登录页 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #06B6D4 0%, #10B981 50%, #FBBF24 100%);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(6, 182, 212, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(16, 185, 129, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(251, 191, 36, 0.2) 0%, transparent 50%);
    animation: float 15s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -30px) scale(1.1); }
}

.login-box {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(30px) saturate(180%);
    padding: 48px 40px;
    border-radius: 28px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 70px rgba(6, 182, 212, 0.25), 0 10px 30px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 8px;
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--cyan) 0%, var(--teal) 50%, var(--emerald) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-box .subtitle {
    text-align: center;
    color: var(--gray-600);
    margin-bottom: 40px;
    font-size: 15px;
    font-weight: 500;
}

/* 侧边栏 */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 240px;
    height: 100vh;
    background: linear-gradient(180deg, var(--gray-900) 0%, var(--gray-800) 100%);
    backdrop-filter: blur(40px) saturate(180%);
    color: white;
    padding: 24px 0;
    z-index: 100;
    border-right: 1px solid rgba(6, 182, 212, 0.2);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

.logo {
    padding: 0 24px 24px;
    border-bottom: 1px solid rgba(6, 182, 212, 0.2);
    margin-bottom: 24px;
}

.logo h1 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.8px;
    background: linear-gradient(135deg, var(--cyan) 0%, var(--emerald) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.logo span { font-size: 13px; color: var(--gray-400); font-weight: 500; }

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    margin: 4px 12px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(2px);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.25) 0%, rgba(16, 185, 129, 0.25) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
    border-left: 3px solid var(--cyan);
}

.nav-item svg { width: 22px; height: 22px; margin-right: 14px; opacity: 0.9; }

.nav-item.logout {
    position: absolute;
    bottom: 24px;
    left: 12px;
    right: 12px;
    color: var(--danger);
    margin: 0;
}

.nav-item.logout:hover { background: rgba(255, 59, 48, 0.1); }

/* 主内容 */
.main { margin-left: 240px; padding: 32px; min-height: 100vh; }

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.header h2 {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--cyan) 0%, var(--teal) 50%, var(--emerald) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.9) 100%);
    border-radius: 20px;
    padding: 28px 24px;
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(6, 182, 212, 0.1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--cyan) 0%, var(--teal) 50%, var(--emerald) 100%);
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(6, 182, 212, 0.15);
    border-color: rgba(6, 182, 212, 0.2);
}

.stat-card .label {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .value {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -1px;
}

.stat-card .value.success { color: var(--success); }
.stat-card .value.warning { color: var(--warning); }
.stat-card .value.danger { color: var(--danger); }
.stat-card .value.primary { color: var(--primary); }

/* 卡片 */
.card {
    background: white;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.08);
    margin-bottom: 24px;
    border: 1px solid rgba(6, 182, 212, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 28px rgba(6, 182, 212, 0.12);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.3px; }

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 8px;
    letter-spacing: -0.2px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--cyan) 0%, var(--teal) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--teal) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.45);
}

.btn-success {
    background: linear-gradient(135deg, var(--emerald) 0%, var(--teal) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 59, 48, 0.4);
}

.btn-outline {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    color: var(--gray-900);
}

.btn-outline:hover {
    background: var(--gray-200);
    transform: translateY(-2px);
}

.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 10px; }

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-group { display: flex; gap: 12px; flex-wrap: wrap; }

/* 表格 */
.table-container { overflow-x: auto; border-radius: 16px; }

table { width: 100%; border-collapse: separate; border-spacing: 0; }

th, td { padding: 16px; text-align: left; }

th {
    font-weight: 600;
    color: var(--gray-500);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

th:first-child { border-top-left-radius: 12px; }
th:last-child { border-top-right-radius: 12px; }

td { border-bottom: 1px solid var(--gray-100); font-size: 15px; }

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }

/* 状态标签 */
.status {
    display: inline-flex;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.1px;
}

.status-active { background: rgba(16, 185, 129, 0.15); color: #059669; }
.status-inactive { background: var(--gray-200); color: var(--gray-600); }
.status-error { background: rgba(239, 68, 68, 0.15); color: #DC2626; }
.status-rate_limited { background: rgba(245, 158, 11, 0.15); color: #D97706; }
.status-banned { background: rgba(239, 68, 68, 0.15); color: #DC2626; }

/* 输入框 */
.input-group { margin-bottom: 20px; }

.input-group label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-900);
    letter-spacing: -0.2px;
}

.input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--gray-50);
    font-family: inherit;
}

.input:focus {
    outline: none;
    border-color: var(--cyan);
    background: white;
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.1);
}

textarea.input { min-height: 140px; resize: vertical; font-family: inherit; }

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
    background: white;
    border-radius: 24px;
    padding: 32px;
    width: 90%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 60px rgba(6, 182, 212, 0.2), 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(6, 182, 212, 0.1);
}

.modal-overlay.active .modal { transform: scale(1) translateY(0); }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.8px;
    background: linear-gradient(135deg, var(--cyan) 0%, var(--emerald) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close {
    background: var(--gray-100);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover { background: var(--gray-200); transform: rotate(90deg); }

/* Toast */
.toast-container { position: fixed; top: 24px; right: 24px; z-index: 2000; }

.toast {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    color: white;
    padding: 16px 24px;
    border-radius: 16px;
    margin-bottom: 12px;
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    font-weight: 500;
    font-size: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.95) 0%, rgba(20, 184, 166, 0.95) 100%);
    backdrop-filter: blur(20px);
    border-color: rgba(255, 255, 255, 0.2);
}
.toast.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95) 0%, rgba(220, 38, 38, 0.95) 100%);
    backdrop-filter: blur(20px);
    border-color: rgba(255, 255, 255, 0.2);
}

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

/* 页面切换 */
.page { display: none; animation: fadeIn 0.3s ease; }
.page.active { display: block; }

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

.app-container { display: none; }
.app-container.active { display: block; }

/* 分页 */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

.pagination-info { color: var(--gray-500); font-size: 15px; font-weight: 500; }
.pagination-controls { display: flex; gap: 12px; align-items: center; }

/* 代码块 */
.code-block {
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%);
    color: var(--cyan);
    padding: 20px;
    border-radius: 16px;
    font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
    font-size: 14px;
    overflow-x: auto;
    line-height: 1.6;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar { width: 72px; padding: 20px 0; }
    .sidebar .nav-item span, .sidebar .logo h1, .sidebar .logo span { display: none; }
    .sidebar .nav-item { justify-content: center; padding: 12px; }
    .sidebar .nav-item svg { margin-right: 0; }
    .main { margin-left: 72px; padding: 20px; }
    .header h2 { font-size: 28px; }
    .stats-grid { grid-template-columns: 1fr; }
}

/* 滚动条美化 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-500); }
