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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  min-height: 100vh;
}

/* Header */
.header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.header .subtitle {
  font-size: 13px;
  opacity: 0.7;
  margin-left: auto;
}

/* Main container */
.container {
  max-width: 960px;
  margin: 24px auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Card */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border: 1px solid #e4e7ec;
}

.card h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #1a1a2e;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card h2 .icon {
  font-size: 18px;
}

/* Form elements */
.form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: #555;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="url"],
textarea {
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
  outline: none;
  background: #fafafa;
}

input:focus,
textarea:focus {
  border-color: #4361ee;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

textarea {
  resize: vertical;
  min-height: 100px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 13px;
  line-height: 1.5;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: #4361ee;
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: #3a56d4;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

.btn-danger {
  background: #ef4444;
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}

.btn-success {
  background: #10b981;
  color: #fff;
}

.btn-success:hover:not(:disabled) {
  background: #059669;
}

.btn-row {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* Progress */
.progress-section {
  display: none;
}

.progress-section.active {
  display: block;
}

.progress-bar-container {
  background: #e5e7eb;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar {
  background: linear-gradient(90deg, #4361ee, #7c3aed);
  height: 100%;
  border-radius: 999px;
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 13px;
  color: #666;
}

/* Status log */
.status-log {
  margin-top: 12px;
  max-height: 120px;
  overflow-y: auto;
  font-size: 12px;
  font-family: 'Consolas', monospace;
  background: #f8f9fa;
  border-radius: 6px;
  padding: 8px 12px;
  border: 1px solid #e4e7ec;
}

.status-log .log-entry {
  padding: 2px 0;
  display: flex;
  gap: 8px;
}

.log-entry .time {
  color: #999;
  flex-shrink: 0;
}

.log-entry.success { color: #059669; }
.log-entry.error { color: #dc2626; }
.log-entry.info { color: #555; }

/* Results table */
.results-table-wrapper {
  overflow-x: auto;
  margin-top: 12px;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.results-table thead th {
  background: #1a1a2e;
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

.results-table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
}

.results-table tbody tr:hover {
  background: #f8f9ff;
}

.results-table tbody tr:nth-child(even) {
  background: #fafafa;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 32px;
  color: #999;
  font-size: 14px;
}

/* Proxy config */
.proxy-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.proxy-row .form-group {
  flex: 1;
}

.proxy-row .btn {
  margin-bottom: 1px;
  white-space: nowrap;
}

/* File input */
input[type="file"] {
  padding: 10px;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  background: #fafafa;
  cursor: pointer;
  width: 100%;
  font-size: 14px;
}

input[type="file"]:hover {
  border-color: #4361ee;
  background: #f0f4ff;
}

/* Responsive */
@media (max-width: 640px) {
  .form-row {
    flex-direction: column;
  }

  .header {
    padding: 16px;
  }

  .header .subtitle {
    display: none;
  }

  .container {
    margin: 12px auto;
  }

  .card {
    padding: 16px;
  }
}
