/* Dashboard 页面自定义样式 - 紧凑高级设计 */
.stat-card {
    border: 1px solid rgba(0,0,0,0.05) !important;
    transition: all 0.2s ease-in-out;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
    transform: translateY(-1px);
}

/* 紧凑版图标样式 */
.stat-icon-wrapper {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.stat-icon-files {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-icon-storage {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.stat-icon-feedback {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.stat-icon-task {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

.stat-icon-invitation {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

/* 确保一屏显示的全局样式 */
.container-fluid.main-content {
    max-height: 100vh;
    overflow-y: auto;
    padding-top: 1rem;
}

/* 减少边距以节省空间 */
.row.mb-4 {
    margin-bottom: 1rem !important;
}

.row.mb-3 {
    margin-bottom: 0.75rem !important;
}

/* 确保一屏显示优化 */
@media (min-height: 768px) {
    .container-fluid {
        height: 100vh;
        display: flex;
        flex-direction: column;
    }
    
    .card:last-child {
        flex: 1;
        min-height: 0;
    }
    
    .card:last-child .card-body {
        height: 100%;
        overflow-y: auto;
    }
}

/* 文件列表紧凑显示 */
.table td {
    padding: 0.5rem !important;
    vertical-align: middle;
}

.table th {
    padding: 0.75rem 0.5rem !important;
}

/* 移动端优化 */
@media (max-width: 991px) {
    .stat-card .card-body {
        padding: 0.75rem !important;
    }
    
    .stat-icon-wrapper {
        width: 28px !important;
        height: 28px !important;
        font-size: 14px !important;
    }
}

/* 用户信息卡片样式 */
.user-profile-card {
    background: #f8f9fa;
}

/* 用户徽章 */
.user-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

/* 进度条优化 */
.progress {
    background-color: #f8f9fa;
    border-radius: 1rem;
    overflow: hidden;
}

.progress-bar {
    border-radius: 1rem;
}

/* 徽章优化 */
.badge {
    font-weight: 500;
    letter-spacing: 0.025em;
    border: 1px solid rgba(0,0,0,0.1);
}

/* 按钮优化 */
.btn {
    font-weight: 500;
    letter-spacing: 0.025em;
}

/* 超小按钮样式 */
.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1.2;
    border-radius: 0.375rem;
}

.btn-dark {
    background-color: #212529;
    border-color: #212529;
}

.btn-dark:hover {
    background-color: #1a1e21;
    border-color: #1a1e21;
    box-shadow: 0 4px 12px rgba(33, 37, 41, 0.3);
}

.btn-outline-dark:hover {
    background-color: #212529;
    border-color: #212529;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 37, 41, 0.2);
}

/* 表格列宽度控制 */
.table th:nth-child(1), .table td:nth-child(1) {
    width: 250px;
    max-width: 250px;
    overflow: hidden;
}

.table th:nth-child(2), .table td:nth-child(2) {
    width: 200px;
    max-width: 200px;
    overflow: hidden;
}

.table th:nth-child(3), .table td:nth-child(3) {
    width: 100px;
    max-width: 100px;
}

.table th:nth-child(4), .table td:nth-child(4) {
    width: 150px;
    max-width: 150px;
}

.table th:nth-child(5), .table td:nth-child(5) {
    width: auto;
    min-width: 400px;
}

/* 图标容器优化 */
.bg-light {
    border: 1px solid rgba(0,0,0,0.05);
}

/* 文字层次优化 */
h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.025em;
}

.text-muted {
    color: #6c757d !important;
}

/* 移动端兼容优化 */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    .card-body {
        padding: 1rem !important;
    }
    
    .btn-lg {
        padding: 0.75rem 2rem !important;
        font-size: 1rem !important;
    }
    
    /* 表格在移动端隐藏，显示卡片视图 */
    .table-responsive {
        display: none !important;
    }
    
    .mobile-card-view {
        display: block !important;
    }
    
    /* 移动端模态框优化 */
    .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    /* 移动端文件上传区域优化 */
    .upload-area {
        padding: 2rem 1rem !important;
        min-height: 200px !important;
    }
    
    /* 移动端统计卡片优化 */
    .row.g-4 {
        gap: 1rem !important;
    }
    
    .col-md-3 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    /* 移动端用户信息优化 */
    .d-flex.align-items-center.gap-3 {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        align-items: center !important;
    }
    
    .d-flex.align-items-center.gap-3 > div {
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    .d-flex.align-items-center.gap-3 .badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    .d-flex.align-items-center.gap-3 .fw-bold {
        font-size: 0.8rem;
    }
    
    .d-flex.align-items-center.gap-3 small {
        font-size: 0.7rem;
    }
    
    .d-flex.align-items-center.gap-3 .bi {
        font-size: 0.8rem;
    }
    
    /* 移动端按钮优化 */
    .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
    
    .btn-sm {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* 移动端文件卡片优化 */
    .card .btn-group {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 0.2rem !important;
    }
    
    .card .btn-group .btn {
        flex: 1 !important;
        min-width: 0 !important;
        margin: 0 !important;
        font-size: 0.7rem !important;
        padding: 0.2rem 0.4rem !important;
    }
    
    .card .text-muted {
        font-size: 0.75rem !important;
    }
    
    .card .badge {
        font-size: 0.7rem !important;
        padding: 0.2rem 0.4rem !important;
    }
    
    .card a {
        word-break: break-all !important;
        font-size: 0.75rem !important;
        line-height: 1.2 !important;
    }
    
    .card-body {
        padding: 0.5rem !important;
    }
    
    /* 防止iOS缩放 */
    input, select, textarea {
        font-size: 16px;
    }
}

@media (max-width: 576px) {
    .btn-group-sm .btn {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    .badge {
        font-size: 0.7rem;
    }
    
    .card-header h5 {
        font-size: 0.9rem;
    }
    
    /* 超小屏幕优化 */
    .container-fluid {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    .container {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }
    
    .card-body {
        padding: 0.75rem !important;
    }
    
    /* 移动端用户信息更紧凑显示 */
    .d-flex.align-items-center.gap-3 {
        gap: 0.25rem !important;
    }
    
    .d-flex.align-items-center.gap-3 .badge {
        font-size: 0.6rem;
        padding: 0.15rem 0.3rem;
    }
    
    .d-flex.align-items-center.gap-3 .fw-bold {
        font-size: 0.7rem;
    }
    
    .d-flex.align-items-center.gap-3 small {
        font-size: 0.6rem;
    }
    
    .d-flex.align-items-center.gap-3 .bi {
        font-size: 0.7rem;
    }
}

/* 平板端优化 */
@media (min-width: 577px) and (max-width: 991px) {
    .col-md-3 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
    
    .table-responsive {
        display: none !important;
    }
    
    .mobile-card-view {
        display: block !important;
    }
}

/* 大屏幕优化 */
@media (min-width: 992px) {
    .mobile-card-view {
        display: none !important;
    }
    
    .table-responsive {
        display: block !important;
    }
}

/* 紧凑设计优化 */
.compact-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
}

.stat-card {
    border: 1px solid rgba(0,0,0,0.05);
}

.stat-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
}

/* 激励元素样式 */
.upgrade-hint {
    background: #667eea;
    color: white;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
}

.upgrade-hint:hover {
    background: #5a6fd8;
    color: white;
    text-decoration: none;
}

.points-boost {
    background: #f093fb;
    color: white;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: 500;
}

.activity-boost {
    background: #4facfe;
    color: white;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: 500;
}

/* 滚动条样式 */
.table-responsive::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

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

/* 排行榜弹窗样式 */
.leaderboard-modal-list {
    max-height: 500px;
    overflow-y: auto;
    padding: 16px 0;
    background: #fafbfc;
}

.leaderboard-modal-item {
    display: flex;
    align-items: center;
    padding: 16px;
    margin: 0 12px 8px 12px;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    background: #ffffff;
    position: relative;
    overflow: hidden;
}

.leaderboard-modal-item:hover {
    background: #f8f9ff;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

/* 前三名特殊样式 */
.leaderboard-modal-item.rank-1 {
    background: #fff9e6;
    border-color: #ffd700;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.1);
}

.leaderboard-modal-item.rank-2 {
    background: #f8fafc;
    border-color: #c0c0c0;
    box-shadow: 0 4px 15px rgba(192, 192, 192, 0.1);
}

.leaderboard-modal-item.rank-3 {
    background: #fef7f0;
    border-color: #cd7f32;
    box-shadow: 0 4px 15px rgba(205, 127, 50, 0.1);
}

.rank-badge {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    border-radius: 50%;
    font-weight: bold;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.rank-medal {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    position: relative;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.rank-medal.gold {
    background: #ffd700;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.rank-medal.silver {
    background: #c0c0c0;
    box-shadow: 0 4px 15px rgba(192, 192, 192, 0.4);
}

.rank-medal.bronze {
    background: #cd7f32;
    box-shadow: 0 4px 15px rgba(205, 127, 50, 0.4);
}

.rank-number {
    font-weight: 700;
    color: #495057;
    font-size: 1.1rem;
    background: #f8f9fa;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 3px solid #dee2e6;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.author-info {
    flex: 1;
    min-width: 0;
    margin-right: 16px;
}

.author-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1f2937;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.leaderboard-modal-item:hover .author-name {
    color: #667eea;
}

.author-username {
    font-size: 0.8rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.tool-count {
    text-align: right;
    min-width: 70px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.count-badge {
    background: #667eea;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 4px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.count-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
}

/* 滚动条样式 */
.leaderboard-modal-list::-webkit-scrollbar {
    width: 6px;
}

.leaderboard-modal-list::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 3px;
}

.leaderboard-modal-list::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.leaderboard-modal-list::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}

/* 排行榜弹窗标题优化 */
#leaderboardModalLabel {
    color: #ffffff !important;
    font-weight: 600 !important;
    letter-spacing: -0.025em;
    font-size: 1.375rem !important;
    line-height: 1.3;
    text-shadow: none;
}

.modal-header .trophy-icon {
    color: #ffc107 !important;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
    text-shadow: none;
}

/* 排行榜弹窗整体优化 */
#leaderboardModal .modal-content {
    overflow: hidden;
}

#leaderboardModal .modal-header {
    padding: 1.25rem 1.5rem;
    background: #667eea;
}

#leaderboardModal .modal-footer {
    border-radius: 0 0 1rem 1rem;
}

/* 统计卡片样式 */
.stats-card:hover {
    transform: translateY(-2px);
}

.stat-item {
    padding: 0.5rem 0;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.stats-icon {
    opacity: 0.8;
}

/* 响应式优化 */
@media (max-width: 991px) {
    .modal-dialog {
        max-width: 90%;
        margin: 1rem auto;
    }
}

@media (max-width: 768px) {
    .leaderboard-modal-item {
        padding: 1rem;
        margin: 0.5rem;
    }
    
    .rank-badge {
        width: 40px;
        height: 40px;
        margin-right: 12px;
    }
    
    .rank-number {
        font-size: 1rem;
    }
    
    .author-name {
        font-size: 0.9rem;
        max-width: 100px;
    }
    
    .author-username {
        font-size: 0.75rem;
        max-width: 100px;
    }
    
    .count-badge {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
}

/* ================== 分页和懒加载样式 ================== */

/* 分页控制样式 */
.pagination-controls {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.pagination-controls .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 加载指示器样式 */
#loadingIndicator {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 文件列表容器最小高度，防止分页时页面跳动 */
#fileTableBody {
    min-height: 400px;
}

#fileCardContainer {
    min-height: 400px;
}

/* 文件卡片样式 */
.file-card {
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.file-card:hover {
    border-color: rgba(13, 110, 253, 0.2);
}

/* ================== 自定义删除确认弹窗样式 ================== */

/* 删除确认弹窗基础样式 */
#deleteConfirmModal .modal-content {
    border-radius: 1rem;
    overflow: hidden;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-width: 95vw;
    max-height: 90vh;
}

#deleteConfirmModal .modal-dialog {
    max-width: 500px;
    width: auto;
    margin: 1rem auto;
}

#deleteConfirmModal .modal-header {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border: none;
    padding: 1.5rem;
}

#deleteConfirmModal .modal-title {
    font-weight: 600;
    font-size: 1.125rem;
    letter-spacing: -0.025em;
}

#deleteConfirmModal .modal-body {
    padding: 2rem 1.5rem;
}

#deleteConfirmModal .modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 1.5rem 1.5rem;
    background: #fafbfc;
}

