:root {
  --primary: #0984E3;
  --primary-dim: rgba(9,132,227,0.15);
  --primary-glow: rgba(9,132,227,0.3);
  --secondary: #74B9FF;
  --accent: #E17055;
  --accent-dim: rgba(225,112,85,0.15);
  --bg: #0D1B2A;
  --bg-card: rgba(13,27,42,0.85);
  --bg-input: rgba(8,20,35,0.8);
  --border: rgba(116,185,255,0.12);
  --border-hover: rgba(116,185,255,0.25);
  --text: #E2E8F0;
  --text-dim: #94A3B8;
  --text-muted: #64748B;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --transition: 250ms ease;
  --glass: rgba(13,27,42,0.65);
  --glass-border: rgba(116,185,255,0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text);
  min-height: 100vh; line-height: 1.6;
  background-image:
    radial-gradient(ellipse at 15% 0%, rgba(9,132,227,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 100%, rgba(225,112,85,0.05) 0%, transparent 50%);
}
.app { max-width: 1400px; margin: 0 auto; padding: 0 24px; display: flex; flex-direction: column; min-height: 100vh; }

.header { padding: 20px 0; border-bottom: 1px solid var(--border); }
.header-left { display: flex; align-items: center; gap: 14px; }
.logo { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: var(--primary-dim); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.header h1 { font-size: 1.3rem; font-weight: 700; background: linear-gradient(135deg, var(--secondary), var(--primary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.subtitle { font-size: 0.75rem; color: var(--text-dim); font-weight: 500; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: var(--radius-sm); border: none; font-family: var(--font); font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all var(--transition); white-space: nowrap; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--primary), #2196F3); color: #fff; box-shadow: 0 2px 12px rgba(9,132,227,0.3); width: 100%; justify-content: center; }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(9,132,227,0.45); }
.btn-ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--border); width: 100%; justify-content: center; }
.btn-ghost:hover:not(:disabled) { color: var(--text); background: var(--primary-dim); }
.btn-sm { padding: 6px 12px; font-size: 0.78rem; width: auto; }

.main { flex: 1; display: grid; grid-template-columns: 340px 1fr; grid-template-rows: 1fr auto; gap: 16px; padding: 20px 0; }
.config-panel { grid-row: 1 / -1; }
.output-panel { grid-column: 2; }
.curl-panel { grid-column: 2; }

.panel { background: var(--glass); backdrop-filter: blur(12px); border: 1px solid var(--glass-border); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; animation: fadeIn 0.3s ease; }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.panel-header h2 { font-size: 0.88rem; font-weight: 600; }
.panel-body { padding: 16px; flex: 1; overflow: auto; }
.panel-footer { padding: 8px 16px; border-top: 1px solid var(--border); }
.output-actions { display: flex; gap: 6px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
select, .field-input { width: 100%; padding: 10px 14px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-family: var(--font); font-size: 0.85rem; outline: none; transition: all var(--transition); appearance: none; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394A3B8' d='M3 5l3 3 3-3'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; cursor: pointer; }
select:focus, .field-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-dim); }

.custom-fields { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.custom-field-row { display: flex; gap: 6px; }
.custom-field-row .field-input { flex: 1; padding: 8px 10px; font-size: 0.8rem; }
.custom-field-row .remove-field { background: transparent; border: 1px solid var(--border); color: var(--accent); width: 32px; height: 32px; border-radius: var(--radius-sm); cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; transition: all var(--transition); }
.custom-field-row .remove-field:hover { background: var(--accent-dim); }

.code-output { background: var(--bg-input); border-radius: var(--radius-sm); padding: 16px; font-family: var(--mono); font-size: 0.82rem; line-height: 1.7; overflow: auto; max-height: 500px; white-space: pre-wrap; word-break: break-word; color: var(--text); }
.curl-code { max-height: 200px; }

.meta-row { display: flex; gap: 16px; }
.meta-item { font-size: 0.75rem; color: var(--text-muted); }

/* JSON Syntax highlighting */
.json-key { color: var(--secondary); }
.json-string { color: #10B981; }
.json-number { color: var(--accent); }
.json-bool { color: #A78BFA; }
.json-null { color: var(--text-muted); }

.footer { padding: 20px 0; text-align: center; font-size: 0.72rem; color: var(--text-muted); border-top: 1px solid var(--border); margin-top: auto; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.panel-body::-webkit-scrollbar, .code-output::-webkit-scrollbar { width: 6px; }
.panel-body::-webkit-scrollbar-track, .code-output::-webkit-scrollbar-track { background: transparent; }
.panel-body::-webkit-scrollbar-thumb, .code-output::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 3px; }

@media (max-width: 900px) {
  .main { grid-template-columns: 1fr; grid-template-rows: auto; }
  .config-panel { grid-row: auto; }
}
@media (max-width: 480px) {
  .app { padding: 0 12px; }
  .header h1 { font-size: 1.1rem; }
}
