:root {
  --bg: #0b0d0a;
  --bg-2: #11150f;
  --panel: #151a13;
  --line: #262d22;
  --line-2: #333c2c;
  --text: #e6eadf;
  --muted: #8b9683;
  --green: #79b74a;
  --green-2: #9ede63;
  --dirt: #7a5a3a;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green-2); text-decoration: none; }
a:hover { text-decoration: underline; }

body.landing {
  background:
    radial-gradient(1100px 520px at 78% -8%, rgba(121, 183, 74, .13), transparent 62%),
    radial-gradient(900px 480px at 8% 8%, rgba(122, 90, 58, .12), transparent 60%),
    var(--bg);
}

.wrap { width: min(1120px, calc(100% - 44px)); margin: 0 auto; }

header.nav {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(11, 13, 10, .78);
  border-bottom: 1px solid var(--line);
}
.nav-in { display: flex; align-items: center; gap: 14px; height: 62px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .2px; }
.logo-mark {
  width: 26px; height: 26px; border-radius: 4px;
  background: linear-gradient(160deg, var(--green-2), var(--green) 55%, #4d7a2c);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .22);
  position: relative;
}
.logo-mark::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 7px;
  background: var(--dirt);
}
.nav .spacer { flex: 1; }
.nav a.link { color: var(--muted); font-size: 14px; }
.nav a.link:hover { color: var(--text); text-decoration: none; }

.hero { padding: 84px 0 56px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font: 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--green-2); border: 1px solid #2c3b24; background: #131a10;
  padding: 8px 12px; border-radius: 999px;
}
.hero h1 {
  font-size: clamp(34px, 6.4vw, 62px); line-height: 1.08; margin: 22px 0 18px;
  letter-spacing: -.02em; font-weight: 800;
}
.hero h1 em { font-style: normal; color: var(--green-2); }
.hero p.lead { font-size: clamp(15px, 2vw, 18px); line-height: 1.75; color: #b7c0ae; max-width: 720px; margin: 0 0 30px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px; border-radius: 10px; border: 1px solid transparent;
  font-size: 15px; font-weight: 650; cursor: pointer; transition: .15s ease;
  font-family: inherit;
}
.btn-primary { background: var(--green); color: #0a1206; box-shadow: 0 10px 30px -14px rgba(121, 183, 74, .9); }
.btn-primary:hover { background: var(--green-2); text-decoration: none; transform: translateY(-1px); }
.btn-ghost { background: #131811; color: var(--text); border-color: var(--line-2); }
.btn-ghost:hover { background: #1a2016; text-decoration: none; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.chip {
  font: 12px/1 var(--mono); color: #a7b39c; background: #10150e;
  border: 1px solid var(--line); padding: 8px 11px; border-radius: 6px;
}
.chip b { color: var(--green-2); font-weight: 600; }

section.block { padding: 54px 0; border-top: 1px solid var(--line); }
h2 { font-size: 24px; margin: 0 0 8px; letter-spacing: -.01em; }
h2 .num { font: 13px var(--mono); color: var(--green); margin-right: 10px; }
.sub { color: var(--muted); margin: 0 0 26px; font-size: 14.5px; }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card {
  background: linear-gradient(180deg, #141913, #10140f);
  border: 1px solid var(--line); border-radius: 14px; padding: 22px;
}
.card h3 { margin: 0 0 8px; font-size: 16px; }
.card p { margin: 0; color: #9fa994; font-size: 13.8px; line-height: 1.7; }
.card .k { font: 11px var(--mono); color: var(--green); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 8px; }
.card code { font-family: var(--mono); font-size: 12.5px; color: var(--green-2); }

table.spec { width: 100%; border-collapse: collapse; font-size: 14px; }
table.spec th, table.spec td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.spec th { color: var(--muted); font-weight: 500; width: 180px; font-family: var(--mono); font-size: 12.5px; }
table.spec td code { font-family: var(--mono); font-size: 13px; color: var(--green-2); }

footer { padding: 40px 0 60px; color: #6f7a68; font-size: 13px; border-top: 1px solid var(--line); }
footer .row { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* ---------- play ---------- */
body.play { overflow: hidden; background: #000; }
#launcher {
  position: fixed; inset: 0; z-index: 30; overflow-y: auto;
  background: radial-gradient(900px 500px at 50% -10%, rgba(121, 183, 74, .12), transparent 60%), var(--bg);
  padding: 28px 18px 40px;
}
.launch-in { width: min(880px, 100%); margin: 0 auto; }
.launch-top { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.launch-top .spacer { flex: 1; }
.pill { font: 12px var(--mono); color: var(--muted); border: 1px solid var(--line); padding: 7px 11px; border-radius: 999px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 16px; }
.panel h3 { margin: 0 0 4px; font-size: 15px; }
.panel .hint { color: var(--muted); font-size: 12.5px; margin: 0 0 14px; line-height: 1.6; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
input[type=text], input[type=password] {
  width: 100%; background: #0d110b; border: 1px solid var(--line-2); color: var(--text);
  border-radius: 9px; padding: 11px 12px; font-size: 14px; font-family: inherit; outline: none;
}
input:focus { border-color: #4f6d38; }
.btn-sm { padding: 10px 16px; font-size: 13.5px; border-radius: 9px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.status { font-size: 13px; color: var(--muted); }
.status.ok { color: var(--green-2); }
.status.err { color: #e07a6b; }
.meta { font: 12px/1.6 var(--mono); color: #7f8a77; }

.slot { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px dashed var(--line); }
.slot:first-of-type { border-top: 0; }
.slot .grow { flex: 1; min-width: 0; }
.slot .name { font-size: 13.5px; }
.slot .info { font: 11.5px var(--mono); color: #77816f; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#game { position: fixed; inset: 0; width: 100%; height: 100%; border: 0; display: none; z-index: 10; background: #000; }
#game.on { display: block; }
#hudbar { position: fixed; top: 0; right: 0; z-index: 20; display: none; gap: 8px; padding: 8px; }
#hudbar.on { display: flex; }
#hudbar button {
  background: rgba(10, 14, 9, .82); color: #cfe0c2; border: 1px solid #2b3524;
  border-radius: 8px; padding: 7px 11px; font: 12px var(--mono); cursor: pointer;
}
#hudbar button:hover { color: #fff; border-color: #4d6a37; }

.loading-bar { height: 4px; background: #10150e; border-radius: 99px; overflow: hidden; margin-top: 12px; }
.loading-bar i { display: block; height: 100%; width: 0; background: var(--green); transition: width .2s; }

@media (max-width: 780px) {
  .grid3 { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
  .hero { padding: 56px 0 40px; }
  table.spec th { width: 120px; }
}

/* 客户端加载/错误覆盖层 */
#client-overlay {
  position: fixed; inset: 0; z-index: 25; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .92); padding: 24px;
}
#client-overlay.hidden { display: none; }
.ov-card {
  width: min(560px, 100%); background: #12160f; border: 1px solid var(--line-2);
  border-radius: 14px; padding: 22px; text-align: center;
}
.ov-title { font-size: 16px; font-weight: 650; }
.ov-sub { color: var(--muted); font-size: 12.5px; margin-top: 8px; line-height: 1.6; }
#ov-err {
  display: block; text-align: left; margin: 14px 0 0; padding: 12px; max-height: 220px; overflow: auto;
  background: #0a0d08; border: 1px solid #3a2a24; border-radius: 9px;
  color: #e0917f; font: 11.5px/1.55 var(--mono); white-space: pre-wrap; word-break: break-all;
}
#ov-err.hidden, .hidden { display: none !important; }
