/* RTS Engine 主站。配色取自引擎图标：蓝黑底、白色线稿、浅蓝剪影。只用系统字体。 */

:root {
  --bg: #0a1220;
  --bg-alt: #0c1627;
  --panel: rgba(16, 30, 49, 0.72);
  --panel-solid: #101e31;
  --line: rgba(200, 225, 255, 0.13);
  --line-strong: rgba(200, 225, 255, 0.3);
  --grid: rgba(142, 198, 242, 0.05);
  --grid-major: rgba(142, 198, 242, 0.08);
  --text: #e6eef7;
  --muted: #93a6bb;
  --faint: #62778e;
  --accent: #8ec6f2;
  --accent-strong: #d4ebff;
  --accent-ink: #07111d;
  --hot: #f2a067;
  --shell: 1180px;
  --gutter: 24px;
  --header: 64px;
  --radius: 4px;
  --sans: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, "SFMono-Regular", "Menlo", monospace;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--text);
  background-color: var(--bg);
  /* 蓝图网格：细格 24px，粗格 120px。 */
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  transition: opacity 0.25s ease;
}

/* lang.json 填好文字之前不显示，避免闪出空白结构。 */
.i18n-pending body {
  opacity: 0;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

p {
  margin: 0;
}

.shell {
  width: min(100% - var(--gutter) * 2, var(--shell));
  margin-inline: auto;
}

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

/* ---- 通用部件 ---- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* 点划线：图标里的中心线画法。 */
.eyebrow::before {
  content: "";
  width: 44px;
  height: 1px;
  background: repeating-linear-gradient(90deg, currentColor 0 10px, transparent 10px 14px, currentColor 14px 16px, transparent 16px 20px);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  /* <button> 也用这个类：去掉浏览器给按钮的默认底色和字体。 */
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.button-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.button-primary:hover {
  background: var(--accent-strong);
  color: var(--accent-ink);
}

.button-ghost {
  background: rgba(10, 18, 32, 0.45);
}

.button-small {
  min-height: 36px;
  padding: 0 16px;
  font-size: 14px;
}

.button-large {
  flex-direction: column;
  gap: 2px;
  min-height: 64px;
  font-size: 17px;
}

.button-large small {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  opacity: 0.72;
}

/* ---- 大号方形按钮（首屏、文档页） ----
   方角，左边线框图标，中间两行字（主标签 + 等宽小字），右边箭头。动效：
   - 进场：几个按钮依次上浮淡入；
   - 悬停：一道光带扫过，左上、右下的图纸角标向外张开，箭头朝自己的方向动，主按钮外发光；
   - 主按钮空闲时每隔几秒自己扫一次光。
   系统要求减少动画时全部关掉（见文件末尾）。 */
.cta {
  --cta-fg: var(--text);
  position: relative;
  display: inline-grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  min-width: 280px;
  min-height: 96px;
  padding: 18px 26px 18px 22px;
  border: 1px solid var(--line-strong);
  background: rgba(10, 18, 32, 0.55);
  color: var(--cta-fg);
  text-decoration: none;
  backdrop-filter: blur(6px);
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.3s ease, color 0.25s ease;
  animation: cta-in 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}

.cta + .cta {
  animation-delay: 0.12s;
}

/* 图纸角标：左上、右下两只 L，悬停时向外张开。 */
.cta::before,
.cta::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--accent);
  border-style: solid;
  pointer-events: none;
  transition: transform 0.3s ease;
}

.cta::before {
  top: -7px;
  left: -7px;
  border-width: 2px 0 0 2px;
}

.cta::after {
  right: -7px;
  bottom: -7px;
  border-width: 0 2px 2px 0;
}

.cta:hover::before {
  transform: translate(-5px, -5px);
}

.cta:hover::after {
  transform: translate(5px, 5px);
}

/* 光带：斜着的一道亮光，从左扫到右。 */
.cta-sweep {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.cta-sweep::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.32), transparent);
  transform: translateX(-130%) skewX(-18deg);
}

.cta:hover .cta-sweep::before {
  animation: cta-sweep 0.8s ease both;
}

.cta-icon {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: square;
}

.cta-text {
  display: grid;
  gap: 4px;
  text-align: left;
}

