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

:root {
  --bg: #0f0f12;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-hover: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.1);
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --accent: #ff3d3d;
  --accent-hover: #ff5555;
  --accent-glow: rgba(255, 61, 61, 0.35);
  --success: #22c55e;
  --radius: 14px;
  --font: "Noto Sans TC", system-ui, sans-serif;
}

html {
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.bg-gradient {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--accent-glow), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(99, 102, 241, 0.12), transparent),
    radial-gradient(ellipse 50% 30% at 0% 80%, rgba(236, 72, 153, 0.08), transparent);
  pointer-events: none;
  z-index: 0;
}

.header,
.container,
.footer {
  position: relative;
  z-index: 1;
}

.header {
  text-align: center;
  padding: 3rem 1.5rem 2rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background: var(--accent);
  border-radius: 8px;
  font-size: 0.85rem;
  color: white;
}

.tagline {
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: 1rem;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
}

.label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.input-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

input[type="url"] {
  flex: 1;
  min-width: 200px;
  padding: 0.85rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="url"]::placeholder {
  color: #71717a;
}

input[type="url"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.85rem 1.5rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, opacity 0.2s;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  background: var(--success);
  color: white;
  width: 100%;
  justify-content: center;
}

.btn-download:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-icon {
  font-size: 1.1rem;
}

.error-msg {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: #f87171;
}

.preview {
  display: flex;
  gap: 1.25rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.preview-thumb {
  width: 160px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.4);
}

.preview-meta {
  flex: 1;
  min-width: 0;
}

.preview-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.preview-details {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.success-msg {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--success);
  text-align: center;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.steps {
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.steps li + li {
  margin-top: 0.5rem;
}

.disclaimer {
  text-align: center;
  font-size: 0.8rem;
  color: #71717a;
  margin-top: 0.5rem;
}

.footer {
  text-align: center;
  padding: 2rem;
  font-size: 0.8rem;
  color: #52525b;
}

@media (max-width: 520px) {
  .preview {
    flex-direction: column;
  }

  .preview-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .input-row {
    flex-direction: column;
  }

  .btn-primary {
    width: 100%;
  }
}
