
*{
    box-sizing:border-box;
}

:root{
    --bg:#f5f7fb;
    --card:#ffffff;
    --border:#e5e7eb;
    --text:#111827;
    --muted:#6b7280;
    --primary:#2563eb;
    --primary-dark:#1d4ed8;
    --success:#16a34a;
    --danger:#dc2626;
    --hover:#f3f4f6;
    --soft:#eff6ff;
    --shadow:0 8px 30px rgba(15,23,42,.07);
}

body{
    margin:0;
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;
    background:var(--bg);
    color:var(--text);
}

button,
input{
    font:inherit;
}

button{
    cursor:pointer;
}

.header{
    background:#fff;
    border-bottom:1px solid var(--border);
    position:sticky;
    top:0;
    z-index:20;
}

.header-inner{
    max-width:1450px;
    margin:auto;
    padding:16px 24px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
}

.brand{
    display:flex;
    align-items:center;
    gap:12px;
}

.logo{
    width:42px;
    height:42px;
    border-radius:11px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:var(--primary);
    color:white;
    font-size:22px;
    font-weight:800;
}

.brand-title{
    font-size:19px;
    font-weight:800;
}

.brand-subtitle{
    color:var(--muted);
    font-size:12px;
    margin-top:2px;
}

.status-badge{
    padding:7px 12px;
    background:#ecfdf5;
    color:#15803d;
    border-radius:999px;
    font-size:12px;
    font-weight:700;
}

.container{
    max-width:1450px;
    margin:0 auto;
    padding:28px 24px 60px;
}

.hero{
    margin-bottom:22px;
}

.hero h1{
    margin:0 0 7px;
    font-size:30px;
}

.hero p{
    margin:0;
    color:var(--muted);
    line-height:1.6;
}

.upload-card{
    background:var(--card);
    border:1px solid var(--border);
    border-radius:16px;
    padding:22px;
    box-shadow:var(--shadow);
    margin-bottom:20px;
}

.dropzone{
    border:2px dashed #cbd5e1;
    border-radius:14px;
    min-height:190px;
    display:flex;
    align-items:center;
    justify-content:center;
    text-align:center;
    padding:30px;
    transition:.2s;
    background:#fafcff;
}

.dropzone.dragover{
    border-color:var(--primary);
    background:var(--soft);
}

.drop-icon{
    font-size:44px;
    margin-bottom:12px;
}

.drop-title{
    font-weight:800;
    font-size:18px;
    margin-bottom:6px;
}

.drop-text{
    color:var(--muted);
    font-size:14px;
    margin-bottom:17px;
}

.primary-btn{
    border:0;
    border-radius:9px;
    background:var(--primary);
    color:white;
    padding:10px 17px;
    font-weight:700;
}

.primary-btn:hover{
    background:var(--primary-dark);
}

.secondary-btn{
    border:1px solid var(--border);
    background:#fff;
    color:var(--text);
    border-radius:9px;
    padding:9px 14px;
    font-weight:600;
}

.secondary-btn:hover{
    background:var(--hover);
}

.danger-btn{
    border:0;
    background:#fef2f2;
    color:var(--danger);
    border-radius:9px;
    padding:9px 14px;
    font-weight:700;
}

input[type=file]{
    display:none;
}

.file-info{
    display:none;
    margin-top:15px;
    border:1px solid var(--border);
    border-radius:10px;
    padding:12px 14px;
    align-items:center;
    justify-content:space-between;
    gap:15px;
}

.file-info.show{
    display:flex;
}

.file-name{
    font-weight:700;
    word-break:break-all;
}

.file-size{
    color:var(--muted);
    font-size:13px;
    margin-top:3px;
}

.stats{
    display:grid;
    grid-template-columns:repeat(5,1fr);
    gap:14px;
    margin-bottom:20px;
}

.stat{
    background:#fff;
    border:1px solid var(--border);
    border-radius:13px;
    padding:17px;
    box-shadow:var(--shadow);
}

.stat-label{
    color:var(--muted);
    font-size:12px;
    font-weight:600;
    margin-bottom:7px;
}

.stat-value{
    font-size:21px;
    font-weight:800;
}

.workspace{
    display:grid;
    grid-template-columns:minmax(340px,1fr) minmax(380px,1fr);
    gap:20px;
}

.panel{
    background:#fff;
    border:1px solid var(--border);
    border-radius:16px;
    box-shadow:var(--shadow);
    overflow:hidden;
    min-width:0;
}

.panel-header{
    padding:15px 17px;
    border-bottom:1px solid var(--border);
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
}

.panel-title{
    font-size:15px;
    font-weight:800;
}

.search-wrap{
    padding:12px;
    border-bottom:1px solid var(--border);
}

.search{
    width:100%;
    border:1px solid var(--border);
    border-radius:8px;
    padding:9px 11px;
    outline:none;
}

