*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0f1117;
    --bg-card: #1a1d27;
    --bg-hover: #232636;
    --border: #2a2d3a;
    --text: #e4e4e7;
    --text-dim: #8b8d98;
    --accent: #6c63ff;
    --accent-hover: #5a52e0;
    --success: #22c55e;
    --error: #ef4444;
    --radius: 12px;
    --radius-sm: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

.hidden { display: none !important; }

/* Screens */
.screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#upload-screen {
    display: flex;
    align-items: flex-start;
    padding: 24px 16px;
}

/* Login */
.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.logo {
    color: var(--accent);
    margin-bottom: 16px;
}

.login-card h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.subtitle {
    color: var(--text-dim);
    margin-bottom: 32px;
    font-size: 14px;
}

#login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

input[type="password"] {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

input[type="password"]:focus {
    border-color: var(--accent);
}

button {
    cursor: pointer;
    border: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

#login-btn {
    background: var(--accent);
    color: white;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 16px;
}

#login-btn:hover {
    background: var(--accent-hover);
}

#login-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.error {
    color: var(--error);
    font-size: 14px;
    margin-top: 8px;
}

/* Container */
.container {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

header h2 {
    font-size: 20px;
    font-weight: 700;
}

.btn-text {
    background: none;
    color: var(--text-dim);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}

.btn-text:hover {
    color: var(--text);
    background: var(--bg-hover);
}

.btn-small {
    background: var(--accent);
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
}

.btn-small:hover {
    background: var(--accent-hover);
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 60px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-card);
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--accent);
    background: rgba(108, 99, 255, 0.05);
}

.drop-zone svg {
    color: var(--text-dim);
    margin-bottom: 16px;
}

.drop-text {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
}

.drop-hint {
    color: var(--text-dim);
    font-size: 14px;
}

/* Upload Queue */
.upload-queue {
    margin-top: 24px;
}

.queue-header, .results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.queue-header h3, .results-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.queue-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.queue-item-thumb {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg);
}

.queue-item-info {
    flex: 1;
    min-width: 0;
}

.queue-item-name {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item-status {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 2px;
}

.queue-item-progress {
    width: 100%;
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.queue-item-progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s;
}

.queue-item-progress-bar.done {
    background: var(--success);
    width: 100%;
}

.queue-item-progress-bar.error {
    background: var(--error);
    width: 100%;
}

.queue-item-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Results */
.results-section {
    margin-top: 24px;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.result-item-thumb {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg);
}

.result-item-url {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: var(--accent);
    word-break: break-all;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

.copy-btn {
    background: var(--bg-hover);
    color: var(--text);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
}

.copy-btn:hover {
    background: var(--border);
}

.copy-btn.copied {
    background: var(--success);
    color: white;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}

/* Mobile */
@media (max-width: 600px) {
    .login-card {
        padding: 32px 24px;
        margin: 0 16px;
    }

    .drop-zone {
        padding: 40px 16px;
    }

    .drop-text {
        font-size: 16px;
    }

    .result-item {
        flex-wrap: wrap;
    }

    .result-item-url {
        order: 3;
        width: 100%;
        font-size: 12px;
    }

    .copy-btn {
        order: 2;
    }
}
