:root {
  --bg0: #fff5fb;
  --bg1: #f0f7ff;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.85);
  --glass-edge: rgba(255, 182, 213, 0.35);
  --text: #4a3f55;
  --muted: #8b7f96;
  --accent: #ff7eb3;
  --accent2: #8ec5ff;
  --accent3: #c9a7ff;
  --ok: #3cb98a;
  --err: #f0627a;
  --radius: 22px;
  --shadow: 0 12px 40px rgba(255, 140, 180, 0.14), 0 4px 16px rgba(140, 180, 255, 0.1);
  --shadow-soft: 0 8px 28px rgba(200, 160, 220, 0.12);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Yu Gothic UI", system-ui, sans-serif;
  --max: 720px;
}

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

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg0);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
  color: #c44d7a;
  background: rgba(255, 180, 210, 0.28);
  border: 1px solid rgba(255, 170, 200, 0.35);
  padding: 0.12em 0.4em;
  border-radius: 8px;
}

/* —— background —— */
.bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.sky {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(165deg, #fff8fd 0%, #f5f0ff 28%, #eaf6ff 62%, #fff0f6 100%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.7;
  animation: floaty 14s ease-in-out infinite;
}

.orb-a {
  width: 48vmax;
  height: 48vmax;
  top: -18vmax;
  right: -12vmax;
  background: radial-gradient(circle, #ffc2e0 0%, transparent 68%);
}

.orb-b {
  width: 42vmax;
  height: 42vmax;
  bottom: -16vmax;
  left: -14vmax;
  background: radial-gradient(circle, #b8d9ff 0%, transparent 68%);
  animation-delay: -4s;
}

.orb-c {
  width: 28vmax;
  height: 28vmax;
  top: 38%;
  left: 42%;
  background: radial-gradient(circle, #e2d0ff 0%, transparent 70%);
  opacity: 0.55;
  animation-delay: -8s;
}

.blob {
  position: absolute;
  border-radius: 40% 60% 55% 45% / 50% 40% 60% 50%;
  opacity: 0.35;
  filter: blur(2px);
  animation: morph 12s ease-in-out infinite;
}

.b1 {
  width: 180px;
  height: 180px;
  top: 12%;
  left: 8%;
  background: linear-gradient(135deg, #ffd6ea, #ffe8f4);
}

.b2 {
  width: 140px;
  height: 140px;
  bottom: 18%;
  right: 10%;
  background: linear-gradient(135deg, #d6ebff, #eef6ff);
  animation-delay: -3s;
}

.b3 {
  width: 100px;
  height: 100px;
  top: 55%;
  left: 70%;
  background: linear-gradient(135deg, #e8d9ff, #f6f0ff);
  animation-delay: -6s;
}

.sparkles span {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.9);
  opacity: 0.85;
  animation: twinkle 3.2s ease-in-out infinite;
}

.sparkles span:nth-child(1) { top: 12%; left: 18%; animation-delay: 0s; }
.sparkles span:nth-child(2) { top: 22%; right: 16%; animation-delay: 0.6s; width: 4px; height: 4px; }
.sparkles span:nth-child(3) { top: 48%; left: 10%; animation-delay: 1.1s; }
.sparkles span:nth-child(4) { bottom: 28%; right: 20%; animation-delay: 1.5s; width: 5px; height: 5px; }
.sparkles span:nth-child(5) { bottom: 18%; left: 24%; animation-delay: 0.3s; }
.sparkles span:nth-child(6) { top: 68%; right: 12%; animation-delay: 2s; width: 4px; height: 4px; }
.sparkles span:nth-child(7) { top: 35%; left: 48%; animation-delay: 1.8s; }
.sparkles span:nth-child(8) { bottom: 40%; left: 55%; animation-delay: 0.9s; width: 3px; height: 3px; }

@keyframes floaty {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-2%, 3%) scale(1.05); }
}

@keyframes morph {
  0%, 100% { border-radius: 40% 60% 55% 45% / 50% 40% 60% 50%; transform: rotate(0deg); }
  50% { border-radius: 55% 45% 40% 60% / 45% 55% 45% 55%; transform: rotate(8deg); }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.7); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* —— layout —— */
.shell {
  position: relative;
  z-index: 1;
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  padding: 1.75rem 0 2.75rem;
}

/* —— glass —— */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  position: relative;
}

.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.65) 0%,
    rgba(255, 255, 255, 0.12) 40%,
    rgba(255, 255, 255, 0) 70%
  );
  opacity: 0.9;
}

.card,
.hero {
  padding: 1.15rem 1.2rem;
  margin-bottom: 0.95rem;
}

.card > *,
.hero > * {
  position: relative;
  z-index: 1;
}

/* —— hero —— */
.hero {
  text-align: center;
  padding: 1.4rem 1.25rem 1.35rem;
  background: var(--glass-strong);
  border-color: rgba(255, 200, 220, 0.55);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #e85a94;
  background: linear-gradient(135deg, rgba(255, 210, 230, 0.7), rgba(220, 235, 255, 0.65));
  border: 1px solid rgba(255, 180, 210, 0.55);
  border-radius: 999px;
  padding: 0.32rem 0.8rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 4px 14px rgba(255, 150, 190, 0.15);
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.55rem, 5vw, 2.15rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.28;
  background: linear-gradient(120deg, #ff6fa8 0%, #c48dff 48%, #6eb6ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(255, 255, 255, 0.6));
}

.br-m {
  display: none;
}

.sub {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.96rem;
  font-weight: 500;
}

/* —— cards —— */
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.card-head h2,
.tips-card > h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #5a4a66;
}

.tips-card > h2 {
  margin-bottom: 0.75rem;
}

