:root {
  --ink: #1f1f1f;
  --paper: #ffffff;
  --stone: #f5f5f5;
  --line: #e6e6e6;
  --mute: #6f6f6f;
  --r: 18px;
  --serif: "Cinzel", "Cormorant Garamond", Georgia, "Songti SC", serif;
  --body: "Crimson Pro", "Cormorant Garamond", Georgia, "Songti SC", serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 150px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--stone);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.78;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.18;
  margin: 0 0 0.5em;
}

p {
  margin: 0 0 1.1em;
}

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

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

figure {
  margin: 26px 0;
}

figure img {
  border-radius: var(--r);
  display: block;
  width: 100%;
}

figcaption {
  font-size: 15px;
  color: var(--mute);
  margin-top: 10px;
  line-height: 1.6;
}

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

/* 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  height: 68px;
  padding: 0 clamp(14px, 4vw, 40px);
  position: relative;
}

.nav ul {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-l ul {
  justify-content: flex-start;
}

.nav-r ul {
  justify-content: flex-end;
}

.nav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 16px;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
  transition: background 0.25s ease, color 0.25s ease;
}

.nav a svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  opacity: 0.5;
}

.nav a:hover {
  background: var(--stone);
}

.brand {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
  padding: 8px 6px;
}

.menu-btn {
  display: none;
  position: absolute;
  left: 12px;
  top: 12px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 13px;
  cursor: pointer;
}

/* 锚点条 */
.anchors {
  position: sticky;
  top: 68px;
  z-index: 55;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.anchors ul {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 8px clamp(14px, 4vw, 40px);
  overflow-x: auto;
  scrollbar-width: none;
}

.anchors ul::-webkit-scrollbar {
  display: none;
}

.anchors a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--stone);
  font-size: 16px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.25s ease, color 0.25s ease;
}

.anchors a:hover {
  background: var(--ink);
  color: #fff;
}

/* 主栅格 */
main {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 20px;
  padding: 22px clamp(16px, 4vw, 48px) 10px;
  align-items: start;
}

.hero {
  grid-column: 1 / -1;
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 120px 22px 90px;
  border-radius: var(--r);
  overflow: hidden;
  isolation: isolate;
  background-color: var(--stone);
  background-image: radial-gradient(rgba(31, 31, 31, 0.09) 1px, transparent 1px);
  background-size: 22px 22px;
}

.hero-fig {
  position: absolute;
  inset: 0;
  margin: 0;
  z-index: -1;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(0.15);
}

.hero-fig::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(245, 245, 245, 0.94));
}

.hero-copy {
  max-width: 20ch;
  text-align: center;
}

.hero h1 {
  font-size: clamp(38px, 7vw, 82px);
  line-height: 1.06;
  letter-spacing: -0.01em;
  margin: 0;
}

/* 左侧目录 */
.rail {
  grid-column: 1;
  grid-row: 2 / span 80;
  position: sticky;
  top: 140px;
  align-self: start;
  background: var(--paper);
  border-radius: var(--r);
  padding: 20px 18px 14px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.rail h2 {
  font-size: 19px;
  letter-spacing: 0.22em;
  margin: 0 0 10px;
}

.rail h2 > span::before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 1px;
  background: var(--ink);
  vertical-align: middle;
  margin-right: 10px;
}

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

.rail li {
  border-top: 1px solid var(--line);
}

.rail a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 9px 2px;
  text-decoration: none;
  font-size: 16px;
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.rail a em {
  font-style: normal;
  font-size: 12px;
  color: var(--mute);
  letter-spacing: 0.12em;
}

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

/* 正文卡片 */
main > article:not(.hero):not(.tiles) {
  grid-column: 2;
  background: var(--paper);
  border-radius: var(--r);
  padding: clamp(22px, 3.2vw, 46px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  scroll-margin-top: 150px;
}

main > article:nth-of-type(even):not(.hero):not(.tiles) {
  background: #fafafa;
}

main > article:nth-of-type(3n):not(.hero):not(.tiles) {
  margin-right: clamp(0px, 5vw, 76px);
}

main > article:not(.hero):not(.tiles) h2 {
  font-size: clamp(26px, 3.4vw, 38px);
  margin-top: 0.1em;
}

h2 > span {
  display: inline-block;
}

h2 > span::before {
  content: "";
  display: inline-block;
  width: 26px;
  height: 1px;
  background: var(--ink);
  vertical-align: middle;
  margin-right: 14px;
}

main > article p {
  max-width: 66ch;
}

main > article ul,
main > article ol {
  padding-left: 1.2em;
}

main > article li {
  margin-bottom: 0.4em;
}

main > article blockquote {
  margin: 24px 0;
  padding: 6px 0 6px 20px;
  border-left: 2px solid var(--ink);
  color: #3a3a3a;
}

main > article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

main > article th,
main > article td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

/* Bento 索引块 */
.tiles {
  grid-column: 2;
  padding: 8px 0 12px;
}

.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 96px;
  gap: 14px;
}

