/* Hyperliquid Wiki Design System - Institutional Minimalist (app.hyperliquid.xyz style) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Hyperliquid Official Color System (Deep Oceanic Slate & Ice Aqua Mint) */
  --hl-bg-canvas: #060a0e;
  --hl-bg-surface: #0b1117;
  --hl-bg-elevated: #111a22;
  
  /* 官方品牌冰薄荷绿 / 青浅水绿 (#98FCE4) */
  --hl-mint-primary: #98fce4;
  --hl-mint-hover: #78e3ca;
  --hl-mint-subtle: rgba(152, 252, 228, 0.08);
  --hl-mint-border: rgba(152, 252, 228, 0.2);
  --hl-accent: var(--hl-mint-primary);

  /* 文字层级：高可读性、高对比、不刺眼 */
  --hl-text-white: #f5fefd;
  --hl-text-primary: #e2eaf0;
  --hl-text-secondary: #8c9ba5;
  --hl-text-muted: #5e6d78;
  
  /* 边框体系：冷黑曜石极细微线条 */
  --hl-border-subtle: #17222c;
  --hl-border-default: #223241;
  --hl-border-active: #324657;

  --hl-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --hl-font-mono: 'JetBrains Mono', monospace;
}

/* Section scroll margins for sticky navbar offset */
section[id], h2[id], h3[id] {
  scroll-margin-top: 80px;
}

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

html {
  font-family: var(--hl-font-sans);
  background-color: var(--hl-bg-canvas);
  color: var(--hl-text-secondary);
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--hl-bg-canvas);
  color: var(--hl-text-secondary);
}

::selection {
  background: rgba(152, 252, 228, 0.25);
  color: #060a0e;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

/* Typography - Clean & Clear */
h1, h2, h3, h4, h5, h6 {
  color: var(--hl-text-white);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

h1 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); font-weight: 700; }
h2 { font-size: 1.375rem; margin-top: 2rem; margin-bottom: 0.875rem; padding-bottom: 0.35rem; border-bottom: 1px solid var(--hl-border-subtle); }
h3 { font-size: 1.125rem; margin-top: 1.5rem; margin-bottom: 0.625rem; }

p {
  margin-bottom: 1rem;
  color: var(--hl-text-secondary);
  font-size: 0.9375rem;
  line-height: 1.65;
}

strong, b {
  color: var(--hl-text-primary);
  font-weight: 600;
}

code {
  font-family: var(--hl-font-mono);
  font-size: 0.8125rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--hl-text-primary);
  padding: 0.125rem 0.35rem;
  border-radius: 4px;
  border: 1px solid var(--hl-border-subtle);
}

/* Layout */
.hl-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

/* Navbar - Quiet & Frosted */
.hl-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 9, 11, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hl-border-subtle);
}

.hl-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  gap: 1rem;
}

.hl-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 600;
  font-size: 1rem;
  color: var(--hl-text-white);
  white-space: nowrap;
  flex-shrink: 0;
}

.hl-brand img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

.hl-brand-tag {
  font-size: 0.6875rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--hl-text-secondary);
  font-family: var(--hl-font-mono);
}

.hl-nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
  white-space: nowrap;
}

.hl-nav-link {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--hl-text-secondary);
  white-space: nowrap;
}

.hl-nav-link:hover, .hl-nav-link.active {
  color: var(--hl-text-white);
}

.hl-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  white-space: nowrap;
  flex-shrink: 0;
}
  gap: 0.625rem;
}

/* Buttons - Flat & Restrained */
.hl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-family: var(--hl-font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.hl-btn-primary {
  background: var(--hl-mint-primary);
  color: #07090b;
  font-weight: 600;
}

.hl-btn-primary:hover {
  background: var(--hl-mint-hover);
}

.hl-btn-outline {
  background: transparent;
  color: var(--hl-text-primary);
  border-color: var(--hl-border-default);
}

.hl-btn-outline:hover {
  border-color: var(--hl-text-white);
  color: var(--hl-text-white);
  background: rgba(255, 255, 255, 0.03);
}

.hl-btn-sm {
  padding: 0.3rem 0.625rem;
  font-size: 0.75rem;
}

/* Minimal Hero */
.hl-hero {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--hl-border-subtle);
}

