/* ==========================================================================
   TopGUI — dark, card-based marketing site (inspired by a modern product page)
   ========================================================================== */

:root {
  --bg: #07070c;
  --bg-elev: #0d0d15;
  --surface: #13131e;
  --surface-2: #1a1a28;
  --border: #262637;
  --border-soft: #1e1e2c;
  --text: #e9e9f2;
  --text-dim: #a0a0b8;
  --text-faint: #6d6d84;

  --accent: #5b8cff;
  --accent-2: #8b5cf6;
  --accent-grad: linear-gradient(135deg, #5b8cff 0%, #8b5cf6 100%);
  --accent-soft: rgba(91, 140, 255, 0.14);

  --success: #34d399;
  --danger: #f87171;
  --warning: #fbbf24;

  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  --shadow-soft: 0 6px 24px rgba(0, 0, 0, 0.35);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Helvetica Neue",
    Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo,
    Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(900px 500px at 85% -10%, rgba(139, 92, 246, 0.12), transparent 60%),
    radial-gradient(800px 500px at 0% 5%, rgba(91, 140, 255, 0.12), transparent 60%);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: rgba(91, 140, 255, 0.35); }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ------------------------------------------------------------------ navbar */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 7, 12, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent-grad);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
}
.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-links a {
  color: var(--text-dim);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 15px;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.nav-auth { display: flex; align-items: center; gap: 10px; }
.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 14px;
}
.nav-user .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
}
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}
.nav-menu-mobile {
  display: none;
}

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.12s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 6px 20px rgba(91, 140, 255, 0.35);
}
.btn-primary:hover { box-shadow: 0 10px 28px rgba(91, 140, 255, 0.5); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface); border-color: #34344a; }

.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 8px; }
.btn-danger { background: rgba(248, 113, 113, 0.12); color: var(--danger); border-color: rgba(248, 113, 113, 0.3); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.2); }
.btn-block { width: 100%; }

/* ------------------------------------------------------------------ layout */
.section { padding: 72px 0; }
.section-tight { padding: 40px 0; }
.hero { padding: 96px 0 80px; text-align: center; position: relative; overflow: hidden; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 22px;
}
.eyebrow .pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

h1.display {
  font-size: clamp(40px, 7vw, 72px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  font-weight: 800;
}
.gradient-text {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.lede {
  font-size: clamp(17px, 2.4vw, 21px);
  color: var(--text-dim);
  max-width: 640px;
  margin: 0 auto 34px;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.hero-art {
  margin: 56px auto 0;
  max-width: 860px;
  height: 320px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background:
    radial-gradient(400px 220px at 30% 30%, rgba(91, 140, 255, 0.22), transparent 60%),
    radial-gradient(400px 220px at 70% 70%, rgba(139, 92, 246, 0.22), transparent 60%),
    var(--surface);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero-art::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, #000 40%, transparent 75%);
}
.hero-art .ring {
  position: absolute;
  left: 50%; top: 50%;
  width: 210px; height: 210px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(139, 92, 246, 0.4);
  box-shadow: 0 0 80px rgba(91, 140, 255, 0.4), inset 0 0 60px rgba(139, 92, 246, 0.25);
  animation: float 6s ease-in-out infinite;
}
.hero-art .ring::before {
  content: "TopGUI";
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-weight: 800; font-size: 26px; letter-spacing: 0.04em;
  color: var(--text);
}
@keyframes float {
  0%, 100% { transform: translate(-50%, -50%); }
  50% { transform: translate(-50%, -56%); }
}

/* -------------------------------------------------------------- section head */
.section-head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-head h2 {
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}
.section-head p { color: var(--text-dim); margin: 0; font-size: 17px; }

/* ------------------------------------------------------------------ cards */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--border);
  box-shadow: var(--shadow-soft);
}
.card .icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(91, 140, 255, 0.3);
  display: grid; place-items: center;
  font-size: 22px;
  margin-bottom: 16px;
}
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--text-dim); font-size: 15px; }

