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

:root {
  --red: #ff0000;
  --purple: #8b00ff;
  --ink: #261717;
  --paper: rgba(255, 246, 246, .95);
  --muted: rgba(255, 228, 232, .64);
  --glass: rgba(255, 255, 255, .10);
  --glass-2: rgba(255, 255, 255, .16);
  --line: rgba(255, 255, 255, .22);
  --blur: blur(16px);
  --r: 4px;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: #170e10;
  color: var(--paper);
  font-family: Inter, system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.68;
  letter-spacing: .01em;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(72vw 62vw at 88% -10%, rgba(255, 0, 0, .58), transparent 62%),
    radial-gradient(66vw 58vw at -6% 16%, rgba(139, 0, 255, .52), transparent 60%),
    radial-gradient(64vw 64vw at 82% 98%, rgba(255, 0, 0, .20), transparent 62%),
    linear-gradient(180deg, #2d1619 0%, #1b1113 56%, #120c0d 100%);
}

h1, h2, h3, .ft-brand, .brand span {
  font-family: Calistoga, Georgia, "Songti SC", serif;
  font-weight: 400;
}

a { color: #ffd2d6; }

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

.skip {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 14px;
  border-radius: var(--r);
  background: rgba(38, 23, 23, .92);
  border: 1px solid var(--line);
  color: var(--paper);
  text-decoration: none;
  font-size: .9rem;
  transition: top .18s ease;
}

.skip:focus { top: 8px; }

/* ---------- 顶部 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: rgba(32, 19, 21, .62);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--line);
}

.topbar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 6px;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: linear-gradient(140deg, rgba(255, 0, 0, .5), rgba(139, 0, 255, .5));
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  color: #fff;
  text-decoration: none;
  font-size: 1.15rem;
  line-height: 1;
  box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .9);
}

.brand span { display: block; }

.menu {
  position: relative;
  margin-left: auto;
}

.menu summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 16px;
  list-style: none;
  cursor: pointer;
  font-size: .92rem;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--paper);
}

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

.menu summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 9px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-2px) rotate(45deg);
}

.menu[open] summary::after { transform: translateY(2px) rotate(-135deg); }

.menu > menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(76vw, 268px);
  margin: 0;
  padding: 8px;
  list-style: none;
  display: none;
  z-index: 80;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: rgba(40, 24, 26, .82);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: 0 26px 50px -26px rgba(0, 0, 0, .95);
}

.menu[open] > menu { display: block; }

.menu > menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 12px;
  border-radius: var(--r);
  color: var(--paper);
  text-decoration: none;
  font-size: .92rem;
}

.menu > menu a:hover { background: var(--glass-2); }

.anchors {
  display: flex;
  gap: 6px;
  padding: 0 12px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.anchors a {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 13px;
  border-radius: var(--r);
  border: 1px solid transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: .84rem;
  white-space: nowrap;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}

.anchors a:hover {
  color: var(--paper);
  background: var(--glass);
  border-color: var(--line);
}

/* ---------- 主区 ---------- */

main {
  max-width: 1140px;
  margin: 0 auto;
  padding: 18px 16px 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  gap: 22px;
  align-items: start;
}

.hero {
  grid-column: 1 / -1;
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  min-height: 45vh;
  overflow: hidden;
  padding: clamp(16px, 4vw, 34px);
  border-radius: var(--r);
  border: 1px solid var(--line);
  background:
    linear-gradient(118deg, rgba(255, 0, 0, .42), rgba(139, 0, 255, .44)),
    rgba(255, 255, 255, .07);
  box-shadow: 0 30px 60px -34px rgba(0, 0, 0, .95);
  scroll-margin-top: 132px;
}

.hero-layer {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero-layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(17, 11, 12, .92), rgba(38, 23, 23, .38) 58%, rgba(139, 0, 255, .3));
}

.hero-copy {
  position: relative;
  max-width: 24ch;
  text-align: right;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.9rem, 5.6vw, 3.3rem);
  line-height: 1.14;
  letter-spacing: -.01em;
  text-shadow: 0 8px 30px rgba(0, 0, 0, .62);
}

.post {
  grid-column: 1;
  min-width: 0;
}

