:root {
  color-scheme: dark;
  --ink: #f7f4ea;
  --muted: rgba(247, 244, 234, 0.72);
  --soft: rgba(247, 244, 234, 0.12);
  --panel: rgba(12, 18, 22, 0.68);
  --panel-strong: rgba(13, 19, 24, 0.86);
  --line: rgba(247, 244, 234, 0.18);
  --accent: #8fd3c7;
  --accent-strong: #f6c66d;
  --danger: #ff9f8d;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", "PingFang SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: #071013;
}

button,
a {
  color: inherit;
}

button {
  font: inherit;
}

.background-stage {
  position: fixed;
  inset: 0;
  z-index: -3;
  overflow: hidden;
  background: #071013;
}

.bg-layer {
  position: absolute;
  inset: -2%;
  opacity: 0;
  background-position: center;
  background-size: cover;
  filter: saturate(1.02) contrast(1.05);
  transform: scale(1.04);
  transition:
    opacity 760ms ease,
    transform 1200ms ease;
}

.bg-layer.is-visible {
  opacity: 1;
  transform: scale(1);
}

.background-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 15%, rgba(255, 255, 255, 0.16), transparent 26%),
    linear-gradient(90deg, rgba(3, 8, 10, 0.72), rgba(3, 8, 10, 0.22) 48%, rgba(3, 8, 10, 0.58)),
    linear-gradient(180deg, rgba(3, 8, 10, 0.62), rgba(3, 8, 10, 0.14) 34%, rgba(3, 8, 10, 0.9));
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(170px, auto) minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  width: min(1680px, calc(100% - 48px));
  margin: 0 auto;
  padding: 18px 0 12px;
}

