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

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --ink: #1B1B2F;
  --ink-deep: #101022;
  --ink-soft: #1e1e38;
  --amber: #F2A65A;
  --amber-deep: #b8621a;
  --cream: #F7F3EE;
  --cream-dim: #ded7cd;
  --line: rgba(242, 166, 90, 0.3);
  --hair: rgba(247, 243, 238, 0.12);
  --barw: 84px;
  --barh: 56px;
  --radius: 4px;
  --ui: "Fredoka", "Nunito", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --body: "Nunito", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--ink);
  background-image: radial-gradient(circle at 82% 6%, rgba(242, 166, 90, 0.12), transparent 46%),
    radial-gradient(circle at 4% 62%, rgba(242, 166, 90, 0.07), transparent 40%);
  color: var(--cream);
  font-family: var(--body);
  font-size: 17px;
  font-weight: 300;
  line-height: 1.78;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

::selection {
  background: var(--amber);
  color: var(--ink);
}

h1,
h2,
h3 {
  font-family: var(--ui);
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: 0.01em;
  margin: 0 0 0.5em;
}

/* 左侧固定竖条 */
.bar {
  position: fixed;
  z-index: 60;
  top: 0;
  left: 0;
  right: 0;
  height: var(--barh);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px 0 16px;
  background: rgba(16, 16, 34, 0.94);
  border-bottom: 1px solid var(--hair);
  backdrop-filter: blur(6px);
}

.bar-brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 2px;
  font-family: var(--ui);
  font-size: 17px;
  font-weight: 600;
  color: var(--amber);
  letter-spacing: 0.24em;
}

.logo-img {
  width: auto;
  max-height: 30px;
}

.bar-word {
  white-space: nowrap;
}

.burger {
  width: 44px;
  height: 44px;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.burger:hover {
  border-color: var(--amber);
}

.burger-line {
  width: 20px;
  height: 2px;
  background: var(--amber);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-open .burger-line:first-child {
  transform: translateY(4px) rotate(45deg);
}

.menu-open .burger-line:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

/* 滚动进度 */
.pbar {
  position: fixed;
  z-index: 50;
  top: 0;
  right: 0;
  width: 3px;
  height: 100%;
  background: rgba(247, 243, 238, 0.07);
}

.pbar i {
  display: block;
  height: 100%;
  background: var(--amber);
  transform: scaleY(0);
  transform-origin: top center;
  will-change: transform;
}

/* 全屏遮罩菜单 */
.veil {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--barh) + 34px) 24px 40px;
  background: var(--ink-deep);
  background-image: radial-gradient(circle at 88% 12%, rgba(242, 166, 90, 0.16), transparent 52%);
  visibility: hidden;
  opacity: 0;
  transform: translateY(-1.2rem);
  transition: opacity 0.4s ease, transform 0.5s ease, visibility 0.5s;
}

.menu-open .veil {
  visibility: visible;
  opacity: 1;
  transform: none;
}

.menu-open body {
  overflow: hidden;
}

.veil-nav ol {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 620px;
}

.veil-nav li {
  border-bottom: 1px solid var(--hair);
  opacity: 0;
}

.menu-open .veil-nav li {
  animation: rise 0.5s ease forwards;
}

.menu-open .veil-nav li:nth-child(1) { animation-delay: 0.05s; }
.menu-open .veil-nav li:nth-child(2) { animation-delay: 0.1s; }
.menu-open .veil-nav li:nth-child(3) { animation-delay: 0.15s; }
.menu-open .veil-nav li:nth-child(4) { animation-delay: 0.2s; }
.menu-open .veil-nav li:nth-child(5) { animation-delay: 0.25s; }
.menu-open .veil-nav li:nth-child(6) { animation-delay: 0.3s; }
.menu-open .veil-nav li:nth-child(7) { animation-delay: 0.35s; }

.veil-nav a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-height: 48px;
  padding: 12px 2px;
  font-family: var(--ui);
  font-size: clamp(21px, 4.8vw, 32px);
  font-weight: 500;
  transition: color 0.2s ease, padding-left 0.25s ease;
}

.veil-nav a:hover {
  color: var(--amber);
  padding-left: 10px;
}

