/* AI 路由服务 - 后台管理样式 */

/* 登录页 */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}
.login-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 48px;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow);
}
.login-card h1 {
    text-align: center;
    font-size: 28px;
    margin-bottom: 8px;
}
.login-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 14px;
}
.login-error {
    color: var(--error);
    text-align: center;
    margin-top: 16px;
    min-height: 20px;
    font-size: 14px;
}

/* 管理面板布局 */
.panel-page {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 240px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
}
.sidebar-header {
    padding: 20px;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border);
}
.sidebar-nav {
    flex: 1;
    padding: 16px 0;
}
.nav-item {
    display: block;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}
.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}
.nav-item.active {
    background: rgba(99,102,241,0.1);
    color: var(--accent-light);
    border-left-color: var(--accent);
}
.sidebar-footer {
    border-top: 1px solid var(--border);
    padding: 8px 0;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 32px;
}
.page-content { display: none; }
.page-content.active { display: block; }
.page-title { font-size: 24px; margin-bottom: 20px; }
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.page-header .page-title { margin-bottom: 0; }

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card .stat-icon { font-size: 28px; margin-bottom: 8px; }
.stat-card .stat-num { font-size: 28px; font-weight: 800; color: var(--accent-light); }
.stat-card .stat-name { color: var(--text-secondary); font-size: 14px; margin-top: 4px; }

/* 趋势图 */
.trend-chart {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 200px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}
.trend-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    height: 100%;
    justify-content: flex-end;
}
.trend-bar {
    width: 100%;
    max-width: 60px;
    background: linear-gradient(180deg, var(--accent-light), var(--accent));
    border-radius: 6px 6px 0 0;
    min-height: 4px;
    transition: height 0.5s;
}
.trend-label {
    font-size: 11px;
    color: var(--text-muted);
}
.trend-value {
    font-size: 11px;
    color: var(--text-secondary);
}

/* 卡片容器 */
.card-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}
.card-box h3 { margin-bottom: 16px; }

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.filter-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
}
.filter-select {
    padding: 10px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
}
.btn-sm {
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-sm:hover { background: var(--accent); color: #fff; }

/* 数据表格 */
.table-wrapper { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.data-table th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    font-weight: 600;
}
.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}
.data-table tr:hover td { background: rgba(99,102,241,0.05); }
.data-table .text-mono { font-family: 'SF Mono', Monaco, monospace; font-size: 13px; }
.data-table .text-mute { color: var(--text-muted); }

/* 分页 */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 20px;
}
.pagination button {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.pagination button:hover { background: var(--accent); color: #fff; }
.pagination button.active { background: var(--accent); color: #fff; }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* 弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}
.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-content h3 { margin-bottom: 24px; }
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* 状态标签 */
.tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}
.tag-active { background: rgba(74,222,128,0.15); color: var(--success); }
.tag-disabled { background: rgba(251,191,36,0.15); color: var(--warning); }
.tag-expired { background: rgba(248,113,113,0.15); color: var(--error); }
.tag-exhausted { background: rgba(248,113,113,0.15); color: var(--error); }

/* 操作按钮 */
.action-btn {
    padding: 4px 10px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    margin-right: 4px;
    transition: all 0.2s;
}
.action-btn:hover { border-color: var(--accent); color: var(--accent-light); }
.action-btn.danger:hover { border-color: var(--error); color: var(--error); }

/* 响应式 */
@media (max-width: 768px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }
    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: 0;
    }
    .nav-item {
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    .nav-item.active {
        border-left: none;
        border-bottom-color: var(--accent);
    }
    .sidebar-footer { display: none; }
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
}