.cta-text strong {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.cta-text small {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  opacity: 0.75;
}

.cta-arrow {
  font-size: 22px;
  transition: transform 0.25s ease;
}

.cta:hover .cta-arrow {
  transform: translateX(6px);
}

.cta:hover .cta-arrow-down {
  transform: none;
  animation: cta-drop 0.9s ease-in-out infinite;
}

.cta-primary {
  --cta-fg: var(--accent-ink);
  border-color: var(--accent);
  background: var(--accent);
}

.cta-primary::before,
.cta-primary::after {
  border-color: var(--accent-strong);
}

.cta-primary .cta-sweep::before {
  animation: cta-shine 5s ease-in-out 1.6s infinite;
}

.cta-primary:hover {
  background: var(--accent-strong);
  box-shadow: 0 0 0 1px var(--accent-strong), 0 0 36px rgba(142, 198, 242, 0.45);
}

.cta-secondary:hover {
  --cta-fg: var(--accent-strong);
  border-color: var(--accent);
  background: rgba(16, 30, 49, 0.85);
  box-shadow: 0 0 28px rgba(142, 198, 242, 0.18);
}

/* 方形小标签，比如“即将公开”。 */
.cta-tag {
  justify-self: start;
  padding: 2px 8px;
  border: 1px solid currentColor;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  opacity: 0.8;
}

@keyframes cta-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@keyframes cta-sweep {
  from {
    transform: translateX(-130%) skewX(-18deg);
  }
  to {
    transform: translateX(330%) skewX(-18deg);
  }
}

@keyframes cta-shine {
  0%,
  82% {
    transform: translateX(-130%) skewX(-18deg);
  }
  100% {
    transform: translateX(330%) skewX(-18deg);
  }
}

@keyframes cta-drop {
  50% {
    transform: translateY(5px);
  }
}

/* 图纸角标。 */
.corner {
  position: absolute;
  width: 22px;
  height: 22px;
  pointer-events: none;
}

.corner-tl {
  top: 16px;
  left: 16px;
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
}

.corner-br {
  right: 16px;
  bottom: 16px;
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.concept-tag {
  position: absolute;
  right: 14px;
  bottom: 12px;
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: rgba(10, 18, 32, 0.7);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}

/* ---- 页头 ---- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  height: var(--header);
  border-bottom: 1px solid var(--line);
  background: rgba(10, 18, 32, 0.82);
  backdrop-filter: blur(12px);
}

/* 页头比内容栏宽：贴着视口两边，只留 --header-gutter。左边是品牌、下载和社区，右边是语言和登录。 */
.header-inner {
  --header-gutter: clamp(16px, 3vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 100%;
  padding: 0 var(--header-gutter);
}

.header-start {
  display: flex;
  align-self: stretch;
  align-items: center;
  gap: 28px;
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand img {
  border-radius: 6px;
}

.brand-name {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.brand-name span {
  margin-left: 0.5em;
  color: var(--accent);
  font-weight: 500;
}

.header-nav,
.header-tools {
  display: flex;
  align-self: stretch;
}

/* 页头的每一项都是图纸标题栏里的一格：占满页头高度、方角，格与格之间一条细竖线。底边一道刻度短线，
   悬停时拉满整格（和卡片左上的刻度同一个画法）。<a> 和 <button> 共用，所以先清掉按钮的默认样式。 */
.header-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: 600 14px var(--sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.header-link:last-child {
  border-right: 1px solid var(--line);
}

.header-link::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: -1px;
  width: 14px;
  height: 2px;
  background: var(--line-strong);
  transition: width 0.3s ease, background-color 0.2s ease;
}

.header-link:hover {
  background: rgba(142, 198, 242, 0.06);
  color: var(--text);
}

.header-link:hover::after {
  width: calc(100% + 1px);
  background: var(--accent);
}

/* 下载是主操作：字用主色，刻度线常亮拉满，悬停时箭头往下点一下。 */
.header-link-primary {
  color: var(--accent);
}

.header-link-primary::after {
  width: calc(100% + 1px);
  background: var(--accent);
}

.header-link-primary:hover {
  color: var(--accent-strong);
}

.header-link-arrow {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: square;
  transition: transform 0.25s ease;
}

.header-link-primary:hover .header-link-arrow {
  transform: translateY(2px);
}

.lang-switch {
  font: 13px var(--mono);
}

/* 页头的“社区”：平时是文字，手机最窄时只剩图标（读屏仍读 aria-label 里的“社区”）。 */
.nav-community-icon {
  display: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

/* 登录还没接上：看得见，但是灰的、点不了（title 里写着即将开放），悬停也没有反应。 */
.login[aria-disabled="true"] {
  color: var(--faint);
  cursor: not-allowed;
}

.login[aria-disabled="true"]:hover {
  background: transparent;
  color: var(--faint);
}

.login[aria-disabled="true"]:hover::after {
  width: 14px;
  background: var(--line-strong);
}

/* ---- 首屏 ---- */

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: min(92vh, 860px);
  padding: calc(var(--header) + 64px) 0 72px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero .corner-tl {
  top: calc(var(--header) + 16px);
}

.hero .concept-tag {
  right: 50px;
  bottom: 20px;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 50%;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 18, 32, 0.94) 0%, rgba(10, 18, 32, 0.78) 38%, rgba(10, 18, 32, 0.15) 75%),
    linear-gradient(0deg, rgba(10, 18, 32, 0.9) 0%, rgba(10, 18, 32, 0) 40%);
}

/* 大号图标只在宽屏的左右对半布局里出现（见下面的 min-width: 1000px），齿轮的转动写在 SVG 里。 */
.hero-logo {
  display: none;
  pointer-events: none;
}

.hero-content {
  position: relative;
}

.hero h1 {
  max-width: 760px;
  font-size: clamp(36px, 6vw, 68px);
  line-height: 1.12;
  /* 口号只在空格处换行，不把「大规模联机」拆开。 */
  word-break: keep-all;
}

.hero h1 em {
  display: block;
  color: var(--accent);
  font-style: normal;
}

.hero-lede {
  max-width: 600px;
  margin-top: 24px;
  color: #c3d1df;
  font-size: 18px;
}

/* 两个按钮等宽并排，放不下时上下排、仍然等宽；间距要容得下各自伸出去的角标。 */
.hero-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px;
  max-width: 620px;
  margin-top: 40px;
}

.hero-actions .cta {
  min-width: 0;
}

.hero-requirement {
  margin-top: 22px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
}

/* 宽屏：首屏左右对半。左半屏是转动的整个图标，底下是背景色，向右渐变出战斗画面；文字在右半屏，压在
   画面上。
   - 图标外框盖满首屏，遮罩按首屏的百分比写，横竖两层取交集：横向从 30% 起先快后慢、46% 全透明（伸到
     文字底下的部分）；纵向在页头下渐入、底部 78% 到 98% 淡出（不被数字条切成直线）。
   - 图标宽是首屏高的 1.6 倍，齿轮中心（比画布中心低 26/1720，往上挪 1.5%）放在横向 34%、页头以下
     纵向 66% 处，下半截落在首屏外。
   - 文字从中线后 40px 起，到内容栏右边为止（--hero-text），标题字号按它算，让“每台电脑算出同一帧。”
     一行放得下。 */
@media (min-width: 1000px) {
  .hero-shade {
    background:
      linear-gradient(90deg, var(--bg) 0%, var(--bg) 40%, rgba(10, 18, 32, 0.66) 58%, rgba(10, 18, 32, 0.6) 76%, rgba(10, 18, 32, 0.72) 100%),
      linear-gradient(0deg, rgba(10, 18, 32, 0.9) 0%, rgba(10, 18, 32, 0) 40%);
  }

  .hero-logo {
    --logo-fade:
      linear-gradient(90deg, #000 30%, rgba(0, 0, 0, 0.4) 36%, rgba(0, 0, 0, 0.12) 41%, transparent 46%),
      linear-gradient(180deg, transparent var(--header), #000 calc(var(--header) + 80px), #000 78%, transparent 98%);
    display: block;
    position: absolute;
    inset: 0;
    overflow: hidden;
    -webkit-mask-image: var(--logo-fade);
    -webkit-mask-composite: source-in;
    mask-image: var(--logo-fade);
    mask-composite: intersect;
  }

  .hero-logo img {
    position: absolute;
    top: calc(var(--header) + 0.66 * (100% - var(--header)));
    left: 34%;
    width: calc(1.6 * (min(92vh, 860px) - var(--header)));
    max-width: none;
    height: auto;
    transform: translate(-50%, -51.5%);
  }

  .hero-content {
    --hero-text: calc(50vw - max(var(--gutter), (100vw - var(--shell)) / 2) - 40px);
    padding-left: calc(50vw + 40px - max(var(--gutter), (100vw - var(--shell)) / 2));
  }

  .hero h1,
  .hero-lede {
    max-width: var(--hero-text);
  }

  .hero h1 {
    font-size: clamp(34px, calc(var(--hero-text) / 10.4), 68px);
  }
}

/* ---- 数字条 ---- */

.stats {
  border-bottom: 1px solid var(--line);
  background: var(--bg-alt);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 30px 24px;
  border-left: 1px dashed var(--line);
}

.stat:first-child {
  border-left: 0;
  padding-left: 0;
}

.stat strong {
  color: var(--accent-strong);
  font-family: var(--mono);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 600;
  line-height: 1.1;
}

.stat span {
  color: var(--muted);
  font-size: 14px;
}

/* ---- 分节 ---- */

.section {
  padding: 112px 0;
  scroll-margin-top: var(--header);
}

.section-alt {
  border-block: 1px solid var(--line);
  background: rgba(12, 22, 39, 0.82);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 56px;
}

.section h2 {
  font-size: clamp(30px, 4vw, 44px);
}

.section-lede {
  margin-top: 20px;
  color: var(--muted);
  font-size: 17px;
}

.card-grid {
  display: grid;
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.card-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

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

.card {
  position: relative;
  padding: 34px 30px 36px;
  background: var(--panel-solid);
  transition: background-color 0.25s ease;
}

.card:hover {
  background: #13243b;
}

/* 卡片左上的刻度短线。 */
.card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 28px;
  height: 2px;
  background: var(--accent);
}

.card-index {
  display: block;
  margin-bottom: 26px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.card h3 {
  margin-bottom: 12px;
  font-size: 20px;
}

.card p {
  color: var(--muted);
  font-size: 15px;
}

/* ---- 截图 ---- */

.shot {
  margin: 56px 0 0;
}

.shot-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel-solid);
}

.shot-frame img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.shot figcaption {
  margin-top: 12px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 13px;
}

.shot figcaption::before {
  content: "FIG. ";
  color: var(--accent);
}

/* ---- 平台流程 ---- */

.flow {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin: 0 0 56px;
  padding: 0;
  list-style: none;
  counter-reset: flow;
}

/* 节点之间的连线，画在节点圆心的高度。 */
.flow::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 8px;
  right: 8px;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--line-strong) 0 8px, transparent 8px 14px);
}

.flow li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  counter-increment: flow;
}

