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

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

:root {
  --red: #ff0000;
  --purple: #8b00ff;
  --ink: #261717;
  --fg: #fbeef0;
  --dim: #d5bdc5;
  --glass: rgba(255, 255, 255, 0.11);
  --glass-soft: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.22);
  --line-soft: rgba(255, 255, 255, 0.12);
  --r: 10px;
  --pad: clamp(16px, 4vw, 34px);
  --wrap: 1180px;
}

html {
  background: #1a0e11;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: transparent;
  color: var(--fg);
  font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.8;
  overflow-x: hidden;
  text-underline-offset: 3px;
}

::selection {
  background: rgba(255, 0, 0, 0.55);
  color: #fff;
}

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

/* 背景光雾层 */
.bg {
  position: fixed;
  inset: -12%;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(58% 48% at 14% 8%, rgba(255, 0, 0, 0.34), transparent 70%),
    radial-gradient(52% 44% at 86% 16%, rgba(139, 0, 255, 0.36), transparent 72%),
    radial-gradient(70% 58% at 46% 98%, rgba(255, 0, 0, 0.2), transparent 72%),
    #261717;
}

.blob {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
}

.blob.a {
  width: 44vmax;
  height: 44vmax;
  left: -8vmax;
  top: -8vmax;
  background: var(--red);
}

.blob.b {
  width: 38vmax;
  height: 38vmax;
  right: -8vmax;
  top: 10vmax;
  background: var(--purple);
}

.blob.c {
  width: 32vmax;
  height: 32vmax;
  left: 34%;
  bottom: -14vmax;
  background: rgba(255, 0, 0, 0.65);
}

/* 顶部细条 */
.strip {
  position: relative;
  z-index: 40;
  background: linear-gradient(90deg, rgba(255, 0, 0, 0.9), rgba(139, 0, 255, 0.9));
}

.strip p {
  margin: 0;
  padding: 8px var(--pad);
  font-size: 16px;
  letter-spacing: 0.22em;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 页头 */
.top {
  position: sticky;
  top: 0;
  z-index: 35;
  padding: 10px var(--pad) 12px;
  background: rgba(38, 23, 23, 0.62);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 2px 4px 2px 0;
  color: #fff;
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.brand .mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  object-fit: cover;
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px -8px rgba(255, 0, 0, 0.9);
}

.brand:hover span {
  background: linear-gradient(92deg, #fff, #ffc9c9 60%, #dcc2ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.menu {
  margin-top: 8px;
}

.menu > summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 16px;
  list-style: none;
  cursor: pointer;
  font-size: 16px;
  letter-spacing: 0.14em;
  color: var(--fg);
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.menu > summary::-webkit-details-marker {
  display: none;
}

.menu > summary::after {
  content: '';
  width: 8px;
  height: 8px;
  margin-left: 2px;
  border-right: 2px solid var(--fg);
  border-bottom: 2px solid var(--fg);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.25s ease;
}

.menu[open] > summary::after {
  transform: rotate(225deg) translate(-2px, -2px);
}

.menu > summary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

.menu > menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 2px;
  padding: 0;
  list-style: none;
}

.menu > menu a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 15px;
  color: var(--fg);
  font-size: 16px;
  text-decoration: none;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.menu > menu a:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.22);
  border-color: var(--line);
}

/* 主体骨架 */
.shell {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad) 44px;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: clamp(18px, 3vw, 36px);
  align-items: start;
}

section {
  scroll-margin-top: 168px;
}

/* 左侧栏 */
.side {
  position: sticky;
  top: 132px;
  margin-top: 26px;
  padding: 20px 18px 18px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: linear-gradient(158deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.045));
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 26px 52px -32px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.side h2 {
  margin: 0 0 6px;
  font-size: 19px;
  letter-spacing: 0.16em;
  line-height: 1.4;
}

.side .subtitle {
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 16px;
  line-height: 1.7;
  color: var(--dim);
}

.jump {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 3px;
}

.jump a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 4px 8px;
  border-radius: 8px;
  color: var(--fg);
  font-size: 16px;
  text-decoration: none;
  transition: background 0.18s ease, padding-left 0.18s ease;
}

.jump b {
  font-family: 'Caveat', cursive;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: #ff8b8b;
  min-width: 22px;
}

.jump a:hover,
.jump a.on {
  background: rgba(255, 255, 255, 0.16);
  padding-left: 14px;
}

.jump a.on b {
  color: var(--red);
}

/* 正文 */
.body {
  min-width: 0;
  padding-bottom: 12px;
}

.hero {
  position: relative;
  min-height: 45vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  text-align: right;
  padding: clamp(30px, 7vw, 60px) clamp(2px, 2vw, 16px) clamp(30px, 6vw, 54px);
  overflow: hidden;
}

