@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,600;0,700;0,800;1,400&display=swap');

:root {
  --paper: #fafaf8;
  --ink: #1a1a1a;
  --mid: #4a4a4a;
  --line: rgba(26, 26, 26, 0.28);
  --soft: rgba(26, 26, 26, 0.07);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.65 'Plus Jakarta Sans', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 99;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image:
    repeating-linear-gradient(0deg, rgba(26, 26, 26, 0.045) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(26, 26, 26, 0.03) 0 1px, transparent 1px 5px),
    radial-gradient(circle at 18% 32%, rgba(26, 26, 26, 0.05), transparent 58%),
    radial-gradient(circle at 78% 71%, rgba(26, 26, 26, 0.045), transparent 55%);
}

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

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- 顶部 ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 248, 0.95);
  backdrop-filter: blur(5px);
  border-bottom: 2px solid var(--ink);
}

.brandrow {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 20px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 2px dashed var(--line);
}

.brand {
  display: inline-block;
  padding: 4px 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  transform: rotate(-0.8deg);
}

.brand::after {
  content: "";
  display: block;
  height: 3px;
  border-radius: 3px;
  background: var(--ink);
  transform: rotate(-0.6deg);
}

.tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pill,
.burger {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 14px;
  border: 2px solid var(--ink);
  border-radius: 10px 14px 11px 15px / 14px 10px 15px 11px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.pill:hover,
.burger:hover {
  background: var(--ink);
  color: var(--paper);
  transform: translate(-1px, -1px);
}

.burger { display: none; }

.nav {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

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

.menu > li { position: relative; }

.menu > li > a {
  display: block;
  min-height: 44px;
  padding: 11px 12px;
  color: var(--mid);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}

.menu > li > a:hover {
  color: var(--ink);
  background: var(--soft);
  border-bottom-color: var(--ink);
}

.sub {
  list-style: none;
  position: absolute;
  left: 0;
  top: 100%;
  z-index: 60;
  min-width: 160px;
  display: none;
  margin: 0;
  padding: 6px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 10px 16px 12px 18px / 16px 10px 18px 12px;
}

.has-sub:hover .sub,
.has-sub:focus-within .sub { display: block; }

.sub a {
  display: block;
  min-height: 40px;
  padding: 8px 10px;
  color: var(--mid);
  text-decoration: none;
  border-bottom: 1px dashed var(--line);
}

.sub a:hover { color: var(--ink); background: var(--soft); }

/* ---------- 首图 ---------- */
.hero {
  position: relative;
  height: 45vh;
  min-height: 320px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-bottom: 2px solid var(--ink);
  background-image: repeating-linear-gradient(135deg, rgba(26, 26, 26, 0.07) 0 8px, transparent 8px 16px);
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.12);
}

.veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(26, 26, 26, 0.34), rgba(26, 26, 26, 0.66));
}

.hero-in {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 900px;
  padding: 0 22px;
  text-align: center;
}

h1 {
  margin: 0;
  font-size: clamp(1.7rem, 5.6vw, 3rem);
  line-height: 1.22;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--paper);
  text-shadow: 0 2px 0 rgba(26, 26, 26, 0.35);
}

/* ---------- 主体 ---------- */
main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 30px 20px 64px;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

.rail {
  position: sticky;
  top: 132px;
}

.note {
  padding: 16px 14px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(6px);
  border: 2px solid rgba(26, 26, 26, 0.55);
  border-radius: 18px 22px 16px 24px / 22px 16px 24px 18px;
  transform: rotate(-0.7deg);
}

small {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--mid);
}

h2 {
  margin: 3px 0 12px;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.35;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

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

.rail-list a {
  position: relative;
  display: block;
  min-height: 40px;
  padding: 9px 0 9px 24px;
  color: var(--mid);
  text-decoration: none;
  border-bottom: 1px dashed rgba(26, 26, 26, 0.16);
}

.rail-list a::before {
  counter-increment: r;
  content: counter(r, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 11px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  opacity: 0.6;
}

.rail-list a:hover { color: var(--ink); background: var(--soft); }

.body {
  min-width: 0;
  max-width: 68ch;
}

.body p { margin: 0 0 1.05em; }

.body div {
  position: relative;
  padding: 26px 0 34px;
  border-top: 2px dashed var(--line);
  scroll-margin-top: 150px;
}

.body div:first-child {
  padding-top: 4px;
  border-top: 0;
}

.body div:nth-of-type(even) { border-top-style: dotted; }

.body div::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 30px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--ink);
  opacity: 0.45;
  transform: rotate(12deg);
}

.body div:first-child::before { top: 8px; }

.body img { max-width: 100%; height: auto; }

.rv { opacity: 0; transform: translateY(12px); }

.rv.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.34s ease-out, transform 0.34s ease-out;
}

/* ---------- 页脚 ---------- */
footer {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.3fr;
  gap: 28px;
  padding: 34px max(20px, calc((100vw - 1120px) / 2)) 44px;
  border-top: 2px solid var(--ink);
  background: #f2f1ec;
}

footer div { min-width: 0; }

.f-brand {
  margin: 0 0 12px;
  font-size: 1.15rem;
  font-weight: 800;
  transform: rotate(-0.9deg);
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}

.f-list {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2;
  column-gap: 14px;
}

.f-list a {
  display: block;
  min-height: 40px;
  padding: 8px 0;
  color: var(--mid);
  text-decoration: none;
  border-bottom: 1px dashed var(--line);
}

.f-list a:hover { color: var(--ink); }

.subform {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.subform input {
  flex: 1 1 130px;
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  color: var(--ink);
  font: inherit;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 8px 14px 10px 12px / 14px 8px 12px 10px;
}

.subform button {
  min-height: 44px;
  padding: 8px 18px;
  color: var(--paper);
  font: inherit;
  font-weight: 700;
  background: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 12px 8px 14px 10px / 8px 14px 10px 12px;
  cursor: pointer;
}

.subform button:hover { transform: translate(-1px, -1px); }

.colophon {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding-top: 16px;
  border-top: 2px dashed var(--line);
  text-align: center;
}

.colophon p {
  margin: 0;
  color: var(--mid);
}

.totop {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 15px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 12px 16px 10px 18px / 16px 10px 18px 12px;
  transform: rotate(-1.2deg);
}

.totop:hover { background: var(--ink); color: var(--paper); }

/* ---------- 窄屏 ---------- */
@media (max-width: 820px) {
  .burger { display: inline-flex; }

  .nav { display: none; padding-bottom: 10px; }
  .nav.open { display: block; }

  .menu { flex-direction: column; gap: 0; }

  .menu > li > a {
    padding: 12px 8px;
    border-bottom: 1px dashed var(--line);
  }

  .sub {
    position: static;
    display: block;
    min-width: 0;
    padding: 0 0 4px 18px;
    border: 0;
    border-radius: 0;
  }

  .sub a { padding: 10px 8px; }

  .hero { height: auto; min-height: 300px; padding: 26px 0; }

  main {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-top: 24px;
  }

  .rail { position: static; }
  .note { transform: none; }
  .body { max-width: none; }

  footer { grid-template-columns: 1fr; gap: 24px; padding-inline: 20px; }
  .f-list { columns: 2; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; transition: none; }
  .pill:hover, .burger:hover, .subform button:hover, .totop:hover { transform: none; }
}

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