/* ==========================================================================
   JiSu TieQi (极速铁骑) — legal & support site
   Self-contained: no CDN, no external fonts, no trackers.
   ========================================================================== */

:root {
  --carbon: #0b0e14;
  --carbon-hi: #181f2a;
  --panel: #111722;
  --line: #263040;
  --red: #e62835;
  --red-deep: #96141e;
  --gold: #f2b438;
  --steel: #9aa7b8;
  --white: #f4f7fa;
  --max: 820px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  padding: 0;
  background: var(--carbon);
  color: var(--white);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC",
    "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  /* Subtle red bloom at the top, echoing the store icon. */
  background-image: radial-gradient(120% 60% at 50% 0%, #2a1016 0%, var(--carbon) 62%);
  background-repeat: no-repeat;
}

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

/* ---------- layout ---------- */

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px 72px; }

header.site {
  border-bottom: 1px solid var(--line);
  background: rgba(11, 14, 20, 0.72);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
}

header.site .bar {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--white);
  font-size: 15px;
}

.brand:hover { text-decoration: none; }

.mark {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  border-right-color: transparent;
  position: relative;
}

.mark::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--red);
}

nav.site {
  margin-left: auto;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

nav.site a {
  color: var(--steel);
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 8px;
}

nav.site a:hover { color: var(--white); background: var(--carbon-hi); text-decoration: none; }
nav.site a[aria-current="page"] { color: var(--white); background: var(--carbon-hi); }

/* ---------- language switch ---------- */

.langs { display: flex; gap: 4px; margin-left: 6px; }

.langs button {
  font: inherit;
  font-size: 13px;
  color: var(--steel);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 9px;
  cursor: pointer;
  line-height: 1.4;
}

.langs button:hover { color: var(--white); border-color: var(--steel); }
.langs button[aria-pressed="true"] { color: var(--carbon); background: var(--gold); border-color: var(--gold); font-weight: 700; }

/* ---------- hero ---------- */

.hero { padding: 56px 0 32px; }

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(30px, 6vw, 46px);
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.hero h1 .accent { color: var(--red); }

.hero p.lead { margin: 0; color: var(--steel); font-size: 17px; max-width: 64ch; }

.rule { height: 4px; width: 96px; background: var(--gold); border-radius: 2px; margin: 22px 0 0; }

/* ---------- cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}

.cards li { margin: 0; }

.card {
  display: block;
  height: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 20px 18px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  text-decoration: none;
}

.card h2 {
  margin: 0 0 6px;
  font-size: 17px;
  color: var(--white);
}

.card p { margin: 0; color: var(--steel); font-size: 14px; line-height: 1.6; }

.card .arrow { color: var(--gold); font-size: 14px; display: block; margin-top: 12px; }

/* ---------- article ---------- */

article { padding-top: 40px; }

article h1 {
  font-size: clamp(26px, 5vw, 36px);
  margin: 0 0 8px;
  line-height: 1.2;
}

article h2 {
  font-size: 19px;
  margin: 38px 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--white);
}

article h3 { font-size: 16px; margin: 24px 0 6px; color: var(--gold); }

article p, article li { color: #d3dae4; }

article ul, article ol { padding-left: 22px; margin: 10px 0 16px; }

article li { margin: 6px 0; }

.meta { color: var(--steel); font-size: 14px; margin: 0 0 26px; }

.note {
  background: rgba(242, 180, 56, 0.08);
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  margin: 22px 0;
  font-size: 15px;
}

.note p:last-child { margin-bottom: 0; }

table { width: 100%; border-collapse: collapse; margin: 16px 0 22px; font-size: 14px; }

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th { color: var(--white); background: var(--carbon-hi); font-weight: 600; }

td { color: #cdd5e0; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--carbon-hi);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--gold);
}

pre {
  background: var(--carbon-hi);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
}

pre code { background: none; padding: 0; color: #d3dae4; }

/* ---------- footer ---------- */

footer.site {
  border-top: 1px solid var(--line);
  margin-top: 56px;
  padding: 26px 0 40px;
  color: var(--steel);
  font-size: 13px;
}

footer.site .wrap { padding-bottom: 0; }

footer.site nav { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }

footer.site a { color: var(--steel); }
footer.site a:hover { color: var(--white); }

/* ---------- i18n plumbing ---------- */

[data-i18n] { }

html[data-lang="en"] [data-lang-show]:not([data-lang-show~="en"]) { display: none; }
html[data-lang="zh-CN"] [data-lang-show]:not([data-lang-show~="zh-CN"]) { display: none; }
html[data-lang="zh-TW"] [data-lang-show]:not([data-lang-show~="zh-TW"]) { display: none; }

/* ---------- mobile ---------- */

@media (max-width: 560px) {
  body { font-size: 15px; }
  .wrap { padding: 0 16px 56px; }
  header.site .bar { padding: 12px 16px; gap: 10px; }
  nav.site { margin-left: 0; width: 100%; }
  nav.site a { padding: 6px 8px; font-size: 13px; }
  .langs { margin-left: auto; }
  .hero { padding: 36px 0 24px; }
  article { padding-top: 28px; }
  table { font-size: 13px; }
  th, td { padding: 8px 8px; }
}