.hero h1 {
  position: relative;
  z-index: 2;
  margin: 0;
  max-width: 13em;
  font-size: clamp(34px, 7.4vw, 66px);
  line-height: 1.14;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero h1 {
    background: linear-gradient(100deg, #ffffff 8%, #ffd2d2 46%, #e2c8ff 92%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.slash {
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: clamp(12px, 3vw, 26px);
  height: 13px;
  background: linear-gradient(90deg, var(--red), var(--purple));
  transform: skewY(-2.6deg);
  opacity: 0.9;
  border-radius: 3px;
  box-shadow: 0 12px 30px -12px rgba(139, 0, 255, 0.9);
}

article > section {
  margin-top: 22px;
  padding: clamp(18px, 3.4vw, 32px);
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04));
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 24px 54px -34px rgba(0, 0, 0, 0.98), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

article > section:hover {
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow: 0 30px 60px -34px rgba(0, 0, 0, 0.98), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

article > section > *:first-child {
  margin-top: 0;
}

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

.body h2 {
  position: relative;
  margin: 1.5em 0 0.55em;
  padding-left: 15px;
  font-size: clamp(21px, 3.4vw, 27px);
  line-height: 1.35;
  letter-spacing: 0.02em;
  color: #fff;
}

.body h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.28em;
  bottom: 0.28em;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(var(--red), var(--purple));
}

.body h3 {
  margin: 1.4em 0 0.4em;
  font-size: 19px;
  line-height: 1.5;
  color: #ffe3e6;
}

.body p {
  margin: 0.9em 0;
}

.body a {
  color: #ffd3d3;
  text-decoration-color: rgba(255, 0, 0, 0.55);
}

.body a:hover {
  color: #fff;
  text-decoration-color: #fff;
}

.body ul,
.body ol {
  margin: 0.9em 0;
  padding-left: 1.3em;
}

.body li {
  margin: 0.35em 0;
}

.body blockquote {
  margin: 1.2em 0;
  padding: 10px 18px;
  border-left: 3px solid var(--red);
  border-radius: 0 var(--r) var(--r) 0;
  background: rgba(255, 255, 255, 0.08);
  color: #ffe6e8;
}

.body img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--r);
  border: 1px solid var(--line-soft);
}

.body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  margin: 1.2em 0;
  border-collapse: collapse;
  font-size: 16px;
}

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

.body th {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.body pre {
  margin: 1.2em 0;
  padding: 14px 16px;
  overflow-x: auto;
  border-radius: var(--r);
  border: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.35);
  font-size: 16px;
}

.body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
}

.body strong {
  color: #fff;
}

/* 页脚 */
.foot {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 26px 24px;
  margin-top: 52px;
  padding: clamp(26px, 4vw, 46px) max(var(--pad), calc((100vw - var(--wrap)) / 2)) 20px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(26, 14, 17, 0.65));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.foot section {
  min-width: 0;
}

.foot h3 {
  margin: 0 0 10px;
  font-size: 17px;
  letter-spacing: 0.14em;
  color: #fff;
}

.foot p {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--dim);
  overflow-wrap: anywhere;
}

.foot ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 2px;
}

.foot ul a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  color: var(--dim);
  font-size: 16px;
  text-decoration: none;
  transition: color 0.18s ease, padding-left 0.18s ease;
}

.foot ul a:hover {
  color: #fff;
  padding-left: 5px;
}

.sub {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sub input {
  flex: 1 1 120px;
  min-height: 44px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 16px;
  color: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.32);
}

.sub input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.sub button {
  min-height: 44px;
  padding: 0 18px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(92deg, var(--red), var(--purple));
  box-shadow: 0 12px 24px -14px rgba(255, 0, 0, 0.95);
  transition: transform 0.16s ease, filter 0.16s ease;
}

.sub button:hover {
  transform: translateY(-2px);
  filter: brightness(1.12);
}

.fbot {
  grid-column: 1 / -1;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  text-align: center;
}

.fbot p {
  margin: 0;
  font-size: 16px;
  color: var(--dim);
}

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

/* 滚动显现 */
.js .rv {
  opacity: 0;
  transform: translateY(16px);
}

.js .rv.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 0.7, 0.3, 1);
}

/* 断点 */
@media (max-width: 960px) {
  .shell {
    grid-template-columns: 1fr;
  }

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

  .body {
    order: 1;
  }

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

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

  .hero {
    min-height: 42vh;
    align-items: flex-start;
    text-align: right;
  }

  .hero h1 {
    max-width: 100%;
  }

  .foot {
    grid-template-columns: 1fr;
  }

  .strip p {
    letter-spacing: 0.14em;
  }
}

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

  .js .rv {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .menu > menu a,
  .sub button,
  .foot ul a,
  .jump a {
    transition: none;
  }
}

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