/* ====== Layout & Base ====== */
:root {
  --bs-bg: #050816;
  --bs-bg-elevated: #0b1020;
  --bs-bg-soft: #111827;
  --bs-border-subtle: #1f2937;
  --bs-primary: #6366f1;
  --bs-primary-soft: rgba(99, 102, 241, 0.12);
  --bs-primary-strong: #818cf8;
  --bs-danger: #f97373;
  --bs-danger-soft: rgba(248, 113, 113, 0.12);
  --bs-text: #e5e7eb;
  --bs-text-muted: #9ca3af;
  --bs-radius-lg: 18px;
  --bs-radius-md: 12px;
  --bs-radius-pill: 999px;
  --bs-shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.6);
  --bs-shadow-subtle: 0 1px 0 rgba(148, 163, 184, 0.2);
  --bs-font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Inter", sans-serif;
}

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

body.bs-body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top left, #1d2646 0, #050816 45%);
  color: var(--bs-text);
  font-family: var(--bs-font-sans);
  -webkit-font-smoothing: antialiased;
}

.bs-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.bs-main {
  padding: 2.4rem 0 3.5rem;
}

.bs-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(22px);
  background: linear-gradient(
    to bottom,
    rgba(5, 8, 22, 0.9),
    rgba(5, 8, 22, 0.7),
    transparent
  );
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.bs-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
}

.bs-logo {
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 0.95rem;
  text-transform: uppercase;
  color: #e5e7eb;
  text-decoration: none;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: var(--bs-shadow-subtle);
  background: radial-gradient(circle at top left, #4c51bf33, #0b1020);
}

.bs-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.bs-nav-link {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--bs-text-muted);
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.18s ease-out;
}

.bs-nav-link:hover {
  color: #e5e7eb;
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.9);
}

.bs-footer {
  border-top: 1px solid rgba(31, 41, 55, 0.9);
  padding: 1.4rem 0 1.6rem;
  background: radial-gradient(circle at bottom, #111827 0, #050816 50%);
}

.bs-footer-text {
  margin: 0;
  font-size: 0.78rem;
  color: var(--bs-text-muted);
  text-align: center;
}

/* ====== Page header & cards ====== */
.bs-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.8rem;
}

.bs-heading-1 {
  font-size: 1.7rem;
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
}

.bs-heading-2 {
  font-size: 1.25rem;
  margin: 1.4rem 0 0.4rem;
}

.bs-heading-3 {
  font-size: 1.05rem;
  margin: 0;
}

.bs-text-muted {
  margin: 0;
  font-size: 0.9rem;
  color: var(--bs-text-muted);
}

.bs-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.1rem;
}

.bs-card {
  background: radial-gradient(circle at top, #111827, #020617 55%);
  border-radius: var(--bs-radius-lg);
  border: 1px solid rgba(15, 23, 42, 0.94);
  box-shadow: var(--bs-shadow-soft);
  padding: 1.1rem 1.1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.bs-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
}

.bs-card-excerpt {
  margin: 0;
  font-size: 0.9rem;
  color: var(--bs-text-muted);
}

.bs-card-footer {
  margin-top: 0.5rem;
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  align-items: center;
}

.bs-link-strong {
  color: #e5e7eb;
  text-decoration: none;
}

.bs-link-strong:hover {
  text-decoration: underline;
}

.bs-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.2rem;
}

.bs-tag {
  font-size: 0.78rem;
  padding: 0.12rem 0.6rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(55, 65, 81, 0.95);
  color: #e5e7eb;
}

/* ====== Buttons & badges ====== */
.bs-btn {
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.85rem;
  padding: 0.45rem 0.95rem;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-decoration: none;
  transition: all 0.15s ease-out;
}

.bs-btn:hover {
  background: rgba(15, 23, 42, 1);
  border-color: rgba(148, 163, 184, 0.5);
}

.bs-btn-primary {
  background: linear-gradient(135deg, #6366f1, #a855f7);
  border-color: transparent;
  box-shadow: 0 10px 25px rgba(88, 80, 236, 0.5);
}

.bs-btn-primary:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.bs-btn-outline {
  border-color: rgba(88, 80, 236, 0.65);
  background: rgba(15, 23, 42, 0.96);
}

.bs-btn-ghost {
  background: transparent;
  border-color: rgba(75, 85, 99, 0.8);
}

.bs-btn-danger-outline {
  border-color: rgba(248, 113, 113, 0.85);
  background: rgba(127, 29, 29, 0.25);
  color: #fecaca;
}

.bs-btn-block {
  width: 100%;
}

.bs-btn-icon {
  border-radius: 999px;
  border: 1px solid rgba(51, 65, 85, 0.9);
  background: rgba(15, 23, 42, 0.96);
  color: var(--bs-text-muted);
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
}

.bs-btn-icon:hover {
  color: #f9fafb;
  border-color: rgba(148, 163, 184, 0.9);
}

.bs-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.94);
  color: var(--bs-text-muted);
}

