@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  --primary: #1880d3;
  --primary-dark: #076fbf;
  --primary-darker: #054f88;
  --secondary: #ff8600;
  --canvas: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #eef3fb;
  --text: #1f2a44;
  --muted: #69758d;
  --line: #dbe3ef;
  --shadow: 0 12px 32px rgba(31, 42, 68, 0.09);
  --sidebar-width: 310px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--canvas);
  font-family: Manrope, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-dark); }
.site-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; }
.site-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 24px 18px;
  color: #fff;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 58%, var(--primary-darker) 100%);
  box-shadow: 8px 0 24px rgba(5, 79, 136, 0.12);
}
.brand-block { display: flex; align-items: center; gap: 10px; padding: 4px 10px 20px; border-bottom: 1px solid rgba(255,255,255,.2); color: #fff; font-size: 1rem; font-weight: 800; text-decoration: none; }
.brand-block img { width: 128px; height: auto; object-fit: contain; filter: brightness(0) invert(1); }
.brand-block span { padding-left: 10px; border-left: 1px solid rgba(255,255,255,.35); white-space: nowrap; }
.search-box { padding: 18px 8px 10px; }
.search-box label { display: block; margin-bottom: 7px; color: #d9edff; font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.search-box input { width: 100%; height: 39px; padding: 0 11px; color: var(--text); border: 0; border-radius: 8px; outline: 2px solid transparent; font: inherit; font-size: .85rem; }
.search-box input:focus { outline-color: var(--secondary); }
.guide-nav { display: flex; flex-direction: column; gap: 4px; padding: 4px 0 16px; }
.tree-section { border-radius: 8px; }
.tree-section[hidden] { display: none; }
.tree-section summary { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; border-radius: 8px; list-style: none; transition: background .15s ease; }
.tree-section summary::-webkit-details-marker { display: none; }
.tree-section summary:hover { background: rgba(255,255,255,.1); }
.tree-section summary.is-active { background: #fff; box-shadow: 0 5px 14px rgba(5,79,136,.2); }
.tree-section summary a { padding: 9px 10px; color: rgba(255,255,255,.92); font-size: .86rem; font-weight: 700; text-decoration: none; }
.tree-section summary.is-active a { color: var(--primary-darker); }
.tree-section summary span { margin-right: 10px; color: rgba(255,255,255,.65); transition: transform .15s ease; }
.tree-section summary.is-active span { color: var(--primary); }
.tree-section[open] summary span { transform: rotate(180deg); }
.tree-articles { display: flex; flex-direction: column; margin: 4px 0 7px 17px; border-left: 1px solid rgba(255,255,255,.25); }
.tree-article-link { padding: 5px 10px 5px 14px; color: rgba(255,255,255,.72); font-size: .76rem; line-height: 1.35; text-decoration: none; }
.tree-article-link:hover { color: #fff; }
.external-links { display: grid; gap: 7px; margin: 4px 8px; }
.external-link { display: flex; justify-content: space-between; padding: 10px 11px; color: #fff; border: 1px solid rgba(255,255,255,.32); border-radius: 8px; font-size: .8rem; font-weight: 700; text-decoration: none; }
.external-link:hover { background: rgba(255,255,255,.1); }
.mobile-header { display: none; }
.site-main { min-width: 0; padding: 40px clamp(24px, 5vw, 72px) 72px; }
.content-card { width: min(100%, 1040px); margin: 0 auto; padding: clamp(30px, 5vw, 64px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.content-card h1, .content-card h2, .content-card h3 { color: var(--text); line-height: 1.24; scroll-margin-top: 24px; }
.content-card h1 { margin: 0 0 16px; font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; letter-spacing: -.035em; }
.content-card h2 { margin: 3rem 0 1rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: 1.55rem; }
.content-card h3 { margin: 2rem 0 .6rem; color: var(--primary-darker); font-size: 1.08rem; }
.content-card p, .content-card li { font-size: 1rem; line-height: 1.75; }
.content-card p { margin: .75rem 0 1.1rem; }
.content-card ul, .content-card ol { padding-left: 1.35rem; }
.content-card li { margin: .38rem 0; }
.content-card > p:first-of-type { color: var(--muted); font-size: 1.12rem; line-height: 1.7; }
.content-card strong { font-weight: 700; }
.content-card blockquote { margin: 1.4rem 0; padding: 16px 20px; border-left: 4px solid var(--secondary); border-radius: 0 8px 8px 0; background: #fff7ed; }
.content-card blockquote p { margin: 0; color: #6c4a20; font-size: .95rem; }
.content-card img { display: block; width: 100%; max-width: 980px; margin: 1.2rem 0 1.8rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 14px 30px rgba(31,42,68,.12); }
.content-card code { padding: .13rem .38rem; border-radius: 5px; background: var(--surface-soft); font-size: .9em; }
.breadcrumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; color: var(--muted); font-size: .78rem; font-weight: 650; }
.breadcrumbs a { text-decoration: none; }
.heading-anchor { margin-left: 8px; color: var(--primary); font-size: .75em; font-weight: 500; text-decoration: none; opacity: 0; }
.content-card h2:hover .heading-anchor, .content-card h3:hover .heading-anchor, .heading-anchor:focus { opacity: .65; }
.article-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 52px; padding-top: 24px; border-top: 1px solid var(--line); }
.article-pager > a { display: flex; flex-direction: column; gap: 5px; padding: 14px 16px; color: var(--text); border: 1px solid var(--line); border-radius: 9px; text-decoration: none; transition: border .15s ease, transform .15s ease; }
.article-pager > a:last-child { text-align: right; }
.article-pager > a:hover { border-color: var(--primary); transform: translateY(-1px); }
.article-pager span { color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.article-pager strong { color: var(--primary-dark); font-size: .88rem; }
.site-footer { width: min(100%, 1040px); margin: 22px auto 0; color: var(--muted); font-size: .75rem; text-align: center; }
@media (max-width: 860px) {
  .site-shell { display: block; }
  .mobile-header { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; height: 58px; padding: 0 14px; background: var(--primary); box-shadow: 0 3px 12px rgba(5,79,136,.2); }
  .mobile-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-size: .85rem; font-weight: 750; text-decoration: none; }
  .mobile-brand img { width: 106px; filter: brightness(0) invert(1); }
  .menu-button { padding: 8px 12px; color: #fff; border: 1px solid rgba(255,255,255,.55); border-radius: 7px; background: transparent; font: inherit; font-size: .8rem; font-weight: 700; }
  .site-sidebar { position: fixed; z-index: 25; top: 58px; bottom: 0; left: 0; width: min(88vw, 330px); height: auto; padding: 18px; transform: translateX(-105%); transition: transform .2s ease; }
  .site-sidebar.is-open { transform: translateX(0); }
  .brand-block { display: none; }
  .search-box { padding-top: 2px; }
  .guide-nav { display: flex; }
  .site-main { padding: 20px 14px 44px; }
  .content-card { padding: 28px 20px; }
}
@media (max-width: 520px) {
  .content-card h1 { font-size: 2rem; }
  .article-pager { grid-template-columns: 1fr; }
}
@media print {
  .site-sidebar, .mobile-header, .article-pager, .site-footer, .heading-anchor { display: none !important; }
  .site-shell { display: block; }
  .site-main { padding: 0; }
  .content-card { width: 100%; padding: 0; border: 0; box-shadow: none; }
  .content-card img { break-inside: avoid; box-shadow: none; }
}