.veil-nav .n {
  font-size: 15px;
  color: var(--amber);
  letter-spacing: 0.16em;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* 首屏 */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  padding: calc(var(--barh) + 56px) 22px 54px;
  background: linear-gradient(165deg, #1f1f3a 0%, #131327 55%, #0d0d1d 100%);
  isolation: isolate;
}

.hero-word {
  position: absolute;
  z-index: 1;
  top: 12%;
  left: -5%;
  font-family: var(--ui);
  font-weight: 700;
  font-size: clamp(90px, 21vw, 250px);
  line-height: 0.86;
  letter-spacing: 0.03em;
  white-space: nowrap;
  color: rgba(242, 166, 90, 0.15);
  pointer-events: none;
  will-change: transform;
}

.hero-media {
  position: absolute;
  z-index: 0;
  inset: -9% 0;
  overflow: hidden;
  will-change: transform;
}

.hero-media .hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
  filter: saturate(1.05);
}

.hero-shade {
  position: absolute;
  z-index: 2;
  inset: 0;
  background: linear-gradient(180deg, rgba(16, 16, 34, 0.62) 0%, rgba(16, 16, 34, 0.18) 38%, var(--ink) 97%);
}

.hero-copy {
  position: relative;
  z-index: 3;
  max-width: 640px;
  will-change: transform;
}

.hero-idx {
  margin: 0 0 12px;
  font-family: var(--ui);
  font-size: 16px;
  letter-spacing: 0.34em;
  color: var(--amber);
}

.hero h1 {
  font-size: clamp(30px, 6vw, 58px);
  margin: 0 0 18px;
  letter-spacing: 0.01em;
}

.hero-desc {
  margin: 0 0 28px;
  max-width: 50ch;
  color: var(--cream-dim);
  font-size: 17px;
}

.hero-jump {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 11px 24px;
  border: 1px solid rgba(242, 166, 90, 0.6);
  border-radius: var(--radius);
  color: var(--amber);
  font-family: var(--ui);
  letter-spacing: 0.2em;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.hero-jump:hover {
  background: var(--amber);
  color: var(--ink);
}

/* 正文区 */
main {
  padding: 0 22px;
}

div {
  position: relative;
  max-width: 760px;
  counter-reset: chap;
  padding-top: clamp(30px, 5vw, 52px);
}

div > section {
  position: relative;
  counter-increment: chap;
  padding: clamp(42px, 6vw, 76px) 26px;
  margin: 0 0 clamp(22px, 3.4vw, 38px);
  background: rgba(247, 243, 238, 0.035);
  border-bottom: 2px solid var(--line);
  border-radius: var(--radius);
  scroll-margin-top: calc(var(--barh) + 18px);
}

div > section:nth-of-type(even) {
  background: var(--cream);
  color: var(--ink);
  border-bottom-color: var(--ink);
}

div > section > h2 {
  font-size: clamp(23px, 3.6vw, 33px);
  margin-bottom: 0.55em;
}

div > section > h2::before {
  content: counter(chap, decimal-leading-zero);
  display: block;
  margin-bottom: 10px;
  font-family: var(--ui);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.34em;
  color: var(--amber);
}

div > section:nth-of-type(even) > h2::before {
  color: var(--amber-deep);
}

div > section p {
  margin: 0 0 1.05em;
}

div > section h3 {
  font-size: 20px;
  margin-top: 1.5em;
  color: var(--amber);
}

div > section:nth-of-type(even) h3 {
  color: var(--amber-deep);
}

div > section a {
  color: var(--amber);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

div > section:nth-of-type(even) a {
  color: var(--amber-deep);
}

div > section ul,
div > section ol {
  margin: 0 0 1.1em;
  padding-left: 1.25em;
}

div > section li {
  margin-bottom: 0.45em;
}

div > section li::marker {
  color: var(--amber);
}

div > section:nth-of-type(even) li::marker {
  color: var(--amber-deep);
}

div > section blockquote {
  margin: 1.3em 0;
  padding: 4px 0 4px 18px;
  border-left: 3px solid var(--amber);
  color: var(--cream-dim);
  font-style: normal;
}

div > section:nth-of-type(even) blockquote {
  color: #4b4a5e;
}

div > section img {
  border-radius: var(--radius);
  margin: 1.4em 0;
}

div > section strong {
  font-weight: 600;
  color: var(--amber);
}

div > section:nth-of-type(even) strong {
  color: var(--ink);
}

div > section pre {
  overflow-x: auto;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: rgba(16, 16, 34, 0.7);
  color: var(--cream);
  font-size: 15px;
  line-height: 1.6;
}

div > section code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.94em;
}

/* 侧栏 */
.rail {
  position: static;
  margin: 0 0 34px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--hair);
}