.bs-badge-success {
  border-color: rgba(45, 212, 191, 0.8);
  background: rgba(6, 95, 70, 0.3);
  color: #a7f3d0;
}

.bs-badge-muted {
  opacity: 0.7;
}

/* ====== Forms & editor layout ====== */
.bs-form {
  background: radial-gradient(circle at top left, #111827, #030712 60%);
  border-radius: 26px;
  border: 1px solid rgba(15, 23, 42, 0.96);
  box-shadow: var(--bs-shadow-soft);
  padding: 1.4rem 1.6rem 1.5rem;
}

.bs-form-narrow {
  max-width: 520px;
  margin: 0 auto;
}

.bs-form-grid {
  display: grid;
  gap: 1.4rem;
}

.bs-form-aside {
  border-left: 1px solid rgba(31, 41, 55, 0.95);
  padding-left: 1.1rem;
}

.bs-field {
  margin-bottom: 0.9rem;
}

.bs-field-inline {
  display: flex;
  gap: 0.75rem;
}

.bs-field-editor-with-preview {
  align-items: flex-start;
}

.bs-field-grow {
  flex: 1 1 0%;
}

.bs-field-small {
  max-width: 120px;
}

.bs-field-inline-middle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.bs-form-side {
  align-self: flex-start;
}

.bs-script-panel-floating {
  position: fixed;
  left: 1.75rem;
  bottom: 1.4rem;
  max-width: 420px;
  max-height: 80vh;
  overflow-y: scroll;
  width: 100%;
  z-index: 60;
  pointer-events: auto;
}

.bs-script-panel-floating .bs-card {
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.9);
}

.bs-label {
  display: block;
  margin-bottom: 0.28rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--bs-text-muted);
}

.bs-label-required::after {
  content: " *";
  color: #f97373;
}

.bs-input,
.bs-textarea,
.bs-select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(31, 41, 55, 0.98);
  background: radial-gradient(circle at top left, #020617, #020617 40%);
  color: #e5e7eb;
  padding: 0.5rem 0.7rem;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.12s ease-out, box-shadow 0.12s ease-out,
    background 0.12s ease-out;
  resize: vertical;
}

.bs-input:focus,
.bs-textarea:focus,
.bs-select:focus {
  border-color: rgba(129, 140, 248, 0.95);
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.6);
  background: radial-gradient(circle at top left, #020617, #020817 50%);
}

.bs-textarea.bs-editor {
  font-family: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 0.85rem;
  line-height: 1.5;
}

.bs-help {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--bs-text-muted);
}

.bs-help code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.78rem;
  padding: 0.05rem 0.25rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(30, 64, 175, 0.7);
}

.bs-section {
  margin-top: 1.4rem;
  padding-top: 0.7rem;
  border-top: 1px dashed rgba(55, 65, 81, 0.8);
}

.bs-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.7rem;
}

.bs-section-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.bs-section-editor {
  border-radius: 18px;
  border: 1px solid rgba(31, 41, 55, 0.98);
  background: radial-gradient(circle at top left, #020617, #020617 55%);
  padding: 0.9rem 0.9rem 0.8rem;
}

.bs-section-preview {
  margin-top: 0.6rem;
  padding: 0.6rem 0.7rem;
  border-radius: 14px;
  border: 1px dashed rgba(148, 163, 184, 0.8);
  background: #ffffff;
  color: #111827;
  max-height: 260px;
  overflow: auto;
  flex: 0 0 45%;
}

.bs-section-preview-sm {
  max-height: 200px;
}

.bs-section-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.bs-section-template {
  display: none;
}

.bs-inline-form {
  margin: 0;
  display: inline-block;
}

/* Switch */
.bs-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.bs-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.bs-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(31, 41, 55, 0.9);
  border-radius: 999px;
  transition: 0.2s;
}

.bs-switch-slider::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.2s;
}

.bs-switch input:checked + .bs-switch-slider {
  background: linear-gradient(135deg, #22c55e, #4ade80);
}

.bs-switch input:checked + .bs-switch-slider::before {
  transform: translateX(18px);
}

/* ====== Table, images, headings for article content ====== */
.bs-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.6rem;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.98);
}

