:root {
  color-scheme: dark;
  --bg: #07080d;
  --panel: #11131b;
  --panel-2: #171a24;
  --line: rgba(255, 255, 255, 0.11);
  --text: #f8fafc;
  --muted: #9ca3af;
  --cyan: #22d3ee;
  --pink: #fb3f8f;
  --yellow: #facc15;
  --green: #34d399;
  --danger: #fb7185;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button,
.primary-button,
.secret-button {
  cursor: pointer;
}

.home-page {
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(251, 63, 143, 0.16), transparent 28%),
    radial-gradient(circle at 78% 72%, rgba(34, 211, 238, 0.12), transparent 32%),
    #05060a;
}

#neon-grid {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

.scanline {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.025),
    rgba(255, 255, 255, 0.025) 1px,
    transparent 1px,
    transparent 5px
  );
  mix-blend-mode: screen;
  z-index: 2;
}

.hero-shell {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 28px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--cyan);
  font-size: 13px;
  text-transform: uppercase;
}

.hero-shell h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(44px, 9vw, 132px);
  font-weight: 900;
  text-shadow:
    0 0 18px rgba(34, 211, 238, 0.65),
    4px 0 0 rgba(251, 63, 143, 0.72),
    -4px 0 0 rgba(250, 204, 21, 0.42);
}

.hero-copy {
  width: min(580px, 92vw);
  margin: 24px auto 36px;
  color: #d1d5db;
  font-size: clamp(17px, 2.2vw, 24px);
  line-height: 1.7;
}

.secret-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 24px;
  border: 1px solid rgba(34, 211, 238, 0.75);
  background: rgba(34, 211, 238, 0.12);
  color: #ecfeff;
  box-shadow: 0 0 26px rgba(34, 211, 238, 0.28), inset 0 0 18px rgba(34, 211, 238, 0.12);
}

.secret-button {
  min-width: 150px;
  margin-top: 34px;
  transform: skewX(-10deg);
}

.primary-button {
  border-radius: 8px;
}

.primary-button.small {
  min-height: 38px;
  padding: 0 16px;
  font-size: 14px;
}

.secret-button:hover,
.primary-button:hover {
  border-color: var(--yellow);
  box-shadow: 0 0 32px rgba(250, 204, 21, 0.28), inset 0 0 18px rgba(250, 204, 21, 0.12);
}

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.08), transparent 36%),
    linear-gradient(315deg, rgba(251, 63, 143, 0.1), transparent 42%),
    var(--bg);
}

.login-panel {
  width: min(430px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 19, 27, 0.92);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.login-panel h1,
.admin-header h1,
.directory-hero h1 {
  margin: 0;
}

.stack-form,
.admin-form {
  display: grid;
  gap: 18px;
}

label {
  display: grid;
  gap: 8px;
}

label span {
  color: #d1d5db;
  font-size: 14px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 8, 13, 0.84);
  color: var(--text);
  padding: 12px 13px;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: rgba(34, 211, 238, 0.9);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.13);
}

.alert {
  margin: 18px 0;
  padding: 12px 14px;
  border-radius: 8px;
}

.alert.danger {
  border: 1px solid rgba(251, 113, 133, 0.45);
  background: rgba(251, 113, 133, 0.12);
  color: #fecdd3;
}

.nav-page {
  background: #0b0d12;
}

.nav-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 180px minmax(180px, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 70px;
  padding: 12px 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 13, 18, 0.86);
  backdrop-filter: blur(18px);
}

.brand,
.admin-logo {
  font-weight: 900;
  color: #fff;
}

.brand {
  font-size: 20px;
}

.nav-search input {
  height: 44px;
  background: rgba(255, 255, 255, 0.055);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-actions button,
.admin-header button,
.row-actions button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 8px 12px;
}

.directory-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 28px;
  width: min(1500px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 30px 0 70px;
}

.category-rail {
  position: sticky;
  top: 96px;
  align-self: start;
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 19, 27, 0.72);
}

.rail-title {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.category-rail a {
  padding: 10px 12px;
  border-radius: 8px;
  color: #d1d5db;
}

.category-rail a:hover {
  background: rgba(34, 211, 238, 0.12);
  color: #fff;
}

.directory-content {
  display: grid;
  gap: 34px;
}

.directory-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.12), rgba(251, 63, 143, 0.08)),
    var(--panel);
}

.directory-hero p {
  margin: 0;
  color: var(--muted);
}

.site-section {
  scroll-margin-top: 90px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0;
  font-size: 22px;
}

.section-heading span {
  color: var(--muted);
  font-size: 14px;
}

.site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.site-card {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02)), var(--panel);
}

.site-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.22);
}

.site-accent {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
}

.site-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  font-weight: 800;
}

.site-card h3 {
  margin: 0;
  font-size: 17px;
}

.site-card-head p,
.site-desc {
  color: var(--muted);
}

.site-card-head p {
  margin: 3px 0 0;
  font-size: 13px;
}

.site-desc {
  margin: 18px 0 20px;
  line-height: 1.6;
}

.open-link {
  position: absolute;
  right: 18px;
  bottom: 16px;
  color: var(--cyan);
  font-size: 14px;
}

.admin-page {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  background: #0f1117;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 16px;
  border-right: 1px solid var(--line);
  background: #0a0c12;
}

.admin-logo {
  display: block;
  margin: 0 8px 28px;
  font-size: 22px;
}

.admin-sidebar nav {
  display: grid;
  gap: 8px;
}

.admin-sidebar a {
  padding: 11px 12px;
  border-radius: 8px;
  color: #cbd5e1;
}

.admin-sidebar a.active,
.admin-sidebar a:hover {
  background: rgba(34, 211, 238, 0.12);
  color: #fff;
}

.admin-main {
  min-width: 0;
  padding: 28px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.admin-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.table-wrap,
.admin-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: #d1d5db;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.035);
}

td {
  color: #e5e7eb;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 13px;
}

.badge.ok {
  background: rgba(52, 211, 153, 0.14);
  color: #bbf7d0;
}

.badge.muted {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
}

.row-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.row-actions form {
  margin: 0;
}

.admin-form {
  width: min(860px, 100%);
  padding: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.check-row input {
  width: 18px;
  height: 18px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-card.hidden {
  display: none;
}

@media (max-width: 900px) {
  .nav-topbar,
  .directory-layout,
  .admin-page,
  .directory-hero {
    grid-template-columns: 1fr;
  }

  .nav-topbar,
  .directory-hero,
  .admin-header {
    align-items: stretch;
  }

  .directory-layout {
    width: min(100% - 28px, 760px);
  }

  .category-rail,
  .admin-sidebar {
    position: static;
    height: auto;
  }

  .admin-page {
    display: block;
  }

  .admin-sidebar nav {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}
