:root {
  --bg0: #f5f5f7;
  --bg1: #ffffff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.08);
  --blue: #0071e3;
  --blue-press: #0077ed;
  --danger: #ff3b30;
  --ok: #34c759;
  --glass: rgba(255, 255, 255, 0.72);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.08);
  --radius: 22px;
  --font: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #dbeafe 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #fce7f3 0%, transparent 50%),
    linear-gradient(180deg, #fbfbfd 0%, var(--bg0) 40%, #eef0f4 100%);
  letter-spacing: -0.01em;
}

.bg-orb {
  position: fixed;
  width: 42vw;
  height: 42vw;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  animation: float 14s ease-in-out infinite;
}
.orb-a { left: -8%; top: 10%; background: #93c5fd; }
.orb-b { right: -10%; top: 35%; background: #f9a8d4; animation-delay: -4s; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(28px); }
}

.topbar, .shell, .foot { position: relative; z-index: 1; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 22px 8px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: linear-gradient(145deg, #111 0%, #555 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
}
.brand-text {
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 22px 80px;
}

.hero {
  text-align: center;
  padding: 36px 0 28px;
  animation: rise 0.7s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.hero-title {
  margin: 0;
  font-size: clamp(40px, 7vw, 64px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.05;
}
.hero-sub {
  margin: 12px auto 0;
  max-width: 520px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.45;
}

.searchbar {
  margin: 28px auto 0;
  max-width: 560px;
  position: relative;
}
.search-wrap {
  display: flex;
  gap: 10px;
  padding: 8px;
  border-radius: 18px;
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: relative;
}
.search-input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 16px;
  padding: 12px 14px;
  color: var(--ink);
}
.suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(22px);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  text-align: left;
  animation: rise 0.18s ease both;
}
.suggest-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  padding: 12px 14px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
}
.suggest-item:hover,
.suggest-item.active {
  background: rgba(0, 113, 227, 0.08);
}
.suggest-thumb {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  background: #eee;
  flex: 0 0 auto;
}
.suggest-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #1d1d1f;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.suggest-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.suggest-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.suggest-meta {
  color: var(--muted);
  font-size: 12px;
}
.btn {
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  border-radius: 980px;
  padding: 12px 18px;
  transition: transform .15s ease, background .15s ease, opacity .15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-press); }
