/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left h1 {
    margin: 0 0 5px 0;
    font-size: 2em;
}

.header-left p {
    margin: 0;
    opacity: 0.9;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 面包屑导航 */
.breadcrumb {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* 工具栏 */
.toolbar {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.upload-section {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.path-input-group {
    flex: 1;
    display: flex;
    min-width: 200px;
    position: relative;
}

.path-input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 8px 0 0 8px;
    font-size: 14px;
    border-right: none;
}

.btn-set-path {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-size: 14px;
    border: 2px solid #ddd;
    border-left: none;
    min-width: 45px;
}

.btn-upload, .btn-refresh, .btn-sync {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.btn-sync {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.description-input-group {
    flex: 1;
    display: flex;
    min-width: 200px;
}

.description-input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.upload-tips {
    width: 100%;
    margin-top: 10px;
    text-align: center;
    color: #666;
    background: #f8f9fa;
    padding: 8px;
    border-radius: 5px;
    border-left: 4px solid #2a5298;
}

/* 文件列表 */
.file-list {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.file-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

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

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

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.file-name a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

.file-name a:hover {
    color: #2a5298;
}

.file-meta {
    font-size: 0.85em;
    color: #666;
}

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

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.btn-download {
    background: #28a745;
    color: white;
}

.btn-upload-dir {
    background: #ffc107;
    color: #333;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 10px 0;
}

.success {
    background: #d4edda;
    color: #155724;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 10px 0;
}

.info {
    background: #d1ecf1;
    color: #0c5460;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 10px 0;
}

.warning {
    background: #fff3cd;
    color: #856404;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 10px 0;
}

#message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-radius: 12px 12px 0 0;
    color: white;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5em;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

.close-btn:hover {
    opacity: 1;
}

.modal-body {
    padding: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2a5298;
}

.form-group p {
    color: #666;
    font-size: 14px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.btn-cancel, .btn-confirm {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.1s;
}

.btn-cancel {
    background: #6c757d;
    color: white;
}

.btn-confirm {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-cancel:hover, .btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-cancel:active, .btn-confirm:active {
    transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .upload-section {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 20px 15px;
    }

    .file-actions {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    #message-container {
        position: relative;
        top: auto;
        right: auto;
        max-width: none;
        margin-bottom: 20px;
    }
}

