:root {
  --bg: #f4f6ff;
  --surface: #ffffff;
  --surface-2: #f8f9ff;
  --border: #e6e9f5;
  --text: #1c2240;
  --text-2: #5b6380;
  --text-3: #9aa2c0;
  --primary: #6366f1;
  --primary-2: #8b5cf6;
  --accent: #06b6d4;
  --danger: #ef4444;
  --success: #10b981;
  --shadow: 0 10px 30px rgba(30, 41, 130, .08);
  --shadow-lg: 0 24px 60px rgba(30, 41, 130, .14);
  --radius: 16px;
  --radius-sm: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

.bg-decor {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(600px 400px at 15% 0%, rgba(99, 102, 241, .10), transparent 60%),
    radial-gradient(700px 500px at 90% 10%, rgba(139, 92, 246, .10), transparent 60%),
    radial-gradient(600px 500px at 50% 100%, rgba(6, 182, 212, .08), transparent 60%);
  pointer-events: none;
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.hidden { display: none !important; }

/* ---------- navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }

.brand-logo {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; font-weight: 800; font-size: 19px;
  box-shadow: 0 6px 16px rgba(99, 102, 241, .35);
}

.brand-name { font-size: 19px; font-weight: 800; color: var(--text); }

.nav-actions { display: flex; align-items: center; gap: 14px; }

.nav-link { font-size: 14px; color: var(--text-2); font-weight: 600; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 999px; border: none; cursor: pointer;
  font-size: 15px; font-weight: 600; text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
  font-family: inherit;
}

.btn:active { transform: scale(.97); }

.btn-sm { padding: 8px 16px; font-size: 13px; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 8px 20px rgba(99, 102, 241, .35);
}
.btn-primary:hover { box-shadow: 0 10px 26px rgba(99, 102, 241, .45); transform: translateY(-1px); }

.btn-ghost {
  background: transparent; color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--primary); border-color: var(--primary); background: #fff; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { box-shadow: 0 8px 20px rgba(239, 68, 68, .35); }

.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

/* ---------- hero ---------- */
.hero { padding: 64px 0 46px; text-align: center; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--primary);
  background: rgba(99, 102, 241, .10);
  border: 1px solid rgba(99, 102, 241, .22);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 22px;
}

.hero-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800; letter-spacing: -.5px;
  background: linear-gradient(135deg, var(--text) 30%, var(--primary));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

.hero-sub { margin-top: 14px; color: var(--text-2); font-size: 16px; }

/* ---------- search ---------- */
.search-box {
  position: relative;
  max-width: 520px; margin: 30px auto 0;
}

.search-icon {
  position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
  width: 19px; height: 19px; color: var(--text-3);
}

.search-box input {
  width: 100%;
  padding: 14px 52px 14px 52px;
  font-size: 15px; font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, .14), var(--shadow);
}

.search-clear {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--surface-2); color: var(--text-3); font-size: 13px;
}
.search-clear:hover { color: var(--danger); }

/* ---------- list ---------- */
.list-head { margin-bottom: 16px; }

.result-count { font-size: 13.5px; color: var(--text-3); }

.app-list { display: flex; flex-direction: column; gap: 14px; }

.app-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex; align-items: center; gap: 20px;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  animation: fadeUp .4s ease both;
}

.app-row:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(99, 102, 241, .35);
}

.row-icon {
  width: 58px; height: 58px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 15px;
  color: #fff; font-size: 26px; font-weight: 800;
  box-shadow: 0 8px 18px rgba(99, 102, 241, .28);
}

.row-body { flex: 1; min-width: 0; }

.row-title {
  font-size: 17px; font-weight: 700;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px;
}
.badge-version { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.badge-cat {
  background: rgba(6, 182, 212, .10); color: #0e7490;
  border: 1px solid rgba(6, 182, 212, .22);
}
.badge-android {
  background: rgba(16, 185, 129, .12); color: #047857;
  border: 1px solid rgba(16, 185, 129, .28);
}
.badge-windows {
  background: rgba(59, 130, 246, .12); color: #1d4ed8;
  border: 1px solid rgba(59, 130, 246, .28);
}
.badge-linux {
  background: rgba(245, 158, 11, .14); color: #b45309;
  border: 1px solid rgba(245, 158, 11, .30);
}
.badge-other {
  background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--border);
}

.row-desc {
  color: var(--text-2); font-size: 13.5px; line-height: 1.6; margin-top: 5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.row-meta { font-size: 12px; color: var(--text-3); margin-top: 8px; }
.row-meta b { color: var(--text-2); font-weight: 700; }
.row-meta .sep { margin: 0 6px; opacity: .5; }

.row-side { flex-shrink: 0; }

/* ---------- row skeleton ---------- */
.row-skeleton {
  height: 112px; border-radius: var(--radius);
  background: linear-gradient(100deg, #eef0fa 40%, #f7f8ff 50%, #eef0fa 60%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}

/* ---------- empty ---------- */
.empty { text-align: center; padding: 70px 0 90px; color: var(--text-3); }
.empty-emoji { font-size: 54px; margin-bottom: 12px; }
.empty p { font-size: 17px; font-weight: 600; color: var(--text-2); }
.empty .empty-sub { font-size: 13.5px; font-weight: 400; margin-top: 4px; }

/* ---------- footer ---------- */
.footer { margin-top: auto; border-top: 1px solid var(--border); padding: 22px 0; background: rgba(255,255,255,.6); }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--text-3);
}
.footer-stat b { color: var(--primary); }

/* ---------- toast ---------- */
.toast-wrap {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 100; display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.toast {
  background: var(--text); color: #fff;
  padding: 11px 20px; border-radius: 999px; font-size: 13.5px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  animation: toastIn .25s ease both;
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }

/* ---------- animations ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .hero { padding: 44px 0 34px; }
  .app-row { flex-direction: column; align-items: flex-start; gap: 14px; }
  .row-side { width: 100%; }
  .row-side .btn { width: 100%; }
  .footer-inner { flex-direction: column; gap: 6px; }
}