.post > article {
  margin: 0 0 18px;
  padding: clamp(16px, 3vw, 30px);
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: 0 20px 44px -28px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .16);
  scroll-margin-top: 132px;
  animation: rise .55s cubic-bezier(.22, .61, .36, 1) both;
}

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

.post > article:nth-child(1) { animation-delay: .02s; }
.post > article:nth-child(2) { animation-delay: .07s; }
.post > article:nth-child(3) { animation-delay: .12s; }
.post > article:nth-child(4) { animation-delay: .17s; }
.post > article:nth-child(5) { animation-delay: .22s; }
.post > article:nth-child(6) { animation-delay: .27s; }
.post > article:nth-child(7) { animation-delay: .32s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.post h2,
.rail h2 {
  margin: 0 0 10px;
  line-height: 1.24;
  letter-spacing: -.005em;
}

.post h2 { font-size: clamp(1.32rem, 3.4vw, 1.88rem); }
.post h3 { font-family: Inter, sans-serif; font-size: 1.05rem; margin: 1.4em 0 .5em; }

hr {
  height: 1px;
  border: 0;
  margin: 0 0 16px;
  background: linear-gradient(90deg, var(--red), var(--purple), rgba(255, 255, 255, .04));
}

.post p { margin: 0 0 1em; }
.post p:last-child { margin-bottom: 0; }

.post ul,
.post ol { margin: 0 0 1em; padding-left: 1.3em; }
.post li { margin-bottom: .35em; }

.post strong { color: #fff; }

.post a {
  text-underline-offset: 3px;
  transition: color .16s ease;
}

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

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

.post blockquote {
  margin: 0 0 1em;
  padding: 10px 16px;
  border-left: 2px solid var(--red);
  background: rgba(255, 0, 0, .10);
  border-radius: 0 var(--r) var(--r) 0;
  color: var(--muted);
}

.post table {
  width: 100%;
  border-collapse: collapse;
  font-size: .94rem;
  margin: 0 0 1em;
}

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

/* ---------- 侧栏 ---------- */

.rail {
  grid-column: 2;
  position: sticky;
  top: 132px;
  padding: 16px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16);
}

.rail h2 { font-size: 1.06rem; }

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

.rail a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 5px 10px;
  border-radius: var(--r);
  color: var(--muted);
  text-decoration: none;
  font-size: .88rem;
  line-height: 1.3;
  transition: background .16s ease, color .16s ease;
}

.rail a:hover {
  background: var(--glass-2);
  color: var(--paper);
}

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

.ft {
  max-width: 1140px;
  margin: 0 auto;
  padding: 32px 16px 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "brand links"
    "copy links";
  align-items: start;
  gap: 6px 24px;
  border-top: 1px solid var(--line);
}

.ft-brand {
  grid-area: brand;
  margin: 0;
  font-size: clamp(2.4rem, 9.5vw, 4.6rem);
  line-height: .96;
  letter-spacing: -.02em;
  background: linear-gradient(100deg, #ffffff, #ffb4b4 48%, #c79cff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ft-links {
  grid-area: links;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 2px 14px;
  max-width: 330px;
}

.ft-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--muted);
  text-decoration: none;
  font-size: .86rem;
}

.ft-links a:hover { color: var(--paper); }

.ft-copy {
  grid-area: copy;
  font-size: .78rem;
  color: var(--muted);
  letter-spacing: .06em;
}

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

@media (max-width: 860px) {
  main {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding: 14px 14px 44px;
  }

  .hero { min-height: 39vh; }
  .hero-copy { max-width: 100%; }

  .rail {
    grid-column: 1;
    position: static;
    order: 2;
  }

  .post { order: 1; }

  .ft {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "brand"
      "links"
      "copy";
    padding: 26px 14px 36px;
  }

  .ft-links {
    justify-content: flex-start;
    max-width: none;
  }
}

@media (max-width: 420px) {
  body { font-size: 16.5px; }
  .topbar-row { padding: 8px 12px 6px; }
  .anchors { padding: 0 10px 8px; }
}

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

  *,
  *::before,
  *::after {
    animation-duration: .001s !important;
    animation-delay: 0s !important;
    transition-duration: .001s !important;
  }
}

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