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

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

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

body {
  margin: 0;
  padding-bottom: calc(5.25rem + env(safe-area-inset-bottom));
  background: #fff;
  color: #000;
  font-family: 'Inter', -apple-system, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 17px;
  line-height: 1.75;
  font-weight: 400;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, 'Songti SC', 'SimSun', serif;
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: -0.045em;
  margin: 0;
}

p { margin: 0 0 1.2rem; }
img { max-width: 100%; }
a { color: inherit; }
::selection { background: #000; color: #fff; }

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

/* ---------- hero ---------- */

.hero {
  position: relative;
  grid-column: 1 / -1;
  min-height: 70vh;
  display: grid;
  place-items: center;
  background: #000;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}

.hero-media {
  position: absolute;
  left: 0;
  right: 0;
  top: -18%;
  bottom: -18%;
  z-index: 0;
  will-change: transform;
}

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

.hero-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.78));
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1080px;
  padding: clamp(3rem, 8vw, 6rem) clamp(1.25rem, 5vw, 3rem);
  text-align: center;
}

.hero-brand {
  margin: 0 0 clamp(1.2rem, 3vw, 2rem);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  color: #fff;
}

.hero h1 {
  font-size: clamp(3rem, 10vw, 9rem);
  letter-spacing: -0.05em;
  line-height: 0.98;
  overflow-wrap: anywhere;
}

.hero-desc {
  max-width: 44ch;
  margin: clamp(1.4rem, 4vw, 2.2rem) auto 0;
  font-size: 1rem;
  line-height: 1.8;
  color: #ededed;
}

/* ---------- 左侧目录 ---------- */

.toc {
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1.25rem, 5vw, 4rem) clamp(1rem, 3vw, 2rem);
  border-bottom: 2px solid #000;
}

.toc h2 {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  margin: 0 0 1.1rem;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  column-gap: 1rem;
}

.toc-list li {
  border-top: 1px solid #000;
}

.toc-list a {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0.7rem 0;
  font-size: 16px;
  text-decoration: none;
  color: #000;
}

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

.toc-num {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  opacity: 0.55;
}

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

.prose {
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1.25rem, 5vw, 4rem) clamp(3rem, 8vw, 6rem);
  max-width: 78ch;
}

.prose div {
  padding-block: clamp(2.5rem, 7vw, 5.5rem);
  border-top: 2px solid #000;
  scroll-margin-top: 1.5rem;
}

.prose div:first-child {
  border-top: 0;
  padding-top: 0.5rem;
}

.prose h2 {
  font-size: clamp(2rem, 6vw, 4.25rem);
  margin: 0 0 1.4rem;
}

.prose h3 {
  font-size: clamp(1.4rem, 3.4vw, 2.1rem);
  letter-spacing: -0.03em;
  margin: 2.4rem 0 0.9rem;
}

.prose h4 {
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  margin: 2rem 0 0.7rem;
}

.prose p,
.prose li {
  max-width: 70ch;
  font-size: 1.02rem;
}

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

.prose li { margin: 0.4rem 0; }

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

.prose strong { font-weight: 700; }

.prose blockquote {
  margin: 1.8rem 0;
  padding: 0.2rem 0 0.2rem 1.2rem;
  border-left: 4px solid #000;
  font-family: 'Playfair Display', Georgia, 'Songti SC', serif;
  font-size: 1.15rem;
  line-height: 1.6;
}

.prose figure { margin: 1.8rem 0; }

.prose img {
  display: block;
  width: 100%;
  height: auto;
  border: 2px solid #000;
}

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

.prose th,
.prose td {
  border: 1px solid #000;
  padding: 0.6rem 0.7rem;
  text-align: left;
  vertical-align: top;
}

.prose th { font-weight: 700; background: #000; color: #fff; }

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.94em;
  border-bottom: 1px solid #000;
}

.prose hr {
  border: 0;
  border-top: 2px solid #000;
  margin: 2.5rem 0;
}

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

.foot {
  border-top: 2px solid #000;
  margin-top: clamp(2rem, 6vw, 4rem);
}

.foot-cta {
  padding: clamp(3rem, 9vw, 6.5rem) clamp(1.25rem, 5vw, 4rem);
  text-align: center;
  border-bottom: 2px solid #000;
}

.foot-cta h2 {
  font-size: clamp(2.5rem, 9vw, 6.5rem);
  letter-spacing: -0.055em;
  margin: 0 0 clamp(1.6rem, 4vw, 2.4rem);
  overflow-wrap: anywhere;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.65rem 1.5rem;
  border: 2px solid #000;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

.pill:hover { background: #000; color: #fff; }

.foot-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  padding: clamp(2rem, 5vw, 3rem) clamp(1.25rem, 5vw, 4rem);
}

.foot-cols dl { margin: 0; }

.foot-cols dt {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  margin-bottom: 0.6rem;
}

.foot-cols dd {
  margin: 0;
  font-size: 16px;
  line-height: 1.9;
}

.foot-links a {
  display: inline-block;
  padding: 0.25rem 0;
  margin-right: 0.9rem;
  text-decoration: none;
  border-bottom: 1px solid #000;
}

.foot-copy {
  margin: 0;
  padding: 1.4rem 1.25rem;
  border-top: 1px solid #000;
  text-align: center;
  font-size: 16px;
}

/* ---------- 底部固定药丸导航 ---------- */

.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem clamp(0.7rem, 3vw, 1.5rem) calc(0.5rem + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 2px solid #000;
}

.dock-group { position: relative; justify-self: start; }
.dock-group.dock-r { justify-self: end; }

.dock summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 1.05rem;
  border: 2px solid #000;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.dock summary::-webkit-details-marker { display: none; }
.dock-group[open] summary { background: #000; color: #fff; }

.dock-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.6rem);
  margin: 0;
  padding: 0.3rem;
  min-width: 10rem;
  list-style: none;
  background: #fff;
  border: 2px solid #000;
}

.dock-r .dock-menu { left: auto; right: 0; }

.dock-menu a {
  display: block;
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  font-size: 16px;
  text-decoration: none;
  border-bottom: 1px solid #000;
}

.dock-menu li:last-child a { border-bottom: 0; }
.dock-menu a:hover { background: #000; color: #fff; }

.dock-brand {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.45rem 1.1rem;
  border: 2px solid #000;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font-family: 'Playfair Display', Georgia, 'Songti SC', serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
}

/* ---------- 动效 ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js .prose div,
  .js .toc-list li {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  }
  .js .toc-list li.in { opacity: 1; transform: none; }
  .js .prose div.in { opacity: 1; transform: none; }
}

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

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

@media (min-width: 760px) {
  .foot-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; }
  .foot-cols dl + dl { border-left: 1px solid #000; padding-left: 1.5rem; }
}

@media (min-width: 940px) {
  main {
    grid-template-columns: minmax(0, 216px) minmax(0, 1fr);
    column-gap: clamp(2rem, 4vw, 4rem);
  }

  .toc {
    position: sticky;
    top: 0;
    align-self: start;
    border-bottom: 0;
    border-right: 1px solid #000;
    padding-top: clamp(2.5rem, 5vw, 4rem);
    padding-bottom: 3rem;
  }

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

  .prose {
    padding-top: clamp(2.5rem, 5vw, 4rem);
    padding-right: clamp(2rem, 6vw, 6rem);
    max-width: 80ch;
  }

  .prose div { scroll-margin-top: 2rem; }

  .hero h1 { font-size: clamp(4rem, 9vw, 9.5rem); }
}

@media (min-width: 1280px) {
  .prose p,
  .prose li { font-size: 1.06rem; }
}

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