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

:root {
  --paper: #f5e6c8;
  --paper2: #eedcb7;
  --tan: #d4a574;
  --tan-d: #b1834f;
  --ink: #262117;
  --ink2: #554c3b;
  --line: rgba(38, 33, 23, 0.24);
  --r: 10px;
  --shell: 1080px;
}

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

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

body {
  margin: 0;
  min-height: 100%;
  background-color: var(--paper);
  background-image: radial-gradient(circle at 16% -4%, rgba(212, 165, 116, 0.3), transparent 58%);
  color: var(--ink);
  font-family: "Epilogue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.72;
  overflow-x: hidden;
  filter: sepia(0.14) contrast(1.03) saturate(0.9);
}

/* 胶片颗粒 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.26;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

/* 漏光 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 89;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.5;
  background:
    radial-gradient(58vw 38vh at 8% -8%, rgba(255, 198, 122, 0.72), transparent 68%),
    radial-gradient(44vw 32vh at 96% 6%, rgba(212, 165, 116, 0.42), transparent 70%);
  animation: leak 16s ease-in-out infinite alternate;
}

@keyframes leak {
  0% { opacity: 0.36; transform: translate3d(0, 0, 0); }
  100% { opacity: 0.62; transform: translate3d(-1.5%, 1%, 0); }
}

/* 顶部两行 */
.masthead {
  position: relative;
  padding: 14px 18px 0;
  border-bottom: 2px solid var(--ink);
}

.brandline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  color: var(--ink);
  text-decoration: none;
  font-family: "Anton", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-weight: 700;
  font-size: clamp(1.5rem, 6vw, 2.15rem);
  letter-spacing: 0.07em;
  line-height: 1.1;
  transition: color 0.2s ease, transform 0.2s ease;
}

.brand:hover {
  color: var(--tan-d);
  transform: translateX(2px);
}

.cta {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 16px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.cta:hover {
  background: var(--tan);
  border-color: var(--tan);
  color: var(--ink);
  transform: translateY(-2px);
}

.dock {
  margin: 0 -18px;
  padding: 4px 18px 12px;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pills a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 15px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper2);
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.pills a:hover,
.pills a:focus-visible {
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-2px);
}

/* 首屏 */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  min-height: 45vh;
  padding: 24px 18px 46px;
  border-bottom: 2px solid var(--ink);
  background: linear-gradient(168deg, var(--paper2), var(--paper) 62%);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 16px;
  background: linear-gradient(90deg, var(--tan), var(--ink));
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

.hero h1 {
  margin: 0;
  text-align: left;
  font-family: "Anton", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-weight: 700;
  font-size: clamp(2.45rem, 11vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: 0.01em;
  text-shadow: 2px 0 0 rgba(212, 165, 116, 0.62), -2px 0 0 rgba(38, 33, 23, 0.16);
  animation: track 9s linear infinite;
}

@keyframes track {
  0%, 88%, 100% { transform: none; }
  90% { transform: translateX(-3px) skewX(-1.6deg); }
  93% { transform: translateX(2px) skewX(1deg); }
  96% { transform: none; }
}

.hero .lede {
  margin: 0;
  max-width: 36ch;
  color: var(--ink2);
  font-size: 17px;
}

/* 骨架：正文 + 右侧栏 */
.shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 18px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 26px;
}

main {
  min-width: 0;
  padding: 30px 0 44px;
}

article {
  min-width: 0;
}

article > section {
  padding-block: 30px;
  border-top: 1px dashed var(--line);
  scroll-margin-top: 20px;
}

article > section:first-child {
  padding-top: 0;
  border-top: 0;
}

article h2,
article h3 {
  font-family: "Anton", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.22;
  margin: 0 0 10px;
}

article h2 {
  font-size: clamp(1.5rem, 5.6vw, 2.1rem);
  color: var(--ink);
}

article h3 {
  font-size: clamp(1.2rem, 4.4vw, 1.42rem);
  color: var(--tan-d);
  margin-top: 26px;
}

article hr {
  height: 0;
  margin: 0 0 20px;
  border: 0;
  border-top: 3px solid var(--ink);
  width: 64px;
}

article p {
  margin: 0 0 16px;
  color: var(--ink);
}

article ul,
article ol {
  margin: 0 0 18px;
  padding-left: 22px;
}

article li {
  margin-bottom: 8px;
}

article li::marker {
  color: var(--tan-d);
}

article strong {
  color: var(--ink);
  background: linear-gradient(transparent 62%, rgba(212, 165, 116, 0.55) 62%);
}

article a {
  color: var(--tan-d);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

article a:hover {
  color: var(--ink);
}

article blockquote {
  margin: 22px 0;
  padding: 14px 18px;
  border: 2px solid var(--ink);
  border-left-width: 8px;
  border-radius: var(--r);
  background: var(--paper2);
  color: var(--ink2);
}

article blockquote p:last-child {
  margin-bottom: 0;
}

article img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 24px auto;
  padding: 10px 10px 34px;
  background: #fdf6e6;
  border: 1px solid var(--line);
  border-radius: 4px;
  filter: sepia(0.1) contrast(1.03);
}

article table {
  width: 100%;
  margin: 22px 0;
  border-collapse: collapse;
  border: 2px solid var(--ink);
  border-radius: var(--r);
  overflow: hidden;
  font-size: 16px;
}

article th,
article td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

article th {
  background: var(--tan);
  color: var(--ink);
  font-weight: 700;
}

article tr:last-child td {
  border-bottom: 0;
}

/* 右侧栏 */
.rail {
  padding: 22px 0 40px;
  border-top: 2px solid var(--ink);
}

.rail h2 {
  margin: 0;
  font-family: "Anton", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.2em;
  font-weight: 700;
}

.rail hr {
  height: 0;
  margin: 8px 0 14px;
  border: 0;
  border-top: 2px solid var(--tan);
}

.rail-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 2px;
}

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 2px 0;
  color: var(--ink2);
  text-decoration: none;
  font-size: 16px;
  border-bottom: 1px solid var(--line);
  transition: color 0.16s ease, padding-left 0.16s ease;
}

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

.to-top {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin-top: 16px;
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  border-bottom: 2px solid var(--tan);
}

.to-top:hover {
  color: var(--tan-d);
}

/* 页脚 */
footer {
  margin-top: 8px;
  padding: 26px 18px 40px;
  border-top: 2px solid var(--ink);
  background: var(--paper2);
  text-align: center;
}

footer p {
  margin: 0;
  font-family: "Anton", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-weight: 700;
  font-size: clamp(1.7rem, 10vw, 3.6rem);
  line-height: 1;
  letter-spacing: 0.07em;
}

footer small {
  display: block;
  margin-top: 12px;
  font-size: 16px;
  color: var(--ink2);
}

/* 滚动显现 */
html.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

html.js .reveal.in {
  opacity: 1;
  transform: none;
}

@media (min-width: 900px) {
  .masthead {
    padding: 18px 26px 0;
  }

  .dock {
    margin: 0 -26px;
    padding: 4px 26px 14px;
  }

  .shell {
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 44px;
    padding: 0 26px 26px;
  }

  main {
    padding: 40px 0 60px;
  }

  .rail {
    margin-top: 40px;
    border-top: 0;
    border-left: 2px solid var(--ink);
    padding: 2px 0 26px 22px;
    position: sticky;
    top: 20px;
    align-self: start;
  }

  footer {
    padding: 34px 26px 48px;
  }
}

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

  .hero h1,
  body::after {
    animation: none;
  }

  html.js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

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