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

:root {
  --paper: #fafaf8;
  --ink: #1a1a1a;
  --gray: #4a4a4a;
  --rail: 234px;
  --bar: 40px;
  --hair: rgba(26, 26, 26, 0.35);
}

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

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

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    radial-gradient(rgba(26, 26, 26, 0.085) 1px, transparent 1px),
    repeating-linear-gradient(0deg, rgba(26, 26, 26, 0.022) 0 1px, transparent 1px 30px);
  background-size: 16px 16px, 100% 30px;
  color: var(--ink);
  font-family: "Barlow", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.78;
  font-weight: 400;
}

h1, h2, h3, h4 {
  font-family: "Barlow Condensed", "Barlow", system-ui, "PingFang SC", sans-serif;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: 0.01em;
  margin: 0 0 0.55em;
}

p { margin: 0 0 1em; }

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

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

/* ---------- 顶部细条 ---------- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--bar);
  display: flex;
  align-items: center;
  padding: 0 18px;
  background: var(--ink);
  color: var(--paper);
  z-index: 60;
  overflow: hidden;
}

.topbar-tag {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 15px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  white-space: nowrap;
}

.topbar::after {
  content: "";
  flex: 1;
  height: 2px;
  margin-left: 18px;
  background: repeating-linear-gradient(90deg, var(--paper) 0 10px, transparent 10px 18px);
  opacity: 0.55;
}

/* ---------- 左侧固定栏 ---------- */
.rail {
  position: fixed;
  top: var(--bar);
  left: 0;
  bottom: 0;
  width: var(--rail);
  padding: 20px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: var(--paper);
  border-right: 2px solid var(--ink);
  overflow-y: auto;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border: 2px solid var(--ink);
  text-decoration: none;
  transform: rotate(-1.2deg);
  background: var(--paper);
}

.brand-logo { width: 44px; height: 44px; object-fit: cover; filter: grayscale(1) contrast(1.15); }

.brand-mark {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 22px;
  letter-spacing: 0.06em;
  line-height: 1;
}

.brand-text {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.04em;
}

.rail nav { margin-top: 2px; }

.rail nav p {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
}

.rail nav a {
  display: block;
  min-height: 42px;
  padding: 10px 9px;
  border: 2px solid rgba(26, 26, 26, 0.16);
  color: var(--ink);
  text-decoration: none;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 18px;
  letter-spacing: 0.05em;
  line-height: 1.2;
  background: var(--paper);
}

.rail nav a:nth-child(even) { transform: rotate(-0.7deg); }
.rail nav a:nth-child(3n) { transform: rotate(0.6deg); }

.rail nav a:hover,
.rail nav a:focus-visible {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
  transform: rotate(-1.4deg) translateX(2px);
}

/* ---------- 主区 ---------- */
main {
  margin-left: var(--rail);
  padding-top: var(--bar);
}

.wrap {
  display: flex;
  align-items: flex-start;
  gap: 26px;
  max-width: 1140px;
  margin: 0 auto;
  padding: 26px 22px 64px;
}

.side {
  flex: 0 0 176px;
  position: sticky;
  top: calc(var(--bar) + 18px);
  border: 2px dashed var(--gray);
  padding: 12px 13px 16px;
  transform: rotate(-0.6deg);
  opacity: 0.94;
}

.side h2 {
  font-size: 17px;
  letter-spacing: 0.14em;
  margin-bottom: 8px;
}

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

.side-list a {
  display: block;
  min-height: 40px;
  padding: 8px 0;
  font-size: 16px;
  text-decoration: none;
  border-bottom: 1px dotted var(--hair);
  line-height: 1.35;
}

.side-list a:hover { text-decoration: underline; text-underline-offset: 4px; }

.sheet {
  flex: 1 1 auto;
  min-width: 0;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 45vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
  text-align: center;
  padding: 24px 12px 28px;
  border-bottom: 4px double var(--ink);
}

.hero-copy { flex: 1 1 320px; min-width: 0; }

.hero h1 {
  font-size: clamp(30px, 5.2vw, 58px);
  line-height: 1.06;
  letter-spacing: 0.005em;
  margin: 0 0 12px;
  text-shadow: 2px 2px 0 rgba(74, 74, 74, 0.18);
}

.hero-desc {
  max-width: 30em;
  margin: 0 auto;
  color: var(--gray);
  font-size: 17px;
  padding-bottom: 2px;
  border-bottom: 2px solid rgba(26, 26, 26, 0.14);
}

.hero-art {
  flex: 0 0 auto;
  transform: rotate(2.5deg);
  filter: grayscale(1) contrast(1.1);
}

.hero-art .hero-img {
  width: 168px;
  height: 168px;
  object-fit: cover;
  border: 3px solid var(--ink);
}

.sketch { display: block; }

.sticker {
  position: absolute;
  top: 12px;
  right: 4px;
  width: 76px;
  height: 26px;
  background: rgba(74, 74, 74, 0.16);
  border: 1px solid rgba(26, 26, 26, 0.4);
  transform: rotate(7deg);
}

