* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    line-height: 1.6;
}
.navbar {
    background: #1e293b;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #334155;
}
.nav-brand { font-size: 1.25rem; font-weight: 700; color: #60a5fa; }
.nav-links a {
    color: #94a3b8;
    text-decoration: none;
    margin-left: 1.5rem;
    font-weight: 500;
}
.nav-links a:hover { color: #60a5fa; }
.container { max-width: 1200px; margin: 2rem auto; padding: 0 1rem; }
.footer { text-align: center; padding: 2rem; color: #64748b; font-size: 0.875rem; }

h1 { font-size: 1.75rem; margin-bottom: 1.5rem; color: #f8fafc; }
h2 { font-size: 1.25rem; margin: 2rem 0 1rem; color: #cbd5e1; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: #1e293b;
    border-radius: 0.5rem;
    padding: 1.25rem;
    text-align: center;
    border-left: 4px solid;
}
.stat-card.pending { border-color: #f59e0b; }
.stat-card.downloading { border-color: #3b82f6; }
.stat-card.completed { border-color: #10b981; }
.stat-card.failed { border-color: #ef4444; }
.stat-card h3 { font-size: 0.875rem; color: #94a3b8; margin-bottom: 0.5rem; }
.stat-value { font-size: 2rem; font-weight: 700; }
.stat-card.pending .stat-value { color: #f59e0b; }
.stat-card.downloading .stat-value { color: #3b82f6; }
.stat-card.completed .stat-value { color: #10b981; }
.stat-card.failed .stat-value { color: #ef4444; }

.speed-bar {
    background: #1e293b;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    display: flex;
    gap: 2rem;
    font-size: 0.875rem;
    color: #94a3b8;
    margin-bottom: 1.5rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #1e293b;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.data-table th, .data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #334155;
}
.data-table th {
    background: #0f172a;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
}
.data-table tr:hover { background: #334155; }
.data-table a { color: #60a5fa; text-decoration: none; }
.data-table a:hover { text-decoration: underline; }
.truncate {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.error-text { color: #f87171; }

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-pending { background: #78350f; color: #fbbf24; }
.badge-searching { background: #1e3a8a; color: #93c5fd; }
.badge-downloading { background: #1e3a8a; color: #60a5fa; }
.badge-completed { background: #064e3b; color: #34d399; }
.badge-uploading { background: #4c1d95; color: #c4b5fd; }
.badge-uploaded { background: #064e3b; color: #34d399; }
.badge-failed { background: #7f1d1d; color: #fca5a5; }

.btn-primary, .btn-small {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
}
.btn-primary {
    background: #2563eb;
    color: white;
}
.btn-primary:hover { background: #1d4ed8; }
.btn-small {
    background: #475569;
    color: white;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}
.btn-small:hover { background: #64748b; }
.btn-danger { background: #dc2626; }
.btn-danger:hover { background: #b91c1c; }

.form-card {
    background: #1e293b;
    border-radius: 0.5rem;
    padding: 1.5rem;
    max-width: 500px;
}
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #cbd5e1;
}
.form-group input, .form-group select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #334155;
    border-radius: 0.375rem;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 0.875rem;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.empty { color: #64748b; font-style: italic; padding: 1rem 0; }

.detail-card {
    background: #1e293b;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.detail-row {
    padding: 0.5rem 0;
    border-bottom: 1px solid #334155;
}
.detail-row:last-child { border-bottom: none; }
.detail-row strong { color: #94a3b8; display: inline-block; width: 120px; }
.detail-row code {
    background: #0f172a;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
}
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.file-name { font-weight: 500; }
.file-meta { font-size: 0.75rem; color: #64748b; margin-top: 0.25rem; }
.file-meta code { background: #0f172a; padding: 0.125rem 0.375rem; border-radius: 0.25rem; }
h4 { font-size: 0.875rem; color: #94a3b8; margin: 1rem 0 0.5rem; text-transform: uppercase; letter-spacing: 0.05em; }

.filter-form { margin-bottom: 1.5rem; max-width: 100%; }
.filter-form .form-row { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.results-count { color: #94a3b8; margin-bottom: 0.75rem; font-size: 0.875rem; }
.lang-badge {
    display: inline-block;
    background: #1e3a8a;
    color: #93c5fd;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    margin-right: 0.25rem;
    font-weight: 600;
}
.votes-up { color: #34d399; font-size: 0.8rem; }
.votes-down { color: #f87171; font-size: 0.8rem; }
.badge-1080p { background: #064e3b; color: #34d399; }
.badge-720p { background: #1e3a8a; color: #60a5fa; }
.badge-480p { background: #78350f; color: #fbbf24; }
.results-table td { font-size: 0.875rem; vertical-align: top; }
.results-table .file-name { max-width: 400px; word-break: break-word; }

.sort-header {
    color: #94a3b8;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.sort-header:hover {
    color: #60a5fa;
}
.sort-header.active {
    color: #60a5fa;
}
.results-table th {
    white-space: nowrap;
}

.disabled { opacity: 0.6; cursor: not-allowed; pointer-events: none; }
