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

:root {
  --amber: #E8A33D;
  --indigo: #1B2A4A;
  --paper: #F5EFE3;
  --line: rgba(27, 42, 74, 0.22);
  --soft: rgba(27, 42, 74, 0.62);
  --display: 'Amatic SC', 'Songti SC', 'STSong', cursive;
  --body: 'Cabin', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
  --gut: clamp(1rem, 4vw, 2.75rem);
}

*,
*::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(rgba(27, 42, 74, 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--indigo);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

body.menu-open { overflow: hidden; }

img { border: 0; }
p { margin: 0 0 1.05em; }

a { color: #8c5a10; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--indigo); }

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

/* ---------- 顶栏 ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem var(--gut);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.mark {
  position: relative;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--indigo);
  border-radius: 4px;
  background: var(--amber);
  color: var(--indigo);
  text-decoration: none;
  overflow: hidden;
  transform: rotate(-3deg);
  transition: transform 0.25s ease, background 0.25s ease;
}

.mark:hover { transform: rotate(3deg) scale(1.05); }

.mark-glyph {
  font-family: 'Amatic SC', cursive;
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}

.mark-img { width: 34px; height: 34px; object-fit: contain; }

.burger {
  position: relative;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--indigo);
  font: inherit;
  font-size: 1rem;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.burger-bars {
  position: relative;
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  transition: background 0.2s ease;
}

.burger-bars::before,
.burger-bars::after {
  content: '';
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: currentColor;
  transition: transform 0.25s ease;
}

.burger-bars::before { top: -6px; }
.burger-bars::after { top: 6px; }

.top.open .burger { color: var(--paper); border-color: rgba(245, 239, 227, 0.45); }
.top.open .burger-bars { background: transparent; }
.top.open .burger-bars::before { transform: translateY(6px) rotate(45deg); }
.top.open .burger-bars::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- 全屏遮罩菜单 ---------- */
.menu {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 5rem 1.25rem 3rem;
  background: var(--indigo);
  color: var(--paper);
  visibility: hidden;
  clip-path: circle(0 at calc(100% - 4.5rem) 2.2rem);
  transition: clip-path 0.5s ease, visibility 0.5s ease;
}

.top.open .menu {
  visibility: visible;
  clip-path: circle(150% at calc(100% - 4.5rem) 2.2rem);
}

.menu p {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  margin: 0;
  max-height: 80vh;
}

.menu a {
  display: block;
  padding: 0.5rem 1rem;
  min-height: 44px;
  color: var(--paper);
  text-decoration: none;
  font-family: var(--display);
  font-size: clamp(1.7rem, 6.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.25;
  border-bottom: 1px solid rgba(245, 239, 227, 0.16);
  transition: color 0.2s ease, letter-spacing 0.2s ease;
}

.menu a:hover { color: var(--amber); letter-spacing: 0.08em; }

/* ---------- 主区 ---------- */
main { padding: 0 var(--gut); }

div {
  counter-reset: s;
  padding-bottom: clamp(2.5rem, 6vw, 4rem);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: grid;
  align-content: end;
  min-height: 70vh;
  padding: clamp(3rem, 12vh, 6rem) 0 clamp(3.25rem, 9vh, 5rem);
  overflow: hidden;
}

.hero-figure {
  position: absolute;
  inset: -6% -6% 0;
  margin: 0;
  z-index: 0;
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% 84%, 0 100%);
}

.hero-figure::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(245, 239, 227, 0.35) 0%, rgba(245, 239, 227, 0.82) 62%, var(--paper) 100%);
}

.hero-img {
  display: block;
  width: 100%;
  height: 112%;
  object-fit: cover;
  transform: scale(1.06);
  will-change: transform;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 40rem;
}

.hero-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.7rem, 10.5vw, 6.2rem);
  line-height: 0.98;
  letter-spacing: 0.005em;
  color: var(--indigo);
  text-wrap: balance;
}

.ch {
  display: inline-block;
  opacity: 0;
  transform: translateY(-0.32em) rotate(-7deg);
  animation: chIn 0.55s cubic-bezier(0.2, 0.85, 0.2, 1) forwards;
  animation-delay: calc(var(--i) * 32ms);
}

@keyframes chIn {
  to { opacity: 1; transform: none; }
}

.hero-sub {
  margin: 1rem 0 0;
  max-width: 34ch;
  font-size: 1.02rem;
  line-height: 1.7;
  color: #2a3852;
  border-left: 3px solid var(--amber);
  padding-left: 0.9rem;
}

.hero-sub::after {
  content: '';
  display: inline-block;
  width: 9px;
  height: 1em;
  margin-left: 3px;
  vertical-align: -0.16em;
  background: var(--amber);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.band {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: clamp(22px, 5vw, 56px);
  z-index: 1;
  background: var(--amber);
  clip-path: polygon(0 55%, 100% 0, 100% 100%, 0 100%);
}

/* ---------- 侧栏 ---------- */
.side {
  margin: 1.75rem 0 0;
  padding: 0 0 0 0.9rem;
  border-left: 3px solid var(--indigo);
}

.side small {
  display: block;
  font-size: 1rem;
  letter-spacing: 0.22em;
  color: #8c5a10;
  line-height: 1.4;
}

.side-h {
  margin: 0.15rem 0 0.6rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.7rem;
  line-height: 1.1;
  color: var(--indigo);
}

.side-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
}

