:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --border: #e5e7eb;
  --success: #059669;
  --danger: #dc2626;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #eef2ff 0%, var(--bg) 220px);
  color: var(--text);
  line-height: 1.6;
}

.container {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  padding: 48px 0 24px;
  text-align: center;
}

.site-header h1 {
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
}

.tagline {
  margin: 0;
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

input[type="url"] {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
}

input[type="url"]:focus {
  outline: 2px solid rgba(37, 99, 235, 0.25);
  border-color: var(--primary);
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

button {
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

button[type="submit"],
.download-link {
  background: var(--primary);
  color: #fff;
}

button[type="submit"]:hover,
.download-link:hover {
  background: var(--primary-dark);
}

button.secondary {
  background: #eef2ff;
  color: var(--primary);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.status-panel {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.hidden {
  display: none !important;
}

.progress-bar {
  width: 100%;
  height: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  width: 8%;
  background: linear-gradient(90deg, #60a5fa, var(--primary));
  border-radius: inherit;
  transition: width 0.4s ease;
}

#status-text {
  margin: 0 0 8px;
  font-weight: 600;
}

.meta-text {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.download-link {
  display: inline-block;
  margin-top: 16px;
  padding: 12px 20px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
}

.notice {
  margin: 16px 0 0;
  padding: 12px 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  color: #92400e;
  font-size: 14px;
}

.info-card ol {
  margin: 0;
  padding-left: 20px;
}

.info-card code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.92em;
}

.ad-slot {
  text-align: center;
  color: var(--muted);
}

.site-footer {
  padding: 32px 0 48px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 8px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--primary);
}

.legal-page {
  max-width: 760px;
  margin: 32px auto 48px;
  padding: 0 16px;
}

.legal-page h1 {
  margin-top: 0;
}

.legal-page h2 {
  margin-top: 28px;
}

.legal-page ul {
  padding-left: 20px;
}

@media (max-width: 640px) {
  .card {
    padding: 18px;
  }

  .actions {
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}
