*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #f5f6fb;
  color: #1f2933;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.site-header {
  background: linear-gradient(90deg, #6a5af9, #8f5eff);
  color: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 20px;
}

.logo-icon {
  font-size: 20px;
}

.logo-text span {
  font-weight: 800;
}

.nav-links {
  display: flex;
  gap: 18px;
  font-size: 14px;
}

.nav-links a {
  position: relative;
  padding-bottom: 2px;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.8);
  transition: width 0.18s ease-out;
}

.nav-links a:hover::after {
  width: 100%;
}

/* Hero section */
.hero-section {
  padding: 24px 0 10px;
  background: linear-gradient(180deg, #f3f4ff, #f5f6fb);
}

.ad-box {
  background: #f9fafb;
  border: 1px dashed #d1d5db;
  border-radius: 8px;
  padding: 18px 12px;
  text-align: center;
  font-size: 13px;
  color: #9ca3af;
  margin-bottom: 14px;
}

.hero-card {
  background: linear-gradient(90deg, #6a5af9, #8f5eff);
  border-radius: 16px;
  padding: 32px 24px;
  color: #fff;
  text-align: center;
  box-shadow: 0 18px 40px rgba(79, 70, 229, 0.35);
}

.hero-card h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.hero-card p {
  margin: 0;
  font-size: 15px;
  opacity: 0.95;
}

/* Tool section */
.tool-section {
  padding: 24px 0 10px;
}

.section-title {
  font-size: 20px;
  margin: 0 0 12px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.btn {
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: #ffffff;
}

.btn.primary {
  background: #3b82f6;
}
.btn.secondary {
  background: #6366f1;
}
.btn.success {
  background: #16a34a;
}
.btn.info {
  background: #0ea5e9;
}
.btn.warning {
  background: #f97316;
}

.btn:hover {
  opacity: 0.93;
}

.indent-select {
  border-radius: 6px;
  border: 1px solid #d1d5db;
  padding: 8px 10px;
  font-size: 13px;
  background: #fff;
  margin-left: auto;
}

.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.editor-block {
  display: flex;
  flex-direction: column;
}

.editor-label {
  font-size: 13px;
  margin-bottom: 4px;
}

textarea {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  padding: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.45;
  background: #ffffff;
}

#outputJson[readonly] {
  background: #f9fafb;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 10px;
}

.stat-card {
  background: #f9fbff;
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
  border: 1px solid #e5e7eb;
}

.stat-label {
  display: block;
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 4px;
  letter-spacing: 0.08em;
}

.stat-value {
  font-size: 18px;
  font-weight: 600;
  color: #4f46e5;
}

.stat-sublabel {
  display: block;
  font-size: 11px;
  color: #9ca3af;
  margin-top: 2px;
}

.stat-valid.ok {
  color: #16a34a;
}

.stat-valid.bad {
  color: #dc2626;
}

/* Info section */
.info-section {
  padding: 26px 0 32px;
}

.info-section h2 {
  font-size: 22px;
  margin-bottom: 8px;
}

.info-section h3 {
  font-size: 18px;
  margin: 20px 0 8px;
}

.info-section p {
  font-size: 14px;
  line-height: 1.6;
  color: #4b5563;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.feature-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 12px 10px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 6px 12px rgba(148, 163, 184, 0.18);
  font-size: 13px;
}

.feature-card h4 {
  margin: 0 0 4px;
  font-size: 14px;
  color: #4f46e5;
}

.howto-list,
.usecases-list {
  font-size: 14px;
  color: #4b5563;
  padding-left: 18px;
}

.howto-list li + li,
.usecases-list li + li {
  margin-top: 4px;
}

/* Footer */
.site-footer {
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  padding: 14px 0 20px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  color: #6b7280;
}

.ad-bottom {
  width: 100%;
}

/* Responsive tweaks */
@media (max-width: 900px) {
  .editor-grid {
    grid-template-columns: 1fr;
  }
  .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .indent-select {
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .nav-links {
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
  }
  .hero-card {
    padding: 24px 18px;
  }
  .feature-grid {
    grid-template-columns: 1fr;
  }
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}
