@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-top: #141a32;
  --bg-mid: #090d1a;
  --bg-bottom: #03050b;

  --text: #f5f7ff;
  --muted: rgba(226, 232, 240, 0.74);

  --line: rgba(255, 255, 255, 0.12);

  --shadow-lg: 0 28px 90px rgba(0, 0, 0, 0.34);
  --shadow-md: 0 18px 54px rgba(0, 0, 0, 0.26);

  --radius-xxl: 32px;

  --container: 1280px;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  background: radial-gradient(
      ellipse at top,
      var(--bg-top) 0%,
      var(--bg-mid) 48%,
      var(--bg-bottom) 100%
    )
    fixed;
}

body {
  min-height: 100vh;
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  color: var(--text);
  background: transparent;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button {
  font: inherit;
}

img,
video {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: 3px solid rgba(96, 165, 250, 0.32);
  outline-offset: 2px;
}

/* 背景效果 */
.scene-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(5, 8, 20, 0.16) 0%,
    rgba(5, 8, 20, 0.8) 100%
  );
  opacity: 0.16;
  transform: scale(1.04);
}

.stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(
      1.5px 1.5px at 25px 35px,
      rgba(255, 255, 255, 1),
      rgba(0, 0, 0, 0)
    ),
    radial-gradient(
      2px 2px at 150px 200px,
      rgba(210, 190, 255, 0.95),
      rgba(0, 0, 0, 0)
    ),
    radial-gradient(
      1px 1px at 50px 160px,
      rgba(255, 255, 255, 0.95),
      rgba(0, 0, 0, 0)
    ),
    radial-gradient(
      1.5px 1.5px at 100px 120px,
      rgba(255, 255, 255, 1),
      rgba(0, 0, 0, 0)
    ),
    radial-gradient(
      1px 1px at 190px 70px,
      rgba(255, 255, 255, 1),
      rgba(0, 0, 0, 0)
    ),
    radial-gradient(
      1.5px 1.5px at 10px 230px,
      rgba(255, 170, 220, 0.86),
      rgba(0, 0, 0, 0)
    ),
    radial-gradient(
      2px 2px at 210px 40px,
      rgba(255, 220, 140, 0.86),
      rgba(0, 0, 0, 0)
    ),
    radial-gradient(
      1.5px 1.5px at 230px 145px,
      rgba(130, 220, 255, 0.86),
      rgba(0, 0, 0, 0)
    );
  background-repeat: repeat;
  background-size: 280px 280px;
  opacity: 0.52;
  animation: moveStars 80s linear infinite;
}

.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.05;
  background-image: linear-gradient(
      rgba(255, 255, 255, 0.05) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 84px 84px;
  mask-image: radial-gradient(circle at center, black 14%, transparent 82%);
  -webkit-mask-image: radial-gradient(
    circle at center,
    black 14%,
    transparent 82%
  );
}

.glow-effect {
  position: fixed;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.14;
  pointer-events: none;
  z-index: 1;
}

.glow-1 {
  top: -220px;
  left: -180px;
  background: radial-gradient(
    circle,
    rgba(139, 92, 246, 0.42) 0%,
    transparent 70%
  );
  animation: drift 20s ease-in-out infinite;
}

.glow-2 {
  right: -180px;
  bottom: -220px;
  background: radial-gradient(
    circle,
    rgba(34, 211, 238, 0.38) 0%,
    transparent 70%
  );
  animation: drift 26s ease-in-out infinite reverse;
}

/* 页面布局 */
.page-shell {
  position: relative;
  z-index: 10;
  width: min(var(--container), 100%);
  margin: 0 auto;
  padding: 18px 24px 88px;
}

.site-header {
  position: sticky;
  top: 18px;
  z-index: 80;
}

.header-stack {
  display: grid;
  gap: 12px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 14px;
  border-radius: 24px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.03)
  );
  border: 1px solid var(--line);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  box-shadow: var(--shadow-lg);
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-copy {
  min-width: 0;
}

.brand-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.brand-domain {
  margin-top: 3px;
  font-size: 0.76rem;
  color: rgba(226, 232, 240, 0.58);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav-center {
  display: flex;
  align-items: center;
  gap: 24px;
  min-width: 0;
}

.nav-link {
  color: rgba(226, 232, 240, 0.74);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: color 0.28s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: #ffffff;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.ghost-btn,
.primary-btn,
.lang-btn,
.menu-toggle {
  border: none;
  cursor: pointer;
  transition: all 0.28s ease;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
}

.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.09);
}

