/* ══════════════════════════════════════════════════════════
   188Pay Documentation — Shared Styles
   ══════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0c0e14;
  --surface: #13161f;
  --surface2: #1a1d28;
  --border: #272b3a;
  --border2: #323649;
  --text: #e8eaf0;
  --text-soft: #8b91a8;
  --text-muted: #565c75;
  --accent: #4f6ef7;
  --accent-glow: rgba(79,110,247,.18);
  --accent-light: rgba(79,110,247,.12);
  --green: #22c55e;
  --green-glow: rgba(34,197,94,.15);
  --green-light: rgba(34,197,94,.12);
  --red: #ef4444;
  --warn: #f59f00;
  --warn-light: rgba(245,159,0,.1);
}

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans SC', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

/* ── HEADER ── */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(12,14,20,.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}
.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: -.01em;
}
.header-logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: .7rem;
  font-weight: 800;
  flex-shrink: 0;
}
.header-nav {
  display: flex;
  gap: 4px;
  align-items: center;
}
.header-nav a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: .85rem;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.header-nav a:hover {
  color: var(--text);
  background: var(--surface2);
}

/* ── HERO ── */
.hero {
  position: relative;
  padding: 64px 24px 56px;
  text-align: center;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--accent-light);
  border: 1px solid rgba(79,110,247,.3);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: .78rem;
  font-weight: 600;
  color: #93b4ff;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.hero-tag::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(.8); }
}
.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.03em;
  margin-bottom: 18px;
}
.hero h1 .brand {
  background: linear-gradient(135deg, var(--accent) 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero h1 .x { color: var(--text-soft); }
.hero-sub {
  color: var(--text-soft);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto 28px;
  line-height: 1.75;
}
.hero-chips {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: .8rem;
  color: var(--text-soft);
}
.chip strong { color: var(--text); font-weight: 500; }

/* ── WRAPPER ── */
.wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ── TOC NAV ── */
.toc {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 32px 0 0;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.toc-label {
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .6px;
  text-transform: uppercase;
  width: 100%;
  margin-bottom: 4px;
}
.toc a {
  font-size: .8rem;
  color: var(--text-soft);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid var(--border);
  transition: all .15s;
}
.toc a:hover {
  color: var(--accent);
  border-color: rgba(79,110,247,.4);
  background: var(--accent-light);
}

/* ── INFO NOTE ── */
.info-note {
  display: flex;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 14px 18px;
  font-size: .84rem;
  color: var(--text-soft);
  line-height: 1.8;
}
.info-note.green {
  border-left-color: var(--green);
}
.info-note.warn {
  border-left-color: var(--warn);
}
.info-note p + p { margin-top: 6px; }
.info-note strong { color: var(--text); }
.info-note-icon { flex-shrink: 0; margin-top: 1px; }
.info-note code {
  font-family: 'JetBrains Mono', monospace;
  font-size: .8em;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  color: #93b4ff;
}
.info-note.green code {
  color: #bbf7d0;
}
.info-note ul, .info-note ol {
  padding-left: 20px;
  margin-top: 6px;
}
.info-note li + li { margin-top: 4px; }

/* ── SECTION ── */
.section {
  margin-top: 56px;
}
.section h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  padding-left: 14px;
  border-left: 3px solid var(--accent);
  line-height: 1.3;
}
.section-sub {
  font-size: .84rem;
  color: var(--text-soft);
  margin-bottom: 20px;
  padding-left: 14px;
}

/* api.html uses .doc-section — alias to .section */
.doc-section {
  margin-top: 56px;
}
.doc-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 14px;
  border-left: 3px solid var(--accent);
  margin-bottom: 20px;
}
.section-desc {
  color: var(--text-soft);
  font-size: .9rem;
  margin-bottom: 20px;
  line-height: 1.75;
}

/* Endpoint badges (api.html) */
.endpoint-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  font-family: 'JetBrains Mono', monospace;
}
.endpoint-badge.post {
  background: rgba(34,197,94,.15);
  color: var(--green);
  border: 1px solid rgba(34,197,94,.25);
}
.endpoint-badge.get {
  background: var(--accent-light);
  color: #93b4ff;
  border: 1px solid rgba(79,110,247,.25);
}

