/* 博客后台管理样式 - 优化版 */

:root {
    /* 与blog.css保持一致的配色体系 */
    --primary-color: #667eea;
    --secondary-color: #5a67d8;
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --danger-color: #f56565;
    --light-bg: #f8f9fa;
    --dark-bg: #2d3748;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --border-color: #e2e8f0;
    --chinese-font-family: PingFang SC, Helvetica, Microsoft YaHei, \5fae\8f6f\96c5\9ed1, Arial, sans-serif;
}

body {
    background-color: var(--light-bg);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-primary);
}

/* 导航栏样式 - 优化 */
.navbar-dark.bg-dark {
    background: linear-gradient(135deg, #1a365d 0%, #2d3748 100%);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
    border-bottom: 3px solid var(--primary-color);
}

.navbar-brand {
    font-weight: 500;
    font-size: 1.1rem;
    color: #ffffff;
    font-family: var(--chinese-font-family);
}

.navbar-brand i {
    color: #cbd5e0;
}

/* 导航链接激活状态 */
.navbar-dark .nav-link {
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
    font-family: var(--chinese-font-family);
    font-weight: 500;
}

.navbar-dark .nav-link:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    transform: translateY(-1px);
}

.navbar-dark .nav-link.active {
    color: #ffffff;
    background: var(--primary-color);
    border-radius: 6px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 卡片样式 */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 15px;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: white;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-family: var(--chinese-font-family);
}

/* 统计卡片 */
.card.text-white {
    border: none;
    border-radius: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card.text-white:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.card.bg-primary { background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%); }
.card.bg-success { background: linear-gradient(135deg, var(--success-color) 0%, #38a169 100%); }
.card.bg-warning { background: linear-gradient(135deg, var(--warning-color) 0%, #dd6b20 100%); }
.card.bg-info { background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%); }

/* 统计卡片内容统一高度 */
.card.text-white .card-body {
    display: flex;
    align-items: center;
    height: 100%;
}

.card.text-white .card-body .d-flex {
    width: 100%;
    align-items: center;
}

.card.text-white .card-body h4 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.card.text-white .card-body p {
    font-size: 0.9rem;
    margin-bottom: 0;
    opacity: 0.9;
}

.card.text-white .card-body .fa-2x {
    font-size: 2.5rem;
    opacity: 0.8;
}

/* 可点击卡片样式 */
.clickable-card {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.clickable-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.clickable-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.2);
}

.clickable-card:hover::after {
    left: 100%;
}

/* 链接悬停效果 */
.text-decoration-none:hover {
    text-decoration: none !important;
}

/* 表格样式 */
.table {
    margin-bottom: 0;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: var(--secondary-color);
    background-color: #f8f9fa;
}

.table-hover tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.05);
}

/* 按钮样式 */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: var(--chinese-font-family);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #4c51bf 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

/* 徽章样式 */
.badge {
    font-size: 0.75em;
    font-weight: 500;
}

/* 侧边栏快速操作 */
.card-body .btn {
    margin-bottom: 0.5rem;
}

/* 统计信息样式 */
.card-body .d-flex {
    font-size: 0.9rem;
}

.card-body strong {
    color: var(--primary-color);
}

/* 空状态样式 */
.text-center.py-4 {
    color: #6c757d;
}

.text-center.py-4 .fa-3x {
    opacity: 0.5;
}

/* 系统信息样式 */
.text-muted small {
    font-size: 0.85rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container-fluid {
        padding: 0 15px;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .btn-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-group .btn {
        width: 100%;
    }
    
    .table-responsive {
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
}

/* 自定义滚动条 */
.table-responsive::-webkit-scrollbar {
    height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeIn 0.5s ease-out;
}

/* 加载状态 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '加载中...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--primary-color);
    font-weight: 600;
}