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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: #333;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  background: #f5f5f5;
}

.page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  margin: 1rem 0 1.5rem;
  padding: 0.75rem 1rem;
  background: white;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.page-nav a, .cell.name a, .attr-table a {
  color: #2980b9;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  border: 1px solid #d0dce8;
  white-space: nowrap;
}

.page-nav a:hover, .cell.name a:hover, .attr-table a:hover {
  background: #eaf2fb;
  border-color: #3498db;
}

h1 {
  color: #2c3e50;
  margin-bottom: 1rem;
  font-size: 2.5rem;
}

h2 {
  color: #34495e;
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #3498db;
}

h3 {
  color: #555;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1rem;
}

code {
  background: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 0.2rem 0.4rem;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

pre {
  background: #2c3e50;
  color: #ecf0f1;
  padding: 1rem;
  border-radius: 5px;
  overflow-x: auto;
  margin-bottom: 1rem;
}

pre code {
  background: none;
  border: none;
  color: inherit;
  padding: 0;
}

.usage-section {
  background: white;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.playground {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  margin-top: 2rem;
}

.playground textarea {
  width: 100%;
  min-height: 150px;
  padding: 1rem;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  resize: vertical;
  margin-bottom: 1rem;
}

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

.button {
  background: #3498db;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s;
}

.button:hover {
  background: #2980b9;
}

.button:active {
  transform: translateY(1px);
}

.button:focus {
  outline: 2px solid #3498db;
  outline-offset: 2px;
}

.example-btn {
  background: #95a5a6;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  display: inline-block;
}

.example-btn:hover {
  background: #7f8c8d;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  max-width: 90%;
  max-height: 90%;
  overflow: auto;
  position: relative;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #e74c3c;
  color: white;
  border: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.modal-close:hover {
  background: #c0392b;
}

.modal-close:focus {
  outline: 2px solid #e74c3c;
  outline-offset: 2px;
}

ul {
  margin-left: 2rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.5rem;
}

.note {
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 4px;
}

.examples-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.result-table th,
.result-table td {
  padding: 0.75rem;
  text-align: left;
  border: 1px solid #dee2e6;
}

.result-table th {
  background: #f8f9fa;
  font-weight: 600;
}

.result-table tr:nth-child(even) {
  background: #f8f9fa;
}

.result-table td {
  word-break: break-all;
}