/* ── PARAM TABLE ── */
.param-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
  margin: 16px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.param-table-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin: 16px 0;
}
.param-table-wrap .param-table {
  margin: 0;
  border: none;
  border-radius: 0;
}
.param-table thead tr {
  background: var(--surface2);
}
.param-table thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .6px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.param-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.param-table tbody tr:last-child { border-bottom: none; }
.param-table tbody tr:last-child td { border-bottom: none; }
.param-table tbody tr:hover { background: rgba(255,255,255,.02); }
.param-table tbody td,
.param-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-soft);
  line-height: 1.6;
}
.param-table td:first-child {
  font-family: 'JetBrains Mono', monospace;
  font-size: .8rem;
  color: #fde68a;
  white-space: nowrap;
}

/* epay.html column classes */
.param-table .col-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: .8rem;
  color: #93a8fb;
  white-space: nowrap;
}
.param-table .col-type {
  color: var(--text-muted);
  font-size: .78rem;
  white-space: nowrap;
}
.param-table .col-req {
  white-space: nowrap;
  font-size: .75rem;
}
.col-req .req { color: var(--red); font-weight: 600; }
.col-req .opt { color: var(--text-muted); }
.param-table .col-desc { color: var(--text-soft); font-size: .82rem; }
.param-table .col-desc code {
  font-family: 'JetBrains Mono', monospace;
  font-size: .78em;
  background: var(--surface2);
  padding: 1px 5px;
  border-radius: 4px;
  color: #86efac;
}

