:root {
  --pink: #FB0E76;
  --purple: #910694;
  --grad: linear-gradient(219deg, #FB0E76 0%, #910694 100%);
  --bg: #f7f7fb;
  --panel: #ffffff;
  --text: #1c1c28;
  --muted: #6b6b80;
  --border: #e6e6ee;
  --danger: #d83a4b;
  --radius: 20px;
  --space: 8px;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
}

/* Header */
.hero {
  text-align: center;
  margin-bottom: 30px;
  padding: 35px 25px;
  border-radius: 20px;
  background: var(--grad);
  box-shadow: 0 12px 30px rgba(145, 6, 148, 0.25);
}

.hero h1 {
  font-size: 2.5rem !important;
  font-weight: 700;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: white !important;
  line-height: 1.2;
}

.hero-sub {
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto;
}

/* Uploader */
.uploader {
  margin-bottom: 24px;
}

.dropzone {
     border: 2.5px dashed #d07ae8;
    border-radius: 18px;
    background: linear-gradient(135deg, #fdf0ff 0%, #fff0f8 100%);
    padding: 56px 40px;
    text-align: center;
    cursor: pointer;
    transition: border-color .3s, background .3s, box-shadow .3s;
    margin-bottom: 30px;
    position: relative;
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--pink);
  outline: none;
}

.dropzone.dragover {
  border-color: var(--pink);
  background: #fff0f7;
  transform: scale(1.005);
}

.upload-icon {
  font-size: 2.6rem;
  line-height: 1;
}

.upload-title {
  margin: 12px 0 4px;
  font-size: 1.3rem;
  font-weight: 700;
}

.dropzone-hint {
  margin: 0 0 20px;
  color: var(--muted);
}

.dropzone-error {
  margin: 14px 0 0;
  color: var(--danger);
  font-size: 0.9rem;
  min-height: 1.2em;
}

/* Buttons */
.btn {
  border: none;
  padding: 14px 28px;
  border-radius: 30px !important;
  cursor: pointer;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: var(--grad);
  transition: .3s;
  font-family: inherit;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(145, 6, 148, 0.3);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-danger {
  background: linear-gradient(135deg, #ff5a5f, #d83a4b);
}

.btn-danger:hover {
  box-shadow: 0 8px 20px rgba(216, 58, 75, 0.3);
}

/* Result */
.result {
  animation: fadeUp .4s ease;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.panel {
    background: #fff;
    border-radius: 18px;
    padding: 28px 26px;
    box-shadow: 0 4px 24px rgba(145, 6, 148, 0.08);
    border: 1px solid rgba(208, 122, 232, 0.18);
}

.panel-title {
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
}

.preview-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafc;
  border-radius: 14px;
  padding: 12px;
  min-height: 220px;
}

#previewImg {
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 10px;
}

.xml-output {
  flex: 1;
  margin: 0;
  background: #1c1c28;
  color: #d6f0ff;
  border-radius: 14px;
  padding: 16px;
  overflow: auto;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  min-height: 220px;
  max-height: 420px;
  white-space: pre;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 22px;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Tablet */
/* Tablet */
@media (max-width: 768px) {

  .app {
    padding: 0 !important;
  }

  .hero {
    padding: 28px 18px;
  }

  .hero h1 {
    font-size: 1.9rem !important;
  }

  .hero-sub {
    font-size: 0.98rem;
  }

  .dropzone {
    padding: 36px 18px;
  }

  .result-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .panel {
    padding: 20px;
  }

  .preview-wrap {
    min-height: auto;
    height: auto;
    padding: 12px;
  }

  #previewImg {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 260px;
    object-fit: contain;
  }

  .xml-output {
    min-height: 220px;
    max-height: 320px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
  }

  .actions {
    gap: 12px;
  }

}

/* Mobile */
/* Mobile */
@media (max-width: 480px) {

  .app {
    padding: 0 !important;
  }

  .hero {
    padding: 24px 14px;
    margin-bottom: 20px;
  }

  .hero h1 {
    font-size: 1.5rem !important;
    gap: 8px;
  }

  .hero-sub {
    font-size: 0.9rem;
  }

  .dropzone {
    padding: 28px 14px;
  }

  .upload-title {
    font-size: 1.1rem;
  }

  .panel {
    padding: 16px;
  }

  .panel-title {
    font-size: 1rem;
  }

  .preview-wrap {
    min-height: auto;
    height: auto;
    padding: 10px;
  }

  #previewImg {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: contain;
    border-radius: 8px;
  }

  .xml-output {
    min-height: 180px;
    max-height: 260px;
    padding: 12px;
    font-size: 0.75rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    overflow: auto;
  }

  .actions {
    flex-direction: column;
    width: 100%;
  }

  .actions .btn {
    width: 100%;
    justify-content: center;
  }

  .btn {
    padding: 12px 20px;
    font-size: 12px;
  }

}