.hl-hero-title {
  margin-bottom: 0.75rem;
  font-size: 2rem;
}

.hl-hero-desc {
  font-size: 1rem;
  color: var(--hl-text-secondary);
  max-width: 720px;
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.hl-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hl-tag {
  font-family: var(--hl-font-mono);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--hl-bg-surface);
  border: 1px solid var(--hl-border-subtle);
  color: var(--hl-text-muted);
}

.hl-tag strong {
  color: var(--hl-text-secondary);
}

/* Minimalist Cards */
.hl-card {
  background: var(--hl-bg-surface);
  border: 1px solid var(--hl-border-subtle);
  border-radius: 8px;
  padding: 1.25rem;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.hl-card:hover {
  border-color: var(--hl-border-default);
  background: var(--hl-bg-elevated);
}

.hl-card-interactive {
  display: block;
}

.hl-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--hl-text-white);
  margin-bottom: 0.35rem;
}

.hl-card-desc {
  font-size: 0.8125rem;
  color: var(--hl-text-secondary);
  line-height: 1.55;
  margin-bottom: 0.75rem;
}

.hl-card-arrow {
  font-size: 0.75rem;
  color: var(--hl-text-muted);
  font-weight: 500;
}

.hl-card:hover .hl-card-arrow {
  color: var(--hl-mint-primary);
}

/* Responsive Grid Utilities */
.hl-grid {
  display: grid;
  gap: 1.25rem;
}

.hl-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.hl-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
  .hl-grid-2,
  .hl-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Numbered / Status Badge */
.hl-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

/* Callout Box - Simple & Clean */
.hl-callout {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--hl-border-default);
  border-left: 3px solid var(--hl-mint-primary);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}

.hl-callout-title {
  color: var(--hl-text-white);
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.hl-callout p {
  color: var(--hl-text-secondary);
  font-size: 0.875rem;
  margin-bottom: 0;
}

.hl-callout-warning {
  border-left-color: #f85149;
  background: rgba(248, 81, 73, 0.03);
  border-color: rgba(248, 81, 73, 0.2);
}

.hl-callout-warning .hl-callout-title {
  color: #f85149;
}

/* Minimal Table */
.hl-table-wrapper,
.hl-table-container {
  overflow-x: auto;
  margin: 1.25rem 0;
  border-radius: 6px;
  border: 1px solid var(--hl-border-subtle);
  background: var(--hl-bg-surface);
}

.hl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  text-align: left;
}

.hl-table th {
  background: rgba(255, 255, 255, 0.02);
  padding: 0.75rem 0.875rem;
  color: var(--hl-text-white);
  font-weight: 600;
  border-bottom: 1px solid var(--hl-border-subtle);
}

.hl-table td {
  padding: 0.75rem 0.875rem;
  color: var(--hl-text-secondary);
  border-bottom: 1px solid var(--hl-border-subtle);
}

.hl-table tr:last-child td {
  border-bottom: none;
}

/* FAQ Minimal Accordion */
.hl-faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1.25rem 0;
}

.hl-faq-item {
  border: 1px solid var(--hl-border-subtle);
  border-radius: 6px;
  background: var(--hl-bg-surface);
  transition: border-color 0.15s ease;
}

.hl-faq-item[open] {
  border-color: var(--hl-border-default);
}

.hl-faq-summary {
  padding: 0.875rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--hl-text-primary);
  list-style: none;
  user-select: none;
}

.hl-faq-summary::-webkit-details-marker {
  display: none;
}

.hl-faq-summary:hover {
  color: var(--hl-text-white);
}