/* Required / optional tags (api.html) */
.tag-req {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: .72rem;
  font-weight: 600;
}
.tag-req.yes {
  background: rgba(239,68,68,.12);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,.2);
}
.tag-req.no {
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ── CODE BLOCK ──
   Unified pattern: .code-block > .code-block-header + pre
   Works for both api.html and epay.html */
.code-block {
  position: relative;
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin: 16px 0;
}
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.code-block-lang {
  font-size: .7rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .8px;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
}
.code-block pre {
  padding: 18px 20px;
  margin: 0;
  overflow-x: auto;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: .82rem;
  line-height: 1.75;
  color: #e2e8f0;
  tab-size: 2;
  background: transparent;
}
.code-block code {
  display: block;
  font-family: inherit;
  font-size: inherit;
}

/* Syntax highlight spans */
.hl-tag  { color: #7dd3fc; }
.hl-attr { color: #93c5fd; }
.hl-str  { color: #86efac; }
.hl-kw   { color: #c4b5fd; }
.hl-cm   { color: #6b7280; font-style: italic; }
.hl-var  { color: #f9a8d4; }
.hl-fn   { color: #fde68a; }
.hl-num  { color: #fb923c; }
.hl-prop { color: #7dd3fc; }
.hl-url  { color: #93c5fd; }

/* ── STEP LIST (api.html) ──
   Uses CSS counter with absolute-positioned number circles
   so that inner content (including code blocks) takes full width. */
.step-list {
  list-style: none;
  counter-reset: step;
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.step-list li {
  counter-increment: step;
  position: relative;
  padding-left: 40px;
  overflow: hidden;
}
.step-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-light);
  border: 1px solid rgba(79,110,247,.3);
  color: var(--accent);
  font-size: .78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-list li > div {
  min-width: 0;
  color: var(--text-soft);
  font-size: .88rem;
  line-height: 1.75;
}
.step-list li .code-block {
  margin-left: -40px;
}
.step-list li > div strong {
  color: var(--text);
  display: block;
  margin-bottom: 2px;
}

/* ── STEP NOTE (epay.html) ──
   Same absolute-position approach for alignment. */
.step-note {
  position: relative;
  padding-left: 40px;
  margin: 20px 0 8px;
}
.step-note-num {
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-light);
  border: 1px solid rgba(79,110,247,.35);
  color: #93a8fb;
  font-size: .75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-note-body { min-width: 0; }
.step-note-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.step-note-desc {
  font-size: .83rem;
  color: var(--text-soft);
  line-height: 1.65;
}
.step-note-desc code {
  font-family: 'JetBrains Mono', monospace;
  font-size: .8em;
  background: var(--surface2);
  padding: 1px 5px;
  border-radius: 4px;
  color: #86efac;
}

/* ── PLATFORM TABLE (epay.html) ── */
.platform-table-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin: 16px 0;
}
.platform-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .83rem;
}
.platform-table thead th {
  background: var(--surface2);
  padding: 10px 16px;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .6px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.platform-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  line-height: 1.6;
}
.platform-table tbody tr:last-child td { border-bottom: none; }
.platform-table tbody tr:hover td { background: rgba(255,255,255,.02); }
.platform-name {
  font-weight: 600;
  color: var(--text);
  font-size: .88rem;
}
.platform-badge {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}
.badge-supported {
  background: var(--green-light);
  color: var(--green);
  border: 1px solid rgba(34,197,94,.25);
}
.platform-desc { color: var(--text-soft); font-size: .82rem; }
.platform-desc code {
  font-family: 'JetBrains Mono', monospace;
  font-size: .78em;
  background: var(--surface2);
  padding: 1px 5px;
  border-radius: 4px;
  color: #93c5fd;
}

/* ── STATUS TABLE (api.html) ── */
.status-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
  margin: 16px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.status-table thead tr { background: var(--surface2); }
.status-table thead th {
  padding: 11px 16px;
  text-align: left;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
}
.status-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.status-table tbody tr:last-child { border-bottom: none; }
.status-table tbody tr:hover { background: rgba(255,255,255,.02); }
.status-table td {
  padding: 11px 16px;
  color: var(--text-soft);
}

.status-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: .75rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}
.status-tag.pending  { background: rgba(245,159,0,.12); color: #fbbf24; border: 1px solid rgba(245,159,0,.2); }
.status-tag.completed { background: rgba(34,197,94,.12); color: #4ade80; border: 1px solid rgba(34,197,94,.2); }
.status-tag.expired  { background: rgba(239,68,68,.12); color: #f87171; border: 1px solid rgba(239,68,68,.2); }
.status-tag.closed   { background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border); }

/* ── RETRY TABLE (api.html) ── */
.retry-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
  margin: 16px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.retry-table thead tr { background: var(--surface2); }
.retry-table thead th {
  padding: 11px 16px;
  text-align: left;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
}
.retry-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.retry-table tbody tr:last-child { border-bottom: none; }
.retry-table tbody tr:hover { background: rgba(255,255,255,.02); }
.retry-table td {
  padding: 11px 16px;
  color: var(--text-soft);
}
.retry-table td:first-child {
  font-family: 'JetBrains Mono', monospace;
  font-size: .8rem;
  color: var(--accent);
  font-weight: 600;
  width: 60px;
  text-align: center;
}
.retry-table td:nth-child(2) {
  font-weight: 600;
  color: var(--text);
}

/* ── FOOTER ── */
.footer {
  text-align: center;
  padding: 28px 24px;
  font-size: .78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 60px;
}
.footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color .15s;
}
.footer a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ── Copy Button ── */
.copy-btn {
  font-family: 'Noto Sans SC', 'Inter', sans-serif;
  font-size: .72rem;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 10px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  line-height: 1.5;
  white-space: nowrap;
}
.copy-btn:hover {
  color: var(--text-soft);
  border-color: var(--border2);
}
.copy-btn.copied {
  color: var(--green);
  border-color: rgba(34,197,94,.35);
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .hero h1 { font-size: 1.8rem; }
  .hero { padding: 40px 16px 36px; }
  .hero-sub { font-size: .9rem; }
  .chip { font-size: .75rem; padding: 5px 10px; }
  .wrapper { padding: 0 16px 60px; }
  .header-inner { padding: 0 16px; }
  .header-nav a { padding: 5px 8px; font-size: .8rem; }

  .param-table,
  .status-table,
  .retry-table {
    font-size: .8rem;
    display: block;
    overflow-x: auto;
  }
  .param-table thead th,
  .param-table td,
  .status-table thead th,
  .status-table td,
  .retry-table thead th,
  .retry-table td {
    padding: 9px 12px;
  }

  .code-block pre { font-size: .72rem; padding: 14px; }
  .section h2 { font-size: 1.15rem; }
  .doc-section { margin-top: 40px; }
  .doc-section h2 { font-size: 1.15rem; }
}
