:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  background: #08070d;
  color: #f8f7ff;
  --bg: #08070d;
  --panel: rgba(24, 24, 31, 0.86);
  --panel-strong: rgba(29, 29, 38, 0.94);
  --line: rgba(255, 255, 255, 0.11);
  --muted: #9298a8;
  --purple: #a855f7;
  --purple-strong: #7c3aed;
  --green: #10b981;
  --red: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 18% 12%, rgba(124, 58, 237, 0.19), transparent 30%),
    radial-gradient(circle at 82% 82%, rgba(14, 165, 233, 0.13), transparent 32%),
    linear-gradient(180deg, #090811 0%, #07070b 100%);
  overflow-x: hidden;
}

svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

button {
  font: inherit;
}

button,
[role="button"],
.drop-card,
.version-btn,
.btn-outline,
.btn-convert,
.btn-clear {
  cursor: default;
}

button *,
[role="button"] *,
.drop-card *,
.version-btn *,
.btn-outline *,
.btn-convert *,
.btn-clear * {
  cursor: inherit;
}

.bg-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-particles span {
  position: absolute;
  bottom: -20px;
  border-radius: 50%;
  background: var(--purple);
  animation: float-up linear infinite;
}

@keyframes float-up {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-110vh);
  }
}

.app {
  position: relative;
  width: min(1120px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 28px 0 32px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(760px, 100%);
  margin: 0 auto 66px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #b65cff, #6d28d9);
  box-shadow: 0 0 28px rgba(168, 85, 247, 0.4);
  font-weight: 900;
}

.logo-text {
  color: #b884ff;
  font-size: 18px;
  font-weight: 800;
}

.logo-text span {
  color: inherit;
}

.local-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #b8bfce;
}

.local-badge {
  padding: 8px 13px;
  font-size: 13px;
}

.local-badge span {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: #34d399;
}

.local-badge span svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.4;
}

.hero {
  max-width: 760px;
  margin: 0 auto 38px;
  text-align: center;
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(30px, 4.8vw, 48px);
  line-height: 1.12;
  letter-spacing: 0;
}

.hero h1 span {
  color: #b66dff;
}

.hero p {
  max-width: 680px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.workbench {
  width: min(760px, 100%);
  margin: 0 auto;
}

.drop-card,
.file-info-card,
.version-card,
.result-area,
.info-item {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(14px);
}

.drop-card {
  display: flex;
  min-height: 230px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 36px 32px;
  text-align: center;
  cursor: default;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.drop-card:hover,
.drop-card.drag-over {
  border-color: rgba(155, 89, 240, 0.58);
  background: rgba(155, 89, 240, 0.06);
  box-shadow: 0 0 36px rgba(155, 89, 240, 0.24), 0 20px 70px rgba(0, 0, 0, 0.24);
}

.drop-card.drag-over {
  transform: scale(1.01);
}

.drop-card.loaded {
  border-color: rgba(16, 185, 129, 0.36);
}

.drop-icon {
  display: grid;
  width: 80px;
  height: 80px;
  place-items: center;
  margin: 0 auto 4px;
  border: 1px solid rgba(155, 89, 240, 0.2);
  border-radius: 20px;
  background: rgba(155, 89, 240, 0.12);
  color: #b66dff;
  font-size: 52px;
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.drop-card:hover .drop-icon,
.drop-card.drag-over .drop-icon {
  background: rgba(155, 89, 240, 0.2);
  box-shadow: 0 8px 24px rgba(155, 89, 240, 0.3);
  transform: translateY(-3px);
}

.loaded .drop-icon {
  color: var(--green);
}

.drop-card h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0;
}

.drop-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.btn-outline,
.btn-convert,
.btn-clear {
  border: 0;
  border-radius: 10px;
  cursor: default;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  margin-top: 4px;
  padding: 0 18px;
  border: 1px solid rgba(155, 89, 240, 0.3);
  background: rgba(155, 89, 240, 0.15);
  color: #c083ff;
  font-size: 14px;
  font-weight: 700;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.btn-outline:hover {
  border-color: rgba(155, 89, 240, 0.5);
  background: rgba(155, 89, 240, 0.25);
  transform: translateY(-1px);
}

.file-info-card {
  margin-top: 18px;
  padding: 18px 20px;
}

.hidden {
  display: none !important;
}

.file-info-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.file-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 12px;
  background: rgba(168, 85, 247, 0.16);
  color: #b66dff;
  font-size: 26px;
}

.file-name {
  overflow: hidden;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size,
.file-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.file-subline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
}

.file-size {
  margin-top: 0;
}

.btn-clear {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  line-height: 1;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.btn-clear svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.4;
}

.btn-clear:hover {
  border-color: rgba(168, 85, 247, 0.45);
  background: rgba(168, 85, 247, 0.14);
  color: #d8b4fe;
}

.detected-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
  font-size: 12px;
  line-height: 1;
}

.version-card {
  margin-top: 18px;
  padding: 18px;
}

.section-title {
  display: flex;
  align-items: center;
  margin: 0 0 12px;
  color: #b8bfce;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.version-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  min-height: 50px;
}

.version-btn {
  position: relative;
  min-height: 50px;
  overflow: hidden;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  color: #fff;
  text-align: left;
  cursor: default;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.version-btn::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(155, 89, 240, 0.1), transparent);
  content: "";
  opacity: 0;
  transition: opacity 160ms ease;
}

