:root {
  --g: #00ff80;
  --b: #0000ff;
  --k: #000000;
  --w: #ffffff;
  --paper: #f5f5f1;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--k);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", "Noto Sans SC", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
}

img {
  max-width: 100%;
}

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

::selection {
  background: var(--g);
  color: var(--k);
}

/* 顶部两行骨架 */
.chrome {
  background: var(--k);
  color: var(--w);
  border-bottom: 6px solid var(--b);
  padding: 14px 16px 0;
}

.chrome-brand {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 0;
  color: var(--w);
  text-decoration: none;
  font-weight: 900;
  font-size: clamp(1.15rem, 3.4vw, 1.7rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mark::before {
  content: "";
  width: 20px;
  height: 20px;
  flex: none;
  background: var(--g);
  border: 3px solid var(--w);
}

.mark:hover {
  color: var(--g);
}

.search {
  display: flex;
  border: 3px solid var(--w);
  background: var(--w);
}

.search input {
  width: 150px;
  min-height: 44px;
  border: 0;
  padding: 0 12px;
  font: inherit;
  font-size: 16px;
  color: var(--k);
  background: var(--w);
}

.search input:focus-visible {
  outline: 3px solid var(--b);
  outline-offset: -3px;
}

.search button {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-left: 3px solid var(--k);
  background: var(--g);
  color: var(--k);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.search button:hover {
  background: var(--b);
  color: var(--w);
}

.chrome-nav {
  max-width: 1180px;
  margin: 10px auto 0;
}

.chrome-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0 0 12px;
  list-style: none;
}

.chrome-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  color: var(--w);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.98rem;
  border: 3px solid var(--w);
}

.chrome-nav a::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  background: var(--g);
}

.chrome-nav a:hover,
.chrome-nav a:focus-visible {
  background: var(--g);
  color: var(--k);
  border-color: var(--g);
}

.chrome-nav a:hover::before,
.chrome-nav a:focus-visible::before {
  background: var(--k);
}

/* 首屏 */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  grid-template-areas: "plate text";
  min-height: 100vh;
  background: var(--w);
  border-bottom: 6px solid var(--k);
}

.hero-plate {
  grid-area: plate;
  position: relative;
  overflow: hidden;
  background: var(--g);
  background-image: repeating-linear-gradient(135deg, var(--b) 0 8px, transparent 8px 44px);
}

.hero-plate::before {
  content: "";
  position: absolute;
  left: -15%;
  right: -15%;
  top: 52%;
  height: 64px;
  z-index: 3;
  background: var(--b);
  transform: rotate(-7deg);
}

.hero-plate img {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.05);
}

.hero-plate.multi img {
  opacity: 0;
  animation: rot 9s steps(1, end) infinite;
}

.hero-plate.multi img:nth-child(2) {
  animation-delay: 3s;
}

.hero-plate.multi img:nth-child(3) {
  animation-delay: 6s;
}

@keyframes rot {
  0% {
    opacity: 1;
  }
  33.4% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

.hero-text {
  grid-area: text;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 64px clamp(20px, 4vw, 56px);
}

.hero-text h1 {
  margin: 0;
  font-family: "Playfair Display", Georgia, "Noto Serif SC", serif;
  font-weight: 700;
  font-size: clamp(2rem, 5.4vw, 4rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.hero-cta {
  margin-top: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 34px;
  background: var(--b);
  color: var(--w);
  font-weight: 800;
  text-decoration: none;
  border: 4px solid var(--k);
  box-shadow: 10px 10px 0 var(--k);
}

.hero-cta:hover {
  background: var(--g);
  color: var(--k);
  box-shadow: 4px 4px 0 var(--k);
  transform: translate(6px, 6px);
}

/* 正文 + 右侧栏 */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 52px 20px 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 40px;
  align-items: start;
}

.col-main {
  min-width: 0;
}

.entry {
  background: var(--w);
  border: 4px solid var(--k);
  border-radius: 28px;
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.13);
  padding: clamp(20px, 3vw, 44px);
  overflow-wrap: break-word;
}

.entry article {
  padding-top: 8px;
  scroll-margin-top: 24px;
}

.entry article + article {
  margin-top: 42px;
  border-top: 3px dashed rgba(0, 0, 0, 0.25);
  padding-top: 38px;
}

.entry h2,
.entry h3,
.entry h4 {
  font-family: "Playfair Display", Georgia, "Noto Serif SC", serif;
  font-weight: 700;
  line-height: 1.2;
}

.entry h2 {
  display: inline-block;
  font-size: clamp(1.45rem, 3vw, 2rem);
  margin: 8px 0 10px;
  padding: 0.08em 0.35em;
  background: var(--g);
  border: 3px solid var(--k);
}

.entry h3 {
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  margin: 28px 0 8px;
}

.entry p {
  margin: 0 0 1.05em;
}

.entry ul,
.entry ol {
  margin: 0 0 1.1em;
  padding-left: 1.35em;
}

.entry li {
  margin: 0.3em 0;
}

.entry a {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.entry a:hover {
  background: var(--g);
}

.entry strong {
  font-weight: 800;
}

.entry blockquote {
  margin: 1.2em 0;
  padding: 14px 18px;
  border-left: 8px solid var(--b);
  background: rgba(0, 0, 255, 0.06);
}

.entry img {
  height: auto;
  margin: 1em 0;
  border: 3px solid var(--k);
}

.entry figure {
  margin: 1.2em 0;
}

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

.entry th,
.entry td {
  border: 2px solid var(--k);
  padding: 8px 10px;
  text-align: left;
}

.entry th {
  background: var(--g);
}

.entry pre {
  overflow-x: auto;
  padding: 14px;
  background: var(--k);
  color: var(--g);
}

.entry code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95em;
}

hr {
  height: 5px;
  border: 0;
  background: var(--k);
  margin: 2px 0 26px;
}

.rail {
  position: sticky;
  top: 26px;
  padding: 20px;
  background: var(--g);
  border: 4px solid var(--k);
  border-radius: 28px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.15);
}

