/* ZXonline 首頁樣式。配色取自 zx-client-slint（深藍底 #111a25／#182436、金色標題 #f0ce69、藍色強調 #58a6ff）。
   只用系統字型，不載入任何網路字型。 */

:root {
  --bg: #0b121c;
  --bg-2: #111a25;
  --panel: #182436;
  --panel-2: #1d2b40;
  --line: #263648;
  --line-2: #365c7e;
  --text: #d8e4f3;
  --muted: #8ea5c2;
  --gold: #f0ce69;
  --gold-ink: #1a1405;
  --blue: #58a6ff;
  --radius: 10px;
  --wrap: 1120px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  color-scheme: dark;
}
:lang(zh-TW) { --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
  "PingFang TC", "Microsoft JhengHei", "Noto Sans CJK TC", "Source Han Sans TC", sans-serif; }
:lang(ja) { --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
  "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", "Noto Sans CJK JP", sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }
code { font-family: var(--mono); font-size: .92em; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .6em; }
h2 { color: var(--gold); font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); }
h3 { color: var(--text); font-size: 1.1rem; }
p { margin: 0 0 .8em; }
[hidden] { display: none !important; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--gold); color: var(--gold-ink); padding: 6px 12px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ── 頂欄 ── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 18, 28, .92);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 16px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--gold); text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: .02em; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: var(--text); text-decoration: none; padding: 6px 10px; border-radius: 6px; white-space: nowrap; }
.nav a:hover { background: var(--panel); color: var(--gold); }
.lang select {
  background: var(--panel); color: var(--text); border: 1px solid var(--line-2);
  border-radius: 6px; padding: 6px 8px; font: inherit; font-size: .9rem; cursor: pointer;
}

/* ── Hero ── */
.hero {
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(88, 166, 255, .16), transparent 60%),
    radial-gradient(900px 400px at 0% 0%, rgba(240, 206, 105, .10), transparent 60%),
    linear-gradient(180deg, #111a25 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
}
.hero-inner { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 40px; align-items: center; padding-top: 64px; padding-bottom: 64px; }
.hero h1 { font-size: clamp(2.4rem, 1.6rem + 4vw, 4rem); color: var(--gold); letter-spacing: .02em; margin-bottom: .2em; }
.badge { display: inline-block; border: 1px solid var(--gold); color: var(--gold); border-radius: 999px; padding: 2px 12px; font-size: .85rem; margin-bottom: 12px; }
.tagline { font-size: 1.2rem; color: var(--text); }
.scope { color: var(--muted); }
.version { color: var(--muted); font-size: .92rem; }
.version code { color: var(--text); }
.hero-shot { margin: 0; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }

/* ── 按鈕 ── */
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0 16px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 18px; border-radius: 8px;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background-color .15s, border-color .15s, color .15s;
}
.btn-gold { background: var(--gold); color: var(--gold-ink); }
.btn-gold:hover { background: #f5da8a; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-small { min-height: 34px; padding: 4px 12px; font-size: .9rem; background: var(--panel-2); color: var(--text); border-color: var(--line-2); }
.btn.is-pending, .link.is-pending { opacity: .55; cursor: not-allowed; }
.btn.is-pending:hover { background: inherit; }
.btn-gold.is-pending:hover { background: var(--gold); }
.pending-tag { font-weight: 400; font-size: .75rem; padding: 0 6px; border-radius: 4px; background: rgba(0, 0, 0, .25); }
.link { color: var(--blue); }
.link.is-pending::after { content: " ⋯"; }

/* ── 區塊 ── */
.section { padding: 64px 0; }
.section.alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lead { color: var(--muted); max-width: 72ch; }
.note { color: var(--muted); font-size: .9rem; margin-top: 16px; }
.warn { color: var(--gold); }
.grid { display: grid; gap: 16px; }
.features { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h3 { color: var(--gold); }
.card p { color: var(--text); }

.shots { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.shot { margin: 0; }
.shot a { display: block; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; }
.shot a:hover { border-color: var(--gold); }
.shot figcaption { color: var(--muted); font-size: .92rem; margin-top: 8px; }

.dl-sources { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 8px 0 20px; }
.dl-sources .btn { min-width: 180px; }
.dl-code { margin: 0; color: var(--muted); }
.dl-code code { font-family: var(--mono); color: var(--text); }
.downloads { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dl { display: flex; flex-direction: column; }
.dl.primary { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(240, 206, 105, .25) inset; }
.dl > p { color: var(--muted); flex: 1 0 auto; }
.dl-meta { margin: 0; font-size: .8rem; color: var(--muted); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 8px; }
.dl-meta dt { color: var(--muted); }
.dl-meta dt:empty { display: none; }
.dl-meta dt:empty + dd { grid-column: 1 / -1; }
.dl-meta dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.dl-meta dd.hash, .dl-meta dd.file, .dl-meta dd.code { font-family: var(--mono); }
.dl-meta dd.hash { font-size: .72rem; color: var(--muted); }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps > li {
  counter-increment: step; position: relative;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px 14px 72px;
}
.steps > li::before {
  content: counter(step); position: absolute; left: 20px; top: 16px;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--gold); color: var(--gold-ink); font-weight: 700;
}
.steps h3 { color: var(--gold); margin-bottom: .3em; }
.addr { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; }
.addr code { background: var(--bg); border: 1px solid var(--line-2); border-radius: 6px; padding: 6px 12px; color: var(--gold); overflow-wrap: anywhere; }

.community { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.community .cta { margin: 0; }

/* ── 頁尾 ── */
.footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 28px 0 40px; font-size: .9rem; }
.disclaimer { color: var(--text); }
.muted { color: var(--muted); }

/* ── 響應式 ── */
@media (max-width: 960px) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 40px; padding-bottom: 48px; }
}
@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; gap: 8px 12px; padding-top: 8px; padding-bottom: 8px; }
  .lang { margin-left: auto; }
  .nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 4px 10px; font-size: .92rem; }
  .section { padding: 44px 0; }
  .features, .downloads, .shots { grid-template-columns: minmax(0, 1fr); }
  .steps > li { padding: 16px 16px 12px 60px; }
  .steps > li::before { left: 14px; width: 32px; height: 32px; }
  .cta .btn { flex: 1 1 auto; }
}

/* 純介紹頁：單欄置中 hero */
.hero-inner.hero-solo { grid-template-columns: minmax(0, 1fr); text-align: center; justify-items: center; }
.hero-solo .cta { justify-content: center; }
.hero-solo .tagline { max-width: 40em; }
.topbar-inner > .lang { margin-left: auto; }
.hero-solo ~ .footer, .footer .disclaimer { text-align: center; }
