:root {
  --bg: #0b1020;
  --bg-soft: #121a30;
  --card: #16203b;
  --card-2: #1c2848;
  --border: #2a375c;
  --text: #e8edf7;
  --muted: #93a1c2;
  --brand: #5b8cff;
  --brand-2: #7a5cff;
  --ok: #2ecc71;
  --err: #ff6b6b;
  --radius: 16px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(122, 92, 255, 0.25), transparent 60%),
    radial-gradient(1000px 500px at -10% 0%, rgba(91, 140, 255, 0.22), transparent 55%),
    var(--bg);
  min-height: 100vh;
  line-height: 1.5;
}

/* ---------- hero ---------- */
.hero {
  text-align: center;
  padding: 56px 20px 20px;
}
.logo {
  font-size: 34px;
  margin: 0 0 8px;
  letter-spacing: 0.5px;
}
.logo-mark {
  display: inline-block;
  transform: translateY(1px);
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 900;
}
.tagline {
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto;
  font-size: 16px;
}

/* ---------- layout ---------- */
.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 20px 60px;
}

/* ---------- dropzone ---------- */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card), var(--bg-soft));
  padding: 54px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.05s;
  outline: none;
}
.dropzone:hover,
.dropzone:focus-visible { border-color: var(--brand); }
.dropzone.drag {
  border-color: var(--brand);
  background: linear-gradient(180deg, var(--card-2), var(--card));
  transform: scale(1.005);
}
.dz-icon { font-size: 46px; }
.dz-title { font-size: 20px; font-weight: 600; margin: 10px 0 2px; }
.dz-sub { margin: 0; color: var(--muted); }
.dz-link { color: var(--brand); text-decoration: underline; }
.dz-note { margin: 12px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- stats dashboard ---------- */
.stats {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 14px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.3px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  min-height: 26px;
}
.stat-label {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* ---------- upload list ---------- */
.list { margin-top: 18px; display: grid; gap: 12px; }

.item {
  display: flex;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  animation: rise 0.25s ease;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.item-icon {
  font-size: 26px;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  background: var(--card-2);
  border-radius: 10px;
  flex: none;
}
.item-body { flex: 1; min-width: 0; }
.item-top { display: flex; justify-content: space-between; gap: 12px; }
.item-name {
  font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.item-size { color: var(--muted); font-size: 13px; flex: none; }

.progress {
  height: 8px;
  background: var(--bg-soft);
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0 6px;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width 0.15s ease;
}
.item.done .progress-bar { background: var(--ok); }
.item.error .progress-bar { background: var(--err); }

.item-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.item-stats .stat-pct { color: var(--text); font-weight: 600; }
.item-stats .stat-dot { opacity: 0.5; }
.item.done .item-stats { color: var(--ok); }
.item.done .item-stats .stat-pct { color: var(--ok); }

.item-status { font-size: 13px; color: var(--muted); margin-top: 4px; }
.item.done .item-status { color: var(--ok); }
.item.error .item-status { color: var(--err); }

.item-share {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}

/* ---------- inputs & buttons ---------- */
.share-input {
  flex: 1;
  min-width: 0;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--text);
  text-decoration: none;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--brand); }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 8px 12px; font-size: 13px; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent;
  font-weight: 600;
}
.btn-primary.ok { background: var(--ok); }
.btn-ghost { background: transparent; }

/* ---------- recent ---------- */
.recent { margin-top: 34px; }
.recent-title { font-size: 15px; color: var(--muted); margin: 0 0 12px; font-weight: 600; }
.recent-list { display: grid; gap: 8px; }
.recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s;
}
.recent-item:hover { border-color: var(--brand); }
.recent-item .ri-icon { font-size: 20px; }
.recent-item .ri-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-item .ri-size { color: var(--muted); font-size: 13px; }

/* ---------- footer ---------- */
.foot {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 24px 20px 40px;
}

/* ---------- share page ---------- */
.share-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
}
.share-card {
  width: 100%;
  max-width: 760px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.brand {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 18px;
}
.brand:hover { color: var(--brand); }
.file-head { display: flex; gap: 16px; align-items: center; }
.file-icon {
  font-size: 30px;
  width: 56px; height: 56px;
  display: grid; place-items: center;
  background: var(--card-2);
  border-radius: 14px;
  flex: none;
}
.file-titles { min-width: 0; }
.file-name {
  font-size: 20px;
  margin: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-meta { margin: 4px 0 0; color: var(--text); font-size: 14px; }
.file-sub { margin: 2px 0 0; color: var(--muted); font-size: 12px; }

.preview {
  margin: 20px 0;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  display: flex;
  justify-content: center;
}
.media { width: 100%; max-height: 70vh; display: block; }
.media.audio { background: var(--bg-soft); padding: 20px; max-height: none; }
.media.doc { height: 70vh; border: 0; background: #fff; }
img.media { object-fit: contain; }
.no-preview {
  background: var(--bg-soft);
  color: var(--muted);
  padding: 40px 20px;
  text-align: center;
  width: 100%;
}
.no-preview p { margin: 4px 0; }

.share-row { display: flex; gap: 8px; margin-bottom: 14px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 520px) {
  .hero { padding-top: 36px; }
  .item-share { flex-wrap: wrap; }
  .share-input { flex-basis: 100%; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat-value { font-size: 19px; }
}
