/* test.chifanba.me — 站点外壳样式，游戏本体样式在 index.css（来自 t-rex-runner） */

:root {
  --ink: #1f2328;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f7f7f7;
  --accent: #c8503c;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body.offline {
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

.page {
  min-height: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 22px 20px 16px;
  display: flex;
  flex-direction: column;
}

/* ---------- 顶栏 ---------- */
.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  letter-spacing: .02em;
}

.brand { font-weight: 600; }

.brand span {
  color: var(--accent);
  margin: 0 3px;
}

.brand em {
  font-style: normal;
  font-weight: 400;
  color: var(--muted);
}

.api-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.api-badge b {
  color: var(--ink);
  font-weight: 600;
}

.api-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c9ccd1;
  display: inline-block;
}

.api-badge[data-state="ok"] i { background: #2f9e44; }
.api-badge[data-state="warn"] i { background: #f59f00; }
.api-badge[data-state="err"] i { background: #e03131; }

/* ---------- 标题 ---------- */
.hero { margin: 46px 0 0; }

.hero h1 {
  margin: 0 0 10px;
  font-size: 27px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -.01em;
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

kbd {
  font-family: inherit;
  font-size: 12px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
}

/* ---------- 游戏区域 ---------- */
.play-area {
  margin: 26px 0 6px;
}

.offline .interstitial-wrapper {
  position: relative;
  width: 100%;
  max-width: 600px;
  height: 152px;
  margin: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
  line-height: normal;
}

.offline .runner-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 600px;
  height: 150px;
  overflow: hidden;
}

.offline .runner-canvas {
  position: absolute;
  top: 0;
  left: 0;
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.offline .controller {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  z-index: 1;
}

#offline-resources { display: none; }

.icon-offline { display: none !important; }

/* 开始提示 */
.hint {
  height: 20px;
  line-height: 20px;
  margin-top: 6px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  transition: opacity .35s ease;
  pointer-events: none;
}

.hint.is-hidden { opacity: 0; }

/* ---------- 说明 / 页脚 ---------- */
.notes {
  margin: 30px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px 28px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.75;
}

.notes h2 {
  margin: 0 0 5px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink);
}

.notes a { color: var(--accent); text-decoration: none; }
.notes a:hover { text-decoration: underline; }

.site-foot {
  margin-top: auto;
  padding-top: 28px;
  font-size: 12px;
  color: #9aa0a6;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  justify-content: space-between;
}

.site-foot a { color: #9aa0a6; text-decoration: none; }
.site-foot a:hover { color: var(--ink); }

@media (max-width: 480px) {
  .page { padding: 16px 16px 12px; }
  .hero { margin-top: 26px; }
  .hero h1 { font-size: 23px; }
  .play-area { margin-top: 20px; }
}

/* ---------- 接口说明 ---------- */
.api-doc {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.api-doc h2 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink);
}

.api-doc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
}

.api-doc li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
}

.api-doc code,
.api-note code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--ink);
  background: #efefef;
  border-radius: 4px;
  padding: 2px 6px;
}

.api-doc li span { color: var(--muted); }

.api-note { margin: 12px 0 0; font-size: 12px; }

@media (max-width: 480px) {
  .api-doc li { display: block; }
  .api-doc li span { display: block; margin-top: 2px; }
}