.flow-node {
  width: 15px;
  height: 15px;
  margin-bottom: 14px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: var(--bg-alt);
  box-shadow: inset 0 0 0 3px var(--bg-alt), inset 0 0 0 8px var(--accent);
}

.flow-node-end {
  border-color: var(--hot);
  box-shadow: inset 0 0 0 3px var(--bg-alt), inset 0 0 0 8px var(--hot);
}

.flow strong {
  font-size: 17px;
}

.flow strong::before {
  content: counter(flow, decimal-leading-zero) " ";
  color: var(--faint);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
}

.flow small {
  color: var(--muted);
  font-size: 13px;
}

/* ---- 创作 ---- */

/* 左栏文字，右栏编辑器截图和代码卡；文字对着右栏竖直居中。 */
.create-layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 64px;
  align-items: center;
}

.create-layout .shot {
  margin-top: 0;
}

.create-side .code-card {
  margin-top: 24px;
}

.points {
  display: grid;
  gap: 12px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.points li {
  position: relative;
  padding-left: 26px;
  color: #c3d1df;
}

.points li::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: 0;
  width: 12px;
  height: 1px;
  background: var(--accent);
}

.create-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 34px;
}

.soon-tag {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 13px;
}

.code-card {
  margin-top: 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #08101c;
}

