@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=Source+Serif+4:ital,wght@0,300;0,400;0,600;1,300&display=swap');

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

:root {
  --red: #ff0000;
  --mag: #ff006e;
  --ink: #1a1a2e;
  --bg: #0b0b16;
  --glass: rgba(255, 255, 255, 0.055);
  --line: rgba(255, 0, 110, 0.26);
  --line-hard: rgba(255, 0, 110, 0.55);
  --txt: #f2ecf8;
  --dim: #aca2c6;
  --serif: "Playfair Display", "Source Serif 4", Georgia, "Songti SC", serif;
  --body: "Source Serif 4", Georgia, "Songti SC", "Noto Serif SC", serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --r: 28px;
}

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

body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.78;
  color: var(--txt);
  background:
    radial-gradient(1000px 620px at 78% -10%, rgba(255, 0, 110, 0.2), transparent 62%),
    radial-gradient(760px 520px at 6% 10%, rgba(255, 0, 0, 0.16), transparent 60%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.033) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.033) 0 1px, transparent 1px 44px),
    var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  opacity: 0.42;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.36) 0 1px, transparent 1px 3px);
}

/* 顶栏 */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 11, 22, 0.84);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.bar {
  max-width: 1180px;
  margin: 0 auto;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.mark,
.f-mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line-hard);
  border-radius: 14px;
  background: linear-gradient(140deg, rgba(255, 0, 110, 0.28), rgba(255, 0, 0, 0.12));
  color: #fff;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 0 18px rgba(255, 0, 110, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.mark img,
.f-mark img {
  display: block;
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.tabs {
  flex: 1 1 auto;
  display: flex;
  gap: 6px;
  padding: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

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

.tab {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.tab:hover,
.tab:focus-visible {
  color: #fff;
  background: rgba(255, 0, 110, 0.18);
  box-shadow: 0 0 18px rgba(255, 0, 110, 0.45), inset 0 0 0 1px var(--line);
}

/* 主体网格 */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 20px 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 30px;
  align-items: start;
}

/* 首屏 */
.stage {
  position: relative;
  grid-column: 1 / -1;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: 45vh;
  padding: 42px 20px 66px;
  text-align: center;
  overflow: hidden;
  background:
    linear-gradient(150deg, rgba(255, 0, 0, 0.18), transparent 55%),
    linear-gradient(330deg, rgba(255, 0, 110, 0.22), transparent 60%),
    rgba(26, 26, 46, 0.55);
  border: 1px solid var(--line);
  border-radius: var(--r);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 48px));
}

.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to top, rgba(11, 11, 22, 0.94), rgba(11, 11, 22, 0.35) 58%, rgba(11, 11, 22, 0.72));
}

.hero-fig {
  position: absolute;
  inset: 0;
  margin: 0;
  z-index: 0;
}

.hero-pic {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.25) contrast(1.08);
}

.bigmark {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-48%);
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(64px, 17vw, 176px);
  line-height: 0.9;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 0, 110, 0.42);
  text-shadow: 0 0 42px rgba(255, 0, 110, 0.3);
  opacity: 0.9;
  pointer-events: none;
  user-select: none;
}

.stage-in {
  position: relative;
  z-index: 3;
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.22em;
  color: var(--mag);
  text-shadow: 0 0 14px rgba(255, 0, 110, 0.8);
}

.stage h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(27px, 5.2vw, 54px);
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 0, 110, 0.75), 0 0 34px rgba(255, 0, 0, 0.45);
  animation: glitch 7s infinite steps(1, end);
}

@keyframes glitch {
  0%, 88%, 100% { text-shadow: 0 0 10px rgba(255, 0, 110, 0.75), 0 0 34px rgba(255, 0, 0, 0.45); transform: none; }
  90% { text-shadow: -2px 0 rgba(255, 0, 110, 0.9), 2px 0 rgba(0, 200, 255, 0.6); transform: skewX(-1.2deg); }
  94% { text-shadow: 2px 0 rgba(255, 0, 110, 0.9), -2px 0 rgba(0, 200, 255, 0.6); transform: skewX(0.8deg); }
}

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