.rail-h {
  margin: 0 0 8px;
  font-family: "Playfair Display", Georgia, "Noto Serif SC", serif;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.25;
}

.rail hr {
  margin: 0 0 14px;
}

.rail-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail-list li + li {
  border-top: 2px solid rgba(0, 0, 0, 0.3);
}

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--k);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.97rem;
}

.rail-list a:hover {
  background: var(--k);
  color: var(--g);
  padding-left: 8px;
}

.totop {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin-top: 16px;
  background: var(--k);
  color: var(--w);
  text-decoration: none;
  font-weight: 800;
  border-radius: 28px;
}

.totop:hover {
  background: var(--b);
}

/* 页脚三栏 */
footer {
  padding: 56px 20px 26px;
  background: var(--k);
  color: var(--w);
  border-top: 8px solid var(--g);
}

.foot-cta {
  max-width: 1180px;
  margin: 0 auto 40px;
  padding-bottom: 34px;
  border-bottom: 4px solid rgba(255, 255, 255, 0.25);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.foot-cta h2 {
  margin: 0;
  max-width: 22ch;
  font-family: "Playfair Display", Georgia, "Noto Serif SC", serif;
  font-size: clamp(1.4rem, 3.4vw, 2.3rem);
  line-height: 1.2;
}

.foot-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 30px;
  background: var(--g);
  color: var(--k);
  font-weight: 800;
  text-decoration: none;
  border: 4px solid var(--w);
}

.foot-btn:hover {
  background: var(--b);
  color: var(--w);
}

.foot-cols {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.foot-cols dl {
  margin: 0;
}

.foot-cols dt {
  margin-bottom: 8px;
  font-weight: 900;
  font-size: 0.9rem;
  letter-spacing: 0.14em;
  color: var(--g);
}

.foot-cols dd {
  margin: 0;
}

.foot-cols a {
  display: inline-block;
  min-height: 40px;
  padding: 9px 0;
  color: var(--w);
  text-decoration: none;
  font-weight: 600;
}

.foot-cols a:hover {
  color: var(--g);
}

.copy {
  max-width: 1180px;
  margin: 34px auto 0;
  padding-top: 16px;
  border-top: 2px solid rgba(255, 255, 255, 0.18);
  font-size: 0.9rem;
  color: #c9c9c9;
}

/* 逐条浮现 */
.stagger-ready > * {
  opacity: 0;
  transform: translateY(14px);
}

.stagger-ready > .in {
  opacity: 1;
  transform: none;
  transition: opacity 0.16s steps(2, end), transform 0.16s steps(2, end);
}

@media (max-width: 900px) {
  .wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
    padding: 34px 16px 56px;
  }

  .rail {
    position: static;
  }

  .foot-cols {
    gap: 16px;
  }
}

@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    grid-template-areas: "text" "plate";
    min-height: 0;
  }

  .hero-text {
    padding: 40px 20px 34px;
  }

  .hero-plate {
    height: 44vh;
    min-height: 210px;
  }
}

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

  .search input {
    width: 118px;
  }

  .chrome-nav a {
    font-size: 0.92rem;
    padding: 8px 10px;
  }

  .entry {
    border-radius: 22px;
    padding: 20px 16px;
  }

  .rail {
    border-radius: 22px;
  }

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

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

  .stagger-ready > * {
    opacity: 1;
    transform: none;
  }

  .hero-plate.multi img {
    animation: none;
    opacity: 0;
  }

  .hero-plate.multi img:first-child {
    opacity: 1;
  }

  .hero-cta:hover {
    transform: none;
  }
}

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