.lang-container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.lang-btn {
  min-width: 62px;
  height: 38px;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.88rem;
  font-weight: 700;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.lang-btn.is-active {
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.22),
    rgba(56, 189, 248, 0.22)
  );
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.1);
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.09);
}

.menu-bars {
  position: relative;
  width: 18px;
  height: 14px;
}

.menu-bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: #ffffff;
  transition: all 0.28s ease;
}

.menu-bars span:nth-child(1) {
  top: 0;
}

.menu-bars span:nth-child(2) {
  top: 6px;
}

.menu-bars span:nth-child(3) {
  top: 12px;
}

.menu-toggle.is-active .menu-bars span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle.is-active .menu-bars span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-active .menu-bars span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.mobile-menu-panel {
  display: none;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.03)
  );
  border: 1px solid var(--line);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  box-shadow: var(--shadow-md);
}

.mobile-menu-panel.is-open {
  display: block;
  border-radius: 24px;
}

.mobile-menu-inner {
  padding: 20px;
  display: grid;
  gap: 20px;
}

.mobile-menu-group {
  display: grid;
  gap: 10px;
}

.mobile-menu-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(226, 232, 240, 0.44);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.mobile-menu-link {
  display: block;
  color: rgba(226, 232, 240, 0.82);
  font-size: 0.94rem;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 12px;
  transition: 0.2s ease;
}

.mobile-menu-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.mobile-menu-cta {
  width: 100%;
}

.btn-icon {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.hero-section {
  margin-top: 22px;
}

.doc-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e7edff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.primary-btn {
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.96),
    rgba(56, 189, 248, 0.96)
  );
  color: #ffffff;
  box-shadow:
    0 16px 36px rgba(56, 189, 248, 0.18),
    0 12px 30px rgba(139, 92, 246, 0.16);
}

.primary-btn:hover {
  transform: translateY(-2px);
}

/* Footer */
.footer-panel {
  margin-top: 22px;
  padding: 30px;
  border-radius: 28px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.03)
  );
  border: 1px solid var(--line);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  box-shadow: var(--shadow-md);
}

.footer-bottom {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  color: rgba(148, 163, 184, 0.72);
  font-size: 0.84rem;
  letter-spacing: 0.04em;
}

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--line);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  box-shadow: var(--shadow-md);
}

.hero-section {
  margin-top: 22px;
}

.doc-intro {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.6fr);
  gap: 22px;
  padding: 34px;
  border-radius: var(--radius-xxl);
  overflow: hidden;
  animation: fadeInUp 0.55s ease both;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--line);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  box-shadow: var(--shadow-md);
}

.doc-intro::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
      radial-gradient(circle at 14% 12%, rgba(139, 92, 246, 0.1), transparent 30%),
      radial-gradient(circle at 86% 16%, rgba(56, 189, 248, 0.1), transparent 28%);
}

.doc-meta,
.doc-stats-panel {
  position: relative;
  z-index: 1;
}

.doc-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.doc-title {
  margin-top: 18px;
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.05em;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 0%, #dfe9ff 46%, #b5d6ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.doc-desc {
  margin-top: 18px;
  max-width: 66ch;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.92;
}

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

.doc-stats-panel {
  padding: 24px;
  border-radius: 28px;
  background:
      linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
      radial-gradient(circle at 18% 18%, rgba(139, 92, 246, 0.12), transparent 34%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  gap: 16px;
}

.stat-item {
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-item:last-child {
  border-bottom: none;
}

.stat-label {
  color: rgba(226, 232, 240, 0.62);
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.stat-value {
  margin-top: 8px;
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.6;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.status-badge.completed {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.14), rgba(96, 165, 250, 0.14));
}

.btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.055);
  color: #fff;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: 0.2s ease;
}
.btn:hover {
  background: rgba(255, 255, 255, 0.09);
}
.btn.primary {
  border: none;
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.96),
    rgba(56, 189, 248, 0.96)
  );
  box-shadow:
    0 10px 28px rgba(56, 189, 248, 0.2),
    0 8px 22px rgba(139, 92, 246, 0.16);
}

.layout {
  margin-top: 22px;
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1.3fr);
  gap: 22px;
  align-items: stretch;
  height: clamp(980px, 82vh, 1200px);
}

