/* ========================================
   BASE Edition Manual - Shared Styles
======================================== */

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

:root {
  --color-bg: #ffffff;
  --color-sidebar-bg: #f7f6f3;
  --color-sidebar-border: #e8e5e0;
  --color-sidebar-text: var(--color-text-light);
  --color-sidebar-text-hover: var(--color-text);
  --color-sidebar-text-muted: var(--color-text-muted);
  --color-sidebar-hover-bg: var(--color-sidebar-border);
  --color-sidebar-active-bg: #eceae6;
  --color-accent: #2d6cdf;
  --color-accent-hover: #1a52b8;
  --color-text: #37352f;
  --color-text-light: #6b6860;
  --color-text-muted: #9b9791;
  --color-border: #e9e9e7;
  --color-table-header: #f7f6f3;
  --color-aside-bg: #f0f7ff;
  --color-aside-border: #b8d4f7;
  --color-hr: #e9e9e7;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
    "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --sidebar-width: 260px;
  --content-max: 820px;
  --header-h: 56px;
}

html {
  font-size: 16px;
  scroll-behavior: auto; /* JS handles smooth scroll */
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  display: flex;
  min-height: 100vh;
}

/* ========================================
   Sidebar
======================================== */

.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--color-sidebar-bg);
  border-right: 1px solid var(--color-sidebar-border);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-logo {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--color-sidebar-border);
  flex-shrink: 0;
}

.sidebar-logo a {
  text-decoration: none;
  color: var(--color-sidebar-text-hover);
}

.sidebar-logo .brand {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-sidebar-text-muted);
  margin-bottom: 4px;
}

.sidebar-logo .title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-sidebar-text-hover);
  line-height: 1.3;
}

/* ---- Sidebar Nav ---- */

.sidebar-nav {
  padding: 12px 8px;
  flex: 1;
}

.sidebar-nav-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-sidebar-text-muted);
  padding: 8px 10px 6px;
}

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

/* Each page entry */
.nav-item {
  margin-bottom: 1px;
}

.nav-row {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 4px;
}

.nav-page-link {
  flex: 1;
  display: block;
  padding: 6px 6px 6px 10px;
  font-size: 14px;
  color: var(--color-sidebar-text);
  text-decoration: none;
  border-radius: 5px;
  transition: background 0.15s, color 0.15s;
  line-height: 1.4;
  min-width: 0;
}

.nav-page-link:hover {
  background: var(--color-sidebar-hover-bg);
  color: var(--color-sidebar-text-hover);
  text-decoration: none;
}

.nav-page-link.active {
  color: var(--color-sidebar-text-hover);
  font-weight: 600;
  background: var(--color-sidebar-active-bg);
}

/* Toggle button (chevron) */
.nav-toggle {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  color: var(--color-sidebar-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}

.nav-toggle:hover {
  background: var(--color-sidebar-hover-bg);
  color: var(--color-sidebar-text-hover);
}

.nav-toggle svg {
  display: block;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item.open .nav-toggle svg {
  transform: rotate(180deg);
}

/* Sub-nav (accordion body) */
.nav-sub {
  list-style: none;
  margin: 0;
  padding: 0 0 0 16px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition:
    max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.25s ease;
}

.nav-item.open .nav-sub {
  opacity: 1;
  /* max-height set by JS */
}

.nav-sub li {
  margin: 0;
}

.nav-sub li a {
  display: block;
  padding: 4px 8px 4px 12px;
  font-size: 12.5px;
  color: var(--color-sidebar-text-muted);
  text-decoration: none;
  border-radius: 4px;
  border-left: 2px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  line-height: 1.45;
  margin: 1px 0;
}

.nav-sub li a:hover {
  background: var(--color-sidebar-hover-bg);
  color: var(--color-sidebar-text-hover);
  text-decoration: none;
}

.nav-sub li a.active {
  color: var(--color-sidebar-text-hover);
  font-weight: 600;
  border-left-color: transparent;
  background: var(--color-sidebar-active-bg);
}

/* Sidebar footer */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--color-sidebar-border);
  flex-shrink: 0;
}

