:root {
  --ink: #26171a;
  --ink-soft: #332226;
  --card: #332226;
  --rose: #eb879c;
  --blush: #ffb6c1;
  --text: #f8ecee;
  --text-2: #dcc0c6;
  --line: rgba(255, 182, 193, 0.16);
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.32), 0 14px 30px -14px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --r: 18px;
  --pill: 999px;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Cabin", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background-color: #1f1215;
  background-image: radial-gradient(120% 78% at 50% -12%, #3d272c 0%, #2a1a1e 44%, #1d1114 100%);
  background-attachment: fixed;
}

h1,
h2,
h3,
.brand,
.side-brand {
  font-family: "Amatic SC", "Cabin", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 700;
  letter-spacing: 0.05em;
}

h1 {
  margin: 0;
  font-size: clamp(2.5rem, 9vw, 5rem);
  line-height: 1.06;
  background: linear-gradient(180deg, #fff6f8 0%, var(--blush) 56%, var(--rose) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-wrap: balance;
}

h2 {
  margin: 0 0 12px;
  font-size: 1.3rem;
  letter-spacing: 0.09em;
  color: #ffe3e8;
}

h2 span {
  position: relative;
  display: inline-block;
}

h2 span::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--rose), rgba(235, 135, 156, 0));
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--blush);
  outline-offset: 2px;
  border-radius: 10px;
}

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

/* 顶部细条 */
.ticker {
  padding: 5px 16px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(235, 135, 156, 0.26), rgba(255, 182, 193, 0.06) 55%, rgba(235, 135, 156, 0.2));
}

.ticker p {
  margin: 0 auto;
  max-width: 900px;
  font-size: 0.95rem;
  letter-spacing: 0.13em;
  color: #ffe0e6;
}

/* 页头 */
.masthead {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(38, 23, 26, 0.55);
}

.split {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  max-width: 1160px;
  margin: 0 auto;
}

.split p {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.split p:first-child {
  justify-content: flex-end;
}

.split p a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: rgba(255, 182, 193, 0.07);
  color: #f4dfe3;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.24s ease, color 0.24s ease, box-shadow 0.24s ease;
}

.split p a:hover {
  color: #fff;
  background: rgba(255, 182, 193, 0.2);
  box-shadow: 0 6px 16px -8px rgba(235, 135, 156, 0.9);
}

.brand {
  padding: 4px 12px;
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: 0.12em;
  color: #ffd9e1;
  text-decoration: none;
  border-radius: 12px;
  text-shadow: 0 0 26px rgba(255, 182, 193, 0.45);
  transition: color 0.24s ease, text-shadow 0.24s ease;
}

.brand:hover {
  color: #fff;
  text-shadow: 0 0 30px rgba(255, 182, 193, 0.8);
}

/* 二级粘性锚点条 */
.rail {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(30, 18, 21, 0.92);
  backdrop-filter: blur(10px);
}

.rail p {
  display: flex;
  gap: 6px;
  max-width: 1160px;
  margin: 0 auto;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.rail a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 13px;
  border: 1px solid transparent;
  border-radius: var(--pill);
  color: #ecd3d8;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.24s ease, color 0.24s ease, border-color 0.24s ease;
}

.rail a:hover {
  color: #fff;
  border-color: var(--line);
  background: rgba(235, 135, 156, 0.18);
}

/* 首屏 */
.hero {
  display: grid;
  place-content: center;
  gap: 12px;
  min-height: 45vh;
  padding: 42px 20px 46px;
  text-align: center;
}

.lede {
  max-width: 44ch;
  margin: 0 auto;
  color: var(--text-2);
  font-size: 1rem;
}

/* 主体：aside 在左 */
main {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  align-items: start;
  gap: 32px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 34px 20px 76px;
}

.side {
  position: sticky;
  top: 76px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  box-shadow: var(--shadow);
}

.side h2 {
  font-size: 1.12rem;
  margin-bottom: 14px;
}

.side h2 + * {
  margin-top: 0;
}

.side h2:not(:first-child) {
  margin-top: 22px;
}

.side-brand {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: 0.1em;
  color: var(--blush);
}

