@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&display=swap");

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

:root {
  --sidebar-w: 270px;
  --text: #41474a;
  --text-light: #72787b;
  --heading: #303537;
  --accent: #222;
  --accent-dark: #222;
  --border: #e2e2df;
  --gray-bg: #f6f6f4;
  --gray-hover: #eeeeeb;
  --radius: 8px;
}

html {
  scroll-behavior: smooth;
}

body {
  display: flex;
  min-height: 100vh;
  color: var(--text);
  background: #fff;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.9;
}

/* Sidebar */
#sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-w);
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}

#sidebar::-webkit-scrollbar {
  width: 4px;
}

#sidebar::-webkit-scrollbar-track {
  background: transparent;
}

#sidebar::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c9c9c6;
}

.sidebar-header {
  flex-shrink: 0;
  padding: 30px 24px 22px;
  border-bottom: 1px solid var(--border);
}

.sidebar-header a {
  display: block;
  text-decoration: none;
}

.sidebar-header .brand {
  margin-bottom: 6px;
  color: #7a8083;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-header .logo-title {
  color: var(--heading);
  font-size: 27px;
  font-weight: 700;
  line-height: 1.4;
  transition: color 0.18s ease;
}

.sidebar-header a:hover .logo-title {
  color: var(--accent-dark);
}

.sidebar-header .subtitle {
  margin-top: 4px;
  color: #7a8083;
  font-size: 13px;
}

#sidebar nav {
  flex: 1;
  padding: 12px 0 0;
}

.sidebar-footer {
  flex-shrink: 0;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #7a8083;
  font-size: 13px;
  text-decoration: none;
  transition: color 0.18s ease;
}

.sidebar-footer a:hover {
  color: var(--accent-dark);
}

.nav-top,
.nav-group-toggle {
  position: relative;
  width: calc(100% - 24px);
  min-height: 48px;
  margin: 3px 12px;
  border-radius: 7px;
  color: #3e4447;
  font-size: 15px;
  transition:
    color 0.18s ease,
    background 0.18s ease;
}

.nav-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  text-decoration: none;
}

.nav-top .nav-icon {
  font-size: 13px;
  opacity: 0.65;
}

.nav-group {
  border: 0;
}

.nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 12px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.nav-top:hover,
.nav-group-toggle:hover {
  color: var(--heading);
  background: #f2f2f0;
}

.nav-top.active,
.nav-group-toggle.active {
  color: var(--heading);
  background: #f0f0ed;
  font-weight: 700;
}

.nav-top.active::before,
.nav-group-toggle.active::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 3px;
  border-radius: 999px;
  background: var(--accent);
}

.nav-group-toggle .toggle-label {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
}

.nav-group-toggle .num {
  flex-shrink: 0;
  min-width: 38px;
  padding: 4px 7px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

.nav-group-toggle .arrow {
  flex-shrink: 0;
  font-size: 10px;
  opacity: 0.5;
  transition: transform 0.3s ease;
}

.nav-group.open .arrow {
  transform: rotate(90deg);
}

.nav-sub {
  max-height: 0;
  margin: 0 12px 5px;
  overflow: hidden;
  border-radius: 7px;
  background: var(--gray-bg);
  transition: max-height 0.35s ease;
}

.nav-group.open .nav-sub {
  max-height: 500px;
}

.nav-sub a {
  display: block;
  min-height: 42px;
  margin: 2px 6px;
  padding: 10px 12px 10px 34px;
  border: 0;
  border-radius: 7px;
  color: #7a8083;
  font-size: 14px;
  line-height: 1.55;
  text-decoration: none;
  transition:
    color 0.18s ease,
    background 0.18s ease;
}

.nav-sub a:hover {
  color: var(--text);
  background: var(--gray-hover);
}

.nav-sub a.active {
  color: var(--accent-dark);
  background: var(--gray-hover);
  font-weight: 700;
}

/* Main layout */
#main {
  flex: 1;
  min-height: 100vh;
  margin-left: var(--sidebar-w);
  background: #fff;
}

.page-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 48px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-light);
  font-size: 14px;
}

.breadcrumb a {
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.18s ease;
}

.breadcrumb a:hover {
  color: var(--accent-dark);
}

.breadcrumb .sep {
  font-size: 10px;
  opacity: 0.45;
}

.breadcrumb .current {
  color: var(--text);
  font-weight: 700;
}

.content-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 52px 64px 100px;
}

.page-section {
  padding: 0;
}

/* Typography */
.page-section h1 {
  margin-bottom: 34px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
  color: var(--heading);
  font-size: 27px;
  font-weight: 700;
  line-height: 1.45;
}

.page-section h1 .sec-num {
  display: inline-block;
  margin-right: 10px;
  padding: 6px 12px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  vertical-align: 2px;
}

.page-section h2 {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 52px 0 20px;
  padding-top: 8px;
  scroll-margin-top: 60px;
  color: #363b3e;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.55;
}

