:root {
    --bg: #f5f5f5;
    --card-bg: #fff;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --success: #16a34a;
    --error: #dc2626;
    --border: #e5e7eb;
    --text: #1f2937;
    --text-muted: #6b7280;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 2rem;
}

.container { max-width: 800px; margin: 0 auto; }

header { margin-bottom: 2rem; }
header h1 { margin: 0 0 0.25rem 0; font-size: 1.75rem; }
.subtitle { color: var(--text-muted); margin: 0; }

.back-link { text-decoration: none; color: var(--primary); font-size: 0.875rem; }

section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
section h2 { margin-top: 0; font-size: 1.25rem; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; }
input[type="file"] { width: 100%; padding: 0.5rem; border: 1px dashed var(--border); border-radius: 4px; }

button, .download-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    text-decoration: none;
    display: inline-block;
}
button:hover, .download-btn:hover { background: var(--primary-hover); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.jobs-table { width: 100%; border-collapse: collapse; }
.jobs-table th, .jobs-table td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); }
.jobs-table th { font-size: 0.8rem; text-transform: uppercase; color: var(--text-muted); }

.empty { color: var(--text-muted); }

.status { padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.8rem; font-weight: 500; text-transform: uppercase; }
.status-pending { background: #e0e7ff; color: #3730a3; }
.status-parsing { background: #fef3c7; color: #92400e; }
.status-translating { background: #dbeafe; color: #1e40af; }
.status-assembling { background: #f3e8ff; color: #6b21a8; }
.status-done { background: #d1fae5; color: #065f46; }
.status-error { background: #fee2e2; color: #991b1b; }

.ping-result { margin-top: 0.75rem; padding: 0.5rem; border-radius: 4px; font-size: 0.9rem; }
.ping-result.success { background: #d1fae5; color: #065f46; }
.ping-result.error { background: #fee2e2; color: #991b1b; }

.job-info p { margin: 0.3rem 0; }

.progress-bar-container { width: 100%; height: 24px; background: var(--border); border-radius: 12px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary); transition: width 0.3s ease; }
.progress-section p { text-align: center; margin-top: 0.5rem; font-size: 0.875rem; color: var(--text-muted); }

.error-display { background: #fee2e2; color: #991b1b; padding: 0.75rem; border-radius: 6px; margin-bottom: 1rem; }

.log { max-height: 300px; overflow-y: auto; background: #1f2937; border-radius: 6px; padding: 0.75rem; }
.log-entry { color: #d1d5db; font-family: 'SF Mono', monospace; font-size: 0.8rem; line-height: 1.5; }
.log-success { color: #4ade80; }
.log-error { color: #f87171; }
