:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #e2e8f0;
  --success: #16a34a;
  --drop-bg: #eff6ff;
  --drop-border: #93c5fd;
  --radius: 12px;
  --shadow: 0 1px 3px rgb(15 23 42 / 8%), 0 8px 24px rgb(15 23 42 / 6%);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  width: min(720px, 100% - 2rem);
  margin: 0 auto;
}

header {
  padding: 2.5rem 0 1.5rem;
  text-align: center;
}

header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

header .tagline {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

.badge strong {
  color: var(--text);
}

main {
  padding-bottom: 3rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--bg);
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--drop-border);
  background: var(--drop-bg);
}

.dropzone-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  line-height: 1;
}

.dropzone p {
  margin: 0.25rem 0;
}

.dropzone .hint {
  font-size: 0.875rem;
  color: var(--muted);
}

.dropzone input[type="file"] {
  display: none;
}

.format-select {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 1.25rem 0 0;
}

.format-select label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: border-color 0.15s, background 0.15s;
}

.format-select input {
  accent-color: var(--accent);
}

.format-select label:has(input:checked) {
  border-color: var(--accent);
  background: var(--drop-bg);
}

#status {
  margin-top: 1rem;
  min-height: 1.5rem;
  text-align: center;
  font-size: 0.9rem;
}

#status.error {
  color: #dc2626;
}

#status.success {
  color: var(--success);
}

.batch-note {
  margin: 0.75rem 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

#preview-area {
  margin-top: 1.25rem;
  display: none;
}

#preview-area.visible {
  display: block;
}

.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 520px) {
  .preview-grid {
    grid-template-columns: 1fr;
  }
}

.preview-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #f1f5f9;
}

.preview-box h3 {
  margin: 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

.preview-box img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.features {
  margin-top: 2.5rem;
}

.features h2 {
  font-size: 1.25rem;
  margin: 0 0 1rem;
  text-align: center;
}

.feature-list {
  display: grid;
  gap: 0.75rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature-list li {
  display: flex;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
}

.feature-list .icon {
  flex-shrink: 0;
  width: 1.5rem;
  text-align: center;
}

.faq {
  margin-top: 2.5rem;
}

.faq h2 {
  font-size: 1.25rem;
  margin: 0 0 1rem;
}

.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  padding: 0.75rem 1rem;
}

.faq summary {
  font-weight: 600;
  cursor: pointer;
}

.faq p {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

nav.pages {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.9rem;
}

nav.pages a {
  color: var(--accent);
  text-decoration: none;
}

nav.pages a:hover {
  text-decoration: underline;
}

nav.pages a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  pointer-events: none;
}

.seo-intro {
  margin-top: 2rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  color: var(--muted);
}

.seo-intro h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  color: var(--text);
}

.seo-intro p {
  margin: 0 0 0.75rem;
}

.seo-intro p:last-child {
  margin-bottom: 0;
}

footer {
  text-align: center;
  padding: 2rem 0;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.footer-links a {
  color: var(--accent);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}
