@font-face {
  font-family: 'system';
  src: local('Inter'), local('-apple-system');
}

:root {
  --bg: #0a0e1a;
  --bg-elevated: #0f1526;
  --bg-card: #131b30;
  --border: #232e4d;
  --border-soft: #182036;
  --text: #eef1fb;
  --text-dim: #9aa3c2;
  --text-faint: #5c6788;
  --gold: #e8c14a;
  --gold-dim: #b8963a;
  --gold-glow: rgba(232, 193, 74, 0.15);
  --blue: #4d8dff;
  --blue-dim: #2f5cb0;
  --blue-glow: rgba(77, 141, 255, 0.15);
  --white: #ffffff;
  --danger: #ff5c6a;
  --success: #4dd97e;
  --radius: 10px;
  --radius-lg: 16px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, Helvetica, Arial, sans-serif;
  --mono: 'SF Mono', 'Fira Code', Consolas, 'Courier New', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(circle at 15% 0%, rgba(232,193,74,0.06), transparent 40%),
    radial-gradient(circle at 85% 15%, rgba(232,193,74,0.04), transparent 35%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; }
p { line-height: 1.55; color: var(--text-dim); }

.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.15em; stroke: currentColor; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 24px; }
main { flex: 1; }

/* ---------- Navbar ---------- */
.nav {
  border-bottom: 1px solid var(--border-soft);
  background: rgba(10,10,11,0.85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 1px 0 rgba(255,255,255,0.02);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 19px; letter-spacing: -0.03em; }
.brand .icon { width: 22px; height: 22px; color: var(--gold); }
.brand .dot { color: var(--gold); }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14.5px;
  color: var(--text-dim);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--text); background: var(--bg-elevated); }
