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

@font-face {
  font-family: "Silkscreen";
  src: url("/assets/fonts/silkscreen-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Silkscreen";
  src: url("/assets/fonts/silkscreen-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --paper: #f6f4ec;
  --paper-2: #eeebe0;
  --ink: #14201a;
  --pine: #0e4d2a;
  --forest: #177a43;
  --lime: #c6f36b;
  --sky: #eaf4e4;
  --muted: #5c6b60;
  --font-pixel: "Silkscreen", "Fusion Pixel 12px Proportional Simplified Chinese", monospace;
  --font-cjk: "Fusion Pixel 12px Proportional Simplified Chinese", "Silkscreen", monospace;
  --bd: 2px solid var(--ink);
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-cjk);
  font-size: 12px;
  line-height: 2;
  -webkit-font-smoothing: none;
  font-smooth: never;
}

a { color: inherit; }

::selection { background: var(--lime); color: var(--ink); }

/* CRT 扫描线，纯装饰 */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(20, 32, 26, .045) 0 1px,
    transparent 1px 4px
  );
}

/* 顶栏 */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 24px;
  border-bottom: var(--bd);
  background: var(--paper);
}
.brand {
  font-family: var(--font-pixel);
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
  letter-spacing: .04em;
}
.brand:hover { color: var(--forest); }
.toplink {
  font-family: var(--font-pixel);
  font-size: 12px;
  line-height: 1;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.toplink:hover { border-bottom-color: var(--ink); }

.page {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 40px;
}

/* 标题区 */
.hero { padding: 40px 0 28px; }

.kicker {
  margin: 0 0 12px;
  font-family: var(--font-pixel);
  font-size: 12px;
  line-height: 1;
  letter-spacing: .08em;
  color: var(--forest);
}

.hero h1 {
  margin: 0 0 12px;
  font-family: var(--font-cjk);
  font-size: 48px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0;
}

.hero mark {
  padding: 0 8px;
  background: var(--lime);
  color: var(--ink);
  border-radius: 6px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.lede {
  max-width: 900px;
  margin: 0;
  font-size: 24px;
  line-height: 1.8;
  color: var(--pine);
}
.nw { white-space: nowrap; }

/* 像素场景 */
.world {
  position: relative;
  height: 420px;
  border: var(--bd);
  border-radius: 12px;
  overflow: hidden;
  background: var(--sky);
  box-shadow: 6px 6px 0 rgba(20, 32, 26, .18);
}

.world-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.hint {
  position: absolute;
  top: 10px;
  left: 14px;
  margin: 0;
  font-family: var(--font-pixel);
  font-size: 12px;
  line-height: 1;
  color: var(--pine);
  opacity: .75;
}

.portals {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 0 20px;
}

.portal {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 172px;
  padding: 10px 12px 8px;
  background: var(--paper);
  border: var(--bd);
  border-radius: 10px;
  box-shadow: 4px 4px 0 var(--ink);
  text-decoration: none;
  transition: transform 80ms steps(2, end), box-shadow 80ms steps(2, end);
}
.portal:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}
.portal:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}
.portal:focus-visible {
  outline: 3px solid var(--forest);
  outline-offset: 3px;
}

.sprite {
  display: block;
  width: 96px;
  height: 96px;
  image-rendering: pixelated;
}
.portal:hover .sprite { transform: translateY(-3px); }

.portal-name {
  margin-top: 4px;
  font-family: var(--font-pixel);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .02em;
  white-space: nowrap;
}

/* 中文名用 12 的整数倍字号，避免像素字体被非整数缩放 */
.portal-name--cjk {
  font-family: var(--font-cjk);
  font-size: 24px;
  font-weight: 400;
}

.portal-desc {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--pine);
}

/* 页脚 */
.foot {
  flex: none;
  margin-top: 32px;
  background: var(--pine);
  color: var(--paper);
}
.dither {
  height: 8px;
  background-image: conic-gradient(var(--pine) 25%, var(--lime) 0 50%, var(--pine) 0 75%, var(--lime) 0);
  background-size: 8px 8px;
}
.foot-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 24px;
  font-size: 12px;
  line-height: 1.8;
}
.foot a { color: var(--lime); text-decoration: none; }
.foot a:hover { text-decoration: underline; }

@media (max-width: 760px) {
  .hero { padding: 40px 0 28px; }
  .hero h1 { font-size: 36px; }
  .lede { font-size: 24px; line-height: 1.8; }

  .world { height: auto; box-shadow: 4px 4px 0 rgba(20, 32, 26, .18); }
  .world-bg, .hint { display: none; }

  .portals {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px;
  }
  .portal { width: auto; }
  .sprite { width: 96px; height: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