.code-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.code-bar span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
}

.code-bar em {
  margin-left: 8px;
  color: var(--faint);
  font: normal 12px var(--mono);
}

.code-card pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  color: #c9daea;
  font: 13.5px/1.7 var(--mono);
}

/* ---- 下载 ---- */

.download-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: 64px;
  padding: 64px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
}

.req-label {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* 配置要求：最低、推荐两栏，行间虚线。 */
.specs {
  width: 100%;
  margin: 12px 0 28px;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.5;
}

.specs th,
.specs td {
  padding: 10px 12px 10px 0;
  border-bottom: 1px dashed var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.specs thead th {
  padding-top: 0;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.specs thead td {
  padding-top: 0;
}

/* 行名不换行，这一列收到行名的宽度（width: 1%）。 */
.specs tbody th {
  width: 1%;
  padding-right: 16px;
  color: var(--faint);
  font-weight: 500;
  white-space: nowrap;
  overflow-wrap: normal;
}

.specs tbody td {
  color: #c3d1df;
}

.download-side .button-large {
  width: 100%;
}

.note {
  margin-top: 16px;
  color: var(--faint);
  font-size: 13px;
  line-height: 1.6;
}

/* ---- 社区 ----
   四个平台一排：图标、名字、号码或地址、按钮。按钮压在卡片底部，四张卡对齐。图标平时是主色，
   悬停卡片时换成该平台的品牌色（卡片上的 --brand）。下面一条虚线框是定制打包的联系方式。 */

.community-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.community-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 30px 26px 28px;
  background: var(--panel-solid);
  transition: background-color 0.25s ease;
}

.community-card:hover {
  background: #13243b;
}

.community-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 28px;
  height: 2px;
  background: var(--accent);
  transition: width 0.35s ease, background-color 0.25s ease;
}

.community-card:hover::before {
  width: 100%;
  background: var(--brand, var(--accent));
}

.community-icon {
  width: 36px;
  height: 36px;
  margin-bottom: 22px;
  fill: var(--accent);
  transition: fill 0.25s ease;
}

.community-card:hover .community-icon {
  fill: var(--brand, var(--accent));
}

.community-card h3 {
  font-size: 20px;
}

.community-id {
  margin: 6px 0 24px;
  color: var(--muted);
  font: 13px/1.5 var(--mono);
  overflow-wrap: anywhere;
}

.community-card .button {
  margin-top: auto;
}

.community-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  margin-top: 28px;
  padding: 20px 26px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 15px;
}

