/* Guide page: tabs & code blocks */

.main-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 20px;
}

.main-tab {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.main-tab:hover {
  color: var(--text);
  background: var(--surface-2);
}

.main-tab.active {
  background: var(--primary);
  color: #fff;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.sub-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  margin-bottom: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  padding-bottom: 4px;
}

.sub-tabs::-webkit-scrollbar {
  height: 4px;
}

.sub-tabs::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.sub-tab {
  flex-shrink: 0;
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.875rem;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.sub-tab:hover {
  border-color: var(--primary);
  color: var(--text);
}

.sub-tab.active {
  border-color: var(--primary);
  background: rgba(91, 141, 239, 0.12);
  color: var(--primary);
}

.content-block {
  display: none;
}

.content-block.active {
  display: block;
}

.content-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.content-desc {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.code-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.code-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  min-width: 0;
}

.code-lang {
  flex: 1;
  min-width: 0;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-card pre {
  margin: 0;
  padding: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.7;
  color: #c9d1d9;
  tab-size: 2;
  word-break: break-word;
  white-space: pre-wrap;
}

.hint-box {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(91, 141, 239, 0.08);
  border-left: 3px solid var(--primary);
  border-radius: 0 6px 6px 0;
  font-size: 0.875rem;
  color: var(--muted);
}

@media (max-width: 768px) {
  .sub-tabs {
    gap: 6px;
    margin-bottom: 16px;
  }

  .sub-tab {
    padding: 10px 14px;
    font-size: 0.8125rem;
  }

  .content-title {
    font-size: 1rem;
  }

  .content-desc {
    font-size: 0.85rem;
    margin-bottom: 12px;
  }

  .code-card pre {
    padding: 16px;
    font-size: 0.8rem;
  }

  .hint-box {
    padding: 10px 12px;
    font-size: 0.8125rem;
    margin-top: 12px;
  }
}

@media (max-width: 600px) {
  .code-card-header {
    padding: 8px 12px;
  }

  .code-lang {
    font-size: 0.7rem;
  }

  .code-card pre {
    padding: 14px 12px;
    font-size: 0.75rem;
    line-height: 1.65;
  }
}

@media (max-width: 380px) {
  .main-tabs {
    flex-direction: column;
  }

  .main-tab {
    flex: none;
    width: 100%;
    text-align: center;
  }
}