.post-in div {
  position: relative;
  margin: 0 0 24px;
  padding: 26px 22px 30px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r);
  backdrop-filter: blur(9px);
  box-shadow: 0 20px 48px -32px rgba(255, 0, 110, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.post-in div:hover {
  border-color: var(--line-hard);
  box-shadow: 0 26px 56px -30px rgba(255, 0, 110, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

div[id] { scroll-margin-top: 126px; }

.post-in p { margin: 0 0 15px; }
.post-in p:last-child { margin-bottom: 0; }

.post-in h2 {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(22px, 3.3vw, 33px);
  line-height: 1.3;
  color: #fff;
  text-shadow: 0 0 22px rgba(255, 0, 110, 0.5);
}

.post-in h2 > span { position: relative; display: inline-block; }

.post-in h2 > span::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -9px;
  height: 2px;
  background: linear-gradient(90deg, var(--red), var(--mag), transparent);
}

.post-in h3 {
  margin: 24px 0 10px;
  font-family: var(--serif);
  font-size: clamp(19px, 2.4vw, 23px);
  line-height: 1.4;
  color: #fff;
}

.post-in h3 > span { display: inline-block; }

.post-in a {
  color: #ff8fb2;
  text-decoration: underline;
  text-decoration-color: rgba(255, 0, 110, 0.5);
  text-underline-offset: 3px;
}

.post-in a:hover { color: #fff; }

.post-in ul,
.post-in ol { margin: 0 0 16px; padding-left: 1.25em; }
.post-in li { margin: 0 0 8px; }

.post-in dl,
.post-in blockquote { margin: 0 0 16px; }

.post-in blockquote {
  padding: 12px 16px;
  border-left: 3px solid var(--mag);
  background: rgba(255, 0, 110, 0.08);
  border-radius: 0 16px 16px 0;
  color: #e8dff4;
}

.post-in dt { font-weight: 600; color: #fff; margin-top: 12px; }
.post-in dd { margin: 0 0 10px; color: var(--txt); }

.post-in img {
  max-width: 100%;
  height: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
}

.post-in hr {
  border: 0;
  height: 1px;
  margin: 22px 0;
  background: linear-gradient(90deg, transparent, var(--line-hard), transparent);
}

.post-in table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 0 0 16px;
  font-size: 16px;
}

.post-in th,
.post-in td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
}

/* 侧栏 */
.side { display: grid; gap: 16px; min-width: 0; }

.panel {
  padding: 16px 16px 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(26, 26, 46, 0.68);
  backdrop-filter: blur(9px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.panel h2 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.panel h2 .t { position: relative; }
.panel h2 .t::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 1px;
  background: linear-gradient(90deg, var(--mag), transparent);
}

.panel h2 .d {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mag);
}

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

.toc a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 8px;
  border-radius: 12px;
  color: var(--dim);
  font-size: 16px;
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease;
}

.toc a:hover,
.toc a:focus-visible { color: #fff; background: rgba(255, 0, 110, 0.16); }

.num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mag);
}

.totop {
  display: grid;
  place-items: center;
  min-height: 44px;
  border: 1px solid var(--line-hard);
  border-radius: 14px;
  background: linear-gradient(120deg, rgba(255, 0, 0, 0.28), rgba(255, 0, 110, 0.28));
  color: #fff;
  font-family: var(--mono);
  font-size: 15px;
  text-decoration: none;
  box-shadow: 0 0 18px rgba(255, 0, 110, 0.3);
}

.totop:hover { box-shadow: 0 0 26px rgba(255, 0, 110, 0.6); }

/* 页脚 */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 26px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 20px 34px;
  border-top: 1px solid var(--line);
}

.f-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.f-brand strong {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(19px, 3.4vw, 26px);
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 0 20px rgba(255, 0, 110, 0.55);
}

.f-nav { flex: 1 1 280px; min-width: 0; }

.f-nav dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 10px;
  margin: 0;
  align-items: center;
}

.f-nav dt {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mag);
}

.f-nav dd { margin: 0; }

.f-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  color: var(--dim);
  font-size: 16px;
  text-decoration: none;
}

.f-nav a:hover,
.f-nav a:focus-visible { color: #fff; text-shadow: 0 0 14px rgba(255, 0, 110, 0.8); }

.f-legal { flex: 0 0 auto; }
.f-legal p {
  margin: 0;
  font-family: var(--mono);
  font-size: 15px;
  color: rgba(172, 162, 198, 0.85);
}

/* 动效 */
.rv {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.rv.in { opacity: 1; transform: none; }

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

/* 断点 */
@media (min-width: 1000px) {
  .side { position: sticky; top: 108px; }
}

@media (max-width: 999px) {
  .wrap {
    grid-template-columns: minmax(0, 1fr);
    padding: 22px 16px 52px;
    gap: 22px;
  }
  div[id] { scroll-margin-top: 118px; }
  .side { grid-template-columns: 1fr; }
  .stage { padding: 34px 16px 58px; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .stage { min-height: 42vh; }
  .post-in div { padding: 22px 17px 24px; border-radius: 22px; }
  .bigmark { font-size: clamp(52px, 20vw, 110px); }
  .foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .f-nav dl { grid-template-columns: auto 1fr auto 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; transition: none; }
  .stage h1 { animation: none; }
  .post-in div { transition: none; }
  .post-in div:hover { transform: none; }
}

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