.nav-link.active { color: var(--text); }
.nav-link .icon { width: 15px; height: 15px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--font);
  font-size: 14.5px; font-weight: 600;
  padding: 10px 18px;
  border-radius: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s ease;
  line-height: 1;
}
.btn .icon { width: 15px; height: 15px; }
.btn-primary { background: var(--gold); color: #14100a; box-shadow: 0 4px 14px rgba(232,193,74,0.28); }
.btn-primary:hover { background: #f3d876; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(232,193,74,0.38); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--gold-dim); background: var(--gold-glow); }
.btn-ghost { background: transparent; color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); }
.btn-danger { background: transparent; border-color: #4a2126; color: var(--danger); }
.btn-danger:hover { background: rgba(255,92,106,0.1); }
.btn-blue { background: var(--blue); color: #04101f; }
.btn-blue:hover { background: #6ba0ff; }
.btn-outline-success { background: transparent; border-color: rgba(77,217,126,0.35); color: var(--success); }
.btn-outline-success:hover { background: rgba(77,217,126,0.1); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.card-hover { transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.card-hover:hover { border-color: var(--gold-dim); transform: translateY(-3px); box-shadow: 0 16px 36px rgba(0,0,0,0.4); }

/* ---------- Hero ---------- */
.hero { padding: 76px 0 46px; text-align: center; }
.hero h1 { font-size: 46px; font-weight: 800; line-height: 1.08; }
.hero h1 .accent { color: var(--gold); }
.hero p { max-width: 560px; margin: 16px auto 0; font-size: 16px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; margin-top: 28px; }

/* ---------- Landing page: feature grid ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.feature-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px; transition: border-color .18s, transform .18s; }
.feature-card:hover { border-color: var(--gold-dim); transform: translateY(-3px); }
.feature-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; background: var(--gold-glow); color: var(--gold); }
.feature-icon .icon { width: 21px; height: 21px; }
.feature-icon.c-blue { background: rgba(77,141,255,0.14); color: var(--blue); }
.feature-icon.c-green { background: rgba(77,217,126,0.14); color: var(--success); }
.feature-icon.c-rose { background: rgba(255,92,138,0.14); color: #ff5c8a; }
.feature-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.feature-card p { font-size: 13.5px; margin: 0; }

.cta-banner {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-elevated));
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 34px 36px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.cta-banner h2 { font-size: 22px; margin-bottom: 6px; }
.cta-banner p { margin: 0; font-size: 14px; }

/* ---------- Section ---------- */
.section { padding: 40px 0; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-title h2 { font-size: 20px; font-weight: 700; }
.section-title .sub { color: var(--text-faint); font-size: 13.5px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 6px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.badge .icon { width: 11px; height: 11px; }
.badge-category { background: var(--bg-elevated); color: var(--text-dim); border: 1px solid var(--border); }
.badge-key { background: rgba(255, 193, 7, 0.1); color: #ffc107; border: 1px solid rgba(255,193,7,0.25); }
.badge-published { background: rgba(77,217,126,0.1); color: var(--success); border: 1px solid rgba(77,217,126,0.25); }
.badge-pending { background: rgba(255,193,7,0.1); color: #ffc107; border: 1px solid rgba(255,193,7,0.25); }
.badge-removed { background: rgba(255,92,106,0.1); color: var(--danger); border: 1px solid rgba(255,92,106,0.25); }

.empty-state { text-align: center; padding: 70px 20px; color: var(--text-faint); }
.empty-state .icon { width: 34px; height: 34px; margin-bottom: 14px; color: var(--text-faint); }

/* ---------- Forms ---------- */
.auth-wrap { max-width: 400px; margin: 70px auto; padding: 0 24px; }
.auth-wrap h1 { font-size: 26px; margin-bottom: 6px; }
.auth-wrap .sub { color: var(--text-dim); font-size: 14px; margin-bottom: 28px; }

.form-group { margin-bottom: 16px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--text-dim); margin-bottom: 7px; }
input[type=text], input[type=email], input[type=password], input[type=url], textarea, select {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px 13px;
  color: var(--text);
  font-family: var(--font);
  font-size: 14.5px;
  outline: none;
  transition: border-color .15s;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--gold-dim); box-shadow: 0 0 0 3px var(--gold-glow); }
input:disabled { opacity: 0.6; cursor: not-allowed; }
.code-input { font-family: var(--mono); font-size: 13px; min-height: 320px; white-space: pre; }
.help-text { font-size: 12.5px; color: var(--text-faint); margin-top: 6px; }
.checkbox-row { display: flex; align-items: center; gap: 9px; }
.checkbox-row input { width: auto; }
.checkbox-row label { margin: 0; }

.alert {
  padding: 12px 15px; border-radius: 9px; font-size: 13.5px; margin-bottom: 18px;
  display: flex; align-items: center; gap: 9px;
}
.alert-error { background: rgba(255,92,106,0.08); border: 1px solid rgba(255,92,106,0.25); color: #ff8991; }
.alert-success { background: rgba(77,217,126,0.08); border: 1px solid rgba(77,217,126,0.25); color: #7ee9a3; }
.alert .icon { width: 15px; height: 15px; flex-shrink: 0; }

.auth-foot { text-align: center; margin-top: 20px; font-size: 13.5px; color: var(--text-faint); }
.auth-foot a { color: var(--gold); font-weight: 600; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; padding: 12px 16px; color: var(--text-faint); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; background: var(--bg-elevated); border-bottom: 1px solid var(--border); }
td { padding: 12px 16px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
td.mono { font-family: var(--mono); color: var(--text-dim); font-size: 12.5px; }
.row-actions { display: flex; gap: 6px; }

/* ---------- Script detail page ---------- */
.script-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.script-header h1 { font-size: 28px; }
.loadstring-box {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; font-family: var(--mono); font-size: 13px; color: var(--gold);
  word-break: break-all; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--border-soft); padding: 26px 0; margin-top: 50px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--text-faint); flex-wrap: wrap; gap: 10px; }
.footer-inner a { color: var(--text-faint); }
.footer-inner a:hover { color: var(--gold); }

/* ---------- Utility ---------- */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.mt-24 { margin-top: 24px; } .mb-24 { margin-bottom: 24px; }
.text-dim { color: var(--text-dim); } .text-faint { color: var(--text-faint); }
.center { text-align: center; }

@media (max-width: 640px) {
  .hero h1 { font-size: 32px; }
  .nav-link span.label { display: none; }
  .script-header { flex-direction: column; }
}
