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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f5;
  color: #333;
}

.navbar {
  background: #2c3e50;
  color: white;
  padding: 0 1em;
  display: flex;
  align-items: center;
  height: 50px;
}

.navbar .brand {
  color: white;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1em;
  margin-right: 2em;
}

.nav-items { display: flex; gap: 0.5em; }

.dropdown { position: relative; }

.dropdown .dropbtn {
  background: none;
  border: none;
  color: white;
  padding: 0.5em 1em;
  cursor: pointer;
  font-size: 0.9em;
}

.dropdown .dropbtn:hover { background: rgba(255,255,255,0.1); }

.dropdown-content {
  display: none;
  position: absolute;
  background: white;
  min-width: 200px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  z-index: 100;
  border-radius: 4px;
}

.dropdown:hover .dropdown-content { display: block; }

.dropdown-content a {
  color: #333;
  padding: 0.6em 1em;
  text-decoration: none;
  display: block;
  font-size: 0.85em;
}

.dropdown-content a:hover { background: #ecf0f1; }

.container {
  display: flex;
  gap: 1em;
  padding: 1em;
  max-width: 1400px;
  margin: 0 auto;
}

.panel {
  flex: 1;
  background: white;
  border-radius: 6px;
  padding: 1em;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.panel h3 {
  font-size: 0.9em;
  color: #666;
  margin-bottom: 0.4em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

textarea {
  width: 100%;
  font-family: "Monaco", "Menlo", "Consolas", monospace;
  font-size: 0.85em;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.5em;
  resize: vertical;
  background: #fafafa;
}

textarea:focus { outline: none; border-color: #3498db; }

.buttons {
  margin-top: 0.8em;
  display: flex;
  gap: 0.5em;
}

.buttons button {
  padding: 0.5em 1em;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85em;
  transition: background 0.2s;
}

#btn-test { background: #27ae60; color: white; }
#btn-test:hover { background: #219a52; }
#btn-bench { background: #2980b9; color: white; }
#btn-bench:hover { background: #2472a4; }
#btn-share { background: #8e44ad; color: white; }
#btn-share:hover { background: #7d3c98; }

.result-output {
  background: #ecf0f1;
  border-radius: 4px;
  padding: 0.8em;
  min-height: 200px;
  font-family: "Monaco", "Menlo", "Consolas", monospace;
  font-size: 0.85em;
  white-space: pre-wrap;
}

.error { color: #c0392b; font-weight: bold; }
.loading { color: #7f8c8d; }

.tree-root {
  font-weight: bold;
  margin-bottom: 0.5em;
  color: #2c3e50;
}

.tree {
  list-style: none;
  padding-left: 1.2em;
}

.tree li {
  padding: 2px 0;
}

.tree .toggle {
  cursor: pointer;
  user-select: none;
  font-size: 0.7em;
  margin-right: 4px;
  color: #7f8c8d;
}

.tree li.collapsed > ul { display: none; }
.tree li.collapsed > .toggle { transform: rotate(-90deg); display: inline-block; }

.node-label { color: #2c3e50; }

.bench { line-height: 1.8; }

.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal.hidden { display: none; }

.modal-content {
  background: white;
  padding: 1.5em;
  border-radius: 8px;
  min-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 0.8em;
}

.modal-content input {
  padding: 0.5em;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9em;
}

.modal-content button {
  padding: 0.5em 1em;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#btn-copy { background: #27ae60; color: white; }
#btn-close-modal { background: #bdc3c7; }

@media (max-width: 768px) {
  .container { flex-direction: column; }
}