.search:focus{
    border-color:var(--primary);
}

.tree{
    height:600px;
    overflow:auto;
    padding:10px;
}

.tree-empty{
    height:100%;
    display:flex;
    align-items:center;
    justify-content:center;
    text-align:center;
    color:var(--muted);
    padding:30px;
}

.tree-row{
    min-height:36px;
    display:flex;
    align-items:center;
    gap:7px;
    border-radius:7px;
    padding:5px 7px;
    user-select:none;
}

.tree-row:hover{
    background:var(--hover);
}

.tree-row.selected{
    background:#eff6ff;
}

.tree-toggle{
    width:20px;
    height:20px;
    border:0;
    background:transparent;
    padding:0;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#64748b;
    flex-shrink:0;
}

.tree-icon{
    width:20px;
    text-align:center;
    flex-shrink:0;
}

.tree-name{
    flex:1;
    min-width:0;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    font-size:13px;
}

.tree-size{
    color:var(--muted);
    font-size:11px;
    white-space:nowrap;
}

.tree-download{
    width:27px;
    height:27px;
    border:1px solid var(--border);
    background:#fff;
    border-radius:6px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:13px;
    opacity:0;
    transition:.15s;
}

.tree-row:hover .tree-download{
    opacity:1;
}

.tree-download:hover{
    color:var(--primary);
    border-color:#bfdbfe;
    background:#eff6ff;
}

.children{
    margin-left:20px;
}

.hidden{
    display:none;
}

.preview{
    min-height:600px;
    display:flex;
    flex-direction:column;
}

.preview-body{
    flex:1;
    overflow:auto;
}

.preview-empty{
    height:100%;
    min-height:500px;
    display:flex;
    align-items:center;
    justify-content:center;
    text-align:center;
    color:var(--muted);
    padding:40px;
}

.preview-meta{
    padding:15px;
    border-bottom:1px solid var(--border);
    background:#fafafa;
}

.preview-name{
    font-weight:800;
    word-break:break-all;
}

.meta-grid{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:9px;
    margin-top:13px;
}

.meta-item{
    background:#fff;
    border:1px solid var(--border);
    border-radius:8px;
    padding:9px;
}

.meta-label{
    font-size:10px;
    color:var(--muted);
    text-transform:uppercase;
    font-weight:700;
}

.meta-value{
    margin-top:3px;
    font-size:12px;
    word-break:break-word;
}

.preview-content{
    padding:15px;
}

.text-preview{
    margin:0;
    white-space:pre-wrap;
    word-break:break-word;
    background:#0f172a;
    color:#e2e8f0;
    border-radius:10px;
    padding:15px;
    font:12px/1.65
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;
    max-height:460px;
    overflow:auto;
}

.image-preview{
    max-width:100%;
    max-height:480px;
    display:block;
    margin:auto;
    border-radius:9px;
    object-fit:contain;
}

.video-preview{
    width:100%;
    max-height:480px;
    border-radius:9px;
    background:#000;
}

.preview-download{
    margin-top:14px;
    display:flex;
    gap:9px;
    flex-wrap:wrap;
}

.progress-card{
    display:none;
    margin-top:20px;
    background:#fff;
    border:1px solid var(--border);
    border-radius:14px;
    padding:16px;
}

.progress-card.show{
    display:block;
}

.progress-top{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:15px;
    margin-bottom:9px;
}

.progress-title{
    font-weight:800;
    font-size:13px;
}

.progress-percent{
    font-weight:800;
    font-size:13px;
}

.progress-track{
    height:9px;
    background:#e5e7eb;
    border-radius:999px;
    overflow:hidden;
}

.progress-bar{
    height:100%;
    width:0;
    background:var(--primary);
    transition:width .15s;
}

.progress-info{
    color:var(--muted);
    font-size:12px;
    margin-top:8px;
    display:flex;
    justify-content:space-between;
    gap:10px;
}

.notice{
    margin-top:20px;
    padding:13px 15px;
    border-radius:10px;
    background:#eff6ff;
    color:#1e40af;
    border:1px solid #bfdbfe;
    font-size:12px;
    line-height:1.6;
}

.footer{
    text-align:center;
    color:var(--muted);
    font-size:12px;
    margin-top:30px;
}

@media(max-width:1000px){
    .workspace{
        grid-template-columns:1fr;
    }

    .stats{
        grid-template-columns:repeat(3,1fr);
    }
}

@media(max-width:650px){
    .header-inner,
    .container{
        padding-left:14px;
        padding-right:14px;
    }

    .stats{
        grid-template-columns:repeat(2,1fr);
    }

    .hero h1{
        font-size:25px;
    }

    .tree{
        height:450px;
    }

    .meta-grid{
        grid-template-columns:1fr;
    }
}