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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --line: rgba(0, 0, 0, 0.16);
  --line-soft: rgba(0, 0, 0, 0.09);
  --glass: rgba(255, 255, 255, 0.66);
  --unit: 8px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 17px;
  line-height: 1.62;
  color: var(--ink);
  background-color: var(--paper);
  background-image: repeating-linear-gradient(
    to right,
    var(--line-soft) 0 1px,
    transparent 1px 8.3333%
  );
  overflow-x: hidden;
}

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

img { max-width: 100%; }

.shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- 顶部 ---------- */

.top {
  position: relative;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-align: center;
  padding: 10px 8px;
  white-space: nowrap;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  min-width: 0;
}

.nav-r { justify-content: flex-end; align-items: center; }

.m-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  font-size: 0.94rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 4px;
  white-space: nowrap;
}

.m-link:hover,
.m-link:focus-visible {
  background: var(--ink);
  color: var(--paper);
  outline: none;
}

.drop { position: relative; display: inline-flex; }

.drop-panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  flex-direction: column;
  min-width: 168px;
  padding: 6px;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 4px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.14);
  z-index: 70;
}

.drop.open .drop-panel,
.drop:hover .drop-panel,
.drop:focus-within .drop-panel { display: flex; }

.d-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 500;
  border-radius: 4px;
}

.d-link:hover,
.d-link:focus-visible {
  background: var(--ink);
  color: var(--paper);
  outline: none;
}

.top-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.search {
  display: flex;
  align-items: center;
  border: 1px solid var(--ink);
  border-radius: 4px;
  overflow: hidden;
  background: var(--paper);
}

.search-in {
  width: 108px;
  min-height: 40px;
  padding: 0 8px;
  border: 0;
  font: inherit;
  font-size: 0.9rem;
  background: transparent;
  color: var(--ink);
}

.search-in:focus { outline: none; }

.search-btn {
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-left: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
}

/* ---------- 粘性锚点条 ---------- */

.rail {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--ink);
  color: var(--paper);
}

.rail-in {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.rail-nav {
  display: flex;
  align-items: stretch;
  width: max-content;
  min-width: 100%;
}

.rail-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 14px;
  color: var(--paper);
  text-decoration: none;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  border-right: 1px solid rgba(255, 255, 255, 0.22);
}

.rail-nav a:hover,
.rail-nav a:focus-visible {
  background: var(--paper);
  color: var(--ink);
  outline: none;
}

.rail-bar {
  display: block;
  height: 3px;
  background: var(--paper);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* ---------- 首屏 ---------- */

.hero {
  padding: 26px 0 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  align-items: end;
  min-height: 45vh;
  padding-bottom: 26px;
  border-bottom: 2px solid var(--ink);
}

h1 {
  margin: 0 0 18px;
  font-size: clamp(2.5rem, 7.2vw, 5.4rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.03em;
  overflow-wrap: break-word;
}

.hero-desc {
  margin: 0;
  max-width: 38ch;
  padding-top: 12px;
  border-top: 1px solid var(--ink);
  font-size: 1rem;
}

.hero-media {
  position: relative;
  margin: 0;
  height: 100%;
  min-height: 240px;
  max-height: 46vh;
  overflow: hidden;
  border-radius: 4px;
  clip-path: polygon(0 0, 100% 0, 100% 84%, 0 100%);
  background: #111;
}

.hero-media img {
  display: block;
  width: 100%;
  height: 120%;
  margin-top: -6%;
  object-fit: cover;
  will-change: transform;
}

/* ---------- 主体 ---------- */

.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 28px;
  align-items: start;
  padding: 34px 0 60px;
}

.article { min-width: 0; }

.article section {
  margin: 0 0 22px;
  padding: 26px 22px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  scroll-margin-top: 92px;
}

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

.article h2 {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  line-height: 1.14;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.article h3 {
  margin: 22px 0 10px;
  font-size: 1.16rem;
  line-height: 1.3;
  font-weight: 600;
}

.article h2 + hr,
.article h3 + hr {
  height: 0;
  margin: 0 0 16px;
  border: 0;
  border-top: 3px solid var(--ink);
}

.article p { margin: 0 0 14px; }
.article p:last-child { margin-bottom: 0; }

.article ul,
.article ol { margin: 0 0 14px; padding-left: 1.3em; }

.article li { margin-bottom: 6px; }

.article blockquote {
  margin: 0 0 14px;
  padding: 10px 16px;
  border-left: 4px solid var(--ink);
  background: rgba(0, 0, 0, 0.04);
}

.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 16px;
  font-size: 0.95rem;
}

.article th,
.article td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
}

