/* AtmoForge Help Portal Theme Override — Sky-Blue Brand + Clean Markdown & Pygments */
:root {
  --af-green: #0284C7;
  --af-green-dark: #0369A1;
  --af-green-deep: #0C4A6E;
  --af-green-soft: #E0F2FE;
  --font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --font-family-monospace: "JetBrains Mono", "Cascadia Mono", "Consolas", monospace;
}

html, body {
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

#nav-path {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 95;
  background: #FFFFFF;
}

div.contents img.af-doc-img,
div.contents p > img {
  display: block;
  max-width: 92%;
  height: auto;
  margin: 14px auto;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(3, 105, 161, 0.08);
}

.af-doc-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0C4A6E;
  color: #FFFFFF;
  padding: 7px 18px;
  font-size: 13px;
  font-family: var(--font-family);
}
.af-doc-topbar a {
  color: #E0F2FE !important;
  text-decoration: none;
  font-weight: 600;
}
.af-doc-topbar a:hover { color: #FFFFFF !important; text-decoration: underline; }
.af-tb-brand { font-size: 14px; font-weight: 700 !important; color: #FFFFFF !important; }
.af-tb-links { display: flex; gap: 16px; flex-wrap: wrap; }

#titlearea {
  padding: 6px 14px;
  border-bottom: 3px solid var(--af-green);
  background: linear-gradient(90deg, #F0F9FF 0%, #FFFFFF 100%);
}
#titlearea table {
  border-collapse: collapse;
}
#projectrow {
  height: 46px;
}
#projectlogo {
  vertical-align: middle !important;
  padding: 0 2px 0 0;
}
#projectlogo img {
  width: 34px;
  height: 34px;
  display: block;
  margin: 0 auto;
}
#projectalign {
  vertical-align: middle !important;
  padding-left: 10px;
}
#projectname {
  font-weight: 700;
  color: #0F172A;
  line-height: 1.15;
}
#projectbrief { color: #475569; margin-top: 2px; }

div.contents {
  max-width: 1080px;
  padding: 18px 28px 46px;
  line-height: 1.75;
  font-size: 15px;
  font-family: var(--font-family);
}

div.contents h1, div.contents h2 {
  color: #0F172A;
  border-bottom: 2px solid var(--af-green-soft);
  padding-bottom: 6px;
  margin-top: 30px;
}
div.contents h3 { color: var(--af-green-deep); margin-top: 22px; }
div.contents h4 { color: #0369A1; margin-top: 18px; }
div.contents h5, div.contents h6 { color: #334155; margin-top: 14px; font-size: 1em; font-weight: 700; }

div.contents p { margin: 10px 0; }
div.contents ul, div.contents ol { margin: 8px 0 12px; padding-left: 24px; }
div.contents li { margin: 4px 0; }

div.contents code {
  font-family: var(--font-family-monospace);
  font-size: 0.9em;
  background: #F0F9FF;
  color: #0C4A6E;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid #BAE6FD;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.af-code-wrap pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border: none;
  border-radius: 0;
  font-size: 0.88em;
  overflow-wrap: normal;
  word-break: normal;
}

.af-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 14px 0 18px;
}
.af-table-wrap table {
  margin: 0 !important;
}

.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
}

.mermaid svg {
  max-width: 100%;
  height: auto;
}

.af-toc-btn,
.af-toc-cell,
.af-drawer-head,
.af-toc-backdrop,
.af-mobile-fab {
  display: none;
}

div.contents table,
table.markdownTable {
  border-collapse: collapse;
  width: 100%;
  margin: 14px 0 18px;
  font-size: 14px;
  display: table;
  overflow-x: auto;
}
div.contents table th,
table.markdownTable th {
  background: #0C4A6E;
  color: #FFFFFF;
  border: 1px solid #075985;
  padding: 8px 12px;
  text-align: left;
  font-weight: 700;
}
div.contents table td,
table.markdownTable td {
  border: 1px solid #CBD5E1;
  padding: 8px 12px;
  vertical-align: top;
}
div.contents table tr:nth-child(even) td,
table.markdownTable tr:nth-child(even) td {
  background: #F4F9FE;
}