.side-list a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(232, 163, 61, 0.1);
  color: var(--indigo);
  font-size: 1rem;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.side-list a:hover { background: var(--amber); border-color: var(--indigo); }

/* ---------- 正文区块 ---------- */
div > section:not(.hero) {
  position: relative;
  max-width: 46rem;
  padding: 2.1rem 0 2.5rem;
  border-top: 1px solid var(--line);
  scroll-margin-top: 5.25rem;
  counter-increment: s;
}

div > section:not(.hero)::before {
  content: counter(s, decimal-leading-zero);
  position: absolute;
  top: 2rem;
  right: 0;
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--amber);
  line-height: 1;
}

div > section:not(.hero) > :first-child { margin-top: 0; }

div small {
  display: block;
  margin-bottom: 0.1rem;
  font-family: var(--body);
  font-size: 1rem;
  letter-spacing: 0.2em;
  color: #8c5a10;
  line-height: 1.4;
}

div h2 {
  margin: 0 0 0.9rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 5.4vw, 2.95rem);
  line-height: 1.05;
  color: var(--indigo);
  text-wrap: balance;
}

div h2::after {
  content: '';
  display: block;
  width: 3.2rem;
  height: 5px;
  margin-top: 0.45rem;
  background: var(--amber);
  transform: skewX(-22deg);
}

div h3 {
  margin: 1.7rem 0 0.6rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 1.95rem);
  line-height: 1.12;
  color: var(--indigo);
}

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

div li { margin-bottom: 0.4em; }

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

div blockquote {
  margin: 1.4rem 0;
  padding: 0.7rem 1rem;
  border-left: 4px solid var(--indigo);
  background: rgba(27, 42, 74, 0.055);
  border-radius: 0 4px 4px 0;
  font-size: 1.02rem;
}

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

div img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
}

div code,
div pre {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.95rem;
}

div pre {
  overflow-x: auto;
  padding: 0.9rem;
  background: rgba(27, 42, 74, 0.07);
  border-radius: 4px;
}

div table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.2rem;
  font-size: 1rem;
}

div th,
div td {
  border: 1px solid var(--line);
  padding: 0.5rem 0.7rem;
  text-align: left;
  vertical-align: top;
}

div th { background: rgba(232, 163, 61, 0.16); }

/* ---------- 滚动显现 ---------- */
.js div > section:not(.hero),
.js .side { opacity: 0; transform: translateY(18px); }

.js div > section:not(.hero).in,
.js .side.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---------- 页脚 ---------- */
.foot {
  margin-top: 1rem;
  padding: 1.7rem var(--gut) 1.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  background: var(--indigo);
  color: var(--paper);
  border-top: 7px solid var(--amber);
}

.foot-word {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.9rem, 6vw, 2.9rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--amber);
}

.foot-nav p {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.9rem;
  margin: 0;
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.15rem 0;
  color: rgba(245, 239, 227, 0.86);
  font-size: 1rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

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

.foot-legal {
  font-size: 1rem;
  color: rgba(245, 239, 227, 0.72);
  text-align: center;
}

/* ---------- 断点 ---------- */
@media (max-width: 479px) {
  .foot { flex-direction: column; align-items: stretch; text-align: center; }
  .foot-nav p { justify-content: center; }
  .foot-brand { text-align: center; }
}

@media (min-width: 900px) {
  body { font-size: 18px; }

  div {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    column-gap: clamp(2rem, 4vw, 3.5rem);
    align-items: start;
    max-width: 1180px;
    margin: 0 auto;
  }

  .hero { grid-column: 1 / -1; grid-row: 1; }
  .hero-title { font-size: clamp(3.4rem, 7.5vw, 7rem); }

  div > .side {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    position: sticky;
    top: 5.5rem;
    margin: 2.5rem 0 0;
    padding-left: 0.9rem;
  }

  .side-list { display: flex; flex-direction: column; flex-wrap: nowrap; gap: 0.2rem; }
  .side-list a { justify-content: flex-start; }

  div > section:not(.hero) {
    grid-column: 2;
    max-width: none;
    padding: 2.4rem 3.5rem 2.9rem 0;
  }

  div > section:not(.hero)::before { top: 2.4rem; }

  .menu a { font-size: clamp(2rem, 4.5vw, 3rem); }
}

@media (min-width: 1280px) {
  .hero-title { font-size: 7.4rem; }
}

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

  .ch { animation: none; opacity: 1; transform: none; }
  .hero-sub::after { animation: none; }
  .hero-img { transform: none; }
  .menu { transition: none; }

  .js div > section:not(.hero),
  .js .side { opacity: 1; transform: none; }
}

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