:root {
  color-scheme: dark;
  --cecx-bg: #080a0f;
  --cecx-panel: #11151f;
  --cecx-panel-soft: #171c29;
  --cecx-border: rgba(255, 255, 255, 0.12);
  --cecx-text: #f2f4f8;
  --cecx-muted: #a9b0bf;
  --cecx-link: #8ecbff;
  --cecx-link-hover: #b7ddff;
  --cecx-code-bg: rgba(255, 255, 255, 0.08);
  --cecx-radius: 22px;
  --cecx-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--cecx-bg);
  color: var(--cecx-text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
}

.cecx-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(18px, 4vw, 48px);
  background:
    radial-gradient(circle at top left, rgba(93, 130, 255, 0.14), transparent 32rem),
    radial-gradient(circle at bottom right, rgba(0, 210, 180, 0.08), transparent 28rem),
    var(--cecx-bg);
}

.cecx-viewer {
  width: min(860px, 100%);
}

.cecx-nav {
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  align-items: center;
  gap: 12px;
  margin: 0 auto 18px;
}

.cecx-arrow {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 1px solid var(--cecx-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--cecx-text);
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, opacity 120ms ease;
}

.cecx-arrow:hover:not(:disabled),
.cecx-arrow:focus-visible:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
  outline: none;
}

.cecx-arrow:disabled {
  opacity: 0.28;
  cursor: default;
}

.cecx-counter {
  justify-self: center;
  color: var(--cecx-muted);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.cecx-card {
  min-height: min(62vh, 620px);
  border: 1px solid var(--cecx-border);
  border-radius: var(--cecx-radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02)), var(--cecx-panel);
  box-shadow: var(--cecx-shadow);
  padding: clamp(24px, 5vw, 56px);
}

.cecx-title {
  display: none;
  margin: 0 0 1.05em;
  max-width: 17ch;
  font-size: clamp(1.55rem, 4vw, 3rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 730;
}

.cecx-title:not(:empty) {
  display: block;
}

.cecx-content {
  font-size: clamp(1.03rem, 1.7vw, 1.22rem);
  line-height: 1.72;
  color: var(--cecx-text);
}

.cecx-content > *:first-child {
  margin-top: 0;
}

.cecx-content > *:last-child {
  margin-bottom: 0;
}

.cecx-content p,
.cecx-content ul,
.cecx-content ol,
.cecx-content blockquote,
.cecx-content pre {
  margin: 0 0 1.05em;
}

.cecx-content strong {
  font-weight: 720;
}

.cecx-content em {
  font-style: italic;
  color: #f6f0d8;
}

.cecx-content a {
  color: var(--cecx-link);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.cecx-content a:hover,
.cecx-content a:focus-visible {
  color: var(--cecx-link-hover);
}

.cecx-content code {
  padding: 0.12em 0.34em;
  border-radius: 0.35em;
  background: var(--cecx-code-bg);
  color: #f8dca8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.cecx-content pre {
  overflow-x: auto;
  padding: 1rem;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.cecx-content pre code {
  padding: 0;
  background: transparent;
}

.cecx-content blockquote {
  margin-left: 0;
  margin-right: 0;
  padding: 0.85em 1em;
  border-left: 4px solid rgba(142, 203, 255, 0.72);
  border-radius: 0 14px 14px 0;
  background: rgba(142, 203, 255, 0.08);
  color: #dbe9f7;
}

.cecx-content ul,
.cecx-content ol {
  padding-left: 1.3em;
}

.cecx-content li + li {
  margin-top: 0.35em;
}

.cecx-content hr {
  border: 0;
  border-top: 1px solid var(--cecx-border);
  margin: 1.4em 0;
}

.cecx-error {
  color: #ffb4b4;
}

@media (max-width: 640px) {
  .cecx-shell {
    align-items: stretch;
    padding: 14px;
  }

  .cecx-viewer {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 28px);
  }

  .cecx-nav {
    grid-template-columns: 46px 1fr 46px;
    gap: 8px;
    margin-bottom: 12px;
  }

  .cecx-arrow {
    width: 46px;
    height: 46px;
    font-size: 30px;
  }

  .cecx-card {
    flex: 1;
    min-height: auto;
    border-radius: 18px;
    padding: 22px;
  }

  .cecx-title {
    max-width: none;
  }
}