/* 删除图标容器样式 */
#deleteConfirmModal .bg-danger.bg-opacity-10 {
    background-color: rgba(220, 53, 69, 0.1) !important;
    border: 2px solid rgba(220, 53, 69, 0.15);
}

/* 警告信息样式 */
#deleteConfirmModal .alert-warning {
    background-color: rgba(255, 193, 7, 0.1) !important;
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 0.75rem;
}

#deleteConfirmModal .alert-danger {
    background-color: rgba(220, 53, 69, 0.1) !important;
    border: 1px solid rgba(220, 53, 69, 0.2);
    border-radius: 0.75rem;
}

/* 按钮样式优化 */
#deleteConfirmModal .btn-light {
    background-color: #ffffff;
    border-color: #dee2e6;
    color: #6c757d;
    font-weight: 500;
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

#deleteConfirmModal .btn-light:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
    color: #495057;
    transform: translateY(-1px);
}

#deleteConfirmModal .btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

#deleteConfirmModal .btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.4);
}

#deleteConfirmModal .btn-danger:disabled {
    background: #dc3545;
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 文件信息显示样式 */
#deleteConfirmModal .alert-warning strong {
    color: #d58512 !important;
    font-weight: 600;
}

#deleteConfirmModal .alert-danger strong {
    color: #b02a37 !important;
    font-weight: 600;
}