.community-contact strong {
  color: var(--accent);
  font: 500 12px var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.community-contact a {
  color: var(--accent-strong);
  font-family: var(--mono);
  text-underline-offset: 3px;
}

.community-contact a:hover {
  color: var(--accent);
}

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

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
}

.footer-main {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px;
  padding: 48px 0 36px;
}

.footer-brand p {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
  word-break: keep-all;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: flex-start;
}

.footer-links a,
.footer-bottom a {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.footer-links a:hover,
.footer-bottom a:hover {
  color: var(--text);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 18px 0 28px;
  border-top: 1px dashed var(--line);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 13px;
}

.footer-bottom a {
  font-family: var(--sans);
  font-size: 13px;
}

/* ---- 条款与隐私 ---- */

.legal {
  width: min(100% - 32px, 720px);
  max-height: min(100% - 48px, 760px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel-solid);
  color: var(--text);
}

.legal::backdrop {
  background: rgba(4, 8, 16, 0.72);
  backdrop-filter: blur(4px);
}

.legal-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-solid);
}

.legal-head h2 {
  font-size: 22px;
}

.legal-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.legal-close:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.legal-body {
  padding: 8px 28px 0;
}

.legal-body h3 {
  margin: 26px 0 8px;
  font-size: 17px;
}

.legal-body p {
  color: #c3d1df;
  font-size: 15px;
}

.legal-body > p:first-child {
  margin-top: 18px;
}

.legal-note {
  margin: 28px 28px 26px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  color: var(--faint);
  font-size: 13px;
}

/* ---- 文档页 ---- */

.docs-hero {
  position: relative;
  overflow: hidden;
  padding: calc(var(--header) + 96px) 0 96px;
  border-bottom: 1px solid var(--line);
}

