/* ==========================================
   文件列表样式模块 - File List Styles
   包含：文件列表区域、预览项、进度条、统计栏等
   ========================================== */

/* 文件列表区域样式 */
.file-list-section {
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.preview-title {
    font-size: 1.8rem;
    color: #ffffff;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* 排序下拉菜单 */
.sort-dropdown {
    position: relative;
}

/* 自定义下拉菜单容器 */
.custom-select {
    position: relative;
    min-width: 200px;
    user-select: none;
}

/* 下拉菜单触发器 */
.custom-select-trigger {
    background: linear-gradient(135deg, #ff9000 0%, #ff6b00 100%);
    color: white;
    border: none;
    padding: 14px 45px 14px 20px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(255, 144, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.custom-select-trigger::before {
    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.6s ease;
}

.custom-select-trigger:hover::before {
    left: 100%;
}

.custom-select-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 144, 0, 0.4);
    background: linear-gradient(135deg, #ff9d1a 0%, #ff7a00 100%);
}

.custom-select-trigger:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(255, 144, 0, 0.3);
}

/* 选中的选项显示 */
.selected-option {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.selected-option i {
    font-size: 1.1rem;
    opacity: 0.95;
}

/* 下拉箭头 */
.select-arrow {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
    opacity: 0.9;
}

.custom-select.open .select-arrow {
    transform: rotate(180deg);
}

/* 下拉选项容器 */
.custom-select-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(30, 30, 30, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 18px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 144, 0, 0.2);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    border: 1px solid rgba(255, 144, 0, 0.15);
}

.custom-select.open .custom-select-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* 单个选项 */
.custom-option {
    padding: 14px 20px;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.custom-option::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #ff9000, #ff6b00);
    transform: scaleY(0);
    transition: transform 0.25s ease;
}

.custom-option i {
    font-size: 1.1rem;
    opacity: 0.85;
    transition: all 0.25s ease;
}

.custom-option:hover {
    background: rgba(255, 144, 0, 0.12);
    color: #ffffff;
    padding-left: 24px;
}

.custom-option:hover::before {
    transform: scaleY(1);
}

.custom-option:hover i {
    opacity: 1;
    transform: scale(1.15);
}

.custom-option.active {
    background: linear-gradient(90deg, rgba(255, 144, 0, 0.25), rgba(255, 144, 0, 0.08));
    color: #ff9000;
    font-weight: 600;
}

.custom-option.active::before {
    transform: scaleY(1);
}

.custom-option.active i {
    opacity: 1;
    color: #ff9000;
}

.custom-option:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* 点击时的涟漪效果 */
.custom-option::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 144, 0, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.custom-option:active::after {
    width: 300px;
    height: 300px;
}

/* 自定义滚动条样式(用于选项较多时) */
.custom-select-options::-webkit-scrollbar {
    width: 6px;
}

.custom-select-options::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.custom-select-options::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ff9000, #ff6b00);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.custom-select-options::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ff9d1a, #ff7a00);
}

/* Firefox滚动条样式 */
.custom-select-options {
    scrollbar-width: thin;
    scrollbar-color: #ff9000 rgba(0, 0, 0, 0.2);
}

/* 下拉菜单打开时的动画序列 */
.custom-select.open .custom-option {
    animation: slideInOption 0.3s ease forwards;
}

.custom-select.open .custom-option:nth-child(1) {
    animation-delay: 0.05s;
}

.custom-select.open .custom-option:nth-child(2) {
    animation-delay: 0.1s;
}

.custom-select.open .custom-option:nth-child(3) {
    animation-delay: 0.15s;
}

@keyframes slideInOption {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.batch-upload-btn, .clear-all-btn {
    background: linear-gradient(135deg, #ff9000 0%, #000000 100%);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(255, 144, 0, 0.25);
    position: relative;
    overflow: hidden;
}

.clear-all-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.25);
}

.batch-upload-btn:hover, .clear-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 144, 0, 0.35);
}

.clear-all-btn:hover {
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.35);
}

