:root {
  --accent: #20f6ff;
  --accent-2: #8a5cff;
  --accent-3: #40ff9c;
  --bg: #05070d;
  --bg-soft: #0c1220;
  --surface: rgba(12, 18, 32, 0.78);
  --surface-strong: rgba(17, 27, 48, 0.94);
  --text: #eef7ff;
  --muted: #9fb2c9;
  --line: rgba(138, 215, 255, 0.22);
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.38);
}

[data-mode='light'] {
  --bg: #f5f8ff;
  --bg-soft: #e9f0fb;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --text: #0b1426;
  --muted: #53657d;
  --line: rgba(33, 87, 139, 0.18);
  --shadow: 0 22px 60px rgba(29, 54, 96, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 18% 12%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 30%),
    radial-gradient(circle at 82% 4%, color-mix(in srgb, var(--accent-2) 26%, transparent), transparent 34%),
    linear-gradient(135deg, var(--bg), var(--bg-soft));
  color: var(--text);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  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: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

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

button, input, textarea, select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

.loadbar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  height: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, .06);
  opacity: 1;
  transition: opacity .22s ease;
}

.loadbar.done {
  opacity: 0;
  pointer-events: none;
}

.loadbar span {
  position: absolute;
  top: 0;
  height: 100%;
  width: 32%;
  transform: translateX(-120%);
  filter: drop-shadow(0 0 8px currentColor);
  animation: loadSweep 2.2s cubic-bezier(.4, 0, .2, 1) infinite;
}

.loadbar span:nth-child(1) {
  color: #20f6ff;
  background: #20f6ff;
  animation-delay: 0s;
}

.loadbar span:nth-child(2) {
  color: #8a5cff;
  background: #8a5cff;
  animation-delay: .18s;
}

.loadbar span:nth-child(3) {
  color: #40ff9c;
  background: #40ff9c;
  animation-delay: .36s;
}

.loadbar span:nth-child(4) {
  color: #ffcc4a;
  background: #ffcc4a;
  animation-delay: .54s;
}

.container {
  width: min(1160px, calc(100% - 36px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}

.nav {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 70%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 28%, transparent), color-mix(in srgb, var(--accent-2) 25%, transparent));
  box-shadow: 0 0 34px color-mix(in srgb, var(--accent) 34%, transparent);
  border-radius: 8px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link, .icon-btn, .primary-btn, .ghost-btn {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  color: var(--text);
  border-radius: 8px;
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.nav-link:hover, .icon-btn:hover, .primary-btn:hover, .ghost-btn:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 65%, var(--line));
  box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 18%, transparent);
}

.nav-link.active {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 72%, var(--line));
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #021018;
  border: 0;
  font-weight: 800;
}

.ghost-btn {
  background: transparent;
}

.hero {
  min-height: 620px;
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  gap: 44px;
  align-items: center;
  padding: 54px 0 36px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 84px);
  line-height: 1.02;
  letter-spacing: 0;
}

.gradient-text {
  background: linear-gradient(120deg, var(--text), var(--accent), var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
  max-width: 680px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 34px;
}

.stat {
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
}

.stat strong {
  display: block;
  font-size: 26px;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

.orbit {
  position: relative;
  min-height: 500px;
}

.core {
  position: absolute;
  inset: 17%;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 20%, transparent), transparent 64%);
  box-shadow: inset 0 0 70px color-mix(in srgb, var(--accent) 16%, transparent), 0 0 80px color-mix(in srgb, var(--accent-2) 20%, transparent);
  animation: pulse 4.2s ease-in-out infinite;
}

.core::before, .core::after {
  content: "";
  position: absolute;
  inset: -34px;
  border: 1px dashed color-mix(in srgb, var(--accent) 42%, transparent);
  border-radius: 50%;
  animation: rotate 20s linear infinite;
}

.core::after {
  inset: 42px;
  animation-duration: 13s;
  animation-direction: reverse;
}

.core span {
  width: 126px;
  height: 126px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--surface-strong) 82%, transparent), color-mix(in srgb, var(--accent) 20%, transparent));
  border: 1px solid var(--line);
  font-weight: 900;
  font-size: 26px;
}

.float-chip {
  position: absolute;
  padding: 9px 12px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 13px;
  animation: floaty 4.8s ease-in-out infinite;
}