.sidebar-footer a {
  font-size: 12px;
  color: var(--color-sidebar-text-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

/* ========================================
   Main Content
======================================== */

.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  
}

.page-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: 0 48px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.breadcrumb a {
  color: var(--color-text-muted);
  text-decoration: none;
}

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

.breadcrumb .sep {
  font-size: 11px;
}

.content {
  padding: 56px 48px 112px;
  max-width: calc(var(--content-max) + 96px);
  width: 100%;


      max-width: 860px;
    margin: 0 auto;
    padding: 56px 48px 112px;


}

/* ========================================
   Typography
======================================== */

h1 {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 40px;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

h2 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 72px;
  margin-bottom: 24px;
  color: var(--color-text);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
  scroll-margin-top: calc(var(--header-h) + 16px);
}

h3 {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 44px;
  margin-bottom: 18px;
  color: var(--color-text);
}

h4 {
  font-size: 15px;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--color-text);
}

p {
  margin-bottom: 22px;
  font-size: 15px;
  line-height: 1.75;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

strong {
  font-weight: 600;
}

ul, ol {
  margin-bottom: 26px;
  padding-left: 24px;
}

li {
  font-size: 15px;
  line-height: 1.75;
  margin-bottom: 8px;
}

.content > *:last-child {
  margin-bottom: 0;
}

/* ========================================
   Callout / Aside Block
======================================== */

.callout {
  background: var(--color-aside-bg);
  border: 1px solid var(--color-aside-border);
  border-radius: 6px;
  padding: 14px 16px 14px 44px;
  margin: 28px 0 34px;
  font-size: 14px;
  line-height: 1.7;
  position: relative;
}

.callout::before {
  content: "💡";
  position: absolute;
  left: 14px;
  top: 14px;
  font-size: 16px;
  line-height: 1;
}

.callout p {
  margin: 0;
  font-size: 14px;
}

.callout p + p {
  margin-top: 8px;
}

/* ========================================
   Blockquote
======================================== */

blockquote {
  border-left: 3px solid var(--color-border);
  padding: 4px 0 4px 16px;
  margin: 24px 0 30px;
  color: var(--color-text-light);
  font-size: 15px;
}

blockquote p {
  margin: 0;
  font-size: 15px;
}

/* ========================================
   Tables
======================================== */

.table-wrap {
  overflow-x: auto;
  margin: 30px 0 42px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 500px;
}

tbody tr {
  border-bottom: 1px solid var(--color-border);
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:hover {
  background: #fafafa;
}

th,
td {
  padding: 10px 14px;
  vertical-align: top;
  line-height: 1.65;
  font-size: 14px;
  text-align: left;
}

th:first-child,
td:first-child {
  font-weight: 600;
  white-space: normal;
  min-width: 160px;
  color: var(--color-text);
  background: var(--color-table-header);
  border-right: 1px solid var(--color-border);
  width: 32%;
}

/* ========================================
   Images
======================================== */

.content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  margin: 28px 0 36px;
  display: block;
}

/* ========================================
   HR / Divider
======================================== */

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

pre {
  margin: 28px 0 36px;
}

/* ========================================
   Hero (index only)
======================================== */

.hero {
}

.hero h1 {
  font-size: 30px;
  margin-bottom: 16px;
}

.hero .tagline {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 0;
}

.hero-image {
  margin-top: 40px;
}

.hero-image img {
  max-width: 100%;
  border-radius: 8px;
  border: none;
  box-shadow: 0 0px 10px rgba(0,0,0,0.1);
}

/* ========================================
   Demo Links
======================================== */

.demo-grid {
  display: grid;
  grid-template-columns: minmax(0, 80%);
  justify-content: center;
  gap: 28px;
  margin: 30px 0 56px;
}

.demo-card {
  display: block;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--color-text);
  font-size: 14px;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  background: #fff;
}