/* 文件名显示区域优化 */
#deleteConfirmModal .file-info-container {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

#deleteConfirmModal .file-name-display {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.375rem;
    padding: 0.5rem;
    max-height: 80px;
    overflow-y: auto;
    word-break: break-all;
    line-height: 1.4;
    font-family: 'Courier New', 'Monaco', monospace;
    font-size: 0.85rem;
    color: #495057;
    white-space: pre-wrap;
}

#deleteConfirmModal .project-name-display {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.375rem;
    padding: 0.5rem;
    max-height: 60px;
    overflow-y: auto;
    word-break: break-all;
    line-height: 1.4;
    color: #495057;
}

/* 滚动条样式 */
#deleteConfirmModal .file-name-display::-webkit-scrollbar,
#deleteConfirmModal .project-name-display::-webkit-scrollbar {
    width: 4px;
}

#deleteConfirmModal .file-name-display::-webkit-scrollbar-track,
#deleteConfirmModal .project-name-display::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 2px;
}

#deleteConfirmModal .file-name-display::-webkit-scrollbar-thumb,
#deleteConfirmModal .project-name-display::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

#deleteConfirmModal .file-name-display::-webkit-scrollbar-thumb:hover,
#deleteConfirmModal .project-name-display::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 响应式优化 */
@media (max-width: 576px) {
    #deleteConfirmModal .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    #deleteConfirmModal .modal-body {
        padding: 1.5rem 1rem;
    }
    
    #deleteConfirmModal .modal-footer {
        padding: 1rem;
    }
    
    #deleteConfirmModal .modal-title {
        font-size: 1rem;
    }
    
    #deleteConfirmModal .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}