.af-code-wrap {
  position: relative;
  margin: 12px 0 16px;
  border: 1px solid #BAE6FD;
  border-left: 4px solid var(--af-green);
  border-radius: 6px;
  background: #F8FBFF;
  overflow: hidden;
}
.af-code-wrap pre {
  margin: 0;
  padding: 12px 16px;
  overflow-x: auto;
  font-family: var(--font-family-monospace);
  font-size: 13.5px;
  line-height: 1.55;
  background: transparent;
}
.af-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  background: #FFFFFF;
  color: #0C4A6E;
  border: 1px solid #7DD3FC;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.af-copy-btn:hover {
  background: var(--af-green);
  color: #FFFFFF;
  border-color: var(--af-green);
}

blockquote {
  border-left: 4px solid var(--af-green);
  background: var(--af-green-soft);
  padding: 10px 16px;
  margin: 14px 0;
  border-radius: 0 6px 6px 0;
  color: #0F172A;
}

.mermaid {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  padding: 14px;
  margin: 14px 0;
  overflow-x: auto;
}

/* Clean Pygments Light Palette */
.af-hl .c, .af-hl .ch, .af-hl .cm, .af-hl .cpf, .af-hl .c1, .af-hl .cs { color: #64748B; font-style: italic; }
.af-hl .k, .af-hl .kc, .af-hl .kd, .af-hl .kn, .af-hl .kp, .af-hl .kr, .af-hl .kt { color: #0369A1; font-weight: 700; }
.af-hl .s, .af-hl .sa, .af-hl .sb, .af-hl .sc, .af-hl .dl, .af-hl .sd, .af-hl .s2, .af-hl .se, .af-hl .sh, .af-hl .si, .af-hl .sx, .af-hl .sr, .af-hl .s1, .af-hl .ss { color: #B45309; }
.af-hl .m, .af-hl .mb, .af-hl .mf, .af-hl .mh, .af-hl .mi, .af-hl .il, .af-hl .mo { color: #0284C7; }
.af-hl .nb, .af-hl .nf, .af-hl .fm { color: #1D4ED8; }
.af-hl .nv, .af-hl .vc, .af-hl .vg, .af-hl .vi, .af-hl .vm { color: #7C3AED; }
.af-hl .o, .af-hl .ow { color: #334155; font-weight: 600; }
.af-hl .err { color: inherit; background: transparent; }

.navpath li.footer a { color: #0369A1; font-weight: 600; text-decoration: none; }
.navpath li.footer a:hover { text-decoration: underline; }

/* Mobile & Tablet Responsive Layout (<= 900px) */
@media (max-width: 900px) {
  html, body {
    height: auto !important;
    min-height: 100%;
    overflow: visible !important;
    overflow-x: hidden !important;
  }
  #container,
  #doc-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }
  #splitbar {
    display: none !important;
  }

  /* Off-canvas TOC Drawer */
  #side-nav {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: min(82vw, 310px) !important;
    max-width: 310px !important;
    height: 100dvh !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 1000 !important;
    background: #F8FBFD !important;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.24);
    transform: translateX(-108%);
    transition: transform 0.22s ease;
    overflow: hidden !important;
  }
  body.af-toc-open {
    overflow: hidden !important;
  }
  body.af-toc-open #side-nav {
    transform: translateX(0);
  }
  .af-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 14px;
    background: #0C4A6E;
    color: #FFFFFF;
    font-weight: 700;
    font-size: 14px;
    font-family: var(--font-family);
  }
  .af-drawer-head button {
    background: transparent;
    border: none;
    color: #E0F2FE;
    font-size: 18px;
    line-height: 1;
    padding: 6px 8px;
    cursor: pointer;
  }
  #nav-tree {
    height: calc(100dvh - 48px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    border-right: none !important;
    padding: 8px 10px 28px !important;
  }
  #nav-tree .label {
    font-size: 14px !important;
    line-height: 30px !important;
  }
  #nav-tree li {
    white-space: normal !important;
  }
  .af-toc-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 990;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  body.af-toc-open .af-toc-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  /* Compact Top Bar, Title Area & Full-Width Search */
  .af-doc-topbar {
    padding: 7px 12px;
    font-size: 12.5px;
    gap: 6px 10px;
    flex-wrap: wrap;
  }
  .af-tb-brand { font-size: 13px; }
  .af-tb-links { gap: 10px; }

  #titlearea { padding: 8px 12px; }
  #titlearea table,
  #titlearea tbody {
    display: block;
    width: 100%;
  }
  #projectrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    height: auto;
  }
  #projectrow > td {
    display: flex;
    align-items: center;
    padding: 0 !important;
  }
  #projectrow > td:last-child {
    flex: 1 0 100%;
    margin-top: 2px;
  }
  .af-toc-cell {
    display: flex !important;
  }
  .af-toc-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #0284C7;
    color: #FFFFFF;
    border: none;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
  }
  #projectlogo img {
    width: 28px;
    height: 28px;
  }
  #projectname {
    font-size: 1.15rem !important;
  }
  #MSearchBox {
    position: static !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center;
    width: 100% !important;
    height: 34px;
    padding: 0 8px;
    box-sizing: border-box;
  }
  #MSearchBox .left {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    height: auto;
  }
  #MSearchField {
    flex: 1;
    width: 100% !important;
    min-width: 0;
    height: 30px;
    font-size: 15px;
  }
  #MSearchResultsWindow {
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-width: calc(100vw - 20px) !important;
  }

  /* Readable Body, Scrollable Tables & Clean Code Blocks */
  div.header {
    margin: 0;
    padding: 10px 14px 4px;
  }
  div.header .headertitle .title {
    font-size: 1.25rem !important;
    line-height: 1.38 !important;
    word-break: break-word;
    margin: 0 !important;
  }
  div.contents {
    padding: 10px 14px 72px !important;
    font-size: 15px;
    line-height: 1.72;
    max-width: 100%;
    overflow-wrap: break-word;
  }
  div.contents h1 { font-size: 1.32rem; margin-top: 22px; }
  div.contents h2 { font-size: 1.18rem; margin-top: 20px; }
  div.contents h3 { font-size: 1.06rem; }
  div.contents h4 { font-size: 1rem; }
  div.contents ul, div.contents ol { padding-left: 18px; }
  div.contents img.af-doc-img,
  div.contents p > img {
    max-width: 100%;
    margin: 10px auto;
  }
  .af-table-wrap table {
    font-size: 13px;
    min-width: 440px;
  }
  .af-table-wrap th,
  .af-table-wrap td {
    padding: 7px 9px;
  }
  .af-code-wrap pre {
    padding: 34px 12px 12px;
    font-size: 12.5px;
    line-height: 1.5;
    -webkit-overflow-scrolling: touch;
  }
  blockquote {
    padding: 9px 12px;
    margin: 12px 0;
  }

  /* Non-Fixed Mobile Footer */
  #nav-path {
    position: static !important;
    height: auto !important;
    margin-left: 0 !important;
    border-top: 1px solid #CBD5E1;
  }
  #nav-path ul {
    height: auto !important;
    background: #F8FAFC !important;
    padding: 10px 12px !important;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 8px;
  }
  #nav-path li.footer {
    float: none !important;
    white-space: normal !important;
    line-height: 1.65 !important;
    font-size: 12px !important;
    width: 100%;
    text-align: center;
    padding: 4px 0 !important;
  }

  /* Floating Thumb Quick Actions */
  .af-mobile-fab {
    display: flex;
    position: fixed;
    right: 14px;
    bottom: 18px;
    z-index: 940;
    gap: 8px;
  }
  .af-fab-btn {
    background: rgba(2, 132, 199, 0.94);
    color: #FFFFFF;
    border: none;
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(12, 74, 110, 0.28);
    cursor: pointer;
  }
  .af-fab-top {
    padding: 9px 13px;
    background: rgba(12, 74, 110, 0.92);
  }
}
