:root {
  --bg: #05070d;
  --panel: rgba(12, 18, 31, 0.82);
  --panel-strong: rgba(14, 22, 38, 0.96);
  --line: rgba(90, 245, 255, 0.22);
  --cyan: #5af5ff;
  --green: #7cffb2;
  --violet: #9b7cff;
  --pink: #ff4fd8;
  --text: #edf7ff;
  --muted: #8ea4ba;
  --danger: #ff6b87;
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 16%, rgba(90, 245, 255, 0.16), transparent 28rem),
    radial-gradient(circle at 78% 8%, rgba(155, 124, 255, 0.18), transparent 24rem),
    radial-gradient(circle at 50% 92%, rgba(124, 255, 178, 0.1), transparent 28rem),
    var(--bg);
  overflow-x: hidden;
}

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

button,
input {
  font: inherit;
}

.grid-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(90, 245, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(90, 245, 255, 0.08) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

.scanline {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, transparent 0 50%, rgba(255, 255, 255, 0.025) 50% 100%);
  background-size: 100% 4px;
  pointer-events: none;
  opacity: 0.32;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  width: min(1180px, calc(100% - 32px));
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
  border-bottom: 1px solid rgba(90, 245, 255, 0.16);
  background: rgba(5, 7, 13, 0.72);
  backdrop-filter: blur(18px);
}

.brand,
.nav {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.brand {
  font-weight: 900;
}

.brand-mark {
  display: grid;
  width: 2.55rem;
  height: 2.55rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--cyan);
  box-shadow: 0 0 24px rgba(90, 245, 255, 0.18);
}

.nav a {
  color: var(--muted);
  font-size: 0.94rem;
  transition: color 0.2s ease;
}

.nav a:hover {
  color: var(--cyan);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 2rem;
  min-height: calc(100svh - 72px);
  align-items: center;
  padding: 4rem 0;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2.9rem, 7.8vw, 6.4rem);
  line-height: 1.02;
  letter-spacing: 0;
  text-shadow: 0 0 36px rgba(90, 245, 255, 0.18);
}

.hero-text {
  max-width: 680px;
  margin: 1.35rem 0 1.8rem;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.button {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  padding: 0 1.2rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.button:hover {
  transform: translateY(-2px);
  border-color: var(--cyan);
}

.button.primary {
  color: #001015;
  border-color: transparent;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  font-weight: 900;
}

.terminal-card,
.status-strip,
.featured-card,
.post-card,
.profile-card,
.stack-card,
.api-card,
.modal-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, var(--panel), rgba(8, 13, 23, 0.72));
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px);
}

.terminal-card {
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  gap: 0.48rem;
  padding: 1rem;
  border-bottom: 1px solid rgba(90, 245, 255, 0.14);
}

.terminal-bar span {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
}

.terminal-bar span:nth-child(1) {
  background: var(--danger);
}

.terminal-bar span:nth-child(2) {
  background: #ffd166;
}

.terminal-bar span:nth-child(3) {
  background: var(--green);
}

pre {
  margin: 0;
  padding: 1.3rem;
  overflow: auto;
  color: var(--cyan);
  font-size: clamp(0.86rem, 2vw, 1rem);
  line-height: 1.8;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 4rem;
  overflow: hidden;
}

.status-strip div {
  min-height: 6.6rem;
  padding: 1.2rem;
  background: rgba(255, 255, 255, 0.025);
}

.status-strip strong {
  display: block;
  color: var(--cyan);
  font-size: 1.7rem;
}

.status-strip span {
  color: var(--muted);
}

.section {
  margin-bottom: 5rem;
}

.section-heading {
  margin-bottom: 1.2rem;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.compact h2 {
  font-size: clamp(1.6rem, 3vw, 2.3rem);
}

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

.featured-card,
.post-card {
  position: relative;
  overflow: hidden;
  padding: 1.2rem;
}

.featured-card::before,
.post-card::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(135deg, rgba(90, 245, 255, 0.12), transparent 42%, rgba(155, 124, 255, 0.12));
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.featured-card:hover::before,
.post-card:hover::before {
  opacity: 1;
}

.featured-card:focus-visible,
.post-card:focus-visible,
.filter-button:focus-visible,
.button:focus-visible,
.modal-close:focus-visible {
  outline: 3px solid rgba(90, 245, 255, 0.4);
  outline-offset: 4px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.featured-card h3,
.post-card h3 {
  margin: 0.9rem 0 0.75rem;
  font-size: 1.28rem;
  line-height: 1.35;
}

.featured-card p,
.post-card p,
.profile-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.tags,
.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}

.tag,
.filter-button {
  display: inline-flex;
  min-height: 2rem;
  align-items: center;
  border: 1px solid rgba(90, 245, 255, 0.18);
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(90, 245, 255, 0.06);
  font-size: 0.82rem;
}

.tag {
  padding: 0 0.7rem;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.2rem;
  align-items: start;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.search-box {
  display: grid;
  gap: 0.42rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.search-box input {
  width: 100%;
  min-height: 3rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  padding: 0 1rem;
  outline: none;
}

.search-box input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(90, 245, 255, 0.1);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-content: end;
  justify-content: flex-end;
}

.filter-button {
  padding: 0 0.8rem;
  cursor: pointer;
}

.filter-button.is-active {
  color: #001015;
  border-color: transparent;
  background: var(--cyan);
  font-weight: 900;
}

.posts-grid {
  display: grid;
  gap: 0.9rem;
}

.post-card {
  width: 100%;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.sidebar {
  display: grid;
  gap: 1rem;
  position: sticky;
  top: 88px;
}

.profile-card,
.stack-card,
.api-card {
  padding: 1.15rem;
}

.profile-card h2 {
  margin: 0 0 0.75rem;
}

.profile-links,
.stack-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.48rem;
  margin-top: 1rem;
}

.profile-links a,
.stack-list span {
  display: inline-flex;
  min-height: 2rem;
  align-items: center;
  padding: 0 0.7rem;
  border: 1px solid rgba(155, 124, 255, 0.24);
  border-radius: 8px;
  color: var(--text);
  background: rgba(155, 124, 255, 0.08);
  font-size: 0.84rem;
}

.api-card code {
  display: block;
  margin-top: 0.55rem;
  color: var(--green);
  overflow-wrap: anywhere;
}

.loading,
.empty,
.error {
  padding: 1.2rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
}

.error {
  border-color: rgba(255, 107, 135, 0.42);
  color: #ffc3ce;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 1rem;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.modal.is-open {
  visibility: visible;
  opacity: 1;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 9, 0.78);
  backdrop-filter: blur(10px);
}

.modal-card {
  position: relative;
  width: min(720px, 100%);
  max-height: min(78vh, 760px);
  overflow: auto;
  padding: clamp(1.25rem, 4vw, 2rem);
}

.modal-card h2 {
  margin: 0 0 0.8rem;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  line-height: 1.2;
}

.modal-card p:last-child {
  color: var(--muted);
  line-height: 1.9;
}

.modal-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

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

  .sidebar {
    position: static;
  }

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

  .filter-group {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 0.8rem 0;
  }

  .nav {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    min-height: auto;
    padding: 3rem 0;
  }

  .status-strip,
  .featured-grid {
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
