:root {
  --paper: #f4f3ef;
  --paper-deep: #ebe9e3;
  --ink: #303335;
  --muted: #747b7f;
  --mist: #91a1aa;
  --mist-light: #dbe3e6;
  --line: rgba(65, 76, 82, 0.16);
  --quote: #58666d;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;

  color: var(--ink);
  background:
    linear-gradient(
      180deg,
      #dce4e7 0,
      #e8ecec 28rem,
      var(--paper) 48rem,
      var(--paper) 100%
    );

  font-family:
    "Noto Serif SC",
    "Source Han Serif SC",
    "Songti SC",
    "STSong",
    "SimSun",
    serif;

  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  color: #24282a;
  background: #cbd7db;
}

/* 返回博客 */

.back-link {
  position: fixed;
  z-index: 20;

  top: 1.4rem;
  left: 1.5rem;

  color: rgba(46, 51, 54, 0.62);

  font-family:
    system-ui,
    -apple-system,
    "Microsoft YaHei",
    sans-serif;

  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-decoration: none;

  transition:
    color 160ms ease,
    transform 160ms ease;
}

.back-link:hover {
  color: var(--ink);
  transform: translateX(-2px);
}

/* 封面 */

.book-cover {
  min-height: 94vh;
  padding: 14vh 1.5rem 8vh;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  text-align: center;
}

.book-version {
  margin: 0 0 3rem;

  color: rgba(55, 67, 73, 0.52);

  font-family:
    Georgia,
    "Times New Roman",
    serif;

  font-size: 0.7rem;
  letter-spacing: 0.36em;
}

.book-cover h1 {
  margin: 0;

  font-size: clamp(3.5rem, 10vw, 6.5rem);
  font-weight: 400;

  letter-spacing: 0.34em;
  text-indent: 0.34em;
}

.book-subtitle {
  margin: 2.4rem 0 0;

  color: #59666c;

  font-size: 1rem;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
}

.book-meta {
  margin-top: 5rem;

  display: flex;
  gap: 1.8rem;

  color: rgba(55, 67, 73, 0.52);

  font-family:
    system-ui,
    -apple-system,
    "Microsoft YaHei",
    sans-serif;

  font-size: 0.74rem;
  letter-spacing: 0.12em;
}

.scroll-hint {
  margin-top: 5rem;

  color: rgba(55, 67, 73, 0.32);

  font-family:
    system-ui,
    sans-serif;

  font-size: 1.1rem;
  text-decoration: none;

  animation: wind-trace-float 2.8s ease-in-out infinite;
}

@keyframes wind-trace-float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(7px);
  }
}

/* 正文容器 */

.page-shell {
  width: min(100%, 820px);
  margin: 0 auto;

  padding: 5rem 2rem 9rem;
}

.wind-trace {
  font-size: 1.05rem;
  line-height: 2.08;
  letter-spacing: 0.02em;
}

.wind-trace p {
  margin: 1.42em 0;

  text-align: justify;
  text-justify: inter-ideograph;
}

/* 辑标题：序、风来、风渐、风去、尾 */

.wind-trace > h1 {
  margin: 10rem 0 4.5rem;

  color: #535e63;

  text-align: center;

  font-size: 1.08rem;
  font-weight: 400;

  letter-spacing: 0.5em;
  text-indent: 0.5em;
}

.wind-trace > h1:first-child {
  margin-top: 4rem;
}

/* 文章标题 */

.wind-trace h2 {
  margin: 6rem 0 3rem;

  text-align: center;

  font-size: clamp(1.65rem, 5vw, 2.15rem);
  font-weight: 500;

  letter-spacing: 0.15em;
  text-indent: 0.15em;
}

.wind-trace h3 {
  margin: 4rem 0 2rem;

  font-size: 1.3rem;
  font-weight: 500;
}

/* 目录 */

.wind-trace ul {
  width: fit-content;

  margin: 2rem auto 5rem;
  padding-left: 1.2rem;

  color: var(--muted);
  line-height: 2;
}

.wind-trace li::marker {
  color: var(--mist);
}

/* 引用 */

.wind-trace blockquote {
  margin: 3rem 0;
  padding: 0.15rem 0 0.15rem 1.5rem;

  color: var(--quote);

  border-left: 2px solid var(--mist);
}

.wind-trace blockquote p {
  margin: 0.8rem 0;
}