.page-section h2::before {
  content: "";
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.page-section h3 {
  margin: 34px 0 12px;
  color: #383e41;
  font-size: 18px;
  font-weight: 700;
}

.page-section p,
.page-section li {
  line-height: 1.95;
}

.page-section p {
  margin-bottom: 18px;
}

.page-section ul,
.page-section ol {
  margin: 14px 0 20px 24px;
}

.page-section strong {
  color: #383e41;
  font-weight: 700;
}

.page-section a {
  color: var(--accent-dark);
  text-decoration: none;
  border-bottom: 1px solid rgba(34, 34, 34, 0.35);
}

.page-section a:hover {
  border-bottom-color: var(--accent-dark);
}

hr {
  margin: 42px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #ececea;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

/* Information boxes */
.toc,
blockquote,
.tip,
.intro-desc,
.support-box {
  border: 0;
  border-radius: var(--radius);
  background: var(--gray-bg);
}

.toc {
  margin: 22px 0 30px;
  padding: 22px;
}

.toc h3,
.page-section .toc h3 {
  margin: 0 0 12px 9px;
  color: var(--text-light);
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

.toc li {
  margin: 0;
}

.toc li + li {
  margin-top: 7px;
}

.toc li a {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-height: 52px;
  padding: 11px 13px;
  border: 0;
  border-radius: var(--radius);
  color: var(--text);
  transition:
    background 0.18s ease,
    transform 0.18s ease;
}

.toc li a:hover {
  border: 0;
  background: #fff;
  color: var(--heading);
  transform: translateX(2px);
}

.toc-num {
  flex-shrink: 0;
  min-width: 48px;
  margin-top: 1px;
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
}

.toc-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.65;
}

blockquote {
  position: relative;
  margin: 18px 0;
  padding: 18px 22px 18px 25px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.9;
}

blockquote::before,
.intro-desc::before {
  content: "";
  position: absolute;
  left: 12px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
}

blockquote::before {
  top: 16px;
  bottom: 16px;
}

.tip {
  display: flex;
  gap: 14px;
  margin: 18px 0;
  padding: 19px 20px;
  font-size: 15px;
  line-height: 1.9;
}

.tip .tip-icon {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: #fff;
  color: var(--accent-dark);
  font-size: 18px;
}

.tip .tip-body {
  flex: 1;
}

.tip .tip-body p {
  margin-bottom: 8px;
}

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

.tip .tip-body ul {
  margin: 5px 0 5px 20px;
}

.intro-desc {
  position: relative;
  margin: 24px 0;
  padding: 25px 28px;
  font-size: 16px;
  line-height: 1.95;
}

.intro-desc::before {
  top: 20px;
  bottom: 20px;
}

.simply-intro {
  margin: 30px 0 36px;
}

.simply-intro img {
  display: block;
  width: min(100%, 980px);
  height: auto;
  margin: 0 auto;
}

.simply-intro-copy {
  max-width: 760px;
  margin: 28px auto 0;
  padding: 24px 28px;
  border-radius: var(--radius);
  background: #f7f7f4;
}

.simply-intro-copy p {
  margin-bottom: 12px;
  color: #4a4d4f;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.95;
}

.support-box {
  margin-top: 16px;
  padding: 28px;
  text-align: center;
}

.support-box p {
  margin: 0;
}

/* Tables */
.table-wrap {
  margin: 20px 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 15px 17px;
  border: 0;
  border-bottom: 1px solid var(--border);
  font-size: 16px;
  line-height: 1.9;
  text-align: left;
  vertical-align: top;
}

tr:last-child th,
tr:last-child td {
  border-bottom: 0;
}

tbody th[scope="row"] {
  width: 32%;
  min-width: 180px;
  border-right: 1px solid var(--border);
  background: #f2f2ef;
  color: #4b5053;
  font-weight: 700;
}

tr:hover td {
  background: #fafaf9;
}

tr:hover th[scope="row"] {
  background: #ecece8;
}

/* Top-page links */
.keyword-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0 30px;
}

.keyword-links a {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 10px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: #4b5053;
  font-size: 15px;
  line-height: 1.45;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.keyword-links a::before {
  content: "#";
  margin-right: 5px;
  color: var(--accent);
  font-weight: 700;
}

.keyword-links a:hover {
  border-color: #c8c8c4;
  background: #f3f3f0;
  color: var(--heading);
}

/* Previous / next navigation */
.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 48px;
}

.page-nav .spacer {
  flex: 1;
}

.page-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 11px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: #4b5053;
  font-size: 15px;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.page-nav a:hover {
  border-color: #c8c8c4;
  background: #f3f3f0;
  color: var(--heading);
  transform: translateY(-1px);
}

/* Mobile menu */
#menu-toggle {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 21px;
  cursor: pointer;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 99;
  display: none;
  background: rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* Responsive */
@media (max-width: 1100px) {
  .content-inner {
    padding-right: 44px;
    padding-left: 44px;
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-w: 260px;
  }

  .content-inner {
    padding: 42px 32px 80px;
  }
}

@media (max-width: 680px) {
  #sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  #sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
  }

  #menu-toggle {
    display: flex;
  }

  #main {
    margin-left: 0;
  }

  .page-header {
    padding: 0 16px 0 66px;
  }

  .content-inner {
    padding: 30px 20px 64px;
  }

  .page-section h1 {
    font-size: 23px;
  }

  .page-section h1 .sec-num {
    margin-bottom: 6px;
    font-size: 16px;
  }

  .page-section h2 {
    font-size: 20px;
  }

  .simply-intro {
    margin-top: 24px;
  }

  .simply-intro-copy {
    padding: 20px;
  }

  .simply-intro-copy p {
    font-size: 15px;
    line-height: 1.85;
  }

  th,
  td,
  tbody th[scope="row"] {
    font-size: 15px;
  }

  tbody th[scope="row"] {
    width: 38%;
    min-width: 130px;
  }

  .page-nav {
    flex-wrap: wrap;
  }
}