.chip-a { left: 0; top: 18%; }
.chip-b { right: 6%; top: 9%; animation-delay: .8s; }
.chip-c { left: 9%; bottom: 17%; animation-delay: 1.4s; }
.chip-d { right: 0; bottom: 28%; animation-delay: 2s; }
.chip-e { left: 24%; top: 2%; animation-delay: .45s; }
.chip-f { right: 18%; bottom: 8%; animation-delay: 1.1s; }
.chip-g { left: 38%; bottom: 1%; animation-delay: 1.8s; }
.chip-h { left: 1%; top: 43%; animation-delay: .25s; }
.chip-i { right: 4%; top: 39%; animation-delay: 1.25s; }
.chip-j { left: 24%; bottom: 31%; animation-delay: 2.25s; }
.chip-k { right: 27%; top: 23%; animation-delay: .65s; }
.chip-l { left: 48%; top: 11%; animation-delay: 1.65s; }
.chip-m { right: 2%; bottom: 6%; animation-delay: 2.65s; }

.section {
  padding: 64px 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 24px;
}

.section h2 {
  margin: 7px 0 0;
  font-size: clamp(28px, 4vw, 46px);
}

.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.card {
  position: relative;
  overflow: hidden;
  min-height: 260px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface-strong) 78%, transparent));
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease;
}

.card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
}

.cover {
  height: 150px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 26%, transparent), color-mix(in srgb, var(--accent-2) 28%, transparent)),
    linear-gradient(45deg, transparent 45%, rgba(255,255,255,.12) 50%, transparent 55%);
  background-size: cover;
  background-position: center;
}

.card-body {
  padding: 18px;
}

.card h3 {
  margin: 0 0 10px;
  font-size: 17px;
  line-height: 1.35;
}

.card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 14px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tag {
  border: 1px solid var(--line);
  color: var(--accent);
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 12px;
}

.tag-link {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}

.tag-link:hover {
  color: #021018;
  background: var(--accent);
  border-color: var(--accent);
}

.active-filter {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: -8px 0 22px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
  border-radius: 8px;
}

.active-filter span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.field, textarea, select {
  width: 100%;
  min-height: 42px;
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
}

textarea {
  min-height: 150px;
  resize: vertical;
}

.detail {
  padding: 54px 0 76px;
}

.detail-panel, .admin-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: clamp(22px, 4vw, 42px);
  box-shadow: var(--shadow);
}

.detail h1 {
  font-size: clamp(28px, 4.8vw, 48px);
  line-height: 1.08;
  margin: 0 0 16px;
}

.prose {
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
  line-height: 1.86;
  font-size: 15px;
}

.prose h1 {
  font-size: 28px;
}

.prose h2 {
  font-size: 22px;
}

.prose h3 {
  font-size: 18px;
}

.prose img {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.code-block {
  position: relative;
  overflow: auto;
  margin: 18px 0;
  padding: 44px 16px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  border-radius: 8px;
  background: #07101d;
  color: #d8f7ff;
  box-shadow: inset 0 0 34px rgba(32, 246, 255, .08);
}

.code-block span {
  position: absolute;
  top: 10px;
  left: 12px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.code-block code {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre;
}

.about-layout {
  max-width: none;
  margin: 0 auto;
}

.admin-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
}

.admin-menu {
  display: grid;
  gap: 10px;
  align-content: start;
}

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

.form-grid .full {
  grid-column: 1 / -1;
}

.link-editor {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: color-mix(in srgb, var(--surface-strong) 64%, transparent);
}

.link-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.link-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(180px, 1.4fr) auto;
  gap: 10px;
  align-items: center;
}

.save-message {
  color: var(--accent-3);
  margin-left: 10px;
  font-weight: 700;
}

.item-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-top: 10px;
}

.footer {
  border-top: 1px solid var(--line);
  min-height: 60px;
  padding: 12px 0;
  color: var(--muted);
  text-align: center;
  display: flex;
  align-items: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  font-size: 12px;
  line-height: 1.45;
}

.footer-links a {
  color: var(--muted);
  transition: color .18s ease;
}

.footer-text {
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--accent);
}

@keyframes rotate {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.035); }
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes loadSweep {
  0% { transform: translateX(-120%); opacity: 0; }
  15% { opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translateX(360%); opacity: 0; }
}

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

  .orbit {
    min-height: 360px;
  }

  .grid, .stats, .form-grid, .link-row {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 24px, 1160px);
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .hero {
    min-height: auto;
    padding-top: 38px;
  }
}
