:root {
  --page-bg: #070b11;
  --page-bg-soft: #0d131d;
  --surface-0: #0f1724;
  --surface-1: #151f2e;
  --surface-2: #1d293a;
  --surface-glass: rgba(19, 28, 42, 0.76);

  --text-strong: #e7edf8;
  --text-main: #c9d4e7;
  --text-muted: #8d9bb4;

  --border-soft: rgba(139, 160, 190, 0.22);
  --border-strong: rgba(148, 174, 210, 0.42);

  --accent: #34b6ff;
  --accent-strong: #149fff;
  --accent-soft: rgba(52, 182, 255, 0.2);
  --accent-glow: rgba(20, 159, 255, 0.28);

  --sidebar-width: 300px;
  --content-max-width: 980px;
  --base-font-size: 16px;

  --announce-info-bg: linear-gradient(90deg, #125b8c, #2a7db6);
  --announce-alert-bg: linear-gradient(90deg, #8f1f2d, #c92c40);
  --announce-sale-bg: linear-gradient(90deg, #0f6c83, #16a7c6);
  --announce-maintenance-bg: linear-gradient(90deg, #896315, #b88f2d);
  --announce-text-color: #e8f2ff;
}

html,
body {
  min-height: 100%;
  background:
    radial-gradient(1200px 700px at 85% -5%, #15304f 0%, rgba(21, 48, 79, 0) 58%),
    radial-gradient(900px 550px at 2% 100%, rgba(28, 82, 128, 0.42) 0%, rgba(28, 82, 128, 0) 60%),
    var(--page-bg);
}

body {
  color: var(--text-main);
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  font-size: var(--base-font-size);
  line-height: 1.65;
}

#app {
  min-height: 100vh;
}

.app-hidden {
  visibility: hidden;
}

.app-name-link {
  display: none !important;
}

/* Global announcement bar */
.announcement-bar {
  position: sticky;
  top: 0;
  z-index: 15;
  width: 100%;
  padding: 0.44rem 1rem;
  font-size: 0.8rem;
  color: var(--announce-text-color);
  border-bottom: 1px solid rgba(18, 31, 49, 0.72);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.announcement-type-info {
  background: var(--announce-info-bg);
}

.announcement-type-alert {
  background: var(--announce-alert-bg);
}

.announcement-type-sale {
  background: var(--announce-sale-bg);
}

.announcement-type-maintenance {
  background: var(--announce-maintenance-bg);
}

.announcement-type-announcement {
  background: linear-gradient(90deg, #104d88, #1f74ba);
}

.announcement-type-warning {
  background: linear-gradient(90deg, #8a4f18, #b76c22);
}

.announcement-layout-compact {
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
  font-size: 0.78rem;
}

.announcement-bar.announcement-visible {
  opacity: 1;
  transform: translateY(0);
}

.announcement-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1120px;
  margin: 0 auto;
  gap: 0.8rem;
}

.announcement-align-left .announcement-inner {
  justify-content: flex-start;
}

.announcement-align-center .announcement-inner {
  justify-content: center;
}

.announcement-content {
  display: flex;
  align-items: center;
  gap: 0.52rem;
}

.announcement-title {
  font-weight: 600;
}

.announcement-subtitle {
  opacity: 0.92;
}

.announcement-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.2rem 0.78rem;
  font-size: 0.74rem;
  border: 1px solid rgba(232, 242, 255, 0.58);
  color: #e8f2ff;
  text-decoration: none;
  background: rgba(8, 18, 30, 0.24);
  transition: background 0.15s ease, transform 0.15s ease;
}

.announcement-cta:hover {
  background: rgba(8, 18, 30, 0.4);
  transform: translateY(-1px);
}

.announcement-text {
  display: inline-block;
  max-width: 960px;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, rgba(14, 22, 33, 0.95), rgba(11, 18, 28, 0.96));
  border-right: 1px solid var(--border-soft);
  box-shadow: 10px 0 34px rgba(0, 0, 0, 0.28);
}

.brand-header {
  padding: 1.1rem 0.95rem 0.9rem 0.95rem;
  margin: 0.6rem 0.65rem 0.72rem 0.65rem;
  border: 1px solid var(--border-soft);
  border-radius: 15px;
  background: linear-gradient(165deg, rgba(28, 42, 62, 0.7), rgba(14, 22, 33, 0.74));
  text-align: center;
}

.sidebar-logo-wrapper img {
  max-height: 66px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(4, 8, 16, 0.8));
}

.sidebar-menu-label {
  margin-top: 0.34rem;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: #aebcd3;
}

.search {
  margin: 0 0.64rem 0.75rem 0.64rem;
  padding: 0;
}

.search input {
  width: 100%;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(18, 28, 43, 0.75);
  color: var(--text-main);
  font-size: 0.82rem;
  padding: 0 0.95rem;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.search input:focus {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(20, 159, 255, 0.18);
}

.results-panel {
  border-radius: 12px;
  margin-top: 0.45rem;
  border: 1px solid var(--border-soft);
  background: rgba(13, 20, 32, 0.95);
}

.sidebar-nav {
  padding: 0 0.5rem 1.2rem 0.5rem;
}

.sidebar-nav ul {
  padding-left: 0.38rem;
}

.sidebar-nav li {
  margin: 0.1rem 0;
}

.sidebar-nav > ul > li > a {
  margin-top: 0.7rem;
  margin-bottom: 0.18rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: #89a0c1;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.sidebar-nav a {
  display: block;
  border-radius: 999px;
  padding: 0.44rem 0.92rem;
  font-size: 0.83rem;
  color: #bdcae0;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.sidebar-nav a:hover {
  color: #eff5ff;
  background: rgba(49, 73, 102, 0.38);
  transform: translateX(2px);
}

.sidebar-nav .active > a,
.sidebar-nav a.active {
  color: #ecf6ff;
  background: linear-gradient(90deg, rgba(17, 66, 110, 0.9), rgba(19, 100, 155, 0.86));
  box-shadow: inset 0 0 0 1px rgba(95, 188, 255, 0.4), 0 10px 20px rgba(10, 38, 65, 0.42);
}

.sidebar-toggle {
  border-color: var(--border-soft);
  background: rgba(14, 21, 32, 0.95);
}

/* Content column */
.content {
  background: transparent;
}

.markdown-section {
  max-width: var(--content-max-width);
  margin-top: 1.35rem;
  margin-bottom: 2rem;
  padding: 2rem 2.6rem 2.4rem;
  border-radius: 22px;
  border: 1px solid var(--border-soft);
  background: linear-gradient(180deg, var(--surface-glass), rgba(13, 20, 31, 0.88));
  box-shadow: 0 18px 46px rgba(2, 8, 18, 0.55);
  backdrop-filter: blur(8px);
}

.markdown-section > :first-child {
  margin-top: 0 !important;
}

.markdown-section h1,
.markdown-section h2,
.markdown-section h3,
.markdown-section h4 {
  font-family: "Sora", "Plus Jakarta Sans", "Segoe UI", sans-serif;
  color: var(--text-strong);
}

.markdown-section h1 {
  margin-bottom: 0.75rem;
  border: none;
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  letter-spacing: -0.025em;
}

.markdown-section h2 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-size: 1.38rem;
  letter-spacing: -0.01em;
  border-bottom: 1px solid rgba(130, 158, 191, 0.16);
  padding-bottom: 0.36rem;
}

.markdown-section h3 {
  margin-top: 1.5rem;
}

.markdown-section p,
.markdown-section li {
  color: var(--text-main);
  line-height: 1.76;
}

.markdown-section strong {
  color: #edf3ff;
}

.markdown-section a {
  color: #69c9ff;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.markdown-section a:hover {
  color: #9ddfff;
  border-bottom-color: rgba(157, 223, 255, 0.5);
}

.markdown-section hr {
  border: 0;
  height: 1px;
  margin: 1.9rem 0;
  background: linear-gradient(90deg, rgba(140, 169, 203, 0), rgba(140, 169, 203, 0.35), rgba(140, 169, 203, 0));
}

.markdown-section blockquote {
  border-left: 4px solid rgba(92, 190, 255, 0.62);
  background: rgba(20, 30, 46, 0.7);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
}

.markdown-section table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
}

.markdown-section table th {
  background: rgba(24, 37, 56, 0.9);
  color: var(--text-strong);
  font-weight: 600;
}

.markdown-section table th,
.markdown-section table td {
  border-color: rgba(131, 153, 182, 0.24);
}

/* Callouts */
.tip,
.warning,
.danger {
  border-left-width: 4px !important;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: rgba(15, 24, 37, 0.92);
  padding: 0.88rem 0.98rem !important;
}

.tip {
  border-left-color: #2fbcff !important;
}

.warning {
  border-left-color: #f2ae3b !important;
}

.danger {
  border-left-color: #f06a7a !important;
}

/* Code blocks */
code {
  background: rgba(20, 31, 47, 0.9);
  border: 1px solid rgba(119, 145, 178, 0.28);
  border-radius: 7px;
  color: #d4e7ff;
  padding: 0.07rem 0.34rem;
  font-size: 0.82em;
}

pre,
pre code {
  border-radius: 14px !important;
}

pre {
  border: 1px solid rgba(119, 145, 178, 0.28) !important;
  background: #0d1724 !important;
  box-shadow: 0 14px 28px rgba(4, 10, 19, 0.44);
}

pre code {
  border: none !important;
  background: transparent !important;
  color: #d8e8fb;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #8094b3;
}

/* Images */
.markdown-section img {
  border-radius: 12px;
  border: 1px solid var(--border-soft);
}

/* Footer */
.cb-footer {
  margin-top: 2.8rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(130, 156, 192, 0.24);
  font-size: 0.75rem;
  color: #92a3bc;
  text-align: center;
}

.cb-footer-logos {
  margin-top: 0.76rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.65rem;
}

.cb-footer-logos img {
  max-height: 18px;
  opacity: 0.75;
  filter: saturate(0.76);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.cb-footer-logos img:hover {
  opacity: 1;
  transform: translateY(-1px);
}

/* Home hero */
.hero-main-title {
  margin: 0;
  text-transform: none;
  letter-spacing: -0.02em;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  font-family: "Sora", "Plus Jakarta Sans", sans-serif;
  color: #eef4ff;
  text-shadow: 0 8px 28px rgba(4, 10, 19, 0.64);
}

.hero-logo-panel {
  padding: 1rem 0 0.35rem;
}

.hero-logo-inner img {
  max-width: 250px;
  max-height: 250px;
  filter: drop-shadow(0 16px 34px rgba(2, 8, 18, 0.76));
  animation: heroFloat 5.4s ease-in-out infinite;
}

@keyframes heroFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.feature-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.95rem;
  margin-top: 1.3rem;
}

.feature-card {
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: linear-gradient(165deg, rgba(23, 35, 53, 0.86), rgba(14, 22, 33, 0.88));
  padding: 0.86rem 0.95rem;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.feature-card h3 {
  margin: 0 0 0.32rem;
  color: #eff5ff;
  font-size: 0.95rem;
}

.feature-card p {
  margin: 0;
  color: var(--text-main);
  font-size: 0.84rem;
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: rgba(95, 188, 255, 0.42);
  box-shadow: 0 16px 32px rgba(4, 12, 23, 0.52);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.17rem 0.58rem;
  border-radius: 999px;
  font-size: 0.69rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid rgba(132, 157, 189, 0.34);
  background: rgba(18, 29, 44, 0.84);
  color: #c4d2e7;
}

.badge--stable {
  border-color: rgba(64, 206, 144, 0.7);
  color: #9ef3c8;
}

.badge--new {
  border-color: rgba(69, 188, 255, 0.68);
  color: #9cdcff;
}

.badge--beta {
  border-color: rgba(244, 181, 72, 0.7);
  color: #ffd694;
}

.badge--legacy {
  border-color: rgba(158, 168, 187, 0.5);
  color: #c8d0dd;
}

.badge--eol {
  border-color: rgba(237, 99, 115, 0.74);
  color: #ffafba;
}

/* Scroll button */
.scroll-toggle-btn {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(95, 188, 255, 0.38);
  background: rgba(18, 30, 46, 0.88);
  color: #d8ebff;
  font-size: 18px;
  cursor: pointer;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 30px rgba(2, 8, 18, 0.52);
  transition: transform 0.15s ease, background 0.15s ease;
}

.scroll-toggle-btn:hover {
  background: rgba(20, 44, 67, 0.92);
  transform: translateY(-2px);
}

/* Page loader */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  background:
    radial-gradient(900px 520px at 80% 8%, rgba(21, 88, 151, 0.34), rgba(21, 88, 151, 0)),
    radial-gradient(900px 540px at 0% 100%, rgba(37, 93, 145, 0.26), rgba(37, 93, 145, 0)),
    #070b11;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.35s ease, visibility 0.35s ease, transform 0.35s ease;
}

.page-loader-hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
}

.page-loader-inner {
  text-align: center;
}

.page-loader-logo img {
  max-width: 125px;
  max-height: 125px;
  object-fit: contain;
  margin-bottom: 0.9rem;
  filter: drop-shadow(0 18px 34px rgba(3, 9, 17, 0.9));
}

.page-loader-spinner {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 3px solid rgba(231, 242, 255, 0.14);
  border-top-color: var(--accent);
  margin: 0 auto 0.62rem auto;
  animation: loaderSpin 0.85s linear infinite;
}

.page-loader-text {
  font-size: 0.86rem;
  color: #dce8fb;
  letter-spacing: 0.04em;
}

@keyframes loaderSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive */
@media (max-width: 960px) {
  .markdown-section {
    margin-top: 0;
    margin-bottom: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    padding: 1.55rem 1.18rem 2.2rem;
    backdrop-filter: none;
  }

  .sidebar {
    width: 288px;
  }

  .brand-header {
    margin-top: 0.3rem;
  }
}

@media (max-width: 680px) {
  .announcement-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .announcement-cta {
    margin-left: 1.48rem;
  }

  .hero-logo-inner img {
    max-width: 200px;
    max-height: 200px;
  }
}