.article pre {
  overflow-x: auto;
  padding: 14px;
  border-radius: 4px;
  background: #000;
  color: #fff;
  font-size: 0.9rem;
}

.article code { font-size: 0.94em; }

.article figure { margin: 0 0 16px; }
.article img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

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

.side {
  position: sticky;
  top: 78px;
}

.side-card {
  padding: 20px 18px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.side-card h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.side-card hr {
  height: 0;
  margin: 0 0 12px;
  border: 0;
  border-top: 3px solid var(--ink);
}

.side-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
}

.side-list a {
  display: flex;
  align-items: center;
  min-height: 42px;
  font-size: 0.94rem;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.side-list li:last-child a { border-bottom: 0; }

.side-list a:hover,
.side-list a:focus-visible { text-decoration: underline; outline: none; }

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

.foot {
  margin-top: 20px;
  padding: 42px 0 20px;
  background: var(--ink);
  color: var(--paper);
}

.foot-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 30px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

.foot-addr {
  font-style: normal;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding-bottom: 12px;
}

.foot-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
}

.foot-list a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--paper);
  text-decoration: none;
  font-size: 0.94rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
}

.foot-list a:hover,
.foot-list a:focus-visible { text-decoration: underline; outline: none; }

.foot-nav dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 18px;
  margin: 0;
}

.foot-nav dt {
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  opacity: 0.6;
  margin-top: 8px;
}

.foot-nav dd { margin: 0; }

.foot-nav dd a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--paper);
  text-decoration: none;
  font-size: 0.94rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
}

.foot-nav dd a:hover,
.foot-nav dd a:focus-visible { text-decoration: underline; outline: none; }

.foot-mark {
  max-width: 1280px;
  margin: 34px auto 10px;
  padding: 0 20px;
  font-size: clamp(2.2rem, 12vw, 8.4rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.04em;
}

.foot-copy {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.26);
  font-size: 0.84rem;
  opacity: 0.78;
}

/* ---------- 断点 ---------- */

@media (max-width: 1000px) {
  .page { grid-template-columns: minmax(0, 1fr) 250px; gap: 20px; }
}

@media (max-width: 900px) {
  .top { grid-template-columns: 1fr auto; }
  .nav-l, .nav-r { display: none; }
  .brand { text-align: left; font-size: 1rem; }
  .search-in { width: 86px; }
  .hero-grid { grid-template-columns: 1fr; min-height: 0; gap: 18px; padding-bottom: 20px; }
  .hero-media { min-height: 190px; max-height: 34vh; clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%); }
  h1 { font-size: clamp(2.2rem, 11vw, 3.4rem); }
  .page { grid-template-columns: minmax(0, 1fr); padding: 26px 0 44px; }
  .side { position: static; order: 2; }
  .article section { padding: 20px 16px; scroll-margin-top: 80px; }
  .foot-grid { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 420px) {
  body { font-size: 16px; }
  .shell { padding: 0 14px; }
  .rail-in { padding: 0 14px; }
  .foot-grid, .foot-mark, .foot-copy { padding-left: 14px; padding-right: 14px; }
  .search-in { width: 68px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-media img { transform: none !important; }
}

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