.btn.ghost { background: rgba(0,0,0,0.06); color: var(--ink); }
.btn.danger { background: rgba(255,59,48,0.12); color: var(--danger); }
.btn.wide { width: 100%; }
.btn.tiny { padding: 8px 12px; font-size: 13px; }
.pill {
  text-decoration: none;
  color: var(--ink);
  background: rgba(0,0,0,0.05);
  padding: 8px 14px;
  border-radius: 980px;
  font-size: 14px;
  font-weight: 500;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 22px;
}
.chip {
  text-decoration: none;
  color: var(--muted);
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 980px;
  font-size: 14px;
  font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.chip.active, .chip:hover {
  background: #111;
  color: #fff;
  border-color: #111;
}
.meta-line {
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
  margin-top: 28px;
}
.card {
  text-decoration: none;
  color: inherit;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.04);
  transition: transform .2s ease, box-shadow .2s ease;
  animation: rise .6s ease both;
}
.card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 18px 40px rgba(0,0,0,0.1);
}
.thumb {
  aspect-ratio: 4/3;
  background: linear-gradient(160deg, #f2f2f7, #e5e5ea);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.icon-badge {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  background: #1d1d1f;
  padding: 10px 14px;
  border-radius: 12px;
}
.icon-badge.video { background: #5856d6; }
.icon-badge.zip { background: #ff9500; }
.icon-badge.app { background: #34c759; }
.icon-badge.large { font-size: 18px; padding: 18px 22px; }
.card-body { padding: 14px 16px 16px; }
.card-name {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-meta { margin-top: 4px; color: var(--muted); font-size: 13px; }

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  background: rgba(255,255,255,0.55);
  border-radius: var(--radius);
  border: 1px dashed var(--line);
}

.detail { animation: rise .55s ease both; }
.back {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
}
.detail-panel {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 22px;
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.preview-pane {
  position: relative;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(147, 197, 253, 0.45), transparent 55%),
    radial-gradient(100% 80% at 100% 100%, rgba(249, 168, 212, 0.35), transparent 50%),
    linear-gradient(160deg, #f7f8fb 0%, #eef1f6 100%);
  border-radius: 20px;
  min-height: 320px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.65);
}
.preview-pane.kind-archives {
  background:
    radial-gradient(120% 90% at 10% 0%, rgba(255, 179, 71, 0.35), transparent 55%),
    radial-gradient(90% 80% at 100% 100%, rgba(255, 214, 165, 0.4), transparent 50%),
    linear-gradient(160deg, #fff8f0 0%, #f3eee8 100%);
}
.preview-pane.kind-apps {
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(52, 199, 89, 0.28), transparent 55%),
    radial-gradient(90% 80% at 100% 100%, rgba(48, 209, 228, 0.22), transparent 50%),
    linear-gradient(160deg, #f3fff6 0%, #eaf3f0 100%);
}
.preview-img, .preview-video {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  display: block;
}
.preview-fallback {
  position: relative;
  width: 100%;
  min-height: 320px;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 18px;
  align-items: center;
  padding: 28px 32px;
  z-index: 1;
}
.preview-glow {
  position: absolute;
  inset: auto auto -20% -10%;
  width: 55%;
  height: 70%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}
.file-visual {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
}
.file-sheet {
  position: relative;
  width: 132px;
  height: 168px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f4f6 100%);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.12),
    0 2px 0 rgba(255, 255, 255, 0.8) inset,
    0 0 0 1px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transform: rotate(-4deg);
  animation: floatDoc 5.5s ease-in-out infinite;
}
@keyframes floatDoc {
  0%, 100% { transform: rotate(-4deg) translateY(0); }
  50% { transform: rotate(-2deg) translateY(-8px); }
}
.file-fold {
  position: absolute;
  top: 0;
  right: 0;
  width: 34px;
  height: 34px;
  background:
    linear-gradient(135deg, transparent 50%, rgba(0, 0, 0, 0.06) 50%),
    linear-gradient(135deg, transparent 50%, #e8e8ed 50%);
  border-bottom-left-radius: 8px;
  box-shadow: -2px 2px 6px rgba(0, 0, 0, 0.05);
}
.file-ext {
  position: absolute;
  left: 16px;
  top: 42px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #1d1d1f;
}
.kind-archives .file-ext { color: #c45d00; }
.kind-apps .file-ext { color: #1a7f37; }
.file-lines {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 28px;
  display: grid;
  gap: 8px;
}
.file-lines span {
  display: block;
  height: 7px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.08);
}
.file-lines span:nth-child(1) { width: 88%; }
.file-lines span:nth-child(2) { width: 70%; }
.file-lines span:nth-child(3) { width: 52%; }
.preview-copy {
  position: relative;
  z-index: 1;
  text-align: left;
  min-width: 0;
}
.preview-kicker {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.preview-filename {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: var(--ink);
  word-break: break-word;
}
.preview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.preview-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 980px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  backdrop-filter: blur(10px);
}
.preview-chip.muted {
  color: var(--muted);
  font-weight: 500;
}
.info-pane h1 {
  margin: 0 0 16px;
  font-size: 28px;
  letter-spacing: -0.03em;
}
.facts {
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
}
.facts li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.facts strong { color: var(--ink); font-weight: 600; }
.label {
  display: block;
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.captcha-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.captcha-img {
  height: 56px;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: #fff;
}
.alert, .ok {
  border-radius: 14px;
  padding: 12px 14px;
  margin: 0 0 14px;
  font-size: 14px;
}
.alert { background: rgba(255,59,48,0.1); color: #b00020; }
.ok { background: rgba(52,199,89,0.12); color: #0b7a2d; }

.auth {
  min-height: 60vh;
  display: grid;
  place-items: center;
}
.auth-card {
  width: min(420px, 100%);
  background: rgba(255,255,255,0.78);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  animation: rise .55s ease both;
}
.auth-card h1 {
  margin: 0;
  font-size: 32px;
  letter-spacing: -0.04em;
}
.auth-form { display: grid; gap: 8px; margin-top: 18px; }
.auth-form .search-input {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 8px;
}

.admin-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}
.admin-head h1 {
  margin: 0;
  font-size: 36px;
  letter-spacing: -0.04em;
}
.upload-panel {
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.drop {
  position: relative;
  border: 1.5px dashed rgba(0,0,0,0.18);
  border-radius: 18px;
  min-height: 160px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  background: rgba(255,255,255,0.55);
  transition: border-color .15s ease, background .15s ease;
}
.drop.over {
  border-color: var(--blue);
  background: rgba(0,113,227,0.06);
}
.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.drop-copy {
  text-align: center;
  color: var(--muted);
  display: grid;
  gap: 4px;
  pointer-events: none;
}
.drop-copy strong { color: var(--ink); font-size: 18px; }
.hint { font-size: 13px; color: var(--muted); }

.selected-files {
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.75);
  overflow: hidden;
}
.selected-head {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.selected-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.selected-item:last-child { border-bottom: 0; }
.selected-name {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}
.selected-size { color: var(--muted); font-size: 13px; }

.cover-row { margin-bottom: 14px; }
.cover-box .search-input {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.cover-preview {
  margin-top: 10px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.cover-preview img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.admin-thumb {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  background: #eee;
}
.admin-thumb.placeholder {
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: #1d1d1f;
}
.thumb-cell { width: 56px; }
.inline-preview { display: inline; }

.rating-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
}
.stars-lg {
  color: #ff9f0a;
  letter-spacing: 1px;
  font-size: 20px;
}
.stars-sm { color: #ff9f0a; letter-spacing: 1px; }
.rating-num { color: var(--muted); font-size: 14px; }

.reviews {
  margin-top: 28px;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(147, 197, 253, 0.22), transparent 55%),
    radial-gradient(90% 70% at 100% 0%, rgba(249, 168, 212, 0.18), transparent 50%),
    rgba(255,255,255,0.78);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 26px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.reviews-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}
.reviews h2 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.035em;
}
.reviews-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.reviews-score {
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--line);
}
.review-form {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--line);
}
.review-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.star-picker {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 6px;
  justify-content: flex-end;
  margin-bottom: 4px;
}
.star-picker input { display: none; }
.star-picker label {
  font-size: 32px;
  color: rgba(0,0,0,0.14);
  cursor: pointer;
  transition: color .12s ease, transform .12s ease;
  line-height: 1;
}
.star-picker label:hover,
.star-picker label:hover ~ label,
.star-picker input:checked ~ label {
  color: #ff9f0a;
}
.star-picker label:hover { transform: scale(1.1); }
.field { display: grid; gap: 8px; }
.field-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.counter {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--muted);
}
.counter.near { color: #c45d00; }
.counter.full { color: var(--danger); }
.field-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  background: #fff;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field-input:focus {
  border-color: rgba(0,113,227,0.45);
  box-shadow: 0 0 0 4px rgba(0,113,227,0.1);
}
.review-text {
  min-height: 110px;
  resize: vertical;
  line-height: 1.45;
}
.field-meter {
  display: block;
  height: 4px;
  border-radius: 99px;
  background: rgba(0,0,0,0.06);
  overflow: hidden;
}
.field-meter i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--blue);
  transition: width .15s ease, background .15s ease;
}
.field-meter i.near { background: #ff9f0a; }
.field-meter i.full { background: var(--danger); }
.review-list { display: grid; gap: 12px; }
.review-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px;
  background: rgba(255,255,255,0.72);
  transition: transform .15s ease, box-shadow .15s ease;
}
.review-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.05);
}
.review-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}
.review-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  background: linear-gradient(145deg, #1d1d1f, #5c5c62);
}
.review-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.review-meta strong {
  font-size: 14px;
}
.review-meta .muted {
  font-size: 12px;
}
.review-card p {
  margin: 0;
  line-height: 1.5;
  color: var(--ink);
}
.empty-reviews {
  text-align: center;
  padding: 18px 8px;
}

.admin-table-wrap {
  overflow: auto;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.72);
  box-shadow: var(--shadow);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.admin-table th, .admin-table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.admin-table th { color: var(--muted); font-weight: 500; }
.admin-table a { color: var(--blue); text-decoration: none; }
.muted { color: var(--muted); }

.foot {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 0 22px 40px;
}

@media (max-width: 860px) {
  .detail-panel { grid-template-columns: 1fr; }
  .preview-fallback { grid-template-columns: 1fr; text-align: center; padding: 28px 20px; }
  .preview-copy { text-align: center; }
  .preview-chips { justify-content: center; }
  .file-sheet { transform: none; }
  .captcha-row { flex-direction: column; align-items: stretch; }
  .search-wrap { flex-direction: column; }
}