/* 行内代码 */

.wind-trace code {
  padding: 0.1em 0.35em;

  border-radius: 0.25rem;

  background: rgba(100, 117, 126, 0.08);

  font-family:
    "Cascadia Code",
    "JetBrains Mono",
    Consolas,
    monospace;

  font-size: 0.88em;
}

/* 代码块 */

.wind-trace pre {
  overflow-x: auto;

  margin: 2.5rem 0;
  padding: 1.2rem 1.4rem;

  border: 1px solid var(--line);
  border-radius: 0.35rem;

  background: rgba(233, 235, 232, 0.72);

  line-height: 1.7;
}

.wind-trace pre code {
  padding: 0;
  background: transparent;
}

/* 链接 */

.wind-trace a {
  color: #566d78;

  text-decoration-color: rgba(86, 109, 120, 0.35);
  text-underline-offset: 0.2em;
}

/* 图片 */

.wind-trace img {
  display: block;

  max-width: 100%;
  height: auto;

  margin: 3rem auto;

  border-radius: 0.2rem;
}

/* 章节间隔 */

.wind-trace hr,
.wind-trace .break-page {
  width: 46%;
  height: 1px;

  margin: 8rem auto;

  border: 0;

  background:
    linear-gradient(
      90deg,
      transparent,
      var(--line),
      transparent
    );
}

/* 页脚 */

.book-footer {
  margin-top: 10rem;
  padding-top: 3rem;

  color: var(--muted);

  border-top: 1px solid var(--line);

  text-align: center;

  font-family:
    system-ui,
    -apple-system,
    "Microsoft YaHei",
    sans-serif;

  font-size: 0.74rem;
  line-height: 1.8;
  letter-spacing: 0.08em;
}

/* 手机端 */

@media (max-width: 680px) {
  .back-link {
    position: absolute;

    top: 1rem;
    left: 1rem;
  }

  .book-cover {
    min-height: 88vh;
    padding-top: 12vh;
  }

  .book-cover h1 {
    font-size: 3.35rem;
  }

  .book-meta {
    flex-direction: column;
    gap: 0.65rem;
  }

  .page-shell {
    padding:
      3rem
      max(1.25rem, env(safe-area-inset-right))
      7rem
      max(1.25rem, env(safe-area-inset-left));
  }

  .wind-trace {
    font-size: 1rem;
    line-height: 2;
  }

  .wind-trace p {
    text-align: left;
  }

  .wind-trace > h1 {
    margin-top: 7rem;
  }

  .wind-trace h2 {
    margin-top: 5rem;
  }

  .wind-trace hr,
  .wind-trace .break-page {
    margin: 6rem auto;
  }
}

/* ==================================================
   WIND TRACE COLOR THEME
   Version A: Misty Paper
   ================================================== */

:root {
  --paper: #f4f3ef;
  --ink: #303335;
  --muted: #737b7f;

  --accent-cool: #687c85;
  --accent-neutral: #707b80;
  --accent-dusk: #786f78;

  --line: rgba(69, 83, 90, 0.17);
  --mist: #91a3ab;
  --quote: #58686f;
}

body {
  margin: 0;

  color: var(--ink);

  background:
    linear-gradient(
      180deg,

      #d9e3e6 0%,
      #e6ebea 7%,

      #f3f2ee 18%,
      #f5f4f0 34%,

      #eef1ef 50%,
      #edf0ef 62%,

      #f0edef 76%,
      #eee9ed 87%,

      #f4f2ef 100%
    );

  font-family:
    "Noto Serif SC",
    "Source Han Serif SC",
    "Songti SC",
    "STSong",
    "SimSun",
    serif;

  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 辑标题保持轻微的冷暖变化 */

.wind-trace > h1:nth-of-type(1),
.wind-trace > h1:nth-of-type(2) {
  color: var(--accent-cool);
}

.wind-trace > h1:nth-of-type(3) {
  color: var(--accent-neutral);
}

.wind-trace > h1:nth-of-type(4),
.wind-trace > h1:nth-of-type(5) {
  color: var(--accent-dusk);
}

.wind-trace blockquote {
  color: var(--quote);
  border-left-color: var(--mist);
}

.wind-trace hr,
.wind-trace .break-page {
  background:
    linear-gradient(
      90deg,
      transparent,
      var(--line),
      transparent
    );
}

/* ================= COLOR THEME END ================= */