:root {
    --bg: #0f111a;
    --card: #161922;
    --accent: #7c3aed;
    --accent2: #22d3ee;
    --green: #22c55e;
    --red: #ef4444;
    --yellow: #eab308;
    --blue: #3b82f6;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --border: rgba(148,163,184,0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 30px 20px;
}

header {
    text-align: center;
    margin-bottom: 24px;
}

header h1 {
    font-size: 1.8rem;
    letter-spacing: 1px;
    background: linear-gradient(90deg, var(--accent2), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 4px;
}

.input-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

textarea {
    width: 100%;
    height: 160px;
    background: #0b0d14;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    padding: 12px;
    font-size: 0.95rem;
    resize: vertical;
    outline: none;
}

textarea:focus {
    border-color: var(--accent);
}

.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--muted);
}

.file-upload input {
    display: none;
}

.action-section {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.btn {
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.15s, opacity 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.btn.start {
    flex: 1;
    background: linear-gradient(135deg, var(--accent), #5b21b6);
    color: white;
    font-size: 1.05rem;
    padding: 14px;
}

.stop {
    background: linear-gradient(135deg, var(--red), #991b1b);
    color: white;
    padding: 14px 22px;
}

.secondary {
    background: rgba(148,163,184,0.12);
    color: var(--text);
}

.danger.secondary {
    background: rgba(239,68,68,0.12);
    color: #fecaca;
}

.progress-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.progress-bar-bg {
    background: #0b0d14;
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    transition: width 0.25s ease;
}

.progress-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.stat {
    background: #0b0d14;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.88rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.dot.green { background: var(--green); }
.dot.red { background: var(--red); }
.dot.yellow { background: var(--yellow); }
.dot.blue { background: var(--blue); }

.results-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}

.tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.tab {
    background: rgba(148,163,184,0.08);
    border: none;
    color: var(--muted);
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.tab.active {
    background: var(--accent);
    color: white;
}

.table-wrap {
    overflow: auto;
    max-height: 400px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

th {
    position: sticky;
    top: 0;
    background: #0b0d14;
    color: var(--muted);
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 10px 12px;
    border-top: 1px solid var(--border);
}

tr:hover td {
    background: rgba(148,163,184,0.05);
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.badge.valid {
    background: rgba(34,197,94,0.15);
    color: #86efac;
}

.badge.invalid {
    background: rgba(239,68,68,0.15);
    color: #fca5a5;
}

.badge.error {
    background: rgba(234,179,8,0.15);
    color: #fde047;
}

.result-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.proxy-section textarea {
    height: 120px;
    background: #0b0d14;
}

.proxy-hint {
    font-size: 0.82rem;
    color: var(--accent2);
    font-weight: 500;
}

footer {
    text-align: center;
    margin-top: 24px;
    color: var(--muted);
    font-size: 0.85rem;
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 12px 16px;
    border-radius: 8px;
    transform: translateY(120%);
    transition: transform 0.3s ease;
    z-index: 9999;
}

.toast.show {
    transform: translateY(0);
}

@media (max-width: 640px) {
    .progress-stats { grid-template-columns: repeat(2, 1fr); }
    .result-actions { flex-wrap: wrap; }
    header h1 { font-size: 1.4rem; }
}