.demo-card img {
  display: block;
  width: 100%;
  object-fit: contain;
  object-position: top;
  border-radius: 0;
  border: none;
  margin: 0;
}

.demo-card-body {
  padding: 16px 18px;
}

.demo-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 16px rgba(45,108,223,0.12);
  text-decoration: none;
  transform: translateY(-2px);
}

.demo-card:hover .demo-card-body {
  color: var(--color-accent);
}

.demo-card .num {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

/* ========================================
   TOC
======================================== */

.toc {
  background: var(--color-sidebar-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 24px;
  margin: 36px 0 56px;
}

.toc h3 {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: none;
  padding: 0;
}

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

.toc li {
  margin: 0;
}

.toc li a {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--color-text);
  text-decoration: none;
  transition: background 0.15s;
}

.toc li a:hover {
  background: var(--color-sidebar-border);
}

.toc li a .toc-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-accent);
  background: rgba(45,108,223,0.08);
  border-radius: 4px;
  padding: 2px 7px;
  white-space: nowrap;
  margin-top: 1px;
}

.toc li a .toc-title {
  line-height: 1.4;
}

/* ========================================
   News / Announcement
======================================== */

.news-box {
  background: #fffbf0;
  border: 1px solid #f0d080;
  border-radius: 6px;
  padding: 20px 24px;
  margin: 30px 0 48px;
}

.news-box h3 {
  font-size: 14px;
  font-weight: 600;
  color: #8a6800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 12px;
  border: none;
  padding: 0;
}

.news-item {
  font-size: 14px;
  line-height: 1.65;
  margin-bottom: 8px;
  color: var(--color-text);
}

.news-item:last-child {
  margin-bottom: 0;
}

/* ========================================
   Support Box
======================================== */

.support-box {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 24px;
  margin: 36px 0 56px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.support-box .support-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.support-box .support-text h3 {
  margin: 0 0 6px;
  font-size: 16px;
  border: none;
  padding: 0;
}

.support-box .support-text p {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--color-text-light);
}

.btn {
  display: inline-block;
  padding: 8px 18px;
  background: var(--color-accent);
  color: #fff;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s;
}

.btn:hover {
  background: var(--color-accent-hover);
  text-decoration: none;
  color: #fff;
}

/* ========================================
   Page Navigation (prev/next)
======================================== */

.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--color-border);
}

.page-nav a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 18px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--color-text);
  min-width: 180px;
  transition: border-color 0.15s, box-shadow 0.15s;
  flex: 1;
}

.page-nav a:hover {
  border-color: var(--color-accent);
  box-shadow: 0 2px 10px rgba(45,108,223,0.1);
  text-decoration: none;
}

.page-nav a.next {
  text-align: right;
}

.page-nav .nav-label {
  font-size: 11px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.page-nav .nav-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-accent);
}

/* ========================================
   Hamburger
======================================== */

.hamburger {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 8px;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
}

/* ========================================
   Responsive
======================================== */

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.12);
  }

  .main {
    margin-left: 0;
  }

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

  .content {
    padding: 40px 20px 80px;
  }

  .hero {
    padding: 40px 20px;
  }

  .hero h1 {
    font-size: 26px;
  }

  .hamburger {
    display: flex;
  }

  h1 { font-size: 24px; }
  h2 {
    font-size: 19px;
    margin-top: 56px;
    margin-bottom: 20px;
  }
  h3 {
    margin-top: 36px;
    margin-bottom: 16px;
  }

  p {
    margin-bottom: 20px;
  }

  .callout,
  blockquote {
    margin: 24px 0 30px;
  }

  .table-wrap {
    margin: 26px 0 36px;
  }

  th:first-child,
  td:first-child {
    min-width: 130px;
    width: 32%;
  }

  .page-nav {
    flex-direction: column;
  }
}