/* ------------------------------------------------------------------- stats */
.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 48px;
  padding: 8px 0 56px;
}
.stat { text-align: center; }
.stat .num {
  font-size: 34px;
  font-weight: 800;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat .label { color: var(--text-faint); font-size: 14px; margin-top: 2px; }

/* --------------------------------------------------------------- download */
.download-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 26px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  margin-bottom: 14px;
  transition: border-color 0.15s;
}
.download-card:hover { border-color: var(--border); }
.download-card .meta { display: flex; align-items: center; gap: 16px; }
.download-card .ver {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  background: var(--surface-2);
  padding: 3px 8px;
  border-radius: 6px;
}
.download-card .size { color: var(--text-faint); font-size: 13px; }

/* ------------------------------------------------------------- auth pages */
.auth-wrap {
  max-width: 440px;
  margin: 60px auto;
  padding: 40px 36px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.auth-wrap h1 { margin: 0 0 6px; font-size: 26px; }
.auth-wrap .sub { color: var(--text-dim); margin: 0 0 28px; font-size: 15px; }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 7px;
}
.field input[type="text"],
.field input[type="password"],
.field input[type="email"],
.field input[type="tel"],
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field .hint { font-size: 12px; color: var(--text-faint); margin-top: 5px; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }

.tabs { display: flex; gap: 6px; background: var(--bg-elev); padding: 5px; border-radius: 12px; margin-bottom: 24px; }
.tabs button {
  flex: 1;
  padding: 9px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tabs button.active { background: var(--surface-2); color: var(--text); }

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 18px;
  display: none;
}
.alert.show { display: block; }
.alert.error { background: rgba(248, 113, 113, 0.12); color: #fca5a5; border: 1px solid rgba(248, 113, 113, 0.3); }
.alert.success { background: rgba(52, 211, 153, 0.12); color: #6ee7b7; border: 1px solid rgba(52, 211, 153, 0.3); }

.auth-alt { text-align: center; margin-top: 20px; color: var(--text-dim); font-size: 14px; }

/* ------------------------------------------------------------ admin / table */
.panel {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 20px; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border-soft); }
.table th { color: var(--text-faint); font-weight: 600; font-size: 13px; }
.table tr:hover td { background: var(--bg-elev); }
.table .actions { display: flex; gap: 8px; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge.on { background: rgba(52, 211, 153, 0.14); color: var(--success); }
.badge.off { background: rgba(248, 113, 113, 0.14); color: var(--danger); }
.badge.admin { background: rgba(139, 92, 246, 0.16); color: #c4b5fd; }
.badge.user { background: rgba(91, 140, 255, 0.14); color: #93c5fd; }

.search { display: flex; gap: 10px; }
.search input {
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  min-width: 240px;
}
.search input:focus { outline: none; border-color: var(--accent); }

.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 16px; color: var(--text-dim); font-size: 14px; }

/* ------------------------------------------------------------------ footer */
.footer {
  border-top: 1px solid var(--border-soft);
  padding: 40px 0;
  margin-top: 40px;
  color: var(--text-faint);
  font-size: 14px;
}
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 22px; }
.footer-links a { color: var(--text-dim); text-decoration: none; }
.footer-links a:hover { color: var(--text); }

/* -------------------------------------------------------------- responsive */
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-auth .btn span { display: none; }
  .nav-menu-mobile {
    display: none;
    flex-direction: column;
    padding: 8px 24px 20px;
    gap: 4px;
  }
  .nav-menu-mobile.open { display: flex; }
  .nav-menu-mobile a {
    color: var(--text-dim);
    padding: 12px 0;
    border-bottom: 1px solid var(--border-soft);
    text-decoration: none;
  }
  .hero { padding: 64px 0 56px; }
  .hero-art { height: 220px; }
  .stats { gap: 32px; }
  .section { padding: 52px 0; }
}

/* ------------------------------------------------------------- reveal anim */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.5s, transform 0.5s; }
.reveal.visible { opacity: 1; transform: none; }

.muted { color: var(--text-faint); }
.small { font-size: 13px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.center { text-align: center; }
