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

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

h1 {
  margin-bottom: 0.5rem;
  color: #333;
}

.subtitle {
  color: #666;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.right-column {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

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

.panel h2 {
  margin-bottom: 1rem;
  color: #333;
  font-size: 1.25rem;
}

.form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #555;
  font-size: 0.9rem;
}

input[type="text"],
textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.9rem;
}

textarea {
  min-height: 200px;
  resize: vertical;
  line-height: 1.5;
}

#html-editor {
  min-height: 400px;
  font-size: 0.9rem;
}

input[type="text"]:focus,
textarea:focus {
  outline: none;
  border-color: #4a90e2;
}

.radio-group {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.radio-option input[type="radio"] {
  cursor: pointer;
}

.radio-option label {
  margin: 0;
  cursor: pointer;
  font-weight: normal;
}

button {
  background: #4a90e2;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.2s;
  margin-top: 1rem;
}

button:hover {
  background: #357abd;
}

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

.preview-area {
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 1rem;
  min-height: 150px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.85rem;
  max-height: 300px;
  overflow-y: auto;
}

.render-area {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 1rem;
  min-height: 200px;
}

.result-item {
  background: white;
  padding: 1rem;
  margin-bottom: 0.75rem;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
}

.result-item:last-child {
  margin-bottom: 0;
}

.result-key {
  font-weight: 600;
  color: #4a90e2;
  margin-right: 0.5rem;
}

.result-value {
  color: #333;
}

.examples {
  background: #fff9e6;
  border: 1px solid #ffd700;
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 2rem;
}

.examples h3 {
  margin-bottom: 0.75rem;
  color: #333;
  font-size: 1rem;
}

.examples ul {
  margin-left: 1.5rem;
}

.examples li {
  margin-bottom: 0.5rem;
  color: #555;
  font-size: 0.9rem;
}

.examples code {
  background: #f5f5f5;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.85rem;
}

.error {
  background: #ffebee;
  color: #c62828;
  padding: 1rem;
  border-radius: 4px;
  margin-top: 1rem;
}

/* Syntax highlighting */
#html-editor {
  color: #333;
  background: #f8f9fa;
  border: 1px solid #d0d0d0;
  font-family: 'Monaco', 'Courier New', monospace;
  padding: 0.75rem;
  border-radius: 4px;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-all;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 500px;
  max-width: 100%;
  width: 100%;
  tab-size: 2;
}

#html-editor:focus {
  outline: none;
  border-color: #4a90e2;
}

.html-tag {
  color: #0066cc;
}

.html-attr-name {
  color: #d73a49;
}

.html-attr-value {
  color: #008000;
}

.html-text {
  color: #333;
}

.preview-area pre {
  white-space: pre-wrap;
  word-wrap: break-word;
}

.json-key {
  color: #0066cc;
  font-weight: 500;
}

.json-string {
  color: #008000;
}

.json-number {
  color: #cc6600;
}

.json-boolean {
  color: #990073;
}

.json-null {
  color: #999;
}

@media (max-width: 968px) {
  .container {
    grid-template-columns: 1fr;
  }
}
