html {
  scroll-behavior: smooth;
}

body.app {
  display: flex;
  background: var(--bg);
}

.app ::selection {
  background: var(--accent);
  color: var(--on-accent);
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  height: 60px;
  background: rgba(16, 22, 29, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 0 20px;
}

.app .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
}

.logo::before {
  content: "";
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: url("/assets/icons/logo.png") center / cover no-repeat;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.app .nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--t-fast);
}

.app .nav-link:hover {
  background: var(--accent-strong);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 38px;
  height: 38px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform var(--t), opacity var(--t);
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.sidebar {
  position: fixed;
  top: 60px;
  left: 0;
  z-index: 90;
  width: 260px;
  height: calc(100vh - 60px);
  padding: 22px 14px;
  overflow-y: auto;
  background: var(--bg-raised);
  border-right: 1px solid var(--line);
}

.sidebar-header {
  padding: 0 10px 12px;
}

.sidebar-header h3,
.sidebar-title {
  display: block;
  margin: 0;
  color: var(--text-3);
  font-size: 0.78rem;
  font-weight: 600;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app .sidebar-link {
  display: block;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--text-2);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast);
}

.app .sidebar-link:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.app .sidebar-link.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 12px 0;
  padding: 14px 0 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.sidebar-title {
  padding: 0 10px 6px;
}

.docs-main {
  flex: 1;
  min-width: 0;
  max-width: 920px;
  margin: 60px auto 0 260px;
  padding: 44px 48px 72px;
}

.page {
  display: none;
  animation: docs-rise 0.25s ease-out;
}

.page.active {
  display: block;
}

@keyframes docs-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.page-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.page-header h1 {
  margin: 0 0 8px;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-subtitle {
  margin: 0;
  color: var(--text-2);
  font-size: 1.02rem;
}

.app .page-subtitle a,
.app .inline-link {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}

.app .page-subtitle a:hover,
.app .inline-link:hover {
  text-decoration: underline;
}

.content {
  color: var(--text-2);
  line-height: 1.75;
}

.content h2 {
  margin: 36px 0 12px;
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

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

.content h3 {
  margin: 24px 0 8px;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 600;
}

.content h4 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 600;
}

.content p {
  margin: 0 0 14px;
}

.content ul,
.content ol {
  margin: 0 0 18px;
  padding-left: 22px;
}

.content li {
  margin-bottom: 6px;
}

.content li::marker {
  color: var(--accent);
}

.content b,
.content strong {
  color: var(--text);
  font-weight: 600;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 20px 0 28px;
}

.feature-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color var(--t-fast), transform var(--t-fast);
}

.feature-card:hover {
  border-color: rgba(31, 200, 219, 0.4);
}

.content .feature-card h3 {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 1rem;
}

.feature-card p {
  margin: 0;
  color: var(--text-2);
  font-size: 0.92rem;
}

.info-box,
.warning-box {
  margin: 22px 0;
  padding: 16px 18px;
  border-radius: var(--radius-md);
}

.info-box {
  background: var(--accent-soft);
  border: 1px solid rgba(31, 200, 219, 0.25);
}

.content .info-box h4 {
  color: var(--accent);
}

.warning-box {
  background: var(--warning-soft);
  border: 1px solid rgba(245, 181, 68, 0.3);
}

.content .warning-box h4 {
  color: var(--warning);
}

.info-box p,
.warning-box p {
  margin: 0;
  color: var(--text);
  font-size: 0.94rem;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color var(--t-fast);
}

.faq-item:hover,
.faq-item.active {
  border-color: var(--line-strong);
}

.faq-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 16px 20px;
  border: none;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.faq-toggle:hover {
  color: var(--accent);
}

.faq-toggle::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform var(--t);
}

.faq-item.active .faq-toggle::after {
  transform: rotate(-135deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
  max-height: 1000px;
  padding: 0 20px 18px;
}

.faq-answer p {
  margin: 0;
  font-size: 0.94rem;
}

@media (max-width: 860px) {
  .docs-main {
    margin-left: 0;
    padding: 32px 16px 56px;
  }

  .sidebar {
    left: -270px;
    z-index: 95;
    box-shadow: var(--shadow);
    transition: left var(--t);
  }

  .sidebar.open {
    left: 0;
  }

  .menu-toggle {
    display: flex;
    order: -1;
  }

  .navbar-container {
    padding: 0 16px;
  }

  .logo {
    margin-right: auto;
  }
}

@media (max-width: 480px) {
  .navbar-container {
    gap: 8px;
    padding: 0 12px;
  }

  .app .logo {
    gap: 8px;
    font-size: 0.92rem;
  }

  .app .nav-link {
    padding: 7px 10px;
    font-size: 0.78rem;
  }

  .feature-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
