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

:root {
  --ink: #171f26;
  --ink-2: #1c2530;
  --ink-3: #222d3a;
  --blue: #c8e0f4;
  --pink: #f5e0e8;
  --paper: #dbe7f1;
  --dim: #93a7b8;
  --line: rgba(200, 224, 244, 0.14);
  --raise: -6px -6px 14px rgba(0, 0, 0, 0.55), 6px 6px 16px rgba(200, 224, 244, 0.07);
  --raise-sm: -3px -3px 8px rgba(0, 0, 0, 0.5), 3px 3px 9px rgba(200, 224, 244, 0.07);
  --inset: inset -4px -4px 10px rgba(0, 0, 0, 0.5), inset 4px 4px 12px rgba(200, 224, 244, 0.08);
  --r: 14px;
  --r-sm: 10px;
  --font: 'Inter', 'Space Grotesk', system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 8% -8%, rgba(200, 224, 244, 0.13), transparent 62%),
    radial-gradient(760px 480px at 98% 4%, rgba(245, 224, 232, 0.11), transparent 60%),
    radial-gradient(820px 620px at 60% 108%, rgba(200, 224, 244, 0.07), transparent 65%),
    var(--ink);
  color: #dde8f2;
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.72;
  letter-spacing: 0.012em;
  overflow-x: hidden;
}

a {
  color: var(--pink);
  text-decoration: none;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration: underline;
}

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

h1,
h2,
h3 {
  font-family: var(--font);
  color: var(--blue);
  letter-spacing: -0.015em;
  line-height: 1.22;
  margin: 0 0 14px;
}

p {
  margin: 0 0 16px;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 3px;
  border-radius: 8px;
}

.skip {
  position: absolute;
  left: 12px;
  top: 10px;
  z-index: 40;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  background: var(--ink-2);
  color: var(--blue);
  box-shadow: var(--raise-sm);
  transform: translateY(-260%);
  transition: transform 180ms ease;
}

.skip:focus {
  transform: translateY(0);
}

/* ---------- 顶部：图标品牌 + 药丸导航 + 搜索 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 10px clamp(14px, 3vw, 28px);
  background: linear-gradient(145deg, rgba(28, 37, 48, 0.94), rgba(23, 31, 38, 0.94));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5), inset 0 -1px 0 rgba(200, 224, 244, 0.06);
}

.mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--ink-3), var(--ink-2));
  color: var(--blue);
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
  box-shadow: var(--raise-sm);
  transition: box-shadow 150ms ease, transform 150ms ease;
}

.mark img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.mark:hover {
  text-decoration: none;
  box-shadow: var(--inset);
}

.mark:active {
  transform: scale(0.96);
}

.pills {
  display: flex;
  flex: 1 1 300px;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 2px;
}

.pills::-webkit-scrollbar {
  display: none;
}

.pills a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: linear-gradient(145deg, var(--ink-3), var(--ink-2));
  color: var(--paper);
  font-size: 15px;
  letter-spacing: 0.03em;
  box-shadow: var(--raise-sm);
  transition: box-shadow 150ms ease, color 150ms ease, transform 150ms ease;
}

.pills a:hover {
  text-decoration: none;
  color: var(--blue);
  box-shadow: var(--inset);
}

.pills a:active {
  transform: scale(0.97);
}

.search {
  flex: 0 0 auto;
  display: flex;
}

.search input {
  width: 168px;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font);
  font-size: 15px;
  box-shadow: var(--inset);
}

.search input::placeholder {
  color: var(--dim);
}

.search input:focus {
  outline: none;
  box-shadow: var(--inset), 0 0 0 2px rgba(245, 224, 232, 0.28);
}

/* ---------- 骨架：左索引 / 右正文 ---------- */

.shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: clamp(16px, 2.4vw, 30px);
  width: min(1160px, 100%);
  margin: clamp(20px, 3vw, 34px) auto 0;
  padding: 0 clamp(14px, 3vw, 28px) 40px;
  align-items: start;
}