.deco {
  color: var(--accent);
  margin-right: 0.2rem;
  font-weight: 400;
}

.tips {
  margin: 0;
  padding: 0 0 0 1.15rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.58;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tips li strong {
  color: #d45088;
  font-weight: 700;
}

.tips code {
  font-size: 0.8em;
  word-break: break-all;
}

/* —— dropzone —— */
.dropzone {
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.18s, box-shadow 0.2s;
  border-style: dashed;
  border-width: 2px;
  border-color: rgba(255, 150, 190, 0.55);
  background: rgba(255, 255, 255, 0.42);
  user-select: none;
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: #ff8fbc;
  background: rgba(255, 240, 248, 0.65);
  box-shadow: 0 14px 36px rgba(255, 140, 190, 0.2);
  outline: none;
  transform: translateY(-1px);
}

.dropzone.dragover {
  border-color: #8ec5ff;
  background: rgba(230, 244, 255, 0.75);
  transform: scale(1.015);
  box-shadow: 0 16px 40px rgba(140, 190, 255, 0.25);
}

.drop-inner {
  text-align: center;
  padding: 1.4rem 0.5rem;
}

.drop-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ff7eb3;
  background: linear-gradient(145deg, rgba(255, 220, 235, 0.9), rgba(220, 235, 255, 0.75));
  border: 1px solid rgba(255, 190, 215, 0.6);
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(255, 150, 190, 0.18);
}

.drop-title {
  margin: 0 0 0.3rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: #5a4a66;
}

.drop-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

/* —— files —— */
.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.file-list .empty {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.45rem 0;
  text-align: center;
}

.file-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.58rem 0.75rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 200, 220, 0.4);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.file-item .tag {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.28rem 0.48rem;
  border-radius: 999px;
}

.tag.man {
  color: #2f7ec4;
  background: rgba(160, 210, 255, 0.45);
  border: 1px solid rgba(140, 195, 255, 0.5);
}

.tag.bin {
  color: #9b4fd0;
  background: rgba(220, 190, 255, 0.45);
  border: 1px solid rgba(200, 170, 255, 0.5);
}

.tag.bad {
  color: #d43d5c;
  background: rgba(255, 180, 190, 0.45);
  border: 1px solid rgba(255, 160, 175, 0.5);
}

.file-item .name {
  font-family: var(--mono);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #5a4a66;
}

.file-item .size {
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.file-meta {
  margin-top: 0.7rem;
  font-size: 0.86rem;
  color: var(--muted);
  font-weight: 500;
  text-align: center;
}

.file-meta.ok { color: var(--ok); }
.file-meta.err { color: var(--err); }

/* —— controls / buttons —— */
.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem 1.15rem;
  background: var(--glass-strong);
}

.btn {
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0.72rem 1.15rem;
  transition: transform 0.14s, opacity 0.15s, box-shadow 0.18s, filter 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  filter: grayscale(0.15);
}

.btn:not(:disabled):active {
  transform: scale(0.97);
}

.btn.primary {
  min-height: 44px;
  min-width: 8.8rem;
  padding: 0.7rem 1.5rem;
  color: #fff;
  background: linear-gradient(135deg, #ff8fbc 0%, #c9a0ff 55%, #8ec5ff 100%);
  box-shadow:
    0 8px 22px rgba(255, 130, 180, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
  letter-spacing: 0.04em;
}

.btn.primary:not(:disabled):hover {
  filter: brightness(1.05);
  box-shadow:
    0 10px 28px rgba(255, 130, 180, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}

.btn.secondary {
  color: #5a6fd0;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(160, 190, 255, 0.55);
  box-shadow: 0 4px 14px rgba(140, 180, 255, 0.15);
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
}

.btn.secondary:hover {
  background: rgba(230, 240, 255, 0.9);
}

.btn.ghost {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 200, 220, 0.35);
  padding: 0.32rem 0.7rem;
  font-size: 0.82rem;
}

.btn.ghost:not(:disabled):hover {
  color: #d45088;
  background: rgba(255, 230, 240, 0.75);
}

.btn.dl {
  width: 100%;
  color: #5a4a66;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 200, 220, 0.45);
  font-size: 0.88rem;
  justify-content: space-between;
  text-align: left;
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn.dl:hover {
  background: linear-gradient(135deg, rgba(255, 235, 245, 0.95), rgba(230, 242, 255, 0.9));
  border-color: rgba(255, 160, 200, 0.55);
  transform: translateY(-1px);
}

.spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.result-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.result-note {
  margin: 0.85rem 0 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.5;
  text-align: center;
}

.foot {
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
  padding: 0.6rem 0.25rem;
  opacity: 0.95;
  font-weight: 500;
}

.foot p {
  margin: 0.2rem 0;
}

.foot .author {
  font-size: 0.86rem;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.foot .author a {
  color: #e85a94;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(232, 90, 148, 0.35);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.foot .author a:hover {
  color: #ff6fa8;
  border-bottom-color: rgba(255, 111, 168, 0.7);
}

@media (max-width: 520px) {
  .shell {
    width: min(100% - 1.15rem, var(--max));
    padding: 1.15rem 0 2rem;
  }

  .card,
  .hero {
    padding: 1rem;
    border-radius: 18px;
  }

  .br-m {
    display: inline;
  }

  .file-item {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }

  .file-item .size {
    grid-column: 2;
  }

  .controls {
    padding: 0.85rem 1rem;
  }

  .btn.primary {
    width: auto;
    max-width: 100%;
    min-height: 42px;
    min-width: 7.8rem;
    padding: 0.6rem 1.25rem;
    font-size: 0.95rem;
  }

  .blob {
    opacity: 0.22;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
