/* Download centre - "Quiet Console" like the TG-SignPulse panel: neutral canvas, raised rounded paper, ink buttons,
   hairline borders, short ease-out motion. White by default, obsidian when the system (or the toggle) is dark. */
:root {
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --r-sm: 9px;
  --r-md: 12px;
  --r-lg: 16px;
  --ease-out: cubic-bezier(.25, .46, .45, .94);
  --t-fast: 120ms;
  --t-base: 180ms;
  --shadow-sm: 0 1px 2px rgba(15, 15, 20, .04), 0 1px 1px rgba(15, 15, 20, .03);
  --shadow-md: 0 8px 24px -6px rgba(15, 15, 20, .10), 0 2px 6px rgba(15, 15, 20, .05);

  color-scheme: light;
  --canvas: #f4f4f6;
  --paper: #ffffff;
  --line: #e9e9ed;
  --line-strong: #d8d8de;
  --ink: #0f0f13;
  --ink-2: #5b5b66;
  --ink-3: #8c8c97;
  --soft: rgba(15, 15, 20, .045);
  --action: #111114;
  --action-hover: #2a2a30;
  --action-text: #ffffff;
  --focus: rgba(15, 15, 20, .20);
  --ok: #17864f;
  --ok-soft: rgba(23, 134, 79, .09);
  --code-bg: #f7f7f9;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="white"]) {
    color-scheme: dark;
    --canvas: #09090b;
    --paper: #111114;
    --line: #212127;
    --line-strong: #33333b;
    --ink: #ededf0;
    --ink-2: #a2a2ad;
    --ink-3: #6f6f7b;
    --soft: rgba(255, 255, 255, .055);
    --action: #ededf0;
    --action-hover: #ffffff;
    --action-text: #0f0f13;
    --focus: rgba(255, 255, 255, .28);
    --ok: #3dd68c;
    --ok-soft: rgba(61, 214, 140, .12);
    --code-bg: #0c0c0e;
  }
}

:root[data-theme="obsidian"] {
  color-scheme: dark;
  --canvas: #09090b;
  --paper: #111114;
  --line: #212127;
  --line-strong: #33333b;
  --ink: #ededf0;
  --ink-2: #a2a2ad;
  --ink-3: #6f6f7b;
  --soft: rgba(255, 255, 255, .055);
  --action: #ededf0;
  --action-hover: #ffffff;
  --action-text: #0f0f13;
  --focus: rgba(255, 255, 255, .28);
  --ok: #3dd68c;
  --ok-soft: rgba(61, 214, 140, .12);
  --code-bg: #0c0c0e;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  color: var(--ink);
  font: 14px/1.6 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
.muted { color: var(--ink-3); }

/* top bar */
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 56px;
  padding: 0 max(16px, env(safe-area-inset-left));
  background: var(--canvas);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; text-decoration: none; letter-spacing: .01em; }
.brand img { border-radius: 8px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--paper); color: var(--ink-2); cursor: pointer;
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.icon-btn:hover { background: var(--soft); color: var(--ink); }

.page { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 32px 16px 48px; }
.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px;
  width: 100%; max-width: 960px; margin: 0 auto; padding: 20px 16px max(24px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); color: var(--ink-2); font-size: 12px;
}

/* home */
.hero { margin-bottom: 24px; }
.hero h1 { font-size: 24px; line-height: 1.35; font-weight: 650; letter-spacing: -.01em; }
.hero p { margin-top: 6px; color: var(--ink-2); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.card {
  display: flex; flex-direction: column; gap: 14px;
  padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--paper); box-shadow: var(--shadow-sm); text-decoration: none;
  transition: border-color var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out);
}
a.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
a.card:focus-visible, .btn:focus-visible, .icon-btn:focus-visible, .copy:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.card-head { display: flex; align-items: center; gap: 12px; }
.mark {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--soft); color: var(--ink); font-weight: 650; font-size: 15px;
}
.card h2 { font-size: 16px; font-weight: 600; line-height: 1.4; }
.kind { color: var(--ink-3); font-size: 12px; }
.card p.summary { color: var(--ink-2); }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; }
.go { color: var(--ink-2); font-weight: 500; }
a.card:hover .go { color: var(--ink); }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.wait { background: var(--soft); color: var(--ink-2); }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* product page */
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 16px; color: var(--ink-2); font-size: 13px; text-decoration: none; }
.back:hover { color: var(--ink); }
.product-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.product-head .mark { width: 52px; height: 52px; border-radius: 14px; font-size: 19px; }
.product-head h1 { font-size: 22px; line-height: 1.35; font-weight: 650; }
.product-head p { margin-top: 4px; color: var(--ink-2); }
.product-head .pill { margin-top: 10px; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
@media (max-width: 760px) { .layout { grid-template-columns: minmax(0, 1fr); } }
.paper { padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--paper); box-shadow: var(--shadow-sm); }
.paper + .paper { margin-top: 16px; }
.paper h2 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.paper .lead { color: var(--ink-2); margin-bottom: 12px; }

.cmd { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--code-bg); overflow: hidden; }
.cmd code { flex: 1; min-width: 0; padding: 12px 14px; font: 13px/1.6 var(--font-mono); white-space: pre-wrap; word-break: break-all; }
.copy {
  flex-shrink: 0; min-width: 72px; border: 0; border-left: 1px solid var(--line); background: transparent;
  color: var(--ink-2); font: 500 13px var(--font-ui); cursor: pointer; transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.copy:hover { background: var(--soft); color: var(--ink); }
.empty { padding: 18px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); color: var(--ink-2); text-align: center; }
.note { margin-top: 10px; color: var(--ink-3); font-size: 13px; }

.list { margin: 0; padding: 0; list-style: none; }
.list li { position: relative; padding: 6px 0 6px 16px; color: var(--ink-2); }
.list li::before { content: ""; position: absolute; left: 2px; top: 15px; width: 5px; height: 5px; border-radius: 50%; background: var(--ink-3); }

.releases { margin: 0; padding: 0; list-style: none; }
.releases li { padding: 14px 0; border-top: 1px solid var(--line); }
.releases li:first-child { border-top: 0; padding-top: 0; }
.rel-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.rel-head b { font-weight: 600; }
.rel-head time { color: var(--ink-3); font-size: 12px; }
.releases p { margin-top: 4px; color: var(--ink-2); white-space: pre-line; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
  border: 1px solid transparent; border-radius: var(--r-sm); background: var(--action); color: var(--action-text);
  font: 500 13px var(--font-ui); text-decoration: none; cursor: pointer; transition: background var(--t-fast) var(--ease-out);
}
.btn:hover { background: var(--action-hover); }

.notfound { padding: 48px 16px; text-align: center; }
.notfound h1 { font-size: 20px; }
.notfound p { margin: 8px 0 20px; color: var(--ink-2); }

@media (max-width: 480px) {
  .page { padding-top: 24px; }
  .hero h1 { font-size: 21px; }
  .product-head { gap: 12px; }
  .product-head h1 { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
