/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #fff;
  color: #111;
  line-height: 1.6;
}

/* ── Nav ── */
nav {
  padding: 14px 40px;
  border-bottom: 1px solid #e5e5e5;
  font-size: 0.9rem;
}
nav a { color: #444; text-decoration: none; }
nav a:hover { color: #111; text-decoration: underline; }

/* ── Page Header ── */
.page-header {
  background: white;
  border-bottom: 1px solid #e5e5e5;
  padding: 40px 0 32px;
}
.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.subtitle { color: #444; font-size: 1rem; }

/* ── Container ── */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ── Sections ── */
.section {
  padding: 40px 0 0;
}
.section:last-child { padding-bottom: 60px; }

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #111;
  margin-bottom: 16px;
}

.section-desc {
  color: #444;
  font-size: 0.9rem;
  margin-bottom: 20px;
  margin-top: -8px;
}

/* ── Command Table ── */
.table-wrap {
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  overflow: hidden;
}

.cmd-table {
  width: 100%;
  border-collapse: collapse;
}

.cmd-table thead {
  background: white;
}

.cmd-table th {
  padding: 12px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  border-bottom: 1px solid #e5e5e5;
}

.cmd-table td {
  padding: 13px 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid #e5e5e5;
  vertical-align: middle;
}

.cmd-table tbody tr:last-child td { border-bottom: none; }

.cmd-table tbody tr:hover { background: #f8f8f8; }

.col-copy { width: 90px; }

.cmd-cell {
  font-family: 'Menlo', 'Monaco', monospace;
  font-size: 0.85rem;
  color: #111;
}

.desc-cell { color: #444; }

/* ── Copy Button ── */
.copy-btn {
  font-size: 0.78rem;
  font-family: system-ui, -apple-system, sans-serif;
  padding: 5px 12px;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  background: #fff;
  color: #444;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.copy-btn:hover { background: #f0f0f0; }
.copy-btn.copied {
  background: #dcfce7;
  border-color: #16a34a;
  color: #16a34a;
}

/* ── JSON Explorer ── */
.json-explorer {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}

/* ── JSON Panel ── */
.json-panel {
  background: #1a1a1a;
  border-radius: 8px;
  padding: 24px;
  font-family: 'Menlo', 'Monaco', monospace;
  font-size: 0.83rem;
  line-height: 1.9;
  color: #e5e5e5;
  overflow-x: auto;
  user-select: none;
}

/* Syntax colors */
.j-brace       { color: #888; }
.j-key         { color: #2563eb; cursor: pointer; }
.j-key:hover   { text-decoration: underline; }
.j-key.active  {
  background: rgba(37,99,235,0.15);
  border-radius: 2px;
  outline: 2px solid #2563eb;
}
.j-str         { color: #16a34a; }
.j-num         { color: #dc2626; }
.j-punct       { color: #888; }
.j-indent      { display: inline-block; }

/* ── Explanation Panel ── */
.json-explain {
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 24px;
  background: white;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.explain-placeholder {
  color: #888;
  font-size: 0.9rem;
  margin: auto;
  text-align: center;
  line-height: 1.6;
}

.explain-key {
  font-family: 'Menlo', 'Monaco', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: #2563eb;
  border-left: 3px solid #2563eb;
  padding-left: 10px;
  margin-bottom: 4px;
}

.explain-text {
  font-size: 0.9rem;
  color: #444;
  line-height: 1.7;
}

.explain-example {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  padding: 10px 14px;
  font-family: 'Menlo', 'Monaco', monospace;
  font-size: 0.8rem;
  color: #444;
  margin-top: 4px;
}

/* ── Mobile ── */
@media (max-width: 640px) {
  nav { padding: 14px 20px; }
  .container { padding: 0 20px; }
  .json-explorer { grid-template-columns: 1fr; }
  .cmd-table th:last-child,
  .cmd-table td:last-child { padding: 8px 10px; }
}