/* 转动的齿轮图标淡淡地垫在右边，向左渐隐。 */
.docs-logo {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 45%, #000 80%);
  mask-image: linear-gradient(90deg, transparent 45%, #000 80%);
}

.docs-logo img {
  position: absolute;
  top: 50%;
  right: -8vw;
  width: min(900px, 70vw);
  max-width: none;
  transform: translateY(-50%);
}

.docs-hero-inner {
  position: relative;
}

.docs-hero h1 {
  font-size: clamp(40px, 6vw, 72px);
}

.docs-lede {
  max-width: 680px;
}

/* 小号方形按钮：GitHub 大按钮下方、更新历史一节里各一个。方角细边框，底边一道主色刻度，
   悬停时拉满（和页头格子同一个画法），箭头往右点一下。 */
.cta-mini {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  background: rgba(10, 18, 32, 0.55);
  color: var(--text);
  font: 600 14px var(--sans);
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.cta-mini::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: -1px;
  width: 14px;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.cta-mini:hover {
  border-color: var(--accent);
  background: rgba(142, 198, 242, 0.06);
  color: var(--accent-strong);
}

.cta-mini:hover::after {
  width: calc(100% + 2px);
}

.cta-mini-arrow {
  color: var(--accent);
  transition: transform 0.25s ease;
}

.cta-mini:hover .cta-mini-arrow {
  transform: translateX(3px);
}

.docs-hero-changelog {
  display: flex;
  width: fit-content;
  margin-top: 22px;
}

/* 更新历史一节：一条虚线框写现状，右边是进完整页面的小按钮。 */
.changelog-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  padding: 22px 26px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 15px;
}

/* 文档页的大号按钮。 */
.cta-huge {
  display: grid;
  width: min(100%, 820px);
  min-height: 150px;
  margin-top: 48px;
  padding: 28px 40px 28px 34px;
  gap: 30px;
}

.cta-huge::before,
.cta-huge::after {
  width: 22px;
  height: 22px;
}

.cta-huge .cta-icon {
  width: 60px;
  height: 60px;
  stroke-width: 1.6;
}

.cta-huge .cta-text {
  gap: 8px;
}

.cta-huge .cta-text strong {
  font-size: clamp(26px, 3.2vw, 38px);
}

.cta-huge .cta-text small {
  font-size: 14px;
}

.cta-huge .cta-arrow {
  font-size: 34px;
}

.cta-huge:hover .cta-arrow {
  transform: translate(5px, -5px);
}

@media (max-width: 760px) {
  .docs-hero {
    padding: calc(var(--header) + 56px) 0 64px;
  }

  .docs-logo {
    opacity: 0.18;
  }

  .cta-huge {
    min-height: 110px;
    padding: 20px 22px;
    gap: 16px;
  }

  .cta-huge .cta-icon {
    width: 40px;
    height: 40px;
  }

}

/* ---- 开发者指引：目录页 ---- */

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.guide-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 190px;
  padding: 30px 28px 28px;
  background: var(--panel-solid);
  color: inherit;
  text-decoration: none;
  transition: background-color 0.25s ease;
}

.guide-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 28px;
  height: 2px;
  background: var(--accent);
  transition: width 0.35s ease;
}

a.guide-card:hover {
  background: #13243b;
}

a.guide-card:hover::before {
  width: 100%;
}

.guide-card h3 {
  font-size: 20px;
}

.guide-card p {
  color: var(--muted);
  font-size: 15px;
}

.guide-card .guide-go {
  margin-top: auto;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  transition: transform 0.25s ease;
}

a.guide-card:hover .guide-go {
  transform: translateX(6px);
}

.guide-card-off {
  opacity: 0.6;
}

.guide-card-off::before {
  background: var(--faint);
}

/* SDK 地图：一组一块，名字链到 GitHub 源码。 */
.sdk-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.sdk-group {
  padding: 26px 28px 20px;
  border: 1px solid var(--line);
  background: var(--panel-solid);
}

