/* 百度网盘插件前端样式 - 专注于数据展示和浏览 */

/* 基础容器样式 */
.baidu-netdisk-container {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.baidu-netdisk-container .container-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.baidu-netdisk-container .container-title:before {
    content: "☁️";
    margin-right: 8px;
}

.baidu-netdisk-container .container-description {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
    font-size: 14px;
}

/* 加载状态 */
.loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #666;
}

.loading-container .loading-spinner {
    margin-right: 10px;
}

/* 文件列表样式 */
.baidu-netdisk-file-list {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.baidu-netdisk-file-list .list-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.baidu-netdisk-file-list .list-title:before {
    content: "📁";
    margin-right: 8px;
}

/* 文件网格视图 */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.file-item {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.file-item:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    transform: translateY(-4px);
    border-color: #007cba;
}

.file-item.is-folder {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
}

.file-item.is-folder:hover {
    background: linear-gradient(135deg, #e8f2ff 0%, #dbeafe 100%);
}

.file-icon-wrapper {
    text-align: center;
    margin-bottom: 16px;
    position: relative;
}

.file-icon-wrapper svg {
    width: 48px;
    height: 48px;
    transition: transform 0.3s ease;
}

.file-item:hover .file-icon-wrapper svg {
    transform: scale(1.1);
}

.file-name {
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 8px;
    word-break: break-word;
    line-height: 1.4;
    font-size: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.file-meta {
    margin-bottom: 16px;
}

.file-type-badge {
    display: inline-block;
    background: #e2e8f0;
    color: #4a5568;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.file-type-badge.folder {
    background: #bee3f8;
    color: #2b6cb0;
}

.file-type-badge.image {
    background: #c6f6d5;
    color: #276749;
}

.file-type-badge.document {
    background: #fed7d7;
    color: #c53030;
}

.file-type-badge.video {
    background: #e9d8fd;
    color: #6b46c1;
}

.file-type-badge.audio {
    background: #fbb6ce;
    color: #b83280;
}

.file-size, .file-date {
    font-size: 12px;
    color: #718096;
    display: block;
    margin-bottom: 2px;
}

.file-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: auto;
}

.file-action-btn {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.file-action-btn.download {
    background: #28a745;
    color: #fff;
}

.file-action-btn.download:hover {
    background: #218838;
    transform: translateY(-1px);
}

.file-action-btn.copy {
    background: #17a2b8;
    color: #fff;
}

.file-action-btn.copy:hover {
    background: #138496;
    transform: translateY(-1px);
}

/* 下载按钮样式 */
.baidu-netdisk-download {
    display: inline-block;
    background: linear-gradient(135deg, #007cba, #00a0d2);
    color: #fff;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
    margin: 5px;
}

.baidu-netdisk-download:hover {
    background: linear-gradient(135deg, #005a87, #007cba);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,124,186,0.3);
    color: #fff;
    text-decoration: none;
}

.baidu-netdisk-download:active {
    transform: translateY(0);
}

.baidu-netdisk-download.loading {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.baidu-netdisk-download .download-icon {
    margin-right: 6px;
}

/* 图片画廊样式 */
.baidu-netdisk-gallery {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.baidu-netdisk-gallery .gallery-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.baidu-netdisk-gallery .gallery-title:before {
    content: "🖼️";
    margin-right: 8px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.gallery-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    transition: all 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item .overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.gallery-item:hover .overlay {
    opacity: 1;
}

.gallery-item .overlay .download-btn {
    background: #fff;
    color: #333;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.gallery-item .overlay .download-btn:hover {
    background: #007cba;
    color: #fff;
}

/* 通知样式 */
.baidu-netdisk-notice {
    padding: 12px 16px;
    margin: 15px 0;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
}

.baidu-netdisk-notice.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.baidu-netdisk-notice.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.baidu-netdisk-notice.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.baidu-netdisk-notice.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 6px;
}

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

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: rgba(0,0,0,0.9);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px 12px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    line-height: 1.4;
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0,0,0,0.9) transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .file-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .gallery-item img {
        height: 120px;
    }
    
    .upload-dropzone {
        padding: 30px 15px;
    }
    
    .upload-dropzone .upload-icon {
        font-size: 36px;
    }
    
    .file-card {
        padding: 15px;
    }
    
    .file-card .file-actions {
        flex-direction: column;
    }
    
    .file-action-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .baidu-netdisk-upload,
    .baidu-netdisk-file-list,
    .baidu-netdisk-gallery {
        margin: 15px 0;
        padding: 15px;
    }
    
    .upload-dropzone {
        padding: 20px 10px;
    }
    
    .upload-dropzone .upload-text {
        font-size: 14px;
    }
    
    .upload-dropzone .upload-hint {
        font-size: 12px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-item img {
        height: 100px;
    }
}

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
    .baidu-netdisk-upload,
    .baidu-netdisk-file-list,
    .baidu-netdisk-gallery {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .upload-dropzone {
        background: #1a202c;
        border-color: #4299e1;
    }
    
    .upload-dropzone:hover,
    .upload-dropzone.dragover {
        background: #2d3748;
        border-color: #63b3ed;
    }
    
    .file-card {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .file-card:hover {
        border-color: #4299e1;
    }
    
    .gallery-item {
        background: #2d3748;
    }
    
    .upload-dropzone .upload-text,
    .file-card .file-name,
    .list-title,
    .gallery-title {
        color: #e2e8f0;
    }
    
    .upload-dropzone .upload-hint,
    .file-card .file-meta {
        color: #a0aec0;
    }
}

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

.baidu-netdisk-upload,
.baidu-netdisk-file-list,
.baidu-netdisk-gallery {
    animation: fadeIn 0.5s ease-out;
}

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

.file-card:nth-child(1) { animation-delay: 0.1s; }
.file-card:nth-child(2) { animation-delay: 0.2s; }
.file-card:nth-child(3) { animation-delay: 0.3s; }
.file-card:nth-child(4) { animation-delay: 0.4s; }
.file-card:nth-child(5) { animation-delay: 0.5s; }
.file-card:nth-child(6) { animation-delay: 0.6s; }

/* 无障碍支持 */
.baidu-netdisk-download:focus,
.upload-button:focus,
.file-action-btn:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.upload-dropzone:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* 打印样式 */
@media print {
    .baidu-netdisk-upload,
    .file-card .file-actions,
    .gallery-item .overlay {
        display: none;
    }
    
    .baidu-netdisk-file-list,
    .baidu-netdisk-gallery {
        box-shadow: none;
        border: 1px solid #000;
    }
}