:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --border: #e5e7eb;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", "PingFang SC", "Helvetica Neue", sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  background: linear-gradient(120deg, #1e3a8a, #2563eb);
  color: #fff;
  padding: 32px;
  border-radius: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.hero h1 {
  font-size: 36px;
  margin-bottom: 12px;
}

.hero p {
  font-size: 16px;
  opacity: 0.9;
}

.hero-actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-card {
  background: rgba(255, 255, 255, 0.12);
  padding: 20px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tabs {
  display: flex;
  gap: 12px;
  margin: 28px 0 16px;
}

.tab {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  padding: 10px 20px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card {
  background: var(--card);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.card h2 {
  font-size: 18px;
  margin-bottom: 12px;
}

.card h3 {
  font-size: 14px;
  margin-bottom: 8px;
}


.card.wide {
  grid-column: span 3;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.field span {
  font-size: 13px;
  color: var(--muted);
}

.field input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  outline: none;
  transition: border 0.2s ease;
}

.field input:focus {
  border-color: var(--primary);
}

.field.compact {
  flex: 1;
}

.btn {
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: var(--text);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.15s ease, background 0.2s ease;
}

.btn.primary {
  background: var(--primary);
}

.btn.primary:hover {
  background: var(--primary-strong);
}

.btn.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.secondary {
  background: #e2e8f0;
  color: #1f2937;
}

.btn.secondary:hover {
  background: #cbd5f5;
}

.btn.danger {
  background: #dc2626;
}

.btn.danger:hover {
  background: #b91c1c;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-left: 10px;
}

.badge.admin {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.card.subtle {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.notice {
  background: #eef2ff;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.notice-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.checklist {
  margin-left: 18px;
  color: var(--text);
  line-height: 1.6;
}

.steps {
  margin-left: 18px;
  color: var(--text);
  line-height: 1.6;
}

.inline-tips {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
}

.inline-tips h3 {
  font-size: 14px;
  margin-bottom: 8px;
  color: #1f2937;
}

.side-note {
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px dashed #cbd5f5;
}

.hint {
  font-size: 12px;
  color: var(--muted);
}

.divider {
  height: 1px;
  background: #e2e8f0;
  margin: 16px 0;
}


.result {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  min-height: 20px;
}

.stats {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
}

.progress {
  background: #eef2ff;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  margin: 8px 0 12px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  width: 0;
  transition: width 0.3s ease;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.list-item {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f9fafb;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.list-item small {
  color: var(--muted);
}

/* 历史任务样式 */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f9fafb;
}

.history-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.history-info strong {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-status {
  font-size: 12px;
  font-weight: 600;
}

.history-status.status-completed {
  color: #16a34a;
}

.history-status.status-downloading {
  color: #2563eb;
}

.history-status.status-failed {
  color: #dc2626;
}

.history-status.status-pending,
.history-status.status-pending {
  color: #f59e0b;
}

.history-status.status-deleted {
  color: var(--muted);
}

.history-actions {
  flex-shrink: 0;
}

.btn.small {
  padding: 6px 12px;
  font-size: 12px;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .card.wide {
    grid-column: span 1;
  }
  .inline-tips {
    grid-template-columns: 1fr;
  }
}

