/* ==========================================================================
   okxapk — blog & article pages
   Styles the HTML written by the cron publisher (~/okx_publisher). Class names
   (header.top, .post, .card, .cta-box, .list a.item, …) come from those files,
   so keep them stable. Tokens mirror style.css.
   ========================================================================== */
:root {
  --bg: #000000;
  --surface: #0b0b0b;
  --surface-2: #141414;
  --surface-3: #1c1c1c;
  --border: #262626;
  --border-strong: #3a3a3a;
  --text: #ffffff;
  --text-muted: #a3a3a3;
  --text-dim: #8a8a8a;
  --accent: #c6f432;
  --on-accent: #000000;
  --warn: #ffb547;
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.75 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(198, 244, 50, 0.35); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
img, svg { display: block; }
.wrap { max-width: 820px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 24px); }

/* Header */
header.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--border);
}
header.top .wrap { max-width: 1200px; display: flex; align-items: center; gap: 24px; height: 68px; }
header.top .brand,
header.top > .wrap > a:first-child { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; min-height: 44px; }
header.top .brand svg, header.top img { width: 32px; height: 32px; border-radius: 9px; }
header.top .name { font-family: var(--font-display); font-weight: 700; font-size: 1.375rem; letter-spacing: -0.04em; }
header.top nav { display: flex; gap: 4px; margin-left: auto; font-size: 0.9375rem; }
header.top nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
header.top nav a:hover { background: var(--surface-2); }
header.top nav a[hreflang] { padding: 0 10px; font-size: 0.8125rem; font-weight: 600; color: var(--text-muted); }
header.top nav a[hreflang]:first-of-type { margin-left: 8px; border-left: 1px solid var(--border); border-radius: 0; }
header.top nav a[aria-current] { color: var(--accent); }
@media (max-width: 640px) {
  header.top .wrap { height: 60px; gap: 12px; }
  header.top nav { display: none; }
  header.top .btn { margin-left: auto; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 160ms ease, transform 160ms ease;
}
.btn:hover { background: #d6ff52; }
.btn:active { transform: scale(0.97); }
.btn svg { width: 20px; height: 20px; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 0.875rem; gap: 8px; background: var(--text); }
.btn-sm:hover { background: #e6e6e6; }
.btn-sm svg { width: 16px; height: 16px; }

/* Post heading */
.post { padding: clamp(40px, 7vw, 72px) 0 12px; }
.crumbs { font-size: 0.875rem; color: var(--text-dim); }
.crumbs a { color: var(--text-muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
h1, .post h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.1rem, 5.4vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin: 16px 0 14px;
  text-wrap: balance;
}
.dates { font-size: 0.875rem; color: var(--text-dim); }
.lead { color: var(--text-muted); font-size: 1.125rem; }

/* Cards & article body */
.card {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  padding: 32px 0;
  margin: 0;
}
article.card { border-top: 0; padding-top: 16px; }
h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
  text-wrap: balance;
}
article.card h2 { margin-top: 44px; }
article.card h2:first-child { margin-top: 0; }
h3 { font-family: var(--font-display); font-size: 1.25rem; letter-spacing: -0.015em; margin: 28px 0 8px; }
p { margin: 0 0 18px; }
article.card p, article.card li { color: #d4d4d4; }
article.card strong { color: var(--text); }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: 8px; }
em { color: var(--text); font-style: normal; font-weight: 500; }
code { background: var(--surface-3); color: #e6e6e6; padding: 2px 7px; border-radius: 6px; font-size: 0.875em; }

table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; margin: 8px 0 20px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--text-muted); font-weight: 600; }
.table-scroll, article.card table { display: block; overflow-x: auto; }

.warn {
  background: rgba(255, 181, 71, 0.08);
  border: 1px solid rgba(255, 181, 71, 0.25);
  color: var(--warn);
  border-radius: 16px;
  padding: 16px 18px;
  font-size: 0.9375rem;
}

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 22px 56px; }
.steps li::before {
  content: counter(s, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 2px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--accent);
  font: 700 0.875rem var(--font-display);
  display: grid;
  place-items: center;
}
.steps b { display: block; color: var(--text); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.feat { border: 1px solid var(--border); background: var(--surface); border-radius: 16px; padding: 18px; }
.feat b { display: block; margin-bottom: 4px; }
.chip { display: inline-block; background: rgba(198, 244, 50, 0.1); color: var(--accent); font-size: 0.8125rem; font-weight: 600; padding: 5px 12px; border-radius: 999px; }
.toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 28px; }
@media (max-width: 640px) { .toc ol { columns: 1; } }

/* FAQ */
details { border-bottom: 1px solid var(--border); padding: 0; }
details:first-of-type { border-top: 1px solid var(--border); }
summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 14px 0;
  cursor: pointer;
  font-weight: 600;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: '+';
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1;
  transition: transform 240ms var(--ease-out), background-color 160ms ease, color 160ms ease;
}
details[open] summary::after { transform: rotate(45deg); background: var(--text); color: #000; border-color: var(--text); }
details p { margin: 0 0 20px; color: var(--text-muted); }

/* Call-to-action boxes */
.cta-box {
  margin: 28px 0;
  padding: clamp(24px, 4vw, 36px);
  border-radius: 24px;
  border: 1px solid var(--border);
  background:
    radial-gradient(420px 200px at 100% 0%, rgba(198, 244, 50, 0.14), transparent 70%),
    var(--surface);
  text-align: left;
}
.cta-box strong { display: block; font-family: var(--font-display); font-size: 1.375rem; letter-spacing: -0.02em; }
.cta-box p { color: var(--text-muted); margin: 6px 0 18px; }
.cta-box .alt { margin: 14px 0 0 !important; font-size: 0.9375rem; }
.cta { text-align: left; }

/* Related & blog list */
.related ul { list-style: none; padding: 0; margin: 0; }
.related li { margin: 0; border-bottom: 1px solid var(--border); }
.related li:last-child { border-bottom: 0; }
.related li a { display: block; padding: 14px 0; color: var(--text); text-decoration: none; font-weight: 500; }
.related li a:hover { color: var(--accent); }

.list { display: grid; gap: 12px; border-top: 0; }
.list a.item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 26px 24px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 240ms ease, transform 240ms var(--ease-out);
}
.list a.item:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.list a.item small { color: var(--text-dim); font-size: 0.8125rem; }
.list a.item strong { font-family: var(--font-display); font-size: 1.375rem; line-height: 1.3; letter-spacing: -0.02em; color: var(--text); }
.list a.item span { color: var(--text-muted); font-size: 0.9375rem; }

/* Footer */
footer { border-top: 1px solid var(--border); margin-top: 48px; padding: 40px 0 110px; color: var(--text-dim); font-size: 0.8125rem; line-height: 1.6; }
footer a { color: var(--text-muted); }
footer p { margin: 0 0 10px; }
@media (min-width: 641px) { footer { padding-bottom: 48px; } }

/* Mobile sticky download bar */
.sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: none;
  padding: 10px 16px max(10px, env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
}
.sticky .btn { width: 100%; }
@media (max-width: 640px) { .sticky { display: block; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