.version-btn:hover::before,
.version-btn.selected::before {
  opacity: 1;
}

.version-btn:hover {
  border-color: rgba(155, 89, 240, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

.version-btn.selected {
  border-color: #a855f7;
  background: rgba(155, 89, 240, 0.1);
  box-shadow: 0 0 20px rgba(155, 89, 240, 0.2);
}

.version-btn.disabled-version {
  cursor: default;
  opacity: 0.3;
  pointer-events: none;
}

.version-btn.disabled-version:hover {
  transform: none;
}

.v-name {
  position: relative;
  display: block;
  margin-bottom: 3px;
  font-size: 14px;
  font-weight: 800;
}

.v-code {
  position: relative;
  display: block;
  color: #7f8798;
  font-family: Consolas, "JetBrains Mono", monospace;
  font-size: 12px;
}

.v-badge {
  position: absolute;
  top: 12px;
  right: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.v-badge:empty {
  display: none;
}

.v-badge.ok {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
}

.v-badge.same {
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}

.v-badge.newer {
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
}

.convert-area {
  margin: 24px auto 0;
  text-align: center;
}

.btn-convert {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(420px, 100%);
  min-height: 58px;
  background: linear-gradient(135deg, #7c3aed, #5b2aa0);
  color: #fff;
  font-weight: 850;
  cursor: default;
  box-shadow: 0 18px 36px rgba(124, 58, 237, 0.25);
}

.btn-convert:disabled {
  cursor: default;
  opacity: 0.45;
}

.btn-convert:disabled * {
  cursor: default;
}

.btn-convert.loading svg {
  animation: spin 900ms linear infinite;
}

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

.convert-area p {
  color: var(--muted);
  font-size: 14px;
}

.result-area {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 20px;
  padding: 20px;
  border-color: rgba(16, 185, 129, 0.28);
  background: rgba(16, 185, 129, 0.08);
}

.result-area.error {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
}

.result-icon {
  display: grid;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 15px;
  background: rgba(16, 185, 129, 0.13);
  color: var(--green);
  font-size: 34px;
}

.error .result-icon {
  background: rgba(239, 68, 68, 0.13);
  color: var(--red);
}

.result-area strong {
  display: block;
  margin-bottom: 6px;
}

.result-area p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: min(760px, 100%);
  margin: 44px auto 0;
}

.info-item {
  display: flex;
  gap: 14px;
  padding: 20px;
  border-radius: 14px;
}

.info-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  font-size: 22px;
}

.info-icon.purple {
  background: rgba(124, 58, 237, 0.22);
  color: #a78bfa;
}

.info-icon.blue {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
}

.info-icon.green {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
}

.info-item h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.info-item p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.footer {
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #777f91;
  text-align: center;
  font-size: 13px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  padding: 11px 16px;
  border-radius: 12px;
  background: rgba(24, 24, 31, 0.95);
  color: #fff;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
  transition: 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  background: rgba(185, 28, 28, 0.95);
}

@media (max-width: 760px) {
  .app {
    width: min(100% - 24px, 560px);
    padding-top: 18px;
  }

  .header,
  .detected-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    margin-bottom: 26px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .hero p {
    font-size: 15px;
  }

  .drop-card {
    min-height: 240px;
    padding: 24px;
  }

  .version-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }
}