.side {
  position: sticky;
  top: 86px;
  padding: 20px 18px 22px;
  border-radius: var(--r);
  background: linear-gradient(145deg, rgba(34, 45, 58, 0.86), rgba(28, 37, 48, 0.86));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--raise);
}

.side-title {
  font-size: 15px;
  letter-spacing: 0.28em;
  color: var(--dim);
  margin: 0 0 10px;
  font-weight: 600;
}

hr {
  border: 0;
  height: 1px;
  margin: 0 0 18px;
  background: linear-gradient(90deg, rgba(200, 224, 244, 0.42), rgba(200, 224, 244, 0.02));
}

.side-nav a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 12px;
  margin-bottom: 6px;
  border-radius: var(--r-sm);
  color: #c6d6e4;
  font-size: 15px;
  box-shadow: var(--raise-sm);
  background: linear-gradient(145deg, rgba(36, 48, 64, 0.8), rgba(28, 37, 48, 0.8));
  transition: box-shadow 150ms ease, color 150ms ease;
}

.side-nav a:hover {
  text-decoration: none;
  color: var(--blue);
  box-shadow: var(--inset);
}

.side-nav li:last-child a {
  margin-bottom: 0;
}

.paper {
  min-width: 0;
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(16px, 2.4vw, 30px);
  min-height: 45vh;
  padding: clamp(24px, 3.4vw, 40px);
  border-radius: 16px;
  background-color: rgba(28, 37, 48, 0.55);
  background-image:
    radial-gradient(rgba(200, 224, 244, 0.14) 1px, transparent 1px),
    linear-gradient(145deg, rgba(36, 48, 64, 0.9), rgba(23, 31, 38, 0.9));
  background-size: 18px 18px, 100% 100%;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--raise), inset 0 1px 0 rgba(200, 224, 244, 0.07);
}

.hero-txt {
  text-align: center;
}

.hero h1 {
  font-size: clamp(28px, 4.4vw, 46px);
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--blue);
  text-shadow: 0 2px 18px rgba(200, 224, 244, 0.18);
}

.lead {
  margin: 0;
  color: #cadbe8;
  font-size: clamp(15.5px, 1.6vw, 17px);
  line-height: 1.78;
}

.hero-art {
  margin: 0;
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--raise);
  background: var(--ink-2);
}

.hero-img {
  width: 100%;
  height: 100%;
  max-height: 260px;
  object-fit: cover;
}

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

.body {
  margin-top: clamp(18px, 2.6vw, 28px);
}

.body article {
  position: relative;
  padding: clamp(20px, 2.6vw, 34px);
  margin-bottom: clamp(16px, 2vw, 24px);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--raise-sm), inset 0 1px 0 rgba(200, 224, 244, 0.06);
  scroll-margin-top: 104px;
}

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

.body h2 {
  font-size: clamp(21px, 2.6vw, 29px);
  font-weight: 600;
}

.body h3 {
  font-size: clamp(18px, 2vw, 21px);
  margin-top: 26px;
}

.body h2 + hr,
.body h3 + hr {
  margin-bottom: 20px;
}

.body p {
  color: #d3e0ec;
  line-height: 1.86;
}

.body ul,
.body ol {
  margin: 0 0 18px;
  padding-left: 0;
  list-style: none;
}

.body ul li,
.body ol li {
  position: relative;
  padding: 6px 0 6px 22px;
  color: #d3e0ec;
}

.body ul li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 18px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 10px rgba(245, 224, 232, 0.6);
}

.body ol {
  counter-reset: n;
}

.body ol li::before {
  counter-increment: n;
  content: counter(n);
  left: 0;
  top: 8px;
  width: auto;
  height: auto;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--blue);
  font-family: var(--mono);
  font-size: 13px;
}

.body strong {
  color: var(--blue);
  font-weight: 600;
}

.body a {
  color: var(--pink);
}

