.ftp-app {
    --ftp-card-bg: #ffffff;
    --ftp-surface: #f8fafc;
    --ftp-border: #e2e8f0;
    --ftp-text: #0f172a;
    --ftp-muted: #64748b;
    --ftp-primary: #6366f1;
    --ftp-primary-2: #8b5cf6;
    --ftp-success: #10b981;
    --ftp-error: #ef4444;

    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin: 24px 0;
    color: var(--ftp-text);
    font-size: 15px;
    line-height: 1.5;
}
@media (prefers-color-scheme: dark) {
    .ftp-app {
        --ftp-card-bg: #0f172a;
        --ftp-surface: #1e293b;
        --ftp-border: #334155;
        --ftp-text: #e2e8f0;
        --ftp-muted: #94a3b8;
    }
}

.ftp-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px;
    background: var(--ftp-card-bg);
    border: 1px solid var(--ftp-border);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px -12px rgba(15, 23, 42, .12);
}

.ftp-head { display: flex; align-items: center; gap: 12px; }
.ftp-badge {
    display: grid; place-items: center;
    width: 44px; height: 44px; flex: 0 0 auto;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(99,102,241,.16), rgba(139,92,246,.16));
    color: var(--ftp-primary);
}
.ftp-head h3 { margin: 0; font-size: 17px; font-weight: 600; }
.ftp-head p { margin: 2px 0 0; font-size: 13px; color: var(--ftp-muted); }

.ftp-drop {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; padding: 28px 16px;
    border: 2px dashed var(--ftp-border); border-radius: 12px;
    background: var(--ftp-surface);
    cursor: pointer; text-align: center;
    transition: border-color .18s, background .18s, transform .18s;
}
.ftp-drop:hover, .ftp-drop.is-drag {
    border-color: var(--ftp-primary);
    background: rgba(99,102,241,.06);
}
.ftp-drop.is-drag { transform: scale(1.01); }
.ftp-drop-icon { color: var(--ftp-muted); transition: color .18s; }
.ftp-drop:hover .ftp-drop-icon, .ftp-drop.is-drag .ftp-drop-icon { color: var(--ftp-primary); }
.ftp-drop-title { font-weight: 600; font-size: 14px; }
.ftp-drop-hint { font-size: 12px; color: var(--ftp-muted); }
.ftp-drop input { display: none; }

.ftp-fileinfo {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; font-size: 13px; color: var(--ftp-muted);
    background: var(--ftp-surface);
    border: 1px solid var(--ftp-border);
    border-radius: 10px;
    word-break: break-all;
}
.ftp-fileinfo[hidden] { display: none; }

.ftp-field { display: flex; flex-direction: column; gap: 6px; }
.ftp-field label { font-size: 13px; font-weight: 500; color: var(--ftp-muted); }
.ftp-field input[type="password"],
.ftp-field input[type="text"],
.ftp-field select {
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--ftp-border);
    border-radius: 10px;
    background: var(--ftp-surface);
    color: var(--ftp-text);
    outline: none;
    font-family: inherit;
    transition: border-color .18s, box-shadow .18s;
}
.ftp-field input:focus, .ftp-field select:focus {
    border-color: var(--ftp-primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

.ftp-btn {
    width: 100%;
    padding: 12px 16px; border: 0; border-radius: 10px;
    font-size: 15px; font-weight: 600; color: #fff;
    background: linear-gradient(135deg, var(--ftp-primary), var(--ftp-primary-2));
    cursor: pointer;
    transition: transform .15s, box-shadow .2s, opacity .2s;
    box-shadow: 0 6px 16px -6px rgba(99,102,241,.6);
}
.ftp-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 22px -8px rgba(99,102,241,.7); }
.ftp-btn:active:not(:disabled) { transform: translateY(0); }
.ftp-btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

.ftp-progress {
    height: 4px; background: var(--ftp-border);
    border-radius: 2px; overflow: hidden;
    margin: 2px 0;
    visibility: hidden;
}
.ftp-progress.is-active { visibility: visible; }
.ftp-progress-bar {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--ftp-primary), var(--ftp-primary-2));
    transition: width .25s ease;
}

.ftp-status { display: none; font-size: 13.5px; padding: 10px 12px; border-radius: 10px; }
.ftp-status.is-loading, .ftp-status.is-success, .ftp-status.is-error { display: block; }
.ftp-status.is-loading { color: var(--ftp-primary); background: rgba(99,102,241,.1); }
.ftp-status.is-success { color: var(--ftp-success); background: rgba(16,185,129,.1); }
.ftp-status.is-error   { color: var(--ftp-error);   background: rgba(239,68,68,.1);   word-break: break-all; }
.ftp-status.is-success::before { content: '✓'; margin-right: 6px; font-weight: 700; }
.ftp-status.is-error::before   { content: '✕'; margin-right: 6px; font-weight: 700; }

.ftp-result { display: none; flex-direction: column; gap: 10px; }
.ftp-result:not(:empty) { display: flex; }
.ftp-result img {
    width: 100%; max-height: 260px; object-fit: contain;
    background: #fff;
    border: 1px solid var(--ftp-border); border-radius: 10px;
}
.ftp-result-meta { font-size: 12.5px; color: var(--ftp-muted); word-break: break-all; }

.ftp-btn-row { display: flex; gap: 8px; }
.ftp-btn-row .ftp-download { flex: 1; cursor: pointer; font-family: inherit; }

.ftp-download {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 16px; border-radius: 10px;
    background: var(--ftp-surface); border: 1px solid var(--ftp-border);
    color: var(--ftp-text); font-size: 14px; font-weight: 600;
    text-decoration: none;
    transition: background .18s, border-color .18s, color .18s;
}
.ftp-download:hover { background: rgba(99,102,241,.08); border-color: var(--ftp-primary); color: var(--ftp-primary); }

.ftp-paste-hint { font-size: 12px; color: var(--ftp-muted); text-align: center; padding: 2px 0; }
.ftp-paste-hint kbd {
    padding: 1px 5px;
    background: var(--ftp-surface);
    border: 1px solid var(--ftp-border);
    border-radius: 4px;
    font-size: 11px;
    font-family: inherit;
}