:root {
  --container: 1180px;
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --text: #1f2937;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --bg: #ffffff;
  --bg-light: #f9fafb;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.image-box,
.media-box,
.visual-box,
.preview-box {
  overflow: visible;
  line-height: 0;
  padding: 0;
}

.image-box img,
.media-box img,
.visual-box img,
.preview-box img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: #f8fafc;
  border-right: 1px solid var(--border);
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-header img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.sidebar-header span {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
}

.nav-group {
  margin-bottom: 24px;
  padding: 0 12px;
}

.nav-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-light);
  padding: 0 8px;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.nav-group ul {
  list-style: none;
}

.nav-item {
  display: block;
  padding: 8px 12px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 13px;
  border-radius: 6px;
  margin-bottom: 4px;
  transition: all 0.3s;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
}

.nav-item.active {
  background: rgba(37, 99, 235, 0.15);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 500;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-light);
  text-align: center;
  flex-shrink: 0;
}

.main-area {
  flex: 1;
  margin-left: 240px;
  display: flex;
  flex-direction: column;
}

.top-header {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  z-index: 100;
}

.header-title {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 8px;
}

.header-progress {
  height: 3px;
  background: var(--bg-light);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  width: 0%;
  transition: width 0.2s ease;
}

.content-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: 40px 0;
}

.container {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

.doc-section {
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 60px;
}

.doc-section h1 {
  font-size: 42px;
  margin-bottom: 32px;
  color: var(--text);
  font-weight: 700;
}

.doc-section h2 {
  font-size: 28px;
  margin-bottom: 24px;
  color: var(--text);
  font-weight: 700;
}

.doc-section h3 {
  font-size: 18px;
  margin-bottom: 12px;
  color: var(--text);
  font-weight: 600;
}

.section-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.text-block p {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.8;
  margin-bottom: 16px;
}

.visual-block {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.visual-block img {
  width: 100%;
}

.feature-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  transition: all 0.3s;
}

.feature-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
  transform: translateY(-4px);
}

.card-num {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}

.feature-card h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.6;
}

.network-table {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 24px;
}

.table-header {
  display: grid;
  grid-template-columns: 150px 1fr 1fr;
  gap: 0;
  background: var(--bg-light);
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  font-size: 13px;
}

.table-row {
  display: grid;
  grid-template-columns: 150px 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.table-row:last-child {
  border-bottom: none;
}

.col-name,
.col-info,
.col-usage {
  padding: 16px;
  font-size: 13px;
}

.col-name {
  background: var(--bg);
  font-weight: 600;
  color: var(--text);
  border-right: 1px solid var(--border);
}

.col-info {
  color: var(--text-light);
  border-right: 1px solid var(--border);
}

.col-usage {
  color: var(--text-light);
}

.note-box {
  background: rgba(37, 99, 235, 0.05);
  border-left: 4px solid var(--primary);
  padding: 16px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
}

.step-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.timeline-step {
  display: flex;
  gap: 20px;
  padding: 20px;
  background: var(--bg-light);
  border-radius: 8px;
  border-left: 4px solid var(--primary);
}

.step-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-weight: 700;
  flex-shrink: 0;
}

.timeline-step h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.timeline-step p {
  font-size: 13px;
  color: var(--text-light);
}

.setup-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.setup-item {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}

.setup-item h3 {
  font-size: 16px;
  margin-bottom: 12px;
  color: var(--text);
}

.setup-item ul {
  list-style: none;
}

.setup-item li {
  font-size: 13px;
  color: var(--text-light);
  padding: 6px 0;
  padding-left: 16px;
  position: relative;
}

.setup-item li:before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
}

.check-items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.check-card {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  transition: all 0.3s;
}

.check-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.check-header {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  font-size: 14px;
}

.check-card p {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 12px;
}

.check-card ul {
  list-style: none;
}

.check-card li {
  font-size: 12px;
  color: var(--text-light);
  padding: 4px 0;
  padding-left: 16px;
  position: relative;
}

.check-card li:before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--primary);
}

