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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  min-height: 100vh;
}

.header {
  background: linear-gradient(135deg, #003366 0%, #004d99 100%);
  color: white;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.header h1 {
  font-size: 22px;
  font-weight: 600;
}

.header .badge {
  background: rgba(255,255,255,0.15);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.panel {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #fafbfc;
  border-bottom: 1px solid #e8ecf0;
}

.panel-header h2 {
  font-size: 14px;
  font-weight: 600;
  color: #4a5568;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.panel-body {
  padding: 0;
}

textarea {
  width: 100%;
  min-height: 500px;
  padding: 20px;
  border: none;
  outline: none;
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.7;
  resize: vertical;
  background: white;
  color: #2d3748;
}

textarea::placeholder {
  color: #a0aec0;
}

.output-area {
  width: 100%;
  min-height: 500px;
  padding: 20px;
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-y: auto;
  color: #2d3748;
  background: #fdfdfe;
  border: none;
  cursor: text;
  -webkit-user-select: all;
  user-select: all;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 20px;
}

.btn {
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary {
  background: #003366;
  color: white;
}

.btn-primary:hover {
  background: #004d99;
  transform: translateY(-1px);
}

.btn-secondary {
  background: #e8ecf0;
  color: #4a5568;
}

.btn-secondary:hover {
  background: #d4dbe3;
}

.btn-copy {
  background: #48bb78;
  color: white;
  font-size: 12px;
  padding: 6px 14px;
}

.btn-copy:hover {
  background: #38a169;
}

.btn-copy.copied {
  background: #2f855a;
}

.status-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: #fafbfc;
  border-top: 1px solid #e8ecf0;
  font-size: 12px;
  color: #718096;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e0;
}

.status-dot.ready {
  background: #48bb78;
}

.status-dot.blocked {
  background: #f6ad55;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.url-input-section {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  padding: 20px 24px;
}

.url-input-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.url-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 15px;
  font-family: 'Segoe UI', system-ui, sans-serif;
  outline: none;
  transition: border-color 0.15s;
}

.url-input:focus {
  border-color: #003366;
  box-shadow: 0 0 0 3px rgba(0,51,102,0.1);
}

.url-input::placeholder {
  color: #a0aec0;
  font-size: 14px;
}

.url-status {
  margin-top: 8px;
  font-size: 13px;
  min-height: 20px;
}

.url-status.loading {
  color: #718096;
}

.url-status.success {
  color: #2f855a;
}

.url-status.error {
  color: #c53030;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.config-section {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  padding: 20px;
  margin-top: 20px;
}

.config-section summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: #4a5568;
  padding: 4px 0;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.config-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.config-item label {
  font-size: 12px;
  color: #718096;
  min-width: 90px;
  font-weight: 500;
}

.config-item input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  font-family: 'Cascadia Code', monospace;
  outline: none;
}

.config-item input:focus {
  border-color: #003366;
  box-shadow: 0 0 0 2px rgba(0,51,102,0.1);
}

@media (max-width: 900px) {
  .editor-grid {
    grid-template-columns: 1fr;
  }
  textarea, .output-area {
    min-height: 300px;
  }
}
