/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.admin-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.admin-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.admin-btn.admin-logged-in {
    background: rgba(46, 204, 113, 0.3);
    border-color: rgba(46, 204, 113, 0.5);
}

.logo {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 主要内容区 */
.main {
    padding: 40px 0;
}

.page-title {
    font-size: 2rem;
    margin-bottom: 30px;
    color: #2c3e50;
    text-align: center;
}

/* 加载动画 */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

/* 文件夹网格布局 */
.folders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.folder-item {
    background: white;
    border-radius: 10px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 2px solid transparent;
}

.folder-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.folder-icon {
    font-size: 3rem;
    color: #f39c12;
    margin-bottom: 15px;
}

.folder-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
}

/* 文件列表 */
.files-list {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #ecf0f1;
    transition: background-color 0.2s ease;
}

.file-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.file-item:last-child {
    border-bottom: none;
}

.file-item:hover {
    background-color: #f8f9fa;
}

.file-icon {
    font-size: 1.8rem;
    margin-right: 20px;
    width: 40px;
    text-align: center;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    word-break: break-all;
}

.file-meta {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: #7f8c8d;
    flex-wrap: wrap;
}

.file-time {
    display: flex;
    align-items: center;
    gap: 5px;
}

.file-size, .file-ext, .file-password {
    display: flex;
    align-items: center;
    gap: 5px;
}

.file-password {
    color: #e74c3c;
    font-weight: 600;
    font-family: monospace;
}

.download-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}


.link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

/* 返回按钮 */
.back-btn {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #ecf0f1;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #7f8c8d;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: background-color 0.2s ease;
}

.close-btn:hover {
    background-color: #f8f9fa;
    color: #2c3e50;
}

.modal-body {
    padding: 20px;
}

#modalFileName {
    margin-bottom: 20px;
    font-weight: 600;
    color: #2c3e50;
}

.password-input-group {
    margin-bottom: 20px;
}

.password-input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.password-input-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ecf0f1;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.password-input-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.error-message {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 10px;
    display: none;
}

.error-message.show {
    display: block;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #ecf0f1;
}

.cancel-btn, .confirm-btn {
    padding: 10px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.cancel-btn {
    background: #95a5a6;
    color: white;
}

.cancel-btn:hover {
    background: #7f8c8d;
}

.confirm-btn {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
}

.confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

/* 隐藏元素 */
.hidden {
    display: none !important;
}

/* Toast提示样式 */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    color: white;
    font-weight: 600;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.success {
    background: #27ae60;
    height: 50px;
}

.toast.error {
    background: #e74c3c;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* 子文件夹提示 */
.subfolder-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 5px;
    padding: 15px 20px;
    margin-bottom: 20px;
    color: #856404;
    display: flex;
    align-items: center;
    gap: 10px;
}

.subfolder-notice i {
    font-size: 1.2rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .logo {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .main {
        padding: 20px 0;
    }
    
    .page-title {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .folders-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .folder-item {
        padding: 20px 15px;
    }
    
    .folder-icon {
        font-size: 2.5rem;
        margin-bottom: 10px;
    }
    
    .folder-name {
        font-size: 1rem;
    }
    
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 15px;
    }
    
    .file-icon {
        margin-right: 0;
        font-size: 1.5rem;
    }
    
    .file-info {
        width: 100%;
    }
    
    .download-btn,
    .link-btn {
        width: 100%;
        padding: 12px;
    }
    
    .link-btn {
        margin-top: 5px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header, .modal-body, .modal-footer {
        padding: 15px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .cancel-btn, .confirm-btn {
        width: 100%;
    }
}

/* Toast提示样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 5px;
    color: white;
    font-weight: 600;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    z-index: 2000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}


.toast.error {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

/* 文件操作按钮样式 */
.file-actions {
    display: flex;
    gap: 10px;
}

.link-btn {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.link-btn:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(149, 165, 166, 0.3);
}

/* 文件图标映射 */
.file-icon.zip, .file-icon.rar, .file-icon.7z {
    color: #e74c3c;
}

.file-icon.png, .file-icon.jpg, .file-icon.jpeg, .file-icon.gif, .file-icon.bmp {
    color: #3498db;
}

.file-icon.pdf {
    color: #e74c3c;
}

.file-icon.doc, .file-icon.docx {
    color: #2980b9;
}

.file-icon.xls, .file-icon.xlsx {
    color: #27ae60;
}

.file-icon.ppt, .file-icon.pptx {
    color: #f39c12;
}

.file-icon.txt {
    color: #7f8c8d;
}

.file-icon.exe {
    color: #9b59b6;
}

.file-icon.mp4, .file-icon.mov, .file-icon.avi {
    color: #e67e22;
}

.file-icon.mp3, .file-icon.wav {
    color: #1abc9c;
}