.sdk-group h3 {
  margin-bottom: 14px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.sdk-group ul {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sdk-group li {
  display: grid;
  grid-template-columns: minmax(0, 12em) minmax(0, 1fr);
  gap: 14px;
  padding: 10px 0;
  border-top: 1px dashed var(--line);
  font-size: 14px;
}

.sdk-group a {
  color: var(--accent-strong);
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.sdk-group a:hover {
  text-decoration: underline;
}

.sdk-group span {
  color: #c3d1df;
}

/* 右栏把 wasm 和“其他”两组上下叠放；左栏更高时，“其他”一组拉长补齐，两栏底部对齐。 */
.sdk-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sdk-stack > .sdk-group:last-child {
  flex: 1;
}

/* outerrim 单独占一整行：上面一句定位，下面两栏功能清单，每条前一道主色短刻度。 */
.sdk-group-wide {
  grid-column: 1 / -1;
}

.sdk-group .sdk-features {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 40px;
}

.sdk-group .sdk-features li {
  position: relative;
  display: block;
  padding: 9px 0 9px 20px;
  color: #c3d1df;
}

.sdk-group .sdk-features li::before {
  content: "";
  position: absolute;
  top: calc(9px + 0.7em);
  left: 0;
  width: 10px;
  height: 2px;
  background: var(--accent);
}

/* ---- 开发者指引：文章页 ---- */

.article-page {
  padding: calc(var(--header) + 40px) 0 96px;
}

/* 指引导航：左边回目录，右边各篇，和下面的目录栏、正文两栏对齐；当前这篇高亮。 */
.guide-nav {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 56px;
  margin-bottom: 44px;
  border-bottom: 1px solid var(--line);
}

.guide-nav-home {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: none;
}

.guide-nav-home:hover {
  color: var(--accent-strong);
}

.guide-nav ol {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-nav li {
  display: flex;
  min-width: 0;
  border-left: 1px solid var(--line);
}

.guide-nav li > a,
.guide-nav li > span {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 14px 14px 13px;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.guide-nav .n {
  flex: none;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
}

.guide-nav a:hover {
  background: rgba(142, 198, 242, 0.05);
  color: var(--text);
}

.guide-nav a.is-current {
  background: rgba(142, 198, 242, 0.08);
  color: var(--accent-strong);
}

.guide-nav a.is-current::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--accent);
}

.guide-nav a.is-current .n {
  color: var(--accent);
}

.guide-nav .is-off {
  color: var(--faint);
  cursor: default;
}

.article-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.toc {
  position: sticky;
  top: calc(var(--header) + 32px);
  display: grid;
  gap: 6px;
  font-size: 14px;
}

.toc-title {
  margin-bottom: 6px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.toc nav {
  display: grid;
  border-left: 1px solid var(--line);
}

.toc nav a {
  margin-left: -1px;
  padding: 6px 0 6px 14px;
  border-left: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.toc nav a:hover,
.toc nav a.is-current {
  border-left-color: var(--accent);
  color: var(--text);
}

.article {
  min-width: 0;
  max-width: 860px;
}

.article-head {
  margin-bottom: 48px;
}

.article-head h1 {
  font-size: clamp(34px, 5vw, 56px);
}

.article-lede {
  margin-top: 18px;
  color: #c3d1df;
  font-size: 18px;
}

.article section {
  padding-top: 24px;
  scroll-margin-top: calc(var(--header) + 24px);
}

.article h2 {
  margin: 28px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
  font-size: 26px;
}

.article h3 {
  margin: 26px 0 10px;
  font-size: 18px;
}

.article p,
.article li {
  color: #c3d1df;
  font-size: 16px;
}

.article p + p {
  margin-top: 14px;
}

.article ul,
.article ol {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  padding-left: 22px;
}

.article ol.steps {
  counter-reset: step;
  padding-left: 0;
  list-style: none;
}

.article ol.steps > li {
  position: relative;
  padding: 14px 18px 14px 56px;
  border: 1px solid var(--line);
  background: var(--panel-solid);
  counter-increment: step;
}

.article ol.steps > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  top: 14px;
  left: 18px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
}

.article code {
  padding: 1px 6px;
  border: 1px solid var(--line);
  background: #08101c;
  color: var(--accent-strong);
  font-family: var(--mono);
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

.article strong {
  color: var(--text);
}

.article a {
  color: var(--accent);
}

.article pre {
  margin: 18px 0;
  padding: 18px 20px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  background: #08101c;
  color: #c9daea;
  font: 13.5px/1.7 var(--mono);
}

.article pre code {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

.note-box {
  margin: 18px 0;
  padding: 14px 18px;
  border: 1px solid var(--line-strong);
  border-left: 2px solid var(--hot);
  background: rgba(242, 160, 103, 0.06);
}

/* 上一篇 / 下一篇 */
.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 72px;
}

.pager a {
  display: grid;
  gap: 4px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  background: var(--panel-solid);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease;
}

.pager a:hover {
  border-color: var(--accent);
}

.pager a:last-child {
  text-align: right;
}

/* 只有一张时（比如更新历史只回目录），它是“上一篇”，靠左。 */
.pager a:only-child {
  text-align: left;
}

.pager small {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 12px;
}

.pager strong {
  font-size: 17px;
}

@media (max-width: 1020px) {
  .guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .guide-nav {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin-bottom: 32px;
    border-bottom: 0;
  }

  .guide-nav ol {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .guide-nav li {
    border: 1px solid var(--line);
  }

  .toc {
    position: static;
  }

  .toc nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 0;
  }
}

@media (max-width: 760px) {
  .guide-grid,
  .sdk-map {
    grid-template-columns: minmax(0, 1fr);
  }

  .sdk-group li {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .sdk-group .sdk-features {
    grid-template-columns: minmax(0, 1fr);
  }

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

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

  .pager a:last-child {
    text-align: left;
  }
}

/* ---- 滚动渐显 ---- */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

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

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

  .cta,
  .cta::before,
  .cta::after,
  .cta-arrow,
  .cta-sweep::before,
  .cta-primary .cta-sweep::before,
  .cta:hover .cta-sweep::before,
  .cta:hover .cta-arrow-down {
    animation: none;
    transition: none;
  }
}

/* ---- 窄屏 ---- */

@media (max-width: 1020px) {
  .card-grid-3,
  .community-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .create-layout,
  .download-panel {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
  }

  .flow {
    grid-template-columns: repeat(3, 1fr);
    row-gap: 32px;
  }

  .flow::before {
    display: none;
  }
}

@media (max-width: 760px) {
  :root {
    --gutter: 16px;
    --header: 58px;
  }

  /* 手机宽度：品牌只留图标，格子收窄，五样东西才放得下一行。 */
  .header-inner {
    gap: 8px;
  }

  .header-start {
    gap: 12px;
  }

  .brand-name {
    display: none;
  }

  .header-link {
    padding: 0 12px;
  }

  .hero {
    min-height: auto;
    padding: calc(var(--header) + 72px) 0 56px;
  }

  .hero-shade {
    background: linear-gradient(0deg, rgba(10, 18, 32, 0.96) 0%, rgba(10, 18, 32, 0.82) 55%, rgba(10, 18, 32, 0.45) 100%);
  }

  .hero-lede {
    font-size: 16px;
  }

  .hero-actions .cta {
    min-height: 84px;
  }

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

  .stat,
  .stat:first-child {
    padding: 22px 14px;
    border-left: 0;
  }

  .stat:nth-child(even) {
    border-left: 1px dashed var(--line);
  }

  .stat:nth-child(n + 3) {
    border-top: 1px dashed var(--line);
  }

  .section {
    padding: 80px 0;
  }

  .section-heading {
    margin-bottom: 40px;
  }

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

  .card {
    padding: 28px 22px 30px;
  }

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

  .download-panel {
    padding: 36px 22px;
  }

  /* 手机上社区卡片改成一行一个：图标在左，名字和号码在中间，按钮在右。 */
  .community-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .community-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: 14px;
    align-items: center;
    padding: 18px 16px;
  }

  .community-icon {
    grid-row: 1 / 3;
    width: 28px;
    height: 28px;
    margin: 0;
  }

  .community-card h3 {
    font-size: 17px;
  }

  .community-id {
    grid-column: 2;
    margin: 0;
  }

  .community-card .button {
    grid-column: 3;
    grid-row: 1 / 3;
    margin: 0;
  }

  .community-contact {
    padding: 18px 16px;
  }

  .corner {
    display: none;
  }

  .legal-head,
  .legal-body {
    padding-inline: 20px;
  }

  .legal-note {
    margin-inline: 20px;
  }
}

/* 最窄的手机：页头的“社区”收成图标，下载去掉箭头，五样东西才放得下一行。 */
@media (max-width: 480px) {
  .header-link {
    padding: 0 10px;
  }

  .nav-community span,
  .header-link-arrow {
    display: none;
  }

  .nav-community-icon {
    display: block;
  }
}
