/* ==========================================================================
   简约风样式：克制的配色、清晰的信息层级、自适应的卡片网格
   ========================================================================== */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #f1f3f6;
  --text: #14171c;
  --text-soft: #5b6270;
  --line: #e4e7ec;
  --line-strong: #d3d8e0;
  --accent: #2f6feb;
  --accent-soft: rgba(47, 111, 235, 0.1);
  --ok: #1e9e63;
  --warn: #c8871a;
  --danger: #d2503f;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a21;
    --surface-soft: #1d2129;
    --text: #e8eaee;
    --text-soft: #9aa3b2;
    --line: #262b36;
    --line-strong: #333a48;
    --accent: #6f9bff;
    --accent-soft: rgba(111, 155, 255, 0.14);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

h1, h2, h3 { line-height: 1.3; margin: 0 0 12px; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 30px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0 0 12px; }
code { font-family: var(--mono); font-size: 13px; background: var(--surface-soft); padding: 2px 6px; border-radius: 6px; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- 头部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 58px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
}
.site-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  padding: 6px 11px;
  border-radius: 8px;
  color: var(--text-soft);
  font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease;
}
.site-nav a:hover { background: var(--surface-soft); color: var(--text); }
.site-nav a.is-active { color: var(--text); background: var(--accent-soft); }

/* ---------- 页面 ---------- */
.page { padding: 34px 20px 64px; }
.page-head { margin-bottom: 26px; }
.page-head .lead { color: var(--text-soft); max-width: 62ch; }

.hero { padding: 26px 0 12px; }
.hero h1 { font-size: 34px; }
.hero .lead { font-size: 16px; color: var(--text-soft); max-width: 60ch; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 40px 0 16px; }
.section-title h2 { margin: 0; }
.section-title span { color: var(--text-soft); font-size: 13px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.15s ease, background 0.15s ease;
}
.btn:hover { filter: brightness(1.06); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { background: var(--surface-soft); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: 0.5; pointer-events: none; }

/* ---------- 卡片 ---------- */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card-hover { transition: transform 0.16s ease, border-color 0.16s ease; }
.card-hover:hover { transform: translateY(-2px); border-color: var(--line-strong); }

.game-card-head { display: flex; align-items: flex-start; gap: 12px; }
.game-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 19px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}
.game-title { font-weight: 600; font-size: 16px; }
.game-sub { color: var(--text-soft); font-size: 13px; }
.game-desc { color: var(--text-soft); font-size: 14px; margin: 0; }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  font-size: 12px;
  color: var(--text-soft);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
}

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-soft); }
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.status.is-ready .dot { background: var(--ok); }
.status.is-partial .dot { background: var(--warn); }
.status.is-offline .dot { background: var(--danger); }

/* ---------- 表格 / 列表 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.table th { color: var(--text-soft); font-weight: 500; font-size: 13px; }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--text-soft); }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--text-soft); }
input[type="text"], input[type="number"], select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
input:focus, select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

/* ---------- 提示条 ---------- */
.note {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 14px;
}
.note.is-warn { border-left-color: var(--warn); }
.note.is-danger { border-left-color: var(--danger); }
.note ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- 让游戏画面铺满 ---------- */
.stage { position: relative; width: 100%; height: calc(100vh - 58px); background: #000; }
.stage canvas { display: block; width: 100%; height: 100%; }
.game-body { margin: 0; background: #000; }
.game-overlay {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
  color: #fff;
  font-size: 13px;
}
.game-overlay form { display: flex; align-items: center; gap: 10px; margin: 0; }
.game-overlay label { display: flex; align-items: center; gap: 8px; }
.game-overlay input {
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font: inherit;
}
.game-loading {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: #000;
  color: #fff;
  z-index: 4;
  transition: opacity 0.4s ease;
}
.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-bottom: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }

/* ---------- 云游戏容器 ---------- */
.cloud-frame-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.cloud-frame-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-soft);
  flex-wrap: wrap;
}
.cloud-frame { width: 100%; height: 74vh; min-height: 520px; border: 0; display: block; background: #000; }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 22px 0 30px; color: var(--text-soft); font-size: 13px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 14px; }

.kv { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--text-soft); }
.kv dd { margin: 0; }

@media (max-width: 640px) {
  h1, .hero h1 { font-size: 26px; }
  .header-inner { height: auto; padding: 10px 0; flex-direction: column; align-items: flex-start; }
  .page { padding: 22px 20px 48px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 10px; }
}