/* ---------- 正文 ---------- */
.prose { padding-top: 8px; }

.prose > article {
  padding: 34px 0 30px;
  border-bottom: 2px dashed var(--hair);
  scroll-margin-top: calc(var(--bar) + 22px);
}

.prose > article:last-child { border-bottom: 0; }

.prose h2 {
  font-size: clamp(24px, 3.1vw, 34px);
}

.prose :is(h2, h3, h4) > span,
.side h2 > span,
.foot h2 > span {
  display: inline-block;
  padding-bottom: 2px;
  border-bottom: 4px solid var(--ink);
  transform: rotate(-0.5deg);
}

.prose h3 { font-size: clamp(20px, 2.4vw, 26px); }

.prose ul,
.prose ol {
  margin: 0 0 1.1em;
  padding-left: 1.35em;
}

.prose li { margin-bottom: 0.45em; }

.prose ul { list-style: square; }

.prose blockquote {
  margin: 0 0 1.1em;
  padding: 10px 16px;
  border-left: 5px solid var(--ink);
  background: rgba(74, 74, 74, 0.07);
  font-style: normal;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.1em;
  font-size: 16px;
}

.prose th,
.prose td {
  border: 2px solid var(--ink);
  padding: 8px 10px;
  text-align: left;
}

.prose th { background: rgba(26, 26, 26, 0.08); }

.prose code {
  font-family: ui-monospace, "Courier New", monospace;
  font-size: 15px;
  background: rgba(26, 26, 26, 0.08);
  padding: 1px 5px;
}

.prose img { border: 3px solid var(--ink); margin: 6px 0 1.1em; }

.prose a {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.prose time {
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.08em;
  border-bottom: 2px solid var(--gray);
}

/* ---------- 页脚 ---------- */
.foot {
  margin-left: var(--rail);
  border-top: 3px solid var(--ink);
  padding: 30px 22px 18px;
  background: var(--paper);
}

.foot-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 0.85fr;
  gap: 22px;
  max-width: 1140px;
  margin: 0 auto;
}

.foot h2 {
  font-size: 16px;
  letter-spacing: 0.14em;
  margin-bottom: 10px;
}

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

.foot ul a {
  display: block;
  min-height: 40px;
  padding: 9px 0;
  font-size: 16px;
  text-decoration: none;
  border-bottom: 1px dotted var(--hair);
  line-height: 1.35;
}

.foot ul a:hover { text-decoration: underline; text-underline-offset: 4px; }

.foot address {
  font-style: normal;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 21px;
  letter-spacing: 0.05em;
  display: inline-block;
  max-width: 100%;
  padding: 8px 12px;
  border: 2px solid var(--ink);
  transform: rotate(-1deg);
}

.totop {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 12px;
  border: 2px solid var(--ink);
  text-decoration: none;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 16px;
  letter-spacing: 0.1em;
}

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

.foot-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  max-width: 1140px;
  margin: 24px auto 0;
  padding-top: 12px;
  border-top: 2px dashed var(--hair);
  font-size: 15px;
  color: var(--gray);
}

.copy { font-family: "Barlow Condensed", sans-serif; letter-spacing: 0.08em; }

.foot-mini {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.foot-mini a {
  display: inline-block;
  min-height: 40px;
  padding: 9px 0;
  border-bottom: 0;
  color: var(--gray);
}

/* ---------- 揭示动效 ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
}

.js [data-reveal].in {
  opacity: 1;
  transform: none;
  transition: opacity 0.18s steps(3, end), transform 0.18s steps(3, end);
}

/* ---------- 断点 ---------- */
@media (max-width: 960px) {
  .topbar {
    position: static;
    height: auto;
    padding: 8px 14px;
  }

  .rail {
    position: static;
    width: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 14px 14px;
    border-right: 0;
    border-bottom: 3px double var(--ink);
    overflow: visible;
  }

  .rail nav { flex: 1 1 100%; }

  .rail nav p {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .rail nav a {
    font-size: 16px;
    padding: 10px 10px;
    min-height: 40px;
  }

  main { margin-left: 0; padding-top: 0; }

  .wrap {
    flex-direction: column;
    gap: 18px;
    padding: 16px 14px 44px;
  }

  .side {
    order: 2;
    position: static;
    width: 100%;
    flex: none;
    transform: none;
  }

  .sheet { width: 100%; }

  .hero {
    min-height: 0;
    padding: 18px 6px 22px;
    gap: 14px;
  }

  .hero-art { transform: rotate(2deg); }

  .hero-art .hero-img,
  .sketch { width: 96px; height: 96px; }

  .sticker { top: 8px; right: 0; width: 54px; height: 20px; }

  .foot {
    margin-left: 0;
    padding: 22px 14px 14px;
  }

  .foot-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .hero h1 { font-size: 30px; }
  .prose > article { padding: 26px 0 24px; }
  .topbar-tag { letter-spacing: 0.3em; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal],
  .js [data-reveal].in {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .rail nav a:nth-child(even),
  .rail nav a:nth-child(3n),
  .brand,
  .side,
  .foot address,
  .hero-art { transform: none; }
}

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