:root{
  --bg:#070a0f;
  --bg-2:#0b0f16;

  --panel: rgba(17, 24, 39, 0.72);
  --panel-solid:#111827;

  --text:#eef2ff;
  --muted:#aab6cc;
  --muted-2:#8ea0bb;

  --accent:#ffb300;
  --accent-2:#ffdd77;

  --link:#7dd3fc;
  --link-2:#93c5fd;

  --border: rgba(255,255,255,0.10);
  --border-2: rgba(255,255,255,0.14);

  --shadow-sm: 0 10px 22px rgba(0,0,0,0.28);
  --shadow:    0 18px 46px rgba(0,0,0,0.38);
  --shadow-lg: 0 28px 70px rgba(0,0,0,0.50);

  --radius: 18px;
  --radius-sm: 12px;

  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 18px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 42px;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;

  --container: 1180px;
  --toc-width: 340px;

  --header-h: 78px;
}

*{ box-sizing: border-box; }
html,body{ height:100%; }

html{
  scrollbar-gutter: stable;
  overflow-x: clip;
}

body{
  overflow-x: hidden;
  touch-action: pan-y;
  margin:0;
  font-family: var(--sans);
  color: var(--text);
  line-height: 1.62;
  letter-spacing: 0.2px;
  background: var(--bg);
}

body::before{
  content:"";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;

  background:
    radial-gradient(1100px 520px at 18% -6%, rgba(255,179,0,0.18), transparent 58%),
    radial-gradient(900px 420px at 100% 10%, rgba(110,168,254,0.14), transparent 60%),
    radial-gradient(900px 520px at 30% 110%, rgba(255,221,119,0.10), transparent 58%),
    linear-gradient(180deg, rgba(255,255,255,0.02), transparent 35%),
    var(--bg);
}

::selection{
  background: rgba(255,179,0,0.24);
  color: var(--text);
}

a{
  color: var(--link);
  text-decoration: none;
  text-underline-offset: 3px;
}
a:hover{ text-decoration: underline; }
a:focus-visible{
  outline: 2px solid rgba(255,179,0,0.55);
  outline-offset: 3px;
  border-radius: 8px;
}

.container{
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
}


.site-header{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;

  border-bottom: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(14px);

  box-shadow: 0 14px 50px rgba(0,0,0,0.20);
}

.site-header .container{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 18px;
  padding: 14px 0;
}

.brand{
  display:flex;
  align-items:center;
  gap: 12px;
  min-width: 260px;
}

.brand__mark{
  width: 46px;
  height: 46px;
  display:grid;
  place-items:center;

  border-radius: 14px;

  background: radial-gradient(120px 60px at 30% 30%, rgba(255,179,0,0.26), rgba(255,179,0,0.08));
  border: 1px solid rgba(255,179,0,0.28);

  box-shadow: var(--shadow-sm);
  font-size: 20px;
}

.brand__text{ min-width: 0; }

.brand__title{
  font-weight: 760;
  font-size: 16px;
  letter-spacing: 0.2px;
}

.brand__subtitle{
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.meta{
  display:flex;
  flex-direction:column;
  gap: 6px;
  text-align:right;
  min-width: 220px;
}

.meta__item{
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.meta__label{ opacity: 0.86; }
.meta__value{ color: var(--text); }



.layout{
  display:grid;
  grid-template-columns: var(--toc-width) 1fr;
  gap: 22px;
  padding: calc(var(--header-h) + 18px) 0 56px;
}

.toc{
  position: sticky;
  top: calc(var(--header-h) + 14px);
  align-self: start;

  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);

  padding: 16px 14px;
  box-shadow: var(--shadow);

  max-height: calc(100vh - (var(--header-h) + 34px));
  overflow: auto;
  overflow-wrap: anywhere;

  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.22) transparent;
}

.toc::-webkit-scrollbar{ width: 10px; }
.toc::-webkit-scrollbar-track{ background: transparent; }
.toc::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.14);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.toc__title{
  display:flex;
  align-items:center;
  justify-content:space-between;

  font-weight: 780;
  font-size: 13px;
  letter-spacing: 0.3px;

  margin: 0 2px 12px;
  color: var(--text);
}

.toc__title::after{
  content:"";
  height:1px;
  flex:1;
  margin-left: 10px;
  background: linear-gradient(90deg, rgba(255,179,0,0.35), transparent 70%);
  opacity: 0.9;
}

.toc ul{
  list-style:none;
  margin:0;
  padding:0;
}

.toc ul ul{
  padding-left: 14px;
  margin-top: 8px;
  border-left: 1px solid rgba(255,255,255,0.10);
}

.toc li{
  margin: 7px 0;
}

.toc a{
  display:block;
  padding: 6px 8px;
  border-radius: 10px;

  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;

  transition: background 120ms ease, color 120ms ease, transform 120ms ease;
}

.toc a:hover{
  background: rgba(255,255,255,0.06);
  color: var(--text);
  text-decoration: none;
}