.body blockquote {
  margin: 0 0 18px;
  padding: 16px 20px;
  border-radius: var(--r-sm);
  background: rgba(23, 31, 38, 0.66);
  box-shadow: var(--inset);
  color: #c3d4e2;
}

.body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 18px;
  font-size: 15.5px;
}

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

.body th {
  color: var(--blue);
  font-weight: 600;
}

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

.foot {
  margin-top: clamp(24px, 4vw, 48px);
  padding: clamp(24px, 3vw, 40px) clamp(14px, 3vw, 28px) 22px;
  background: linear-gradient(180deg, rgba(28, 37, 48, 0.9), rgba(23, 31, 38, 0.98));
  box-shadow: inset 0 1px 0 rgba(200, 224, 244, 0.08);
}

.foot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(16px, 2.4vw, 30px);
  width: min(1160px, 100%);
  margin: 0 auto;
}

.foot-nav {
  grid-column: 1 / 4;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 26px);
}

.foot-nav dl {
  margin: 0;
}

.foot-nav dt {
  margin-bottom: 10px;
}

.foot-nav dt a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  font-size: 13px;
  letter-spacing: 0.24em;
  color: var(--dim);
  font-family: var(--mono);
}

.foot-nav dt a:hover {
  text-decoration: none;
  color: var(--blue);
}

.foot-nav dd {
  margin: 0 0 4px;
}

.foot-nav dd a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 0;
  color: #c2d3e1;
  font-size: 15px;
}

.foot-nav dd a:hover {
  color: var(--pink);
  text-decoration: none;
}

.foot-sub {
  grid-column: 4 / 5;
  padding: 18px;
  border-radius: var(--r);
  background: linear-gradient(145deg, rgba(36, 48, 64, 0.7), rgba(23, 31, 38, 0.7));
  box-shadow: var(--raise-sm);
}

.foot-k {
  margin: 0 0 12px;
  font-size: 13px;
  letter-spacing: 0.24em;
  color: var(--dim);
  font-family: var(--mono);
}

.sub-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sub-form input {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font);
  font-size: 15px;
  box-shadow: var(--inset);
}

.sub-form input::placeholder {
  color: var(--dim);
}

.sub-form button {
  min-height: 44px;
  border: 0;
  border-radius: var(--r-sm);
  background: linear-gradient(145deg, corresponding, var(--ink-3));
  background: linear-gradient(145deg, #2b3949, #1d2630);
  color: var(--blue);
  font-family: var(--font);
  font-size: 15px;
  letter-spacing: 0.16em;
  cursor: pointer;
  box-shadow: var(--raise-sm);
  transition: box-shadow 150ms ease, transform 150ms ease;
}

.sub-form button:hover {
  box-shadow: var(--inset);
}

.sub-form button:active {
  transform: scale(0.98);
}

.copy {
  width: min(1160px, 100%);
  margin: 26px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 14px;
  letter-spacing: 0.06em;
}

/* ---------- 响应式 ---------- */

@media (max-width: 900px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .side {
    position: static;
    order: 2;
    margin-top: 6px;
  }

  .side-nav ul {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
  }

  .side-nav a {
    margin-bottom: 0;
  }

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

  .foot-nav {
    grid-column: 1 / -1;
  }

  .foot-sub {
    grid-column: 1 / -1;
  }

  .sub-form {
    flex-direction: row;
  }

  .sub-form input {
    flex: 1 1 auto;
  }

  .sub-form button {
    flex: 0 0 auto;
    padding: 0 22px;
  }
}

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

  .topbar {
    gap: 8px;
    padding: 8px 12px;
  }

  .pills {
    order: 3;
    flex: 1 1 100%;
  }

  .search {
    margin-left: auto;
  }

  .search input {
    width: 116px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding: 22px 18px;
  }

  .hero-art {
    order: 2;
  }

  .hero-img {
    max-height: 180px;
  }

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

  .body article {
    padding: 18px 16px;
  }
}

@media (max-width: 420px) {
  .foot-nav {
    grid-template-columns: minmax(0, 1fr);
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .body article {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

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