.hl-faq-chevron {
  width: 14px;
  height: 14px;
  stroke: var(--hl-text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.hl-faq-item[open] .hl-faq-chevron,
.hl-mobile-toc[open] .hl-faq-chevron {
  transform: rotate(180deg);
  stroke: var(--hl-text-white);
}

.hl-faq-body {
  padding: 0 1rem 1rem;
  color: var(--hl-text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
  border-top: 1px solid var(--hl-border-subtle);
  padding-top: 0.75rem;
}

.hl-faq-body p:last-child {
  margin-bottom: 0;
}

/* Breadcrumbs */
.hl-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--hl-text-muted);
  margin-bottom: 1.25rem;
}

.hl-breadcrumb a {
  color: var(--hl-text-secondary);
}

.hl-breadcrumb a:hover {
  color: var(--hl-text-white);
}

.hl-breadcrumb-sep {
  color: var(--hl-text-muted);
  user-select: none;
}

/* Code Snippet */
.hl-code-block {
  background: #050709;
  border: 1px solid var(--hl-border-subtle);
  border-radius: 6px;
  margin: 1rem 0;
  overflow: hidden;
}

.hl-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.875rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--hl-border-subtle);
  font-family: var(--hl-font-mono);
  font-size: 0.6875rem;
  color: var(--hl-text-muted);
}

.hl-code-content {
  padding: 0.875rem;
  overflow-x: auto;
  font-family: var(--hl-font-mono);
  font-size: 0.75rem;
  color: var(--hl-text-primary);
  line-height: 1.6;
}

/* Article Sidebar Layout */
.hl-layout-article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 3rem;
  align-items: start;
  padding: 2.5rem 0 4rem;
}

.hl-content,
.hl-layout-article > article {
  min-width: 0;
}

.hl-sidebar,
.hl-toc-sticky {
  position: sticky;
  top: 80px;
  background: var(--hl-bg-surface);
  border: 1px solid var(--hl-border-subtle);
  border-radius: 8px;
  padding: 1rem;
}

.hl-toc-title {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--hl-text-muted);
  margin-bottom: 0.625rem;
}

.hl-toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.75rem;
}

.hl-toc-link {
  color: var(--hl-text-secondary);
  display: block;
  padding: 3px 0 3px 8px;
  border-left: 2px solid transparent;
  transition: all 0.15s ease;
}

.hl-toc-link:hover, .hl-toc-link.active {
  color: var(--hl-mint-primary);
  border-left-color: var(--hl-mint-primary);
}

/* Minimal Footer */
.hl-footer {
  margin-top: auto;
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--hl-border-subtle);
  background: var(--hl-bg-canvas);
  font-size: 0.8125rem;
}

.hl-footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.hl-footer-title,
.hl-footer-col h4 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--hl-text-muted);
  margin-bottom: 0.75rem;
}

.hl-footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hl-footer-link {
  font-size: 0.8125rem;
  color: var(--hl-text-secondary);
}

.hl-footer-link:hover {
  color: var(--hl-text-white);
}

.hl-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hl-border-subtle);
  font-size: 0.75rem;
  color: var(--hl-text-muted);
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Mobile Menu Toggle Button */
.hl-menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--hl-border-default);
  color: var(--hl-text-primary);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.hl-menu-toggle:hover {
  border-color: var(--hl-text-white);
  color: var(--hl-text-white);
}

.hl-mobile-menu {
  display: none;
  position: absolute;
  top: 56px;
  left: 0;
  right: 0;
  background: rgba(6, 10, 14, 0.98);
  border-bottom: 1px solid var(--hl-border-default);
  padding: 1rem 1.25rem 1.5rem;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.6);
  z-index: 99;
}

.hl-mobile-menu.open {
  display: block;
}

.hl-mobile-menu-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hl-mobile-menu-links a {
  display: block;
  font-size: 0.9375rem;
  color: var(--hl-text-primary);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--hl-border-subtle);
}

.hl-mobile-menu-links a:hover {
  color: var(--hl-mint-primary);
}

/* Mobile Article TOC (Collapsible on mobile) */
.hl-mobile-toc {
  display: none;
  background: var(--hl-bg-surface);
  border: 1px solid var(--hl-border-subtle);
  border-radius: 6px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.hl-mobile-toc summary {
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--hl-text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
}

.hl-mobile-toc summary::-webkit-details-marker {
  display: none;
}

.hl-mobile-toc-list {
  padding: 0.5rem 1rem 1rem;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.8125rem;
  border-top: 1px solid var(--hl-border-subtle);
}

.hl-mobile-toc-list a {
  color: var(--hl-text-secondary);
  display: block;
  padding: 2px 0;
}

.hl-mobile-toc-list a:hover {
  color: var(--hl-mint-primary);
}

/* Article Header Container */
.hl-article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--hl-border-subtle);
}

