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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --soft: #f3f3f3;
  --soft-2: #e9e9e9;
  --line: #dcdcdc;
  --muted: #333333;
  --unit: 8px;
  --radius: 18px;
  --maxw: 1180px;
  --rail: 216px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Sans", Helvetica, Arial, system-ui, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  letter-spacing: 0.01em;
}

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

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

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

::selection {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- 顶部：品牌居中，药丸菜单分列两侧 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.menu {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.55rem clamp(1rem, 4vw, 2rem);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pills-right {
  justify-content: flex-end;
}

.pills a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.pills a:hover,
.pills a:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

.brand {
  padding: 0.3rem 0.6rem;
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

/* ---------- 主体网格 ---------- */
main {
  padding-bottom: 1rem;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}

main [id] {
  scroll-margin-top: 104px;
}

.lede {
  padding: clamp(1rem, 2.6vw, 1.8rem) 0 0;
}

/* ---------- 头图区：12 栏非对称 ---------- */
.hero {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
  align-items: center;
  min-height: 45vh;
  padding: clamp(1.4rem, 4vw, 3rem);
  border-radius: var(--radius);
  background-color: var(--paper);
  background-image: radial-gradient(rgba(0, 0, 0, 0.16) 1px, transparent 1px);
  background-size: 18px 18px;
  background-position: 0 0;
}

.hero-copy {
  grid-column: 1 / span 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  text-align: center;
}

.hero-solo .hero-copy {
  grid-column: 1 / -1;
}

.kicker {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: clamp(1.9rem, 5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.hero-desc {
  margin: 0;
  max-width: 34ch;
  color: var(--muted);
}

.cta {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  margin-top: 0.3rem;
  padding: 0.5rem 1.4rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.cta:hover {
  transform: translateY(-2px);
  opacity: 0.88;
}

.hero-art {
  grid-column: 8 / span 5;
  margin: 0;
}

.hero-img {
  width: 100%;
  height: auto;
  max-height: 46vh;
  object-fit: cover;
  border-radius: var(--radius);
}

/* ---------- 正文 + 右侧栏 ---------- */
.body-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
  padding: clamp(1.3rem, 3vw, 2.4rem) 0 3rem;
}

.prose {
  min-width: 0;
  max-width: 74ch;
}

.prose > section {
  margin: 0 0 1.1rem;
  padding: clamp(1.3rem, 3.2vw, 2.6rem);
  border-radius: var(--radius);
  background: var(--soft);
}

.prose > section:nth-of-type(even) {
  background: var(--soft-2);
}

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

.prose h2,
.prose h3 {
  margin: 0 0 0.7rem;
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.02em;
}

.prose h2 {
  font-size: clamp(1.3rem, 2.6vw, 1.85rem);
}

.prose h3 {
  font-size: 1.12rem;
}

.prose h2 span,
.prose h3 span {
  display: inline;
}

.prose p {
  margin: 0 0 0.9rem;
}

.prose p,
.prose li {
  font-size: 1.02rem;
  line-height: 1.78;
}

.prose ul,
.prose ol {
  margin: 0 0 0.9rem;
  padding-left: 1.25rem;
}

.prose li {
  margin: 0.28rem 0;
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.prose blockquote {
  margin: 0 0 1rem;
  padding: 0.15rem 0 0.15rem 1rem;
  border-left: 3px solid var(--ink);
  font-weight: 500;
}

.prose img {
  margin: 0.4rem 0 1rem;
  border-radius: 12px;
}

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

/* ---------- 侧栏 ---------- */
.rail {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1rem 0.9rem 1.1rem;
  border-radius: var(--radius);
  background: var(--soft);
}

.rail-title {
  margin: 0;
  padding-left: 0.5rem;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.24em;
}

.rail-nav ul {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail-nav a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.92rem;
  text-decoration: none;
  transition: background-color 0.18s ease, color 0.18s ease;
}

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

.totop {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-top: 0.2rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.9rem;
  text-decoration: none;
}

.totop:hover {
  opacity: 0.85;
}

/* ---------- 页脚 ---------- */
.foot {
  margin-top: 2rem;
  border-top: 1px solid var(--line);
}

.foot section {
  padding: clamp(1.1rem, 3vw, 1.8rem) clamp(1rem, 4vw, 2rem);
}

.foot-mark-wrap {
  padding-top: clamp(1.8rem, 6vw, 3.4rem) !important;
  text-align: center;
}

.foot-mark {
  margin: 0;
  font-size: clamp(2.2rem, 12vw, 7rem);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.045em;
}

.foot-links {
  border-top: 1px solid var(--line);
}

.foot-links ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background-color 0.18s ease, color 0.18s ease;
}

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

.foot-base {
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.foot-base p {
  margin: 0.15rem 0;
}

.host {
  letter-spacing: 0.08em;
}

/* ---------- 动效 ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero-art .hero-img {
    animation: hero-float 9s ease-in-out infinite alternate;
  }

  @keyframes hero-float {
    from {
      transform: translate3d(0, 0, 0);
    }
    to {
      transform: translate3d(0, -8px, 0);
    }
  }
}

/* ---------- 断点 ---------- */
@media (max-width: 900px) {
  .body-area {
    grid-template-columns: minmax(0, 1fr);
  }

  .prose {
    order: 1;
    max-width: none;
  }

  .rail {
    position: static;
    order: 2;
  }
}

@media (max-width: 860px) {
  .menu {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 0.25rem;
    padding-bottom: 0.6rem;
  }

  .brand {
    order: -1;
  }

  .pills,
  .pills-right {
    justify-content: center;
  }

  .pills a {
    font-size: 0.9rem;
    padding: 0.3rem 0.7rem;
  }
}

@media (max-width: 780px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 1.2rem;
  }

  .hero-copy,
  .hero-art {
    grid-column: 1 / -1;
  }

  .hero-img {
    max-height: none;
  }
}

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

  .hero {
    padding: 1.2rem 1rem;
  }
}

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