.bs-table thead {
  background: radial-gradient(circle at top left, #111827, #020617 60%);
}

.bs-table th,
.bs-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(31, 41, 55, 0.95);
  font-size: 0.85rem;
}

.bs-table th {
  text-align: left;
  font-weight: 500;
  color: #d1d5db;
}

.bs-table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.9);
}

.bs-table-actions {
  white-space: nowrap;
  text-align: right;
}

.bs-image {
  max-width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(31, 41, 55, 0.95);
  display: block;
}

.bs-figure {
  margin: 0;
}

.bs-figure-cover {
  margin-top: 1rem;
}

.bs-article {
  background: radial-gradient(circle at top left, #020617, #020617 55%);
  border-radius: 28px;
  border: 1px solid rgba(15, 23, 42, 0.98);
  box-shadow: var(--bs-shadow-soft);
  padding: 1.6rem 1.7rem 1.6rem;
}

.bs-article-header {
  margin-bottom: 1.2rem;
}

.bs-article-title {
  margin: 0.35rem 0 0.4rem;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
}

.bs-article-excerpt {
  margin: 0;
  color: var(--bs-text-muted);
}

.bs-article-status {
  margin: 0;
}

.bs-article-footer {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.6rem;
}

.bs-prose {
  font-size: 0.97rem;
  line-height: 1.7;
  color: #e5e7eb;
}

.bs-prose-section + .bs-prose-section {
  margin-top: 1.5rem;
  padding-top: 1.2rem;
  border-top: 1px dashed rgba(55, 65, 81, 0.9);
}

.bs-prose-content h2,
.bs-prose-content h3,
.bs-prose-content h4 {
  margin: 1.2rem 0 0.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.bs-prose-content h2 {
  font-size: 1.25rem;
}

.bs-prose-content h3 {
  font-size: 1.07rem;
}

.bs-prose-content h4 {
  font-size: 0.98rem;
}

.bs-prose-content p {
  margin: 0.35rem 0;
}

.bs-prose-content a {
  color: var(--bs-primary-strong);
  text-decoration: none;
}

.bs-prose-content a:hover {
  text-decoration: underline;
}

.bs-prose-content ul,
.bs-prose-content ol {
  margin: 0.35rem 0 0.35rem 1.35rem;
}

.bs-prose-content li + li {
  margin-top: 0.1rem;
}

.bs-prose-content blockquote {
  margin: 0.8rem 0;
  padding: 0.55rem 0.85rem;
  border-left: 3px solid rgba(129, 140, 248, 0.9);
  background: radial-gradient(circle at top left, #020617, #020617 45%);
  border-radius: 0 16px 16px 0;
  color: var(--bs-text-muted);
  font-style: italic;
}

.bs-prose-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.84rem;
  padding: 0.08rem 0.35rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(37, 99, 235, 0.7);
}

.bs-prose-content pre {
  margin: 0.7rem 0;
  padding: 0.8rem 0.9rem;
  border-radius: 18px;
  background: radial-gradient(circle at top left, #020617, #020617 55%);
  border: 1px solid rgba(17, 24, 39, 0.98);
  overflow-x: auto;
}

.bs-prose-content pre code {
  border: none;
  background: transparent;
  padding: 0;
}

.bs-prose-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.7rem 0;
  font-size: 0.9rem;
}

.bs-prose-content th,
.bs-prose-content td {
  padding: 0.45rem 0.6rem;
  border: 1px solid rgba(31, 41, 55, 0.95);
}

.bs-prose-content th {
  background: rgba(15, 23, 42, 0.9);
  font-weight: 500;
}

.bs-prose-content img {
  max-width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(31, 41, 55, 0.95);
}

/* ====== Responsive ====== */
@media (max-width: 880px) {
  .bs-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .bs-form-aside {
    border-left: none;
    border-top: 1px solid rgba(31, 41, 55, 0.95);
    padding-left: 0;
    padding-top: 0.9rem;
    margin-top: 0.4rem;
  }

  .bs-page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .bs-article {
    padding: 1.3rem 1.25rem 1.25rem;
  }

  .bs-script-panel-floating {
    right: 1rem;
    left: 1rem;
    max-width: none;
  }
}

@media (max-width: 600px) {
  .bs-header-inner {
    padding-inline: 1rem;
  }

  .bs-container {
    padding-inline: 1.05rem;
  }

  .bs-card-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .bs-field-inline {
    flex-direction: column;
  }
}


