:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --text: #111418;
  --muted: #5c6670;
  --accent: #1f7aec;
  --accent-soft: rgba(31, 122, 236, 0.12);
  --accent-strong: #1557b0;
  --success: #12b981;
  --border: rgba(17, 20, 24, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(circle at 10% 10%, rgba(31, 122, 236, 0.18), transparent 40%),
    radial-gradient(circle at 90% 0%, rgba(18, 185, 129, 0.18), transparent 45%),
    radial-gradient(circle at top, #e8eef7 0%, var(--bg) 45%, #f8fafc 100%);
  color: var(--text);
  min-height: 100vh;
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 64px 24px 80px;
  display: grid;
  gap: 32px;
}

.hero {
  display: grid;
  gap: 16px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

h1 {
  font-size: clamp(32px, 5vw, 48px);
  margin: 0;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.card {
  background: var(--surface);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
  display: grid;
  gap: 24px;
}

.upload-area {
  position: relative;
  border: 1px dashed var(--border);
  padding: 28px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
  display: grid;
  gap: 12px;
  transition: border 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.upload-area.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}

.upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-copy {
  pointer-events: none;
}

.upload-copy .title {
  font-size: 18px;
  margin: 0;
}

.upload-copy .hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.primary {
  padding: 12px 24px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.primary:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(31, 122, 236, 0.25);
}

.primary.loading {
  background: var(--accent-strong);
  box-shadow: 0 12px 24px rgba(21, 87, 176, 0.3);
}

.primary.loading::after {
  content: "";
  width: 14px;
  height: 14px;
  margin-left: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-top-color: #fff;
  display: inline-block;
  vertical-align: middle;
  animation: spin 0.9s linear infinite;
}

.status {
  color: var(--muted);
  font-size: 14px;
}

.progress {
  display: none;
  align-items: center;
  gap: 12px;
}

.progress.show {
  display: flex;
}

.progress-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(17, 20, 24, 0.08);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--success));
  transition: width 0.2s ease;
}

.progress-label {
  font-size: 13px;
  color: var(--muted);
  min-width: 36px;
  text-align: right;
}

.result {
  display: none;
  padding: 20px;
  border-radius: 12px;
  background: rgba(31, 122, 236, 0.08);
  gap: 8px;
  animation: fadeUp 0.3s ease;
}

.result.show {
  display: grid;
}

.result-title {
  margin: 0;
  font-weight: 600;
}

.download {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.note {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  padding: 20px 24px;
  border: 1px solid var(--border);
}

.note h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.note ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 640px) {
  .card {
    padding: 24px;
  }

  .actions {
    flex-direction: column;
    align-items: flex-start;
  }
}
