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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #ffffff;
  color: #1a1a1a;
  min-height: 100vh;
}

/* Header */
.site-header {
  background: linear-gradient(90deg, #f5f7f6 0%, #f8f8f5 50%, #f6f7f4 100%);
  border-bottom: 1px solid #ececec;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.15rem;
  font-weight: 700;
  color: #222;
  text-decoration: none;
  letter-spacing: -0.3px;
}

.lang-switch {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  font-size: 0.75rem;
  max-width: 520px;
}

.lang-switch a {
  color: #666;
  text-decoration: none;
  transition: color 0.2s;
}

.lang-switch a:hover {
  color: #222;
}

.lang-switch a[aria-current="page"] {
  color: #222;
  font-weight: 700;
}

.lang-sep {
  color: #ccc;
}

@media (max-width: 600px) {
  .header-inner {
    padding: 16px 20px;
  }
}

/* Main */
.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 16px 60px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.5px;
  color: #1a1a1a;
}

.subtitle {
  text-align: center;
  color: #777;
  font-size: 0.95rem;
}

/* Upload */
.upload-area {
  display: block;
  border: 2px dashed #d0d0d0;
  border-radius: 16px;
  padding: 60px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: #fafafa;
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.04);
}

.upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #888;
}

.upload-content svg {
  color: #aaa;
}

.upload-content p {
  font-size: 1rem;
  color: #444;
}

.upload-content span {
  font-size: 0.8rem;
  color: #999;
}

/* Controls */
.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f5f5f5;
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid #ececec;
}

.controls label {
  font-size: 0.9rem;
  color: #555;
  white-space: nowrap;
}

.controls input[type="range"] {
  flex: 1;
  accent-color: #6366f1;
  cursor: pointer;
}

.controls span {
  font-size: 0.85rem;
  color: #6366f1;
  min-width: 36px;
  text-align: right;
  font-weight: 600;
}

/* Status */
.status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  background: #f5f5f5;
  border-radius: 12px;
  border: 1px solid #ececec;
  color: #555;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #ddd;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Preview */
.preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.preview-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preview-item p {
  font-size: 0.85rem;
  color: #888;
  text-align: center;
}

.preview-item img,
.preview-item canvas {
  width: 100%;
  border-radius: 12px;
  display: block;
  background: #f0f0f0;
  border: 1px solid #ececec;
}

/* Actions */
.actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

button {
  padding: 12px 28px;
  border-radius: 10px;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
  background: #6366f1;
  color: #fff;
}

button:hover {
  opacity: 0.85;
}

button.secondary {
  background: #fff;
  color: #555;
  border: 1px solid #ddd;
}

#bootError {
  border-color: #fca5a5 !important;
  color: #dc2626 !important;
  background: #fef2f2 !important;
}

/* SEO sections */
.info-section,
.faq-section {
  margin-top: 16px;
  padding-top: 32px;
  border-top: 1px solid #ececec;
}

.info-section h2,
.faq-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 12px;
  text-align: left;
}

.info-lead {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.feature-list li {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.5;
  padding-left: 20px;
  position: relative;
}

.feature-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #6366f1;
  font-weight: 700;
}

.feature-list strong {
  color: #333;
}

.keyword-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-tags span {
  font-size: 0.78rem;
  color: #666;
  background: #f5f5f5;
  border: 1px solid #e8e8e8;
  padding: 5px 12px;
  border-radius: 20px;
}

.faq-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-section details {
  background: #fafafa;
  border: 1px solid #ececec;
  border-radius: 10px;
  overflow: hidden;
}

.faq-section summary {
  padding: 14px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  list-style: none;
}

.faq-section summary::-webkit-details-marker {
  display: none;
}

.faq-section details[open] summary {
  border-bottom: 1px solid #ececec;
}

.faq-section p {
  padding: 14px 16px;
  font-size: 0.88rem;
  color: #666;
  line-height: 1.6;
}

/* Extension promo */
.extension-promo {
  background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 40%, #f5f7f0 100%);
  border-top: 1px solid #dce8dc;
  padding: 56px 16px 64px;
}

.extension-promo-inner {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.extension-promo h2 {
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.35;
  letter-spacing: -0.3px;
}

.promo-desc {
  font-size: 0.95rem;
  color: #444;
  line-height: 1.65;
  max-width: 680px;
}

.promo-desc strong {
  color: #1a1a1a;
}

.promo-features {
  font-size: 0.82rem;
  color: #666;
}

.promo-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 8px;
}

.promo-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  background: #4caf50;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.2s, transform 0.15s;
}

.promo-btn:hover {
  background: #43a047;
  transform: translateY(-1px);
}

.promo-btn img {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: block;
}

.promo-more {
  font-size: 0.82rem;
  color: #777;
  margin-top: 8px;
}

.promo-more a {
  color: #388e3c;
  font-weight: 600;
  text-decoration: none;
}

.promo-more a:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .extension-promo {
    padding: 40px 16px 48px;
  }

  .promo-btn {
    width: 100%;
    justify-content: center;
    font-size: 0.72rem;
    padding: 13px 16px;
  }
}