.rail h2 {
  font-size: 17px;
  margin: 0;
  letter-spacing: 0.08em;
  color: var(--amber);
}

.rail .subtitle {
  margin: 2px 0 14px;
  font-family: var(--ui);
  font-size: 16px;
  letter-spacing: 0.3em;
  color: var(--cream-dim);
}

.rail-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rail-list a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 42px;
  padding: 9px 0;
  border-bottom: 1px solid var(--hair);
  color: var(--cream-dim);
  font-size: 16px;
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.rail-list a:hover {
  color: var(--amber);
  padding-left: 6px;
}

.rail-list .n {
  font-family: var(--ui);
  font-size: 14px;
  color: var(--amber);
  letter-spacing: 0.14em;
}

/* 页脚 */
.foot {
  position: relative;
  z-index: 10;
  margin-top: clamp(48px, 8vw, 90px);
  padding: clamp(34px, 5vw, 56px) 22px 26px;
  display: grid;
  gap: 26px;
  background: var(--ink-deep);
  border-top: 2px solid var(--line);
}

.foot-logo {
  margin: 0 0 8px;
  font-family: var(--ui);
  font-size: 19px;
  letter-spacing: 0.18em;
}

.foot-logo a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  color: var(--amber);
}

.foot-host {
  margin: 0;
  font-size: 16px;
  color: var(--cream-dim);
  word-break: break-all;
}

.foot-nav dl {
  margin: 0;
}

.foot-nav dt {
  margin: 0;
  border-bottom: 1px solid var(--hair);
}

.foot-nav dt a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 0;
  font-size: 16px;
  color: var(--cream-dim);
  transition: color 0.2s ease;
}

.foot-nav dt a:hover {
  color: var(--amber);
}

.foot-end {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.foot-end p {
  margin: 0;
  font-size: 16px;
  color: var(--cream-dim);
}

.to-top a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 6px 0;
  color: var(--amber);
}

/* 滚动揭示 */
.reveal-ready div > section {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.75s ease, transform 0.75s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.reveal-ready div > section.in {
  opacity: 1;
  transform: none;
}

/* 平板及以上：左侧竖排固定条 + 固定侧栏 */
@media (min-width: 900px) {
  body {
    padding-left: var(--barw);
  }

  .bar {
    right: auto;
    bottom: 0;
    width: var(--barw);
    height: auto;
    flex-direction: column;
    justify-content: space-between;
    padding: 22px 0 22px;
    border-bottom: 0;
    border-right: 1px solid var(--hair);
  }

  .bar-brand {
    writing-mode: vertical-rl;
    min-height: 0;
    padding: 4px 0;
    font-size: 16px;
    letter-spacing: 0.34em;
  }

  .burger {
    width: 42px;
    height: 42px;
  }

  .veil {
    padding: 90px 60px;
  }

  .hero {
    padding: 130px 56px 96px;
  }

  main {
    padding: 0 clamp(24px, 5vw, 60px) 0 0;
  }

  div {
    margin-left: clamp(215px, 21vw, 295px);
  }

  div > section {
    scroll-margin-top: 24px;
  }

  .rail {
    position: fixed;
    z-index: 20;
    top: 108px;
    left: calc(var(--barw) + clamp(16px, 2vw, 30px));
    width: clamp(150px, 15vw, 200px);
    max-height: calc(100vh - 190px);
    overflow-y: auto;
    margin: 0;
    padding-bottom: 0;
    border-bottom: 0;
    scrollbar-width: thin;
  }

  .foot {
    grid-template-columns: 1.15fr 1fr 1fr;
    padding-left: clamp(24px, 5vw, 60px);
  }
}

@media (min-width: 1200px) {
  .foot {
    padding-left: clamp(230px, 20vw, 300px);
  }
}

/* 次要信息 */
.foot-nav nav::before {
  content: "";
  display: block;
  height: 8px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal-ready div > section {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .veil,
  .burger-line,
  .veil-nav a {
    transition: none;
  }

  .menu-open .veil-nav li {
    animation: none;
    opacity: 1;
  }

  .hero-word,
  .hero-media,
  .hero-copy {
    transform: none !important;
  }
}

button[aria-expanded]{min-width:44px;min-height:44px}