.batch-upload-btn:disabled {
    background: linear-gradient(135deg, #444 0%, #666 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.clear-all-btn:disabled,
.clear-all-btn.disabled-uploading {
    background: linear-gradient(135deg, #666 0%, #888 100%) !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.clear-all-btn.disabled-uploading {
    color: transparent !important;
}

.clear-all-btn.disabled-uploading i {
    opacity: 0;
    visibility: hidden;
}

.clear-all-btn.disabled-uploading::after {
    font-family: "Font Awesome 7 Pro";
    content: "\f251  上传中...";
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.9rem;
    color: #ccc;
    white-space: nowrap;
}

/* 统计栏 */
.stats-bar {
    background: rgba(30, 30, 30, 0.8);
    padding: 15px 25px;
    margin-bottom: 20px;
    border-radius: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stats-number {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ff9000;
}

.stats-label {
    font-size: 0.8rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 预览网格 */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
    margin-top: 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 0;
    transform: translateZ(0);
    perspective: 1000px;
}

.empty-state {
    text-align: center;
    color: #888;
    padding: 60px 20px;
    font-size: 1.2rem;
    background: rgba(30, 30, 30, 0.5);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    grid-column: 1 / -1;
}

/* 预览项 */
.preview-item {
    background: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    /* autoAnimate 会处理进入和移除动画，这里只保留基础样式 */
}

.preview-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #ff9000, #000000);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.preview-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 144, 0, 0.2), transparent);
    z-index: 1;
    pointer-events: none;
    transition: left 0.6s ease;
}

.preview-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 144, 0, 0.3);
}

.preview-item:hover::before {
    opacity: 1;
}

.preview-item:hover::after {
    left: 100%;
}

/* 拖拽排序模式样式 */
.preview-item.sortable-mode {
    cursor: move;
    cursor: grab;
}

.preview-item.sortable-mode:active {
    cursor: grabbing;
}

.preview-item.sortable-mode::before {
    font-family: "Font Awesome 7 Pro";
    content: "\f0c9";
    font-weight: 900;
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    color: rgba(255, 144, 0, 0.8);
    z-index: 10;
    background: rgba(0, 0, 0, 0.6);
    padding: 5px 10px;
    border-radius: 5px;
    backdrop-filter: blur(5px);
}

.sortable-ghost {
    opacity: 0.4;
    background: rgba(255, 144, 0, 0.2);
    border: 2px dashed rgba(255, 144, 0, 0.8);
}

.sortable-drag {
    opacity: 0.8;
    transform: rotate(3deg);
    box-shadow: 0 10px 30px rgba(255, 144, 0, 0.5);
}

.sortable-chosen {
    border-color: rgba(255, 144, 0, 0.8);
    box-shadow: 0 8px 25px rgba(255, 144, 0, 0.4);
}

.preview-item.upload-success {
    animation: successPulse 0.6s ease-out;
}

.preview-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.preview-image.preview-clickable {
    cursor: pointer;
    position: relative;
}

.preview-image.preview-clickable:hover {
    filter: brightness(1.1);
}

.preview-image.preview-clickable::before {
    font-family: "Font Awesome 7 Pro";
    content: "\f06e  点击预览";
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
    white-space: nowrap;
}

.preview-image.preview-clickable:hover::before {
    opacity: 1;
}

/* 视频预览包装器 */
.video-preview-wrapper {
    width: 100%;
    height: 180px;
    position: relative;
    overflow: hidden;
}

.video-preview-wrapper video {
    width: 100%;
    height: 100%;
}

/* 占位符样式 - 用于懒加载优化 */
.preview-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, rgba(40, 40, 40, 0.9), rgba(30, 30, 30, 0.9));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    position: relative;
    overflow: hidden;
}

.preview-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 144, 0, 0.15), transparent);
    animation: placeholderShimmer 2s infinite;
}

.placeholder-icon {
    font-size: 3rem;
    opacity: 0.6;
    animation: placeholderPulse 1.5s ease-in-out infinite;
}

.placeholder-loading {
    font-size: 0.9rem;
    color: #888;
    font-weight: 500;
}

@keyframes placeholderShimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

@keyframes placeholderPulse {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 0.8;
    }
}

.preview-item:hover .preview-image {
    transform: scale(1.05);
}

.preview-info {
    padding: 20px;
}

.preview-filename {
    font-size: 0.95rem;
    color: #ffffff;
    margin-bottom: 15px;
    word-break: break-all;
    font-weight: 500;
    line-height: 1.4;
}

.link-container {
    background: rgba(40, 40, 40, 0.8);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
    backdrop-filter: blur(10px);
}

.generated-link {
    font-size: 0.85rem;
    color: #cccccc;
    word-break: break-all;
    line-height: 1.5;
    font-family: 'Courier New', monospace;
    user-select: all;
    cursor: text;
}

.generated-link:hover {
    background: rgba(255, 144, 0, 0.1);
    border-radius: 6px;
}

/* 按钮 */
.copy-btn, .upload-btn-small, .remove-btn {
    border: none;
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.copy-btn {
    background: linear-gradient(135deg, #ff9000 0%, #000000 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 144, 0, 0.3);
}

.upload-btn-small {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    margin-right: 10px;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.remove-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.copy-btn:hover, .upload-btn-small:hover, .remove-btn:hover {
    transform: translateY(-2px);
}

.copy-btn:hover {
    box-shadow: 0 8px 25px rgba(255, 144, 0, 0.4);
}

.upload-btn-small:hover {
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

.remove-btn:hover {
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

.upload-btn-small:disabled {
    background: linear-gradient(135deg, #555 0%, #777 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
    pointer-events: none;
}

.remove-btn:disabled,
.remove-btn.disabled-uploading {
    background: linear-gradient(135deg, #666 0%, #888 100%) !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.remove-btn.disabled-uploading {
    color: transparent !important;
}

.remove-btn.disabled-uploading i {
    opacity: 0;
    visibility: hidden;
}

.remove-btn.disabled-uploading::after {
    font-family: "Font Awesome 7 Pro";
    content: "\f251";
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    color: #ccc;
}

.copy-btn.copied {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 上传状态 */
.upload-status {
    font-size: 0.85rem;
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 20px;
    text-align: center;
    font-weight: 500;
    backdrop-filter: blur(10px);
    background: rgba(158, 158, 158, 0.2);
    color: #bdbdbd;
    border: 1px solid rgba(158, 158, 158, 0.3);
    position: relative;
    overflow: hidden;
}

.upload-status.uploading {
    background: linear-gradient(
        90deg,
        rgba(33, 150, 243, 0.2),
        rgba(33, 150, 243, 0.4),
        rgba(33, 150, 243, 0.2)
    );
    background-size: 200% 100%;
    color: #64b5f6;
    border: 1px solid rgba(33, 150, 243, 0.3);
    animation: shimmer 2s infinite;
}

.upload-status.success {
    background: rgba(76, 175, 80, 0.2);
    color: #81c784;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.upload-status.error {
    background: rgba(244, 67, 54, 0.2);
    color: #e57373;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

/* 进度条 */
.progress-container {
    margin-bottom: 15px;
    background: rgba(40, 40, 40, 0.6);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(50, 50, 50, 0.9);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff9000, #000000);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 144, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transform: translateX(-100%);
    animation: progressShine 2s infinite;
}

.progress-text {
    font-size: 0.75rem;
    color: #cccccc;
    text-align: center;
    font-weight: 600;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

