/* 通用样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: url('/static/images/uploads/default-bg.jpg') no-repeat center center fixed;
    background-size: cover;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 导航栏样式 */
.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

/* 内容区域样式 */
.content-wrapper {
    flex: 1;
    background-color: none;
    border-radius: 12px;
    margin: 20px 0;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 卡片网格布局 - 使用Flexbox实现流动排列 */
.sites-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
    justify-content: flex-start; /* 确保从左对齐 */
}

/* 卡片样式  */
.card {
    flex: 1 0 calc(25% - 20px); /* 4列布局，考虑gap */
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background-color: #fff;
    opacity: 0.85;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    min-width: 250px; /* 设置最小宽度防止过度收缩 */
    max-width: calc(25% - 20px); /* 确保最大宽度不超过4列 */
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.75rem;
}

.card-text {
    color: #6c757d;
    font-size: 0.9rem;
    flex-grow: 1;
}

.card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    gap: 10px;
}

/* 公告板样式 */
.announcement {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: none;
}

.announcement-content {
    font-size: 1.1rem;
    color: #495057;
    margin: 0;
}

/* 按钮样式 */
.btn-download {
    border-radius: 8px;
    background-color: #4CAF50;
    color: white;
    padding: 6px 12px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    border: none;
}

.btn-download:hover {
    background-color: #3d8b40;
    color: white;
    transform: translateY(-2px);
}

.btn-download i {
    margin-right: 5px;
}

.btn-primary {
    background: linear-gradient(45deg, #0d6efd, #0b5ed7);
    border: none;
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 6px 12px;
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    font-size: 0.875rem;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #0b5ed7, #0a58ca);
    transform: translateY(-2px);
}

/* 分类导航 */
.category-nav {
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-nav .nav-link {
    border-radius: 20px;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    color: #495057;
    transition: all 0.3s;
    border: 1px solid #dee2e6;
    padding: 8px 20px;
    background-color: white;
    opacity: 0.9;
}

.category-nav .nav-link.active, 
.category-nav .nav-link:hover {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
    opacity: 0.85;
}

/* 分页样式 */
.pagination {
    margin-top: 2rem;
}

.page-link {
    border-radius: 8px;
    margin: 0 3px;
    border: 1px solid #dee2e6;
    color: #0d6efd;
}

.page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* 页脚样式优化 */
footer {
    background-color: #f8f9fa;
    margin-top: 3rem;
    padding: 1.5rem 0;
    padding-left: 5px;
    padding-right: 5px;
    border-top: 1px solid #e9ecef;
}

.footer-links {
    margin-bottom: 1rem;
}

.footer-links a {
    color: #6c757d;
    text-decoration: none;
    margin-right: 1rem;
    padding: 0.5rem 0;
    transition: color 0.2s ease;
    position: relative;
}

.footer-links a:not(:last-child)::after {
    content: "•";
    margin-left: 1rem;
    color: #dee2e6;
}

.footer-links a:hover {
    color: #0d6efd;
    text-decoration: none;
}

/* 备案信息样式 */
.beian-info {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.beian-info a {
    color: #6c757d;
    text-decoration: none;
    font-size: 1.25em;
}

.beian-info a:hover {
    color: #0d6efd;
    text-decoration: none;
    font-size: 1.25em;
}

/* 社交链接样式 */
.social-links {
    display: flex;
    float: left;
    gap: 15px;
    justify-content: center;
    margin-top: 10px;
}

.social-link {
    color: #6c757d;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 1.2rem;
}

.social-link:hover {
    color: #0d6efd;
    transform: translateY(-2px);
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 3px solid #f3f3f3;
    border-radius: 50%;
    border-top: 3px solid #0d6efd;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading-section {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* 登录页背景样式 */
.login-bg {
    background: url('/static/images/uploads/default-login.jpg') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #dee2e6;
}

/* 表单控件样式 */
.form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* 徽章样式 */
.badge {
    font-size: 0.75em;
    padding: 0.35em 0.65em;
}

/* 链接样式 */
a {
    color: #0d6efd;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #0a58ca;
    text-decoration: none;
    font-size: 1rem;
}

/* 文本选择样式 */
::selection {
    background-color: rgba(13, 110, 253, 0.2);
    color: inherit;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

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

/* 焦点样式 */
:focus {
    outline: 2px solid rgba(13, 110, 253, 0.5);
    outline-offset: 2px;
}

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

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* 工具类 */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.box-shadow {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.rounded-lg {
    border-radius: 12px;
}

.rounded-xl {
    border-radius: 16px;
}

/* 加载状态 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
   100% {
        background-position: -200% 0;
    }
}

/* 图片响应式 */
img {
    max-width: 100%;
    height: auto;
}

/* 打印样式 */
@media print {
    .navbar,
    .pagination,
    .btn {
        display: none !important;
    }
    
    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* 响应式调整 - 确保流动布局在不同屏幕尺寸下表现良好 */
@media (max-width: 1200px) {
    .card {
        flex: 1 0 calc(33.333% - 20px); /* 3列布局 */
        max-width: calc(33.333% - 20px);
    }
}

@media (max-width: 992px) {
    .card {
        flex: 1 0 calc(50% - 20px); /* 2列布局 */
        max-width: calc(50% - 20px);
    }
}

@media (max-width: 768px) {
    .sites-grid {
        gap: 15px;
    }
    
    .card {
        flex: 1 0 100%; /* 单列布局 */
        max-width: 100%;
        margin-bottom: 1rem;
        padding: 1rem;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .category-nav .nav-link {
        font-size: 0.9rem;
        padding: 0.375rem 0.75rem;
    }
    
    .content-wrapper {
        margin: 10px 0;
        padding: 15px;
    }
    
    .social-links {
        gap: 10px;
    }
    
    .social-link {
        font-size: 1rem;
    }
    
    .card-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-primary, .btn-download {
        width: 100%;
        justify-content: center;
        margin-bottom: 8px;
    }
    
    .announcement {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .announcement-content {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .card {
        padding: 0.75rem;
    }
    
    .sites-grid {
        gap: 10px;
    }
}