.site-header::before {
  position: absolute;
  inset: 0 -24px;
  z-index: -1;
  content: "";
  background: linear-gradient(180deg, rgba(5, 12, 14, 0.84), rgba(5, 12, 14, 0.3) 72%, transparent);
  backdrop-filter: blur(16px);
  mask-image: linear-gradient(180deg, #000 72%, transparent);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #061014;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, #f6c66d, #8fd3c7 56%, #d8efe9);
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
}

.brand strong,
.brand small {
  display: block;
  white-space: nowrap;
}

.brand strong {
  font-size: 17px;
  letter-spacing: 0;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.home-return {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  color: #071013;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  text-decoration: none;
  background: linear-gradient(135deg, #f4f0df, #8fd3c7);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.22);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.home-return:hover,
.home-return:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.3);
}

.stage-tabs {
  display: flex;
  gap: 8px;
  min-width: 0;
  padding: 6px;
  overflow-x: auto;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  scrollbar-width: none;
}

.stage-tabs::-webkit-scrollbar {
  display: none;
}

.stage-tab {
  position: relative;
  flex: 0 0 auto;
  min-width: 104px;
  padding: 10px 14px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 999px;
  outline: none;
  transition:
    color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.stage-tab:hover,
.stage-tab:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.stage-tab.is-active {
  color: #071013;
  background: linear-gradient(135deg, #f4f0df, #8fd3c7);
  box-shadow: 0 14px 32px rgba(143, 211, 199, 0.2);
}

.stage-tab span {
  position: relative;
  z-index: 1;
  display: block;
}

.stage-tab small {
  position: relative;
  z-index: 1;
  display: block;
  margin-bottom: 2px;
  font-size: 11px;
  opacity: 0.72;
}

.stage-tab.is-active::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: translateX(-100%);
  animation: tab-shine 2.4s ease infinite;
}

@keyframes tab-shine {
  0% {
    transform: translateX(-100%);
  }

  55%,
  100% {
    transform: translateX(100%);
  }
}

.page-shell {
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
  padding: 72px 0 96px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.9fr);
  gap: 28px;
  align-items: end;
  min-height: 56vh;
  padding: 54px 34px 44px;
}

.hero-copy {
  max-width: 840px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  margin: 0 0 16px;
  padding: 8px 12px;
  color: #071013;
  font-size: 13px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  border-radius: 999px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.hero-copy h1 {
  max-width: 860px;
  margin-bottom: 18px;
  font-size: clamp(42px, 7vw, 92px);
  line-height: 0.96;
  letter-spacing: 0;
  text-shadow: 0 12px 42px rgba(0, 0, 0, 0.48);
  text-wrap: balance;
}

.hero-summary {
  max-width: 760px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 19px;
  line-height: 1.78;
}

.stage-dashboard {
  display: grid;
  gap: 12px;
}

.metric-card {
  padding: 18px;
  background: rgba(5, 14, 16, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
}

.metric-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.metric-card strong {
  display: block;
  color: #fff;
  font-size: 18px;
  line-height: 1.45;
}

.hero-actions {
  display: flex;
  grid-column: 1 / -1;
  gap: 12px;
  align-items: center;
}

.primary-button,
.ghost-button {
  min-height: 44px;
  padding: 0 18px;
  cursor: pointer;
  border-radius: 999px;
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
}

.primary-button {
  color: #071013;
  font-weight: 800;
  background: linear-gradient(135deg, #f4f0df, #8fd3c7);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.ghost-button {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.primary-button:hover,
.ghost-button:hover,
.primary-button:focus-visible,
.ghost-button:focus-visible {
  transform: translateY(-1px);
}

.content-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin-top: 24px;
}

.reading-rail {
  position: sticky;
  top: 94px;
  display: grid;
  gap: 14px;
}

.rail-card,
.document-card {
  background: var(--panel-strong);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.rail-card {
  padding: 18px;
}

.rail-label,
.doc-label {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.rail-progress {
  display: grid;
  gap: 10px;
}

.rail-progress span {
  font-size: 28px;
  font-weight: 900;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.progress-fill {
  width: 12.5%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  border-radius: inherit;
  transition: width 360ms ease;
}

.outline-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 280px);
  padding: 0;
  margin: 0;
  overflow: auto;
  list-style: none;
}

.outline-list a {
  display: block;
  padding: 9px 10px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.5;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 6px;
}

.outline-list a:hover,
.outline-list a:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.document-card {
  min-width: 0;
  overflow: hidden;
}

.document-toolbar {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  padding: 20px 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.document-toolbar h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.35;
}

.doc-status {
  flex: 0 0 auto;
  padding: 8px 12px;
  color: #071013;
  font-size: 13px;
  font-weight: 800;
  background: var(--accent);
  border-radius: 999px;
}

.doc-status.is-pending {
  color: #271407;
  background: var(--accent-strong);
}

.markdown-body {
  padding: 34px 42px 48px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 16px;
  line-height: 1.86;
}

.markdown-body > *:first-child {
  margin-top: 0;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  color: #fff;
  line-height: 1.32;
  letter-spacing: 0;
  scroll-margin-top: 120px;
}

.markdown-body h1 {
  margin: 0 0 24px;
  font-size: 34px;
}

.markdown-body h2 {
  margin: 42px 0 16px;
  padding-top: 12px;
  font-size: 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.markdown-body h3 {
  margin: 34px 0 12px;
  font-size: 20px;
}

.markdown-body h4 {
  margin: 28px 0 10px;
  font-size: 17px;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body blockquote,
.markdown-body table,
.markdown-body pre {
  margin-bottom: 18px;
}

.markdown-body a {
  color: var(--accent);
}

.markdown-body strong {
  color: #fff;
}

.markdown-body code {
  padding: 2px 6px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
}

.markdown-body pre {
  padding: 18px;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
}

.markdown-body pre code {
  padding: 0;
  background: transparent;
  border: 0;
}

.markdown-body blockquote {
  padding: 16px 18px;
  margin-left: 0;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(143, 211, 199, 0.12);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
}

.markdown-body table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.markdown-body th,
.markdown-body td {
  min-width: 120px;
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.markdown-body th {
  color: #071013;
  background: rgba(143, 211, 199, 0.9);
}

.markdown-body td {
  background: rgba(255, 255, 255, 0.055);
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.35em;
}

.markdown-body li + li {
  margin-top: 6px;
}

.markdown-body hr {
  height: 1px;
  margin: 36px 0;
  background: rgba(255, 255, 255, 0.14);
  border: 0;
}

.placeholder-note {
  padding: 18px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(246, 198, 109, 0.12);
  border: 1px solid rgba(246, 198, 109, 0.32);
  border-radius: 8px;
}

.prototype-video-card {
  margin: 24px 0 28px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.28);
}

.prototype-video {
  display: block;
  width: 100%;
  max-height: 72vh;
  aspect-ratio: 16 / 9;
  background: #020708;
}

.bilibili-frame-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #020708;
  aspect-ratio: 16 / 9;
}

.bilibili-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.prototype-video-card figcaption {
  display: grid;
  gap: 6px;
  padding: 16px 18px 18px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  line-height: 1.55;
}

.prototype-video-card figcaption strong {
  color: #fff;
  font-size: 16px;
}

.prototype-video-card figcaption span,
.prototype-video-card figcaption em {
  display: block;
}

.prototype-video-card figcaption em {
  color: var(--accent-strong);
  font-style: normal;
}

.prototype-video-card figcaption a {
  width: fit-content;
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.prototype-video-card figcaption a:hover,
.prototype-video-card figcaption a:focus-visible {
  text-decoration: underline;
}

.fade-enter {
  animation: content-enter 420ms ease both;
}

@keyframes content-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1120px) {
  .site-header {
    grid-template-columns: 1fr;
    width: min(100% - 28px, 980px);
  }

  .home-return {
    justify-self: start;
  }

  .page-shell {
    width: min(100% - 28px, 980px);
    padding-top: 42px;
  }

  .hero-panel,
  .content-layout {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    min-height: 0;
    padding: 34px;
  }

  .reading-rail {
    position: static;
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .outline-list {
    max-height: 220px;
  }
}

@media (max-width: 720px) {
  .site-header {
    width: calc(100% - 20px);
    padding-top: 10px;
  }

  .brand strong {
    font-size: 15px;
  }

  .stage-tabs {
    border-radius: 8px;
  }

  .stage-tab {
    min-width: 94px;
    padding: 9px 12px;
  }

  .page-shell {
    width: calc(100% - 20px);
    padding-top: 22px;
    padding-bottom: 56px;
  }

  .hero-panel {
    padding: 24px;
  }

  .hero-copy h1 {
    font-size: 40px;
  }

  .hero-summary {
    font-size: 16px;
  }

  .stage-dashboard,
  .reading-rail {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .document-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .markdown-body {
    padding: 24px 20px 34px;
    font-size: 15px;
  }

  .markdown-body h1 {
    font-size: 27px;
  }

  .markdown-body h2 {
    font-size: 22px;
  }
}