.layout > .card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.card {
  border-radius: 24px;
  padding: 24px;
}

.code-card {
  align-self: stretch;
  padding-bottom: 14px;
}

.card-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.title {
  font-size: 1rem;
  font-weight: 740;
  color: #fff;
}
.sub {
  font-size: 0.78rem;
  text-transform: uppercase;
  color: rgba(186, 230, 253, 0.86);
  letter-spacing: 0.12em;
}

.search {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  padding: 0 12px;
  font-size: 0.9rem;
  outline: none;
}
.search::placeholder {
  color: rgba(226, 232, 240, 0.5);
}

.tree-wrap {
  flex: 1;
  min-height: 0;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px;
  max-height: none;
  overflow: auto;
}

.tree,
.tree ul {
  list-style: none;
}
.tree ul {
  margin-left: 16px;
  padding-left: 10px;
  border-left: 1px dashed rgba(255, 255, 255, 0.14);
}

.row {
  min-height: 34px;
  border-radius: 10px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(226, 232, 240, 0.88);
  user-select: none;
  transition: 0.2s ease;
}
.row:hover {
  background: rgba(255, 255, 255, 0.06);
}
.row.file {
  cursor: pointer;
}
.row.file.active {
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.2),
    rgba(56, 189, 248, 0.2)
  );
  border: 1px solid var(--line);
  color: #fff;
}

.caret {
  width: 14px;
  text-align: center;
  color: rgba(226, 232, 240, 0.68);
  cursor: pointer;
  flex: 0 0 14px;
}

.node-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.code-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 10px;
}

.code-file {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}
.code-meta {
  font-size: 0.8rem;
  color: rgba(226, 232, 240, 0.62);
}

.code-wrap {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(5, 8, 20, 0.65);
  overflow: hidden;
}

pre {
  flex: 1;
  min-height: 0;
  margin: 0;
  --line-no-width: 4ch;
  padding: 14px;
  max-height: 100%;
  overflow-x: auto;
  overflow-y: auto;
  tab-size: 4;
  -moz-tab-size: 4;
  font-size: 0.86rem;
  line-height: 1.65;
  color: #eaf1ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", monospace;
}

.code-line {
  display: grid;
  grid-template-columns: var(--line-no-width) minmax(0, 1fr);
  align-items: stretch;
  min-height: 1.65em;
}

.line-content {
  position: relative;
  display: block;
  min-width: 0;
  flex: 1;
  white-space: pre;
}

.indent-overlay {
  position: absolute;
  left: -1.8ch;
  top: 0;
  bottom: 0;
  background-image: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc(2ch - 1px),
    rgba(148, 163, 184, 0.24) calc(2ch - 1px),
    rgba(148, 163, 184, 0.24) 2ch,
    transparent 2ch,
    transparent 4ch
  );
  pointer-events: none;
}

.line-no {
  display: block;
  width: var(--line-no-width);
  padding-right: 1ch;
  text-align: right;
  color: rgba(148, 163, 184, 0.56);
  user-select: none;
}

.hidden {
  display: none !important;
}

@keyframes moveStars {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 500px 1000px;
  }
}

@keyframes drift {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(36px, 28px) scale(1.05);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1160px) {
  .doc-intro {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .layout > .card {
    height: auto;
  }
  .tree-wrap,
  .code-wrap {
    max-height: 55vh;
  }
  pre {
    max-height: 100%;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 12px 12px 56px;
  }
  .topbar {
    border-radius: 18px;
    padding: 10px;
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .nav-center {
    display: none;
  }
  .nav-actions {
    width: 100%;
    justify-content: space-between;
  }
  .brand-mark {
    width: 40px;
    height: 40px;
  }
  .brand-name {
    font-size: 0.88rem;
  }
  .brand-domain {
    font-size: 0.7rem;
  }
  .doc-intro,
  .card {
    border-radius: 20px;
    padding: 14px;
  }
  .doc-kicker {
    font-size: 0.72rem;
    padding: 8px 13px;
  }
  .doc-title {
    font-size: 2rem;
  }
  .doc-desc {
    font-size: 0.92rem;
    line-height: 1.78;
  }
  .doc-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
  .btn {
    width: 100%;
  }
  .menu-toggle {
    display: inline-flex;
  }
  .ghost-btn {
    display: none;
  }
}
