.toc-sidebar {
  width: 320px;
  min-width: 280px;
  background: #ffffff;
  border-right: 1px solid #f0f0f0;
  padding: 24px;
  z-index: 100;
  transition: transform 0.3s ease;
  overflow-y: auto;
  overflow-x: hidden;
  height: 100vh;
  max-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
}

.toc-logo-section {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f0f0f0;
}

.toc-logo {
  display: flex;
  align-items: center;
}

.toc-logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.toc-logo-link:hover {
  opacity: 0.85;
}

.toc-logo a {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.toc-logo a:hover {
  opacity: 0.8;
}

.toc-logo img {
  max-width: 40px;
  height: auto;
  vertical-align: middle;
}

.toc-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin: 0;
  line-height: 1.2;
  flex: 1;
}

.mobile-close-toc-btn {
  display: none;
  background: transparent;
  border: none;
  font-size: 28px;
  color: rgba(0, 0, 0, 0.65);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  line-height: 1;
  transition: color 0.2s ease;
}

.mobile-close-toc-btn:hover {
  color: #ff9a3c;
}

.toc-header {
  font-size: 16px;
  font-weight: 600;
  color: #000000;
  margin-bottom: 16px;
  margin-top: 0;
}

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

.toc-item {
  margin-bottom: 8px;
}

.toc-link {
  display: block;
  padding: 6px 8px;
  color: #000000;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.5;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.toc-link:hover {
  background: rgba(255, 154, 60, 0.1);
  color: #ff9a3c;
}

.toc-link.active {
  background: #ff9a3c;
  color: #ffffff;
  font-weight: 500;
}

.toc-subitem {
  margin-left: 16px;
  margin-top: 4px;
}

.agreement-content {
  flex: 1;
  min-width: 0;
  padding: 0 32px;
  margin-left: 320px;
  background: #ffffff;
  line-height: 1.8;
  color: #000000;
}

.agreement-content h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 10px;
  text-align: center;
}

.agreement-content h2 {
  font-size: 22px;
  font-weight: 600;
  margin-top: 30px;
  margin-bottom: 15px;
  scroll-margin-top: 20px;
}

.agreement-content h3 {
  font-size: 18px;
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 10px;
  scroll-margin-top: 20px;
}

.agreement-content p {
  margin-bottom: 15px;
  text-align: justify;
}

.agreement-content ul,
.agreement-content ol {
  margin-bottom: 15px;
  padding-left: 30px;
}

.agreement-content li {
  margin-bottom: 8px;
}

.agreement-meta {
  text-align: center;
  margin-bottom: 30px;
  font-size: 14px;
  color: rgba(0, 0, 0, 0.65);
}

.agreement-summary {
  margin: 0 auto 24px;
  max-width: 900px;
  padding: 16px 20px;
  border-radius: 12px;
  background: rgba(255, 154, 60, 0.08);
  border: 1px solid rgba(255, 154, 60, 0.2);
  text-align: left;
}

.agreement-summary p:last-child {
  margin-bottom: 0;
}

.main-layout {
  display: flex;
  min-height: 100vh;
  background: #ffffff;
}

.right-sidebar {
  width: 280px;
  min-width: 280px;
  padding: 24px;
  border-left: 1px solid #f0f0f0;
  position: sticky;
  top: 0;
  height: 100vh;
  background: #ffffff;
}

.right-sidebar .help-section {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.agreement-lang-switcher-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: auto;
}

.agreement-lang-switcher-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  color: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(0, 0, 0, 0.15);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.right-sidebar .help-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  color: rgba(0, 0, 0, 0.65);
}

.agreement-lang-switcher-dropdown,
.right-sidebar .help-dropdown {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  overflow: hidden;
}

.agreement-lang-switcher-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  min-width: 80px;
  display: none;
}

.agreement-lang-switcher-dropdown.open {
  display: block !important;
}

.agreement-lang-switcher-btn:hover,
.right-sidebar .help-btn:hover {
  background: #ff9a3c;
  border-color: #ff9a3c;
  color: #ffffff;
}

.agreement-lang-switcher-dropdown button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  text-align: left;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: #333;
}

.agreement-lang-switcher-dropdown button:first-child {
  border-radius: 8px 8px 0 0;
}

.agreement-lang-switcher-dropdown button:last-child {
  border-radius: 0 0 8px 8px;
}

.agreement-lang-switcher-dropdown button:hover {
  background: #ffe7d1 !important;
}

.agreement-lang-switcher-dropdown button.active {
  background: #ff9a3c !important;
  color: #ffffff !important;
}

.right-sidebar .help-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.right-sidebar .help-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.right-sidebar .help-link {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  text-decoration: none;
  color: #000000;
  transition: background 0.2s ease;
  border-bottom: 1px solid #f0f0f0;
}

.right-sidebar .help-link:last-child {
  border-bottom: none;
}

.right-sidebar .help-link:hover {
  background: rgba(255, 154, 60, 0.1);
}

.right-sidebar .help-link-value {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.65);
  margin-top: 4px;
}

.mobile-toc-toggle-container {
  display: none;
  text-align: center;
  padding: 0 16px;
  margin-bottom: 20px;
}

.mobile-toc-toggle {
  display: none;
  background: linear-gradient(135deg, #ff9a3c 0%, #f08a2c 100%);
  color: #ffffff;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 154, 60, 0.4);
  transition: all 0.2s ease;
  margin: 20px auto;
}

.mobile-toc-toggle:hover {
  background: linear-gradient(135deg, #f08a2c 0%, #e07a1c 100%);
  box-shadow: 0 6px 16px rgba(255, 154, 60, 0.5);
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-overlay.active {
  display: block;
  opacity: 1;
}

.scroll-to-top-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: #ff9a3c;
  color: #ffffff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(255, 154, 60, 0.4);
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
}

.scroll-to-top-btn.visible {
  display: flex;
  opacity: 1;
  visibility: visible;
}

.scroll-to-top-btn:hover {
  background: #f08a2c;
  box-shadow: 0 6px 16px rgba(255, 154, 60, 0.5);
  transform: translateY(-2px);
}

@media (max-width: 1024px) {
  .right-sidebar {
    display: none;
  }
}

@media (max-width: 768px) {
  .mobile-close-toc-btn,
  .mobile-toc-toggle,
  .mobile-toc-toggle-container {
    display: block;
  }

  .toc-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    transform: translateX(-100%);
    z-index: 101;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
  }

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

  .agreement-content {
    padding: 0 16px;
    width: 100%;
    margin-left: 0;
  }

  .agreement-content h1 {
    font-size: 24px;
  }

  .agreement-content h2 {
    font-size: 20px;
  }

  .agreement-content h3 {
    font-size: 16px;
  }

  .scroll-to-top-btn {
    bottom: calc(20px + env(safe-area-inset-bottom));
    right: 16px;
    width: 44px;
    height: 44px;
  }
}
