@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&family=Crimson+Pro:wght@400;500;600;700&display=swap');

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

:root {
  --paper: #fdfbf7;
  --paper-2: #f5f5f5;
  --ink: #1a1a1a;
  --rule: #e0e0e0;
  --muted: #565656;
  --glass: rgba(245, 245, 245, 0.66);
  --serif: 'Crimson Pro', 'Songti SC', 'Noto Serif SC', 'Source Han Serif SC', Georgia, serif;
  --ui: 'Atkinson Hyperlegible', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --r: 18px;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.8;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
}

[hidden] { display: none !important; }

img, svg { max-width: 100%; }
a { color: inherit; }

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

/* ---------- 顶部：只有品牌图标与全屏菜单 ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 40px) 6px;
}

.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 46px;
  padding: 6px;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: rgba(245, 245, 245, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: border-color 0.12s linear, background 0.12s linear;
}

.mark:hover { border-color: var(--ink); background: var(--paper-2); }
.mark img { display: block; width: 34px; height: 34px; object-fit: contain; }

.menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow-y: auto;
  background: var(--paper);
  padding: clamp(76px, 12vh, 128px) clamp(20px, 6vw, 48px) 128px;
}

html[data-menu="open"] .menu { display: block; }
html[data-menu="open"] body { overflow: hidden; }

.menu p {
  display: block;
  max-width: 860px;
  margin: 0 auto;
}

.menu p > a {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 10px 6px;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 5.4vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  animation: ink 0.2s linear backwards;
}

.menu p > a:first-child { border-top: 1px solid var(--rule); }
.menu p > a:hover { background: var(--paper-2); }
.menu p > a:nth-child(1) { animation-delay: 0s; }
.menu p > a:nth-child(2) { animation-delay: 0.03s; }
.menu p > a:nth-child(3) { animation-delay: 0.06s; }
.menu p > a:nth-child(4) { animation-delay: 0.09s; }
.menu p > a:nth-child(5) { animation-delay: 0.12s; }
.menu p > a:nth-child(6) { animation-delay: 0.15s; }
.menu p > a:nth-child(7) { animation-delay: 0.18s; }

@keyframes ink {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 主区 ---------- */

main {
  position: relative;
  z-index: 2;
  padding-bottom: 104px;
}

.hero {
  min-height: 45vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  text-align: right;
  gap: 0.7rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(2rem, 8vh, 4.5rem) clamp(18px, 5vw, 52px) clamp(1.4rem, 4vh, 2.6rem);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.3rem, 8.4vw, 4.9rem);
  line-height: 1.03;
  letter-spacing: -0.032em;
  font-weight: 600;
}

.hero .lead {
  margin: 0;
  max-width: 46ch;
  font-size: clamp(1rem, 2.4vw, 1.1rem);
  line-height: 1.7;
  color: var(--muted);
}

.wrap {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: clamp(24px, 4.5vw, 60px);
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(18px, 5vw, 52px) 40px;
}

/* ---------- 侧栏 ---------- */

.side {
  position: sticky;
  top: 22px;
  padding: 16px 18px 18px;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: var(--glass);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.side small {
  display: block;
  font-family: var(--ui);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.side h2 {
  margin: 0.15rem 0 0.6rem;
  font-size: 1.12rem;
  letter-spacing: 0.02em;
  font-weight: 600;
}

.side ul {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}

.side li {
  border-bottom: 1px solid var(--rule);
  animation: ink 0.2s linear backwards;
}

.side li:nth-child(1) { animation-delay: 0.02s; }
.side li:nth-child(2) { animation-delay: 0.05s; }
.side li:nth-child(3) { animation-delay: 0.08s; }
.side li:nth-child(4) { animation-delay: 0.11s; }
.side li:nth-child(5) { animation-delay: 0.14s; }
.side li:nth-child(6) { animation-delay: 0.17s; }
.side li:nth-child(7) { animation-delay: 0.2s; }

.side li a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 2px;
  font-size: 0.98rem;
  line-height: 1.5;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.12s linear;
}

.side li a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- 正文 ---------- */

.body { min-width: 0; }

.prose article {
  margin: 0 0 22px;
  padding: clamp(18px, 3.2vw, 34px);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: var(--glass);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  scroll-margin-top: 24px;
  scroll-margin-bottom: 120px;
}

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

.prose h2,
.prose h3 {
  margin: 1.5rem 0 0.6rem;
  line-height: 1.28;
  letter-spacing: -0.012em;
  font-weight: 600;
}

.prose h2 { font-size: clamp(1.35rem, 3.2vw, 1.72rem); }
.prose h3 { font-size: clamp(1.1rem, 2.4vw, 1.28rem); }
.prose h2:first-child,
.prose h3:first-child,
.prose small + h2,
.prose small + h3 { margin-top: 0; }

.prose small {
  display: block;
  margin-top: 1.4rem;
  font-family: var(--ui);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.prose p { margin: 0 0 1rem; }
.prose p:last-child { margin-bottom: 0; }

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

.prose li { margin: 0.3rem 0; }

.prose a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: background 0.12s linear;
}

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

.prose blockquote {
  margin: 1rem 0;
  padding: 0.2rem 0 0.2rem 1rem;
  border-left: 3px solid var(--ink);
  color: var(--muted);
}

.prose strong { font-weight: 700; }

.prose hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 1.4rem 0;
}

/* ---------- 页脚 ---------- */

.foot {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 24px;
  max-width: 1180px;
  margin: 24px auto 0;
  padding: clamp(30px, 6vw, 60px) clamp(18px, 5vw, 52px) 120px;
  border-top: 1px solid var(--rule);
}

.foot p { margin: 0; }

.foot .brand-big {
  grid-column: 1 / -1;
  font-size: clamp(2rem, 10vw, 4.6rem);
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 600;
  margin-bottom: 6px;
}

.foot .col {
  display: flex;
  flex-direction: column;
  font-family: var(--ui);
  font-size: 16px;
}

.foot .col a {
  display: flex;
  align-items: center;
  min-height: 40px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.12s linear, border-color 0.12s linear;
}

.foot .col a:hover { color: var(--ink); border-bottom-color: var(--ink); }

.foot small {
  grid-column: 1 / -1;
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-family: var(--ui);
  font-size: 16px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ---------- 底部固定条 ---------- */

.bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px clamp(12px, 3vw, 28px) calc(10px + env(safe-area-inset-bottom));
  background: rgba(253, 251, 247, 0.95);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--rule);
}

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

.find input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--paper-2);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 16px;
  transition: border-color 0.12s linear, background 0.12s linear;
}

.find input:focus {
  outline: none;
  border-color: var(--ink);
  background: var(--paper);
}

.act {
  flex: 0 0 auto;
  min-width: 66px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 16px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.12s linear, color 0.12s linear;
}

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

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

/* ---------- 窄屏 ---------- */

@media (max-width: 860px) {
  .wrap { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; order: 1; }
  .body { order: 2; }
  .hero { min-height: 45vh; align-items: flex-start; text-align: left; }
  .hero .lead { max-width: none; }
  .foot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  .act { min-width: 58px; padding: 0 10px; }
  .foot { grid-template-columns: minmax(0, 1fr); padding-bottom: 116px; }
  .foot .brand-big { font-size: clamp(1.9rem, 13vw, 3rem); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .menu p > a,
  .side li { animation: none; }
  * { transition: none; }
}

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