.hl-article-title {
  font-size: clamp(1.625rem, 3.2vw, 2.25rem);
  font-weight: 700;
  color: var(--hl-text-white);
  line-height: 1.25;
  margin-bottom: 0.875rem;
}

.hl-article-lead {
  font-size: 1.0625rem;
  color: var(--hl-text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .hl-nav-links {
    display: none;
  }
  .hl-menu-toggle {
    display: flex;
  }
}

@media (max-width: 860px) {
  .hl-layout-article {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.5rem 0 3rem;
  }
  .hl-sidebar,
  .hl-toc-sticky {
    display: none;
  }
  .hl-mobile-toc {
    display: block;
  }
  .hl-footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 640px) {
  .hl-container {
    padding: 0 1rem;
  }
  .hl-hero {
    padding: 2.25rem 0 1.5rem;
  }
  .hl-hero-title {
    font-size: 1.625rem;
  }
  .hl-hero-desc {
    font-size: 0.875rem;
  }
  .hl-hero-tags {
    gap: 0.35rem;
  }
  .hl-tag {
    font-size: 0.6875rem;
    padding: 2px 6px;
  }
  .hl-card {
    padding: 1rem;
  }
  .hl-footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .hl-footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Article Metadata & Trust Indicators */
.hl-article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  font-size: 0.75rem;
  color: var(--hl-text-muted);
  margin-top: 0.75rem;
  margin-bottom: 1.5rem;
}

.hl-article-meta-badge {
  background: var(--hl-mint-subtle);
  color: var(--hl-mint-primary);
  border: 1px solid var(--hl-mint-border);
  border-radius: 4px;
  padding: 1px 6px;
  font-weight: 500;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hl-article-meta-dot {
  color: var(--hl-border-default);
}

/* Code Snippet Blocks */
.hl-code-container {
  background: #080d12;
  border: 1px solid var(--hl-border-subtle);
  border-radius: 6px;
  margin: 1.25rem 0;
  overflow: hidden;
}

.hl-code-header {
  background: #0c141c;
  padding: 0.375rem 0.875rem;
  font-size: 0.75rem;
  font-family: var(--hl-font-mono);
  color: var(--hl-text-muted);
  border-bottom: 1px solid var(--hl-border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hl-code-pre {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--hl-font-mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: #c9d1d9;
}

/* Comparison Solution Cards */
.hl-solution-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.hl-solution-card {
  background: var(--hl-bg-surface);
  border: 1px solid var(--hl-border-subtle);
  border-radius: 8px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease;
}

.hl-solution-card:hover {
  border-color: var(--hl-border-default);
}

.hl-solution-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.hl-solution-badge-primary {
  background: var(--hl-mint-subtle);
  color: var(--hl-mint-primary);
  border: 1px solid var(--hl-mint-border);
}

.hl-solution-badge-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--hl-text-secondary);
  border: 1px solid var(--hl-border-subtle);
}

.hl-solution-title {
  font-size: 1rem;
  color: var(--hl-text-white);
  margin-bottom: 0.5rem;
}

.hl-solution-desc {
  font-size: 0.8125rem;
  color: var(--hl-text-secondary);
  line-height: 1.55;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.hl-solution-meta {
  font-size: 0.75rem;
  color: var(--hl-text-muted);
  border-top: 1px solid var(--hl-border-subtle);
  padding-top: 0.75rem;
  margin-bottom: 1rem;
}

/* Sidebar Tooling Widget */
.hl-sidebar-widget {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hl-border-subtle);
}

.hl-sidebar-widget-title {
  font-size: 0.6875rem;
  color: var(--hl-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.625rem;
}

.hl-sidebar-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  font-size: 0.75rem;
}

.hl-sidebar-links a {
  color: var(--hl-text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.hl-sidebar-links a:hover {
  color: var(--hl-mint-primary);
}

