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

[hidden] {
  display: none !important;
}

:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --border: #d1d1d6;
  --text: #1d1d1f;
  --text-sub: #6e6e73;
  --accent: #E8185C;
  --accent-hover: #D4155A;
  --accent-active: #BE1250;
  --accent-light: #fff0f5;
  --danger: #ff3b30;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
}

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

/* Site Header */
.site-header {
  background: #ffffff;
  border-bottom: 3px solid var(--accent);
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
}

.site-header-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}

.site-header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-header-nav-link {
  font-size: 0.85rem;
  color: var(--text-sub);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.site-header-nav-link:hover {
  background: var(--bg);
  color: var(--text);
}

.site-header-icon {
  display: block;
}

.site-header-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
  white-space: nowrap;
}

.site-header-tagline {
  font-size: 0.78rem;
  color: var(--text-sub);
  text-align: right;
}

/* Site Footer */
.site-footer {
  background: #ffffff;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.site-footer-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.site-footer-privacy {
  font-size: 0.78rem;
  color: var(--text-sub);
}

.site-footer-links {
  display: flex;
  gap: 20px;
}

.site-footer-links a {
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer-links a:hover {
  color: var(--accent-hover);
}

.site-footer-copy {
  font-size: 0.75rem;
  color: var(--text-sub);
}

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 36px 20px 48px;
  flex: 1;
}

/* How to */
.how-to {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
}

.how-to-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.how-to-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #7C3AED;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.how-to-step p {
  font-size: 0.8rem;
  color: var(--text-sub);
  line-height: 1.4;
}

.how-to-arrow {
  color: var(--border);
  font-size: 1rem;
  text-align: center;
}

/* Card */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 20px;
}

.card h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 18px;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.78rem;
}

/* Upload area */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-sub);
  padding: 32px;
  text-align: center;
}

.upload-placeholder svg {
  color: #b0b0b8;
}

.upload-placeholder p {
  font-size: 0.95rem;
  font-weight: 500;
}

.hint {
  font-size: 0.78rem;
}

/* Preview */
.upload-preview {
  width: 100%;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.preview-thumb-wrap {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
}

.preview-thumb-placeholder {
  width: 96px;
  height: 96px;
  border-radius: 18px;
  border: 1.5px dashed var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b0b0b8;
}

.upload-preview img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  border: 1px solid var(--border);
  display: block;
}

.preview-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.preview-filename {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-meta {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  margin: 0;
  overflow: hidden;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--text-sub);
  white-space: nowrap;
}

.meta-item svg {
  flex-shrink: 0;
  color: #b0b0b8;
}

/* Sizes info */
.sizes-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.size-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.82rem;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sizes-note {
  font-size: 0.8rem;
  color: var(--text-sub);
}

/* Filename input */
.filename-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}

.filename-wrap:focus-within {
  border-color: var(--accent);
}

.filename-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 11px 14px;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  font-family: inherit;
}

.filename-ext {
  padding: 11px 14px 11px 0;
  font-size: 0.95rem;
  color: var(--text-sub);
  background: var(--surface);
  user-select: none;
}

/* Button */
.btn-primary {
  display: block;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #E8185C, #FF6B9D);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.18s, transform 0.1s;
}

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

.btn-primary:active:not(:disabled) {
  opacity: 0.8;
  transform: scale(0.99);
}

.btn-primary:disabled {
  background: #b0b0b8;
  cursor: not-allowed;
}

/* Progress */
.progress-wrap {
  margin-top: 16px;
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.3s ease;
}

.progress-label {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-sub);
  text-align: center;
}

/* Error */
.error-msg {
  margin-top: 12px;
  color: var(--danger);
  font-size: 0.88rem;
}

/* Responsive */
@media (max-width: 480px) {
  .container {
    padding: 24px 16px 40px;
  }

  .site-header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .site-header-tagline {
    text-align: left;
  }

  .upload-preview {
    flex-direction: column;
    text-align: center;
  }
}
