:root {
  --bg: #ffffff;
  --panel: #f8f9fa;
  --text: #1a1a1a;
  --muted: #6c757d;
  --accent: #0066cc;
  --border: #e0e0e0;
  --ok: #28a745;
  --warn: #ffc107;
  --bad: #dc3545;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  width: 100%;
}

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

a:hover {
  text-decoration: underline;
}

/* Top Bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  top: 0;
  z-index: 100;
}

.site-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.lang-switcher {
  display: flex;
  gap: 8px;
}

.lang-switcher .btn {
  padding: 8px 16px;
  min-width: 50px;
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

/* Navigation */
nav {
  position: sticky;
  top: 0;
 
  overflow: auto;
  padding: 24px;
  background: var(--panel);
  border-right: 1px solid var(--border);
}


nav a {
  display: block;
  padding: 4px 12px;
  margin: 2px 0;
  border-radius: 6px;
  color: var(--text);
  transition: background 0.2s;
}

nav a:hover {
  background: rgba(0, 0, 0, 0.05);
  text-decoration: none;
}

.group-title {
  margin: 20px 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-transform: uppercase;
}

/* Main */
main {
  padding: 32px 5vw;
  max-width: 1200px;
  width: 100%;
  overflow-x: hidden;
}

section {
  margin: 0 0 32px;  
  border-radius: 8px;
  background: var(--bg);
  width: 100%;
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

h2 {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 600;
}

.desc {
  color: var(--muted);
  margin: 0 0 16px;
  font-size: 14px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

/* Buttons */
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0;
  align-items: center;
}

.btn {
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

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



/* Primary button - выразительная кнопка */
button,
input[type="button"],
input[type="submit"] {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

button:hover,
input[type="button"]:hover,
input[type="submit"]:hover {
  background: #0052a3;
  transform: translateY(-1px);
}

button:active,
input[type="button"]:active,
input[type="submit"]:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 102, 204, 0.2);
}

.btn-sec {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-sec:hover {
  background: var(--bg);
  color: var(--accent);
}
/* Grid */
.grid {
  display: grid;
  gap: 16px;
}

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

/* Code */
.code {
  position: relative;
  margin: 16px 0;
}

.code pre {
  margin: 0;
}

.copy {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
}

.copy:hover {
  background: var(--panel);
  border-color: var(--accent);
  color: var(--accent);
}
.code:hover .copy {
  opacity: 1;
  pointer-events: all;
}

pre {
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  overflow-x: auto;
  font-size: 13px;
  max-width: 100%;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid;
}

.badge.muted {
  border-color: var(--muted);
  background: var(--panel);
  color: var(--muted);
}
.badge.sm{
    font-size: 11px;
    padding: 2px 6px;
}

.badge.warn {
  border-color: #ffc107;
  background: #fff9e6;
  color: #997404;
}

.badge.ok {
  border-color: #28a745;
  background: #e6f4ea;
  color: #1e7e34;
}

.badge.bad {
  border-color: #dc3545;
  background: #fee;
  color: #bd2130;
}

/* Video */
.video {
  width: 100%;
  max-height: 400px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* Log */
.log {
  font-size: 13px;
  color: var(--text);
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  white-space: pre-wrap;
  font-family: 'Courier New', monospace;
  word-break: break-word;
  overflow-x: auto;
  max-width: 100%;
}

/* Адаптив */
@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
  }
  
  nav {
    position: relative;
    height: auto;
    border-right: none;
    border-top: 1px solid var(--border);
    border-bottom: none;
    padding: 16px;
    order: 2;
  }
  
  main {
    padding: 20px 16px;
    width: 100%;
    order: 1;
  }
  
  /* Top bar на мобильных */
  .top-bar {
    padding: 12px 16px;
  }
  
  .site-title {
    font-size: 16px;
  }
  
  .lang-switcher .btn {
    padding: 6px 12px;
    font-size: 13px;
    min-width: 45px;
  }
  
  /* Навигационные ссылки */
  nav a {
    padding: 4px 12px;
    font-size: 15px;
  }
  
  .group-title {
    margin: 16px 0 8px;
    font-size: 11px;
  }
  
  .two {
    grid-template-columns: 1fr;
  }
  .code{
    padding-top:20px;
  }
  .code .copy {
    opacity: 1;
    pointer-events: all;
    
    }
    
  
}

@media (max-width: 480px) {
  nav {
    padding: 16px;
  }
  
  main {
    padding: 12px;
    width: 100%;
  }
  
  h2 {
    font-size: 18px;
  }
  
 
}
