
* {
    box-sizing: border-box;
}
body {
    font-family: Arial, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background: #f8f9fa;
}
h1 {
    color: #333;
    border-bottom: 2px solid #2196F3;
    padding-bottom: 10px;
}
.upload-container {
    display: flex;
    flex-wrap: wrap;
    background: #f5f5f5;
    border: 1px dashed #ccc;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    gap: 20px;
}
.upload-block {
    flex: 1;
    min-width: 200px;
    border: 1px solid #5050ff;
    border-radius: 8px;
    padding: 15px 20px;
}
.upload-block h3 {
    margin-top: 0;
    font-size: 14px;
    color: #333;
}
.upload-btn-wrapper {
    position: relative;
    display: inline-block;
}
.btn {
    padding: 8px 16px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin: 5px 5px 5px 0;
}
.btn:hover {
    opacity: 0.9;
}
.btn-danger {
    background-color: #f44336;
}
.btn-success {
    background-color: #4CAF50;
}
.btn-warning {
    background-color: #ff9800;
}
.btn-purple {
    background-color: #9c27b0;
}
.btn-purple:hover {
    background-color: #7b1fa2;
}
.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}
.file-input {
    display: none;
}
.upload-status {
    margin-top: 10px;
    font-size: 14px;
    color: #333;
    word-break: break-all;
}
.upload-status.success {
    color: #4CAF50;
}
.upload-status.error {
    color: #f44336;
}
.upload-status.loading {
    color: #2196F3;
}

.path-navigation {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    flex-wrap: wrap;
}
.path-navigation .path-label {
    font-weight: bold;
    color: #666;
}
.path-navigation .path-segments {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
.path-navigation .path-sep {
    color: #999;
}
.path-navigation .path-link {
    color: #2196F3;
    cursor: pointer;
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 4px;
}
.path-navigation .path-link:hover {
    background: #e3f2fd;
}
.path-navigation .path-link.current {
    color: #333;
    font-weight: bold;
    cursor: default;
}
.path-navigation .path-link.current:hover {
    background: transparent;
}
.path-navigation .nav-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
    flex-wrap: wrap;
}

.stats-bar {
    display: flex;
    gap: 20px;
    padding: 8px 16px;
    background: #e8f5e9;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #2e7d32;
    flex-wrap: wrap;
}
.stats-bar .stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.stats-bar .stat-item .num {
    font-weight: bold;
}

#fileList {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}
.file-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #eee;
    transition: background 0.15s;
}
.file-item:hover {
    background: #f5f9ff;
}
.file-item:last-child {
    border-bottom: none;
}
.file-item .file-icon {
    font-size: 24px;
    margin-right: 12px;
    width: 32px;
    text-align: center;
}
.file-item .file-icon.directory {
    color: #ff9800;
}
.file-item .file-icon.file {
    color: #2196F3;
}
.file-item .file-info {
    flex: 1;
    min-width: 0;
}
.file-item .file-name {
    font-weight: bold;
    word-break: break-all;
}
.file-item .file-name .dir-link {
    color: #2196F3;
    cursor: pointer;
    text-decoration: none;
}
.file-item .file-name .dir-link:hover {
    text-decoration: underline;
}
.file-item .file-size {
    color: #666;
    font-size: 0.85em;
}
.file-item .file-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    margin-left: 12px;
}
.file-item .qr-code {
    width: 60px;
    height: 60px;
    border: 1px solid #ddd;
    border-radius: 4px;
    object-fit: contain;
    background: #fff;
    cursor: pointer;
    transition: transform 0.2s;
}
.file-item .qr-code:hover {
    transform: scale(1.1);
}
.file-item .qr-code.error {
    border-color: #f44336;
    background: #fff5f5;
}
.file-item .download-btn {
    padding: 4px 10px;
    background: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    white-space: nowrap;
}
.file-item .download-btn:hover {
    opacity: 0.85;
}
.file-item .delete-btn {
    padding: 4px 10px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
}
.file-item .delete-btn.deleting {
    opacity: 0.5;
    cursor: not-allowed;
}

.qr-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}
.qr-modal.show {
    display: flex;
}
.qr-modal .qr-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.qr-modal .qr-content img {
    max-width: 300px;
    max-height: 300px;
}
.qr-modal .qr-content .qr-filename {
    margin-top: 12px;
    font-size: 14px;
    color: #333;
    word-break: break-all;
}
.qr-modal .qr-content .qr-close {
    margin-top: 16px;
    padding: 8px 30px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    justify-content: center;
    align-items: center;
}
.modal-overlay.show {
    display: flex;
}
.modal-overlay .modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-overlay .modal-content h3 {
    margin-top: 0;
    margin-bottom: 16px;
    color: #333;
}
.modal-overlay .modal-content .modal-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 16px;
}
.modal-overlay .modal-content .modal-input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33,150,243,0.2);
}
.modal-overlay .modal-content .modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}
.empty-state .icon {
    font-size: 48px;
    margin-bottom: 16px;
}

@media (max-width: 768px) {
    body { padding: 12px; }
    .upload-container { flex-direction: column; }
    .upload-block { min-width: auto; }
    .file-item {
        flex-wrap: wrap;
        gap: 8px;
    }
    .file-item .file-actions {
        width: 100%;
        justify-content: flex-start;
        margin-left: 44px;
    }
    .file-item .qr-code {
        width: 50px;
        height: 50px;
    }
    .path-navigation {
        flex-direction: column;
        align-items: flex-start;
    }
    .path-navigation .nav-actions {
        margin-left: 0;
        width: 100%;
    }
    .qr-modal .qr-content {
        margin: 20px;
        padding: 20px;
    }
    .qr-modal .qr-content img {
        max-width: 200px;
        max-height: 200px;
    }
}