.dapp-guide {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.guide-section {
  background: var(--bg-light);
  border-radius: 8px;
  padding: 20px;
}

.guide-section h3 {
  font-size: 16px;
  margin-bottom: 12px;
}

.guide-section p {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 10px;
}

.guide-section ul {
  list-style: none;
}

.guide-section li {
  font-size: 12px;
  color: var(--text-light);
  padding: 4px 0;
  padding-left: 16px;
  position: relative;
}

.guide-section li:before {
  content: '•';
  position: absolute;
  left: 0;
  font-weight: bold;
}

.risk-matrix {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.risk-level {
  border-radius: 8px;
  padding: 20px;
  border: 1px solid var(--border);
}

.risk-level h3 {
  font-size: 16px;
  margin-bottom: 16px;
}

.risk-level.high-risk {
  background: rgba(239, 68, 68, 0.05);
  border-color: rgba(239, 68, 68, 0.2);
}

.risk-level.high-risk h3 {
  color: #dc2626;
}

.risk-level.medium-risk {
  background: rgba(245, 158, 11, 0.05);
  border-color: rgba(245, 158, 11, 0.2);
}

.risk-level.medium-risk h3 {
  color: #f59e0b;
}

.risk-level.low-risk {
  background: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.2);
}

.risk-level.low-risk h3 {
  color: #10b981;
}

.risk-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.risk-item {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: var(--text-light);
  align-items: flex-start;
}

.risk-icon {
  flex-shrink: 0;
  font-weight: bold;
}

.protect-modules {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.module-card {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}

.module-card h3 {
  font-size: 16px;
  margin-bottom: 12px;
}

.module-content p {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 10px;
}

.module-content ul {
  list-style: none;
}

.module-content li {
  font-size: 12px;
  color: var(--text-light);
  padding: 4px 0;
  padding-left: 16px;
  position: relative;
}

.module-content li:before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
}

.checklist-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.checklist-group {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}

.checklist-group h3 {
  font-size: 16px;
  margin-bottom: 12px;
}

.checklist-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.check-box {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-light);
}

.check-box input {
  cursor: pointer;
  accent-color: var(--primary);
}

.interface-showcase {
  margin-bottom: 40px;
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.showcase-item {
  text-align: center;
}

.showcase-item img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.showcase-item h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.showcase-item p {
  font-size: 12px;
  color: var(--text-light);
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s;
}

.faq-item:hover {
  border-color: var(--primary);
}

.faq-trigger {
  width: 100%;
  padding: 16px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s;
}

.faq-trigger:hover {
  background: var(--bg-light);
  color: var(--primary);
}

.faq-trigger::after {
  content: '+';
  font-size: 18px;
  color: var(--primary);
  transition: transform 0.3s;
}

.faq-trigger.open::after {
  transform: rotate(45deg);
}

.faq-answer {
  display: none;
  padding: 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-light);
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.8;
}

.faq-answer.show {
  display: block;
}

.doc-footer {
  background: var(--bg-light);
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 40px;
}

.footer-info {
  margin-bottom: 24px;
}

.footer-info p {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.8;
}

.footer-copyright {
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
}

.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-4px);
}

.back-to-top.show {
  display: flex;
}

@media (max-width: 1440px) {
  .feature-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .setup-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .check-items {
    grid-template-columns: repeat(2, 1fr);
  }

  .risk-matrix {
    grid-template-columns: repeat(2, 1fr);
  }

  .showcase-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    left: -240px;
    width: 240px;
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s;
  }

  .sidebar.open {
    left: 0;
  }

  .main-area {
    margin-left: 0;
  }

  .feature-cards,
  .setup-cards,
  .dapp-guide {
    grid-template-columns: 1fr;
  }

  .check-items,
  .risk-matrix,
  .checklist-container {
    grid-template-columns: 1fr;
  }

  .section-content {
    grid-template-columns: 1fr;
  }

  .showcase-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 200px;
    left: -200px;
  }

  .sidebar-header {
    padding: 16px;
  }

  .doc-section {
    padding: 24px 0;
  }

  .doc-section h1 {
    font-size: 28px;
  }

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

  .top-header {
    padding: 12px 0;
  }

  .header-title {
    font-size: 12px;
  }

  .feature-card {
    padding: 16px;
  }

  .timeline-step {
    padding: 16px;
    gap: 12px;
  }

  .step-marker {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .protect-modules {
    grid-template-columns: 1fr;
  }

  .faq-trigger {
    padding: 12px;
    font-size: 13px;
  }

  .faq-answer {
    padding: 12px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .sidebar {
    width: 100%;
    left: -100%;
  }

  .content-wrapper {
    padding: 20px 0;
  }

  .doc-section h1 {
    font-size: 22px;
  }

  .doc-section h2 {
    font-size: 18px;
  }

  .table-header,
  .table-row {
    grid-template-columns: 1fr;
  }

  .col-name,
  .col-info,
  .col-usage {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .section-content {
    gap: 16px;
  }

  .doc-footer {
    padding: 20px 0;
  }

  .back-to-top {
    width: 40px;
    height: 40px;
    font-size: 12px;
    bottom: 16px;
    right: 16px;
  }
}