.side-note {
  margin: 8px 0 0;
  color: var(--text-2);
  font-size: 0.95rem;
}

.toc {
  counter-reset: toc;
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc li {
  counter-increment: toc;
}

.toc a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #edd8dc;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.22s ease, border-color 0.22s ease, color 0.22s ease;
}

.toc a::before {
  content: counter(toc, decimal-leading-zero);
  margin-right: 10px;
  color: var(--rose);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.toc a:hover {
  color: #fff;
  border-color: var(--line);
  background: rgba(255, 182, 193, 0.11);
}

/* 正文 */
.body {
  min-width: 0;
}

.body > article {
  margin: 0 0 22px;
  padding: 26px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  box-shadow: var(--shadow);
  scroll-margin-top: 88px;
}

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

.body h2 {
  font-size: 1.45rem;
  margin-bottom: 14px;
}

.body h3 {
  font-size: 1.18rem;
  margin: 24px 0 10px;
  color: var(--blush);
}

.body p,
.body li {
  color: #f3e4e6;
}

.body ul,
.body ol {
  padding-left: 1.25em;
}

.body li + li {
  margin-top: 6px;
}

.body blockquote {
  margin: 18px 0;
  padding: 12px 16px;
  border-left: 3px solid var(--rose);
  border-radius: 0 12px 12px 0;
  background: rgba(255, 182, 193, 0.08);
}

.body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.body strong {
  color: #ffe6ea;
}

/* 页脚 */
.foot {
  padding: 44px 20px 26px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(51, 34, 38, 0.92), #1d1114);
}

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

.foot .col h2 {
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
}

.foot dl {
  margin: 0;
}

.foot dt {
  margin-bottom: 6px;
  color: var(--rose);
  font-size: 0.95rem;
  letter-spacing: 0.14em;
}

.foot dd {
  margin: 0;
  font-size: 0.98rem;
  color: #f1e0e3;
}

.foot dd + dd {
  margin-top: 2px;
}

.foot dd a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: #eed7dc;
  text-decoration: none;
  transition: color 0.22s ease;
}

.foot dd a:hover {
  color: #fff;
}

.sub {
  display: grid;
  gap: 10px;
}

.sub input {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  font-size: 0.98rem;
}

.sub button {
  min-height: 44px;
  border: 0;
  border-radius: var(--pill);
  background: linear-gradient(180deg, var(--blush), var(--rose));
  color: #2a1418;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 22px -12px rgba(235, 135, 156, 0.95);
  transition: transform 0.22s ease, box-shadow 0.22s ease, opacity 0.22s ease;
}

.sub button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -10px rgba(235, 135, 156, 1);
}

.sub button:disabled {
  opacity: 0.85;
  cursor: default;
  transform: none;
}

.foot-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  max-width: 1160px;
  margin: 26px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-size: 0.95rem;
}

.foot-end p {
  margin: 0;
}

.foot-links {
  display: flex;
  gap: 12px;
}

.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 4px;
  color: #e9d2d7;
  text-decoration: none;
}

.foot-links a:hover {
  color: #fff;
}

/* 回到顶部 */
.totop {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: rgba(51, 34, 38, 0.92);
  color: #ffd9e1;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.totop:hover {
  color: #fff;
  background: rgba(235, 135, 156, 0.25);
}

@media (prefers-reduced-motion: no-preference) {
  html.js .body > article {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

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

  html.js .toc li {
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.28s ease, transform 0.28s ease;
  }

  html.js .toc li.in {
    opacity: 1;
    transform: none;
  }

  html {
    scroll-behavior: smooth;
  }
}

@media (max-width: 900px) {
  .split {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .split p,
  .split p:first-child {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .brand {
    order: 1;
    font-size: 1.75rem;
  }

  main {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    padding-top: 24px;
  }

  .side {
    position: static;
  }

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

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

@media (max-width: 560px) {
  html {
    font-size: 17px;
  }

  .hero {
    min-height: 38vh;
    padding: 28px 16px 34px;
  }

  .body > article {
    padding: 20px 16px;
  }

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

  .foot {
    padding-bottom: 22px;
  }
}

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