.toc a:active{
  transform: translateY(0.5px);
}

.toc a:focus-visible{
  outline: 2px solid rgba(255,179,0,0.55);
  outline-offset: 2px;
}

.content{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);

  padding: 26px 26px;
  box-shadow: var(--shadow);

  min-width: 0;
  overflow-wrap: anywhere;
}

.content > :first-child{
  margin-top: 0;
}

.content h2,
.content h3,
.content h4,
.content h5{
  scroll-margin-top: calc(var(--header-h) + 26px);
}

.content h2{
  font-size: 20px;
  margin: 26px 0 12px;
  padding-top: 22px;

  border-top: 1px solid rgba(255,255,255,0.10);

  letter-spacing: 0.2px;
}

.content h3{
  font-size: 17px;
  margin: 20px 0 10px;
  color: var(--text);
}

.content h4{
  font-size: 15px;
  margin: 16px 0 8px;
  color: var(--text);
}

.content h5{
  font-size: 14px;
  margin: 14px 0 8px;
  color: var(--muted-2);
  font-weight: 700;
}

.content p{
  margin: 10px 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.content h2 + p,
.content h3 + p,
.content h4 + p{
  margin-top: 8px;
}

.content ul,
.content ol{
  margin: 12px 0 12px 22px;
  padding: 0;
}

.content li{
  margin: 7px 0;
}

.content p.dash{
  margin: 10px 0;
  padding: 10px 12px 10px 14px;

  border-left: 3px solid rgba(255,179,0,0.42);
  background: rgba(255,255,255,0.04);

  border-radius: 12px;

  color: var(--text);
}

.content blockquote{
  margin: 14px 0;
  padding: 12px 14px;

  border-left: 3px solid rgba(125, 211, 252, 0.40);
  background: rgba(125, 211, 252, 0.06);

  border-radius: 12px;

  color: var(--text);
}

.content hr{
  border:0;
  border-top: 1px solid rgba(255,255,255,0.10);
  margin: 20px 0;
}

.content code{
  font-family: var(--mono);
  font-size: 0.92em;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
}

.content table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 14px 0;

  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  overflow: hidden;
}

.content th,
.content td{
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.content tr:last-child td{ border-bottom: 0; }

.content th{
  background: rgba(255,255,255,0.06);
  font-weight: 760;
  color: var(--text);
}

.doc-footer{
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.10);
  color: var(--muted);
  font-size: 12px;
}

.doc-footer__hint{
  background: rgba(255,179,0,0.08);
  border: 1px solid rgba(255,179,0,0.18);
  border-radius: 14px;
  padding: 12px 14px;
}


.site-footer{
  border-top: 1px solid rgba(255,255,255,0.10);
  padding: 22px 0;
  color: var(--muted);
  font-size: 12px;
}

.site-footer__text{
  opacity: 0.92;
}


@media (max-width: 1100px){
  :root{ --toc-width: 320px; }
}

@media (max-width: 980px){
  :root{ --header-h: 124px; }

  .layout{
    grid-template-columns: 1fr;
    gap: 0;
    padding: calc(var(--header-h) + 12px) 0 40px;
  }

  .toc{
    display: none;
  }

  .content{
    padding: 20px 18px;
    border-radius: 16px;
  }

  .site-header .container{
    padding: 12px 0;
  }

  .site-header .container{
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .brand{
    min-width: 0;
    flex: 1 1 260px;
  }

  .meta{
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px 14px;

    width: 100%;
    min-width: 0;

    text-align: left;
    margin-top: 6px;

    padding-top: 6px;
    border-top: 1px solid rgba(255,255,255,0.10);
  }

  .meta__item{
    font-size: 11px;
    line-height: 1.35;

    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 520px){
  :root{ --header-h: 148px; }

  .container{
    width: calc(100% - 22px);
  }

  .brand__subtitle{
    display:none;
  }

  .brand__mark{
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  .content h2{
    font-size: 18px;
  }

  .meta{
    flex-direction: column;
    gap: 6px;
  }
}

@media (max-width: 520px){
  .container{
    width: calc(100% - 22px);
  }

  .brand__subtitle{
    display:none;
  }

  .brand__mark{
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  .content h2{
    font-size: 18px;
  }

  .meta{
    flex-direction: column;
    gap: 6px;
  }
}

@media print{
  :root{
    --bg:#ffffff;
    --text:#111827;
    --muted:#374151;
    --border: rgba(0,0,0,0.14);
    --panel: #ffffff;
    --link: #111827;
  }

  body{
    background: #ffffff !important;
    color: #111827 !important;
  }

  .site-header{
    position: relative;
    background: #ffffff;
    border-bottom: 1px solid rgba(0,0,0,0.14);
    box-shadow: none;
  }

  .toc{
    display:none;
  }

  .layout{
    grid-template-columns: 1fr;
    padding: 0;
  }

  .content{
    background: #ffffff;
    border: none;
    box-shadow: none;
    padding: 0;
  }

  a{
    text-decoration: underline;
  }
}
