/* ── CodeAgent Hub 自定义样式 ────────────────────────── */

/* 配色变量 */
:root {
    --bg-page: #f5f7fa;
    --text-primary: #1a1a2e;
    --text-secondary: #6c757d;
    --border-color: #e5e7eb;
    --color-success: #10b981;
    --color-danger: #ef4444;
    --color-warning: #f59e0b;
    --card-radius: 12px;
    --transition-speed: 0.2s;
}

/* 全局 */
body {
    background-color: var(--bg-page);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Navbar 固定顶部，正文留出空间 */
.main-content {
    padding-top: 80px;
    padding-bottom: 60px;
    max-width: 1200px;
}

/* Footer */
.footer {
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    background: #fff;
    font-size: 0.875rem;
}

/* ── 卡片通用 ──────────────────────────────────────── */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    transition: box-shadow var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.card-body {
    padding: 24px;
}

/* ── 套餐卡片 ──────────────────────────────────────── */
.product-card {
    text-align: center;
    height: 100%;
}

.product-card .product-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.product-card .product-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.product-card .product-specs {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
    line-height: 1.8;
}

.product-card .product-price {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.product-card .product-price-period {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.product-card .product-price-yearly {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.product-card .divider {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 16px 0;
}

/* ── 状态标签 ──────────────────────────────────────── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-running {
    background: #d1fae5;
    color: #065f46;
}

.status-stopped {
    background: #f3f4f6;
    color: #4b5563;
}

.status-creating {
    background: #dbeafe;
    color: #1e40af;
}

.status-error {
    background: #fee2e2;
    color: #991b1b;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-paid {
    background: #dbeafe;
    color: #1e40af;
}

.status-delivered {
    background: #d1fae5;
    color: #065f46;
}

.status-cancelled {
    background: #f3f4f6;
    color: #6b7280;
}

/* 状态圆点 */
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.dot-running { background: var(--color-success); }
.dot-stopped { background: #9ca3af; }
.dot-creating { background: #3b82f6; animation: pulse 1.5s infinite; }
.dot-error { background: var(--color-danger); }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ── 按钮过渡 ──────────────────────────────────────── */
.btn {
    transition: all var(--transition-speed) ease;
}

/* ── 表格 ──────────────────────────────────────────── */
.table-hover tbody tr:hover {
    background-color: #f0f4ff;
}

/* ── Toast 容器 ────────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1080;
}

/* ── 空状态 ────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state .empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h5 {
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* ── 管理后台侧边栏 ────────────────────────────────── */
.admin-sidebar {
    min-height: calc(100vh - 80px);
    background: #1a1a2e;
    padding-top: 20px;
}

.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 10px 20px;
    border-radius: 0;
    transition: all var(--transition-speed) ease;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.admin-sidebar .nav-link i {
    margin-right: 8px;
}

/* ── 仪表盘统计卡片 ────────────────────────────────── */
.stat-card {
    border-radius: var(--card-radius);
    padding: 20px;
    height: 100%;
}

.stat-card .stat-icon {
    font-size: 2rem;
    opacity: 0.8;
}

.stat-card .stat-number {
    font-size: 1.75rem;
    font-weight: 800;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ── 响应式微调 ────────────────────────────────────── */
@media (max-width: 768px) {
    .main-content {
        padding-top: 70px;
        padding-bottom: 40px;
    }
}
