:root {
  --bg: #f4f7ff;
  --panel: #ffffff;
  --line: #e2e8f5;
  --text: #172033;
  --muted: #6b7791;
  --accent: #4f6ef7;
  --accent-2: #ff8fb8;
  --danger: #e5484d;
  --shadow: 0 14px 40px rgba(31, 45, 80, .08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(800px 420px at 8% -8%, #dbe4ff 0%, transparent 60%),
    radial-gradient(700px 380px at 100% 0%, #ffe1ec 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

.wrap {
  position: relative;
  z-index: 1;
  width: min(1080px, 94vw);
  margin: 0 auto;
  padding: 38px 0 60px;
}

.petals {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 80%);
  mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 80%);
}
.petals span {
  position: absolute;
  top: -30px;
  border-radius: 70% 30% 70% 30%;
  background: linear-gradient(135deg, #ffd4e3, #ff9dbc);
  opacity: .7;
  animation: petal-fall linear infinite;
}
@keyframes petal-fall {
  0% { transform: translate3d(0, -30px, 0) rotate(0deg); opacity: 0; }
  10% { opacity: .75; }
  100% { transform: translate3d(var(--drift, 40px), 110vh, 0) rotate(420deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .petals { display: none; }
}

header { margin-bottom: 22px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3d55c6;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .3px;
}
.tag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 110, 247, .15);
}
h1 {
  margin: 12px 0 8px;
  font-size: clamp(26px, 4.6vw, 38px);
  letter-spacing: .2px;
  line-height: 1.25;
}
h1 span {
  background: linear-gradient(120deg, #4f6ef7, #d65b9a 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sub {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 14.5px;
}
.sub strong { color: #334155; }

.card {
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  margin: 16px 0;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  color: #475569;
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px auto;
  gap: 10px;
}
input, select, button {
  font: inherit;
  border-radius: 11px;
  border: 1px solid var(--line);
  padding: 11px 13px;
  outline: none;
}
input, select {
  background: #f8faff;
  color: var(--text);
  min-width: 0;
}
input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 110, 247, .12);
  background: #fff;
}
button {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 700;
  cursor: pointer;
  padding: 11px 24px;
  white-space: nowrap;
}
button:hover { background: #3f5de6; }
button:disabled { opacity: .55; cursor: not-allowed; }

.hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.status-card { padding: 15px 20px; }
.status-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}
.status-row.error #status-text { color: var(--danger); }
.muted { color: var(--muted); font-size: 13px; }

.result-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.result-head h2 { margin: 0; font-size: 18px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 14px;
}
.item {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(31, 45, 80, .04);
}
.thumb {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f4fb;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
}
.thumb img, .thumb video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #0f172a;
}
.meta { padding: 10px 12px 12px; }
.name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kind { color: var(--muted); font-size: 12px; margin: 2px 0 9px; }
.actions { display: flex; gap: 12px; align-items: center; }
.download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
}
.download:hover { background: #3f5de6; }
.open {
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}
.open:hover { color: var(--accent); text-decoration: underline; }
.empty {
  grid-column: 1 / -1;
  padding: 30px 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

footer {
  margin-top: 26px;
  text-align: center;
  color: #94a3b8;
  font-size: 12.5px;
}
footer p { margin: 4px 0; }
.tiny { font-size: 11.5px; color: #a8b3c7; }

@media (max-width: 720px) {
  .wrap { padding-top: 24px; }
  .row { grid-template-columns: 1fr; }
  button { width: 100%; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
