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

:root {
  --bg: #0f0f12;
  --surface: #1a1a22;
  --border: #2a2a36;
  --text: #f0f0f5;
  --muted: #8888a0;
  --accent: #e1306c;
  --accent-hover: #c13584;
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.header-text {
  flex: 1;
}

.logo {
  font-size: 2.5rem;
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

.subtitle {
  color: var(--muted);
  font-size: 0.9rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.section {
  margin-bottom: 1.75rem;
}

.section h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.dropzone {
  display: block;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(225, 48, 108, 0.05);
}

.dropzone-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}

.dropzone p {
  font-weight: 500;
}

.hint {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.preview-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
  width: 100%;
}

.preview-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem;
}

.preview-item img {
  width: 100%;
  height: 80px;
  border-radius: 4px;
  object-fit: cover;
}

.preview-name {
  font-size: 0.65rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-remove {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  width: 1.4rem;
  height: 1.4rem;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.format-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 520px) {
  .format-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.format-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.format-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 0.5rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
}

.format-card strong {
  font-size: 0.8rem;
}

.format-card span {
  font-size: 0.75rem;
  color: var(--muted);
}

.format-card small {
  font-size: 0.65rem;
  color: var(--muted);
  line-height: 1.3;
}

.format-option input:checked + .format-card {
  border-color: var(--accent);
  background: rgba(225, 48, 108, 0.08);
}

.format-shape {
  background: var(--border);
  border-radius: 3px;
  margin-bottom: 0.25rem;
}

.format-shape--square { width: 36px; height: 36px; }
.format-shape--portrait { width: 32px; height: 40px; }
.format-shape--landscape { width: 44px; height: 23px; }
.format-shape--story { width: 24px; height: 42px; }

.mode-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mode-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-card {
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.mode-card strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}

.mode-card span {
  font-size: 0.8rem;
  color: var(--muted);
}

.mode-option input:checked + .mode-card {
  border-color: var(--accent);
  background: rgba(225, 48, 108, 0.08);
}

.btn-primary {
  width: 100%;
  padding: 0.85rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.92;
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-text {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.85rem;
  text-decoration: underline;
}

.btn-text:disabled {
  opacity: 0.6;
  cursor: wait;
}

.error {
  margin-top: 0.75rem;
  color: #ff6b6b;
  font-size: 0.85rem;
  text-align: center;
}

.footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.loading {
  opacity: 0.6;
  pointer-events: none;
}

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
}

.badge--free {
  background: rgba(136, 136, 160, 0.2);
  color: var(--muted);
}

.badge--pro {
  background: rgba(225, 48, 108, 0.15);
  color: var(--accent);
}

.usage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
}

.notice {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: rgba(46, 204, 113, 0.12);
  border: 1px solid rgba(46, 204, 113, 0.35);
  color: #8be8ae;
  font-size: 0.85rem;
}

.notice--warn {
  background: rgba(255, 193, 7, 0.1);
  border-color: rgba(255, 193, 7, 0.35);
  color: #ffd966;
}

.notice--error {
  background: rgba(255, 107, 107, 0.1);
  border-color: rgba(255, 107, 107, 0.35);
  color: #ff9a9a;
}

.pricing {
  margin-bottom: 1rem;
}

.pricing h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 520px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

.price-card {
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
}

.price-card--current {
  border-color: var(--accent);
}

.price-card h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.price {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.price-card ul {
  list-style: none;
  margin-bottom: 0.85rem;
}

.price-card li {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0.2rem 0;
}

.price-card li::before {
  content: "✓ ";
  color: var(--accent);
}

.price-cta {
  display: block;
  text-align: center;
  font-size: 0.8rem;
}

.price-cta--muted {
  color: var(--muted);
}

.btn-secondary {
  width: 100%;
  padding: 0.6rem;
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary:hover {
  background: rgba(225, 48, 108, 0.08);
}

.seo-content {
  margin-top: 1rem;
}

.seo-content h2 {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
}

.seo-content h3 {
  font-size: 0.95rem;
  margin: 1.25rem 0 0.5rem;
  color: var(--text);
}

.seo-content p {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.seo-list {
  list-style: none;
  margin-bottom: 0.75rem;
}

.seo-list li {
  font-size: 0.88rem;
  color: var(--muted);
  padding: 0.25rem 0;
}

.seo-list li::before {
  content: "• ";
  color: var(--accent);
}

.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}

.faq summary {
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
}

.faq p {
  margin-top: 0.6rem;
  margin-bottom: 0;
}
