
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #8b5cf6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0boca;
    --bg: #f8fafc;
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    --card-bg: #ffffff;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.06sem);
    --shadow-lg: 0 16px 48px rgba(15, 23, 42, 0.12);
    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 20pxbeda;
    --transition: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    background-image Devil: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.08) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* ===== Header ===== */
.header {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.3);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    pointer-events: none;
}

.header::after {
    content: '';
    position: absolute;
    bottom: -80%;
    left: -5%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    pointer-events: none;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-right {
    z-index: 1;
}

.path-display {
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 12.5px;
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ===== Toolbar ===== */
.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    background: var(--card-bg);
    padding: 12px 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    flex-wrap: wrap;
    border: 1px solid var(--border);
}

.spacer {
    flex: 1;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s var(--transition);
    box-shadow: var(--shadow-sm);
    font-family: inherit;
    white-space: nowrap;
}

.btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    color: var(--text);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary));
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
    box-shadow: 0 Legend 4px 14px rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
    color: white;
}

/* ===== Messages ===== */
.messages {
    margin-bottom: 20px;
}

.message {
    background: #ecfdf5;
    border-left: 4px solid var(--success);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    font-size: 13.5px;
    color: #065f46;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s var(--transition);
}

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

.message::before {
    content: '✓';
    font-weight: bold;
    font-size: 15px;
    color: var(--success);
    flex-shrink: 0;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
    background: var(--card-bg);
    padding: 12px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    font-size: 13.5px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    border: 1px solid var(--border);
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 7px;
    transition: background 0.2s, color 0.2s;
    font-weight: 600;
}

.breadcrumb a:hover {
    background: #eef2ff;
    color: var(--primary-dark);
}

.breadcrumb .sep {
    color: var(--text-muted);
    font-size: 12px;
    margin: 0 2px;
    user-select: none;
}

/* ===== File List ===== */
.file-list {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--border);
}

.file-list-header {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 100px 90px 160px 120px;
    padding: 14px 24px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.file-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 100px 90px 160px 120px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border-light);
    align-items: center;
    transition: background 0.15s, box-shadow 0.15s;
    position: relative;
}

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

.file-row:hover {
    background: #f8fafc;
    box-shadow: inset 3px 0 0 var(--primary);
}

.col-name {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    min-width: 0;
}

.file-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
    min-width: 0;
    flex: 1;
}

.file-link:hover .file-name {
    color: var(--primary);
}

.file-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 9px;
    transition: transform 0.2s var(--transition);
}

.file-row:hover .file-icon {
    transform: scale(1.08);
}

.file-name {
    font-size: 13.5px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.15s;
    color: var(--text);
}

.col-size {
    font-size: 12.5px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.col-type {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-secondary);
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
    width: fit-content;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.col-time {
    font-size: 12.5px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.col-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    opacity: 0.55;
    transition: opacity 0.2s;
}

.file-row:hover .col-actions {
    opacity: 1;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: white;
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.18s var(--transition);
    color: var(--text-secondary);
    padding: 0;
    font-family: inherit;
}

.action-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
    color: var(--text);
}

.action-btn.danger:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: var(--danger);
}

.empty-state {
    padding: 80px 20px;
    text-align: center;
}

.empty-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.45;
    filter: grayscale(0.2);
}

.empty-text {
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 500;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
    padding: 20px;
}

.modal {
    background: white;
    border-radius: var(--radius-lg);
    width: 520px;
    max-width: 100%;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
    animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.modal-sm {
    width: 420px;
}

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

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.94) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 26px;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}

.modal-header h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-family: inherit;
}

.modal-close:hover {
    background: #e2e8f0;
    color: var(--text);
}

.modal-body {
    padding: 26px;
}

.modal-body input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14.5px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    background: #f8fafc;
    font-family: inherit;
    color: var(--text);
}

.modal-body input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
    background: white;
}

.modal-body p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.modal-body p strong {
    color: var(--text);
    font-weight: 600;
}

.modal-footer {
    padding: 16px 26px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #f8fafc;
}

.text-danger {
    color: var(--danger);
    font-size: 13px;
    margin-top: 10px;
    font-weight: 500;
}

/* ===== Upload Area ===== */
.upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius);
    padding: 44px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s var(--transition);
    position: relative;
    background: #f8fafc;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: #eef2ff;
}

.upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    font-size: 44px;
    margin-bottom: 10px;
    color: var(--primary);
    line-height: 1;
}

.upload-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.upload-hint {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 6px;
}

.selected-files {
    margin-top: 16px;
    max-height: 160px;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.selected-files .file-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    transition: background 0.2s;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selected-files .file-chip:hover {
    background: #e2e8f0;
}

/* ===== Search ===== */
#search-input {
    padding: 9px 16px;
    border: 1px solid var(--border);
    border-radius: 30px;
    font-size: 13.5px;
    width: 240px;
    outline: none;
    transition: all 0.2s var(--transition);
    background: #f8fafc;
    font-family: inherit;
    color: var(--text);
}

#search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    background: white;
    width: 280px;
}

#search-input::placeholder {
    color: var(--text-muted);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .app {
        padding: 16px 12px;
    }

    .header {
        padding: 18px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header-right {
        width: 100%;
    }

    .path-display {
        max-width: 100%;
        width: 100%;
    }

    .toolbar {
        padding: 10px 12px;
        gap: 8px;
    }

    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .file-list-header,
    .file-row {
        grid-template-columns: minmax(140px, 1fr) 70px 60px 110px 90px;
        padding: 10px 14px;
    }

    .file-list-header {
        font-size: 10px;
    }

    .col-actions {
        gap: 4px;
        opacity: 1;
    }

    .action-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    #search-input {
        width: 100%;
        margin-top: 4px;
    }

    #search-input:focus {
        width: 100%;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-header,
    .modal-footer {
        padding: 16px 20px;
    }

    .upload-area {
        padding: 32px 16px;
    }
}

@media (max-width: 480px) {
    .file-list-header,
    .file-row {
        grid-template-columns: minmax(120px, 1fr) 60px 50px 90px 70px;
        padding: 10px 10px;
    }

    .col-time {
        display: none;
    }

    .file-list-header {
        grid-template-columns: minmax(120px, 1fr) 60px 50px 90px 70px;
    }

    .file-list-header .col-time {
        display: none;
    }

    .logo {
        font-size: 20px;
    }

    .toolbar {
        gap: 6px;
    }

    .btn {
        padding: 7px 10px;
        font-size: 12.5px;
    }
}