.bento a {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 16px;
  border-radius: var(--r);
  background: var(--paper);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  text-decoration: none;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.3;
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.bento a .idx {
  font-family: var(--body);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--mute);
}

.bento a:hover {
  transform: scale(1.02);
}

.bento a:nth-child(1) {
  grid-column: span 3;
  grid-row: span 2;
  background: var(--ink);
  color: #fff;
}

.bento a:nth-child(1) .idx {
  color: #b9b9b9;
}

.bento a:nth-child(2) {
  grid-column: span 3;
}

.bento a:nth-child(6) {
  grid-column: span 4;
}

.bento a:nth-child(7) {
  grid-column: span 2;
  background: var(--stone);
}

/* 页脚 */
.foot {
  background: var(--ink);
  color: #f2f2f2;
  margin-top: 34px;
  padding: 56px clamp(18px, 5vw, 64px) 22px;
  border-radius: 24px 24px 0 0;
}

.foot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
  max-width: 1120px;
  margin: 0 auto;
}

.foot h3 {
  font-size: 18px;
  letter-spacing: 0.16em;
  margin: 0 0 14px;
  color: #fff;
}

.foot h3 > span {
  border-bottom: 1px solid #4a4a4a;
  padding-bottom: 6px;
}

.foot address {
  font-style: normal;
  color: #cfcfcf;
  line-height: 1.9;
}

.foot address span {
  font-size: 15px;
  color: #a9a9a9;
}

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

.flinks a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 0;
  color: #cfcfcf;
  text-decoration: none;
  font-size: 16px;
}

.flinks a:hover {
  color: #fff;
}

.sub input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #3d3d3d;
  background: #2a2a2a;
  color: #fff;
  font-family: var(--body);
  font-size: 16px;
}

.sub input::placeholder {
  color: #9b9b9b;
}

.sub button {
  width: 100%;
  margin-top: 10px;
  padding: 12px 14px;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.fmark {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.4;
  color: #fff;
  margin: 0;
}

.copy {
  max-width: 1120px;
  margin: 40px auto 0;
  padding-top: 16px;
  border-top: 1px solid #3a3a3a;
  text-align: center;
  font-size: 14px;
  color: #b5b5b5;
}

/* 动效 */
@media (prefers-reduced-motion: no-preference) {
  .js main > article:not(.hero) {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }

  .js main > article.in {
    opacity: 1;
    transform: none;
  }
}

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

  * {
    transition: none !important;
    animation: none !important;
  }
}

/* 窄屏 */
@media (max-width: 1060px) {
  .brand {
    font-size: 20px;
  }

  .nav a span {
    display: none;
  }

  .nav a {
    padding: 10px;
  }

  main {
    grid-template-columns: 200px minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  main {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px 16px 8px;
    gap: 16px;
  }

  .hero {
    grid-column: 1;
    min-height: 88vh;
    padding: 110px 18px 70px;
  }

  .rail {
    grid-column: 1;
    grid-row: auto;
    position: static;
  }

  .rail ul {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .rail ul::-webkit-scrollbar {
    display: none;
  }

  .rail li {
    border-top: 0;
  }

  .rail a {
    background: var(--stone);
    border-radius: 10px;
    padding: 8px 12px;
    gap: 8px;
    white-space: nowrap;
  }

  main > article:not(.hero):not(.tiles),
  .tiles {
    grid-column: 1;
  }

  main > article:nth-of-type(3n):not(.hero):not(.tiles) {
    margin-right: 0;
  }

  .bento {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 110px;
  }

  .bento a,
  .bento a:nth-child(1),
  .bento a:nth-child(2),
  .bento a:nth-child(6),
  .bento a:nth-child(7) {
    grid-column: span 1;
    grid-row: span 1;
  }

  .bento a:nth-child(1) {
    grid-column: span 2;
  }

  .menu-btn {
    display: block;
  }

  .bar {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0 12px;
    height: 68px;
  }

  .brand {
    padding-top: 18px;
  }

  .nav {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 8px 12px 14px;
    max-height: calc(100vh - 68px);
    overflow-y: auto;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
  }

  .topbar.open .nav {
    display: block;
  }

  .nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .nav a {
    justify-content: flex-start;
    min-height: 46px;
    padding: 10px 12px;
  }

  .nav a span {
    display: inline;
  }

  .anchors {
    top: 68px;
  }

  .foot {
    padding: 44px 20px 20px;
  }

  .foot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  .foot-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  h2 > span::before {
    width: 18px;
    margin-right: 10px;
  }

  .hero-copy {
    max-width: 16ch;
  }
}

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