:root {
  --ink: #102033;
  --muted: #607083;
  --panel: rgba(255, 255, 255, 0.68);
  --panel-strong: rgba(255, 255, 255, 0.88);
  --line: rgba(255, 255, 255, 0.72);
  --line-dark: rgba(16, 32, 51, 0.11);
  --accent: #0ea5a4;
  --accent-2: #2563eb;
  --cyan: #0284c7;
  --pink: #ec4899;
  --green: #16a34a;
  --shadow: 0 24px 68px rgba(15, 62, 79, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6fbff;
}

body.theme-light {
  --ink: #102033;
  --muted: #607083;
  --panel: rgba(255, 255, 255, 0.68);
  --panel-strong: rgba(255, 255, 255, 0.9);
  --line: rgba(255, 255, 255, 0.72);
  --accent: #0ea5a4;
  --accent-2: #2563eb;
  --cyan: #0284c7;
  --pink: #ec4899;
  --green: #16a34a;
  --shadow: 0 24px 68px rgba(15, 62, 79, 0.14);
}

body.theme-dark {
  --ink: #f8fafc;
  --muted: #cbd5e1;
  --panel: rgba(15, 23, 42, 0.58);
  --panel-strong: rgba(15, 23, 42, 0.78);
  --line: rgba(255, 255, 255, 0.13);
  --accent: #22d3ee;
  --accent-2: #60a5fa;
  --cyan: #67e8f9;
  --pink: #f472b6;
  --green: #86efac;
  --shadow: 0 24px 70px rgba(2, 6, 23, 0.34);
  background: #020617;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.svg-icons {
  position: absolute;
}

svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: currentColor;
}

.background {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: linear-gradient(135deg, #e0f2fe, #f8fafc 40%, #fdf2f8);
}

.background-image {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  opacity: 0;
  transform: scale(1.02);
  animation: bgCycle 18s infinite;
}

.background-image.one {
  background-image: url("/assets/bg1.jpg");
}

.background-image.two {
  background-image: url("/assets/bg2.png");
  animation-delay: 9s;
}

.wash {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(248, 250, 252, 0.78), rgba(224, 242, 254, 0.42), rgba(253, 242, 248, 0.7)),
    radial-gradient(circle at 15% 12%, rgba(14, 165, 164, 0.26), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(236, 72, 153, 0.14), transparent 28%);
  backdrop-filter: blur(2px);
}

body.theme-dark .wash {
  background:
    linear-gradient(120deg, rgba(2, 6, 23, 0.78), rgba(15, 23, 42, 0.58), rgba(30, 41, 59, 0.7)),
    radial-gradient(circle at 16% 12%, rgba(34, 211, 238, 0.2), transparent 30%),
    radial-gradient(circle at 82% 18%, rgba(244, 114, 182, 0.14), transparent 30%);
}

.effect-layer,
.sakura-layer,
.firefly-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.sakura-petal {
  position: absolute;
  top: -12vh;
  border-radius: 100% 0 100% 0;
  background: rgba(251, 113, 133, 0.62);
  box-shadow: 0 0 8px rgba(251, 113, 133, 0.35);
  animation: sakuraFall linear infinite;
}

.firefly {
  position: absolute;
  border-radius: 999px;
  background: rgba(187, 247, 208, 0.88);
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.78), 0 0 22px rgba(34, 197, 94, 0.38);
  mix-blend-mode: screen;
  animation-name: floatOne;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.firefly::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  background: inherit;
  animation: fireflyPulse var(--pulse-duration, 4s) ease-in-out infinite;
  animation-delay: var(--pulse-delay, 0s);
}

.firefly-path-2 { animation-name: floatTwo; }
.firefly-path-3 { animation-name: floatThree; }
.firefly-path-4 { animation-name: floatFour; }

@keyframes bgCycle {
  0%, 42% { opacity: 0.32; }
  50%, 92% { opacity: 0; }
  100% { opacity: 0.32; }
}

@keyframes sakuraFall {
  0% { transform: translate(0, -10vh) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  82% { opacity: 1; }
  100% { transform: translate(16vw, 114vh) rotate(360deg); opacity: 0; }
}

@keyframes fireflyPulse {
  0%, 100% { opacity: 0.16; transform: scale(0.5); }
  50% { opacity: 1; transform: scale(1.4); }
}

@keyframes floatOne {
  0%, 100% { transform: translate(0, 0); }
  35% { transform: translate(12vw, -14vh); }
  70% { transform: translate(-6vw, -20vh); }
}

@keyframes floatTwo {
  0%, 100% { transform: translate(0, 0); }
  35% { transform: translate(-13vw, 10vh); }
  70% { transform: translate(8vw, 16vh); }
}

@keyframes floatThree {
  0%, 100% { transform: translate(0, 0); }
  35% { transform: translate(15vw, 14vh); }
  70% { transform: translate(-10vw, 5vh); }
}

@keyframes floatFour {
  0%, 100% { transform: translate(0, 0); }
  35% { transform: translate(-15vw, -10vh); }
  70% { transform: translate(10vw, -16vh); }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1180px, calc(100% - 28px));
  height: 64px;
  margin: 16px auto 0;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 12px 40px rgba(15, 62, 79, 0.1);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 900;
}

.brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  object-fit: cover;
}

.brand-mark {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-links a,
.nav-links button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #334155;
  cursor: pointer;
  padding: 8px 12px;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}

.nav-links a:hover,
.nav-links button:hover {
  background: rgba(79, 70, 229, 0.1);
  color: var(--accent);
}

.shell {
  position: relative;
  z-index: 5;
  width: min(1180px, calc(100% - 28px));
  margin: 30px auto;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 18px;
  margin-bottom: 18px;
}

.panel,
.tool-card,
.mini-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.profile-panel,
.status-panel {
  min-height: 236px;
  padding: 26px;
}

.profile-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}

.profile-top {
  display: flex;
  align-items: center;
  gap: 20px;
}

.avatar {
  width: 104px;
  height: 104px;
  border: 4px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  object-fit: cover;
  box-shadow: 0 18px 40px rgba(14, 165, 164, 0.22);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(24px, 3vw, 36px);
}

h3 {
  margin-bottom: 0;
  font-size: 19px;
}

.bio,
.lead {
  color: #334155;
  font-size: 16px;
  line-height: 1.75;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.icon-link,
form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid rgba(79, 70, 229, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.icon-link {
  min-width: 52px;
  padding: 0 14px;
}

.text-icon {
  font-size: 13px;
}

.icon-link:hover,
form button:hover {
  transform: translateY(-1px);
  background: var(--accent);
  color: #fff;
}

.status-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.chip-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip-cloud span {
  border: 1px solid rgba(8, 145, 178, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: #0f766e;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 12px;
}

.tab-panel {
  padding: 16px;
}

.tabs {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 16px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
}

.tab {
  min-width: 110px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #475569;
  cursor: pointer;
  font-weight: 900;
  padding: 10px 16px;
}

.tab.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 10px 24px rgba(14, 165, 164, 0.28);
}

.tab-content {
  display: none;
}

.tab-content.is-active {
  display: block;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 18px;
  padding: 12px;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mini-card {
  display: flex;
  flex-direction: column;
  min-height: 116px;
  justify-content: center;
  padding: 18px;
}

.metric {
  color: var(--pink);
  font-size: 28px;
  font-weight: 900;
}

.tool-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.tool-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.tool-launch-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.54);
  color: var(--ink);
  cursor: pointer;
  padding: 18px;
  text-align: left;
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.1);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.tool-launch-card:hover,
.tool-launch-card.is-active {
  transform: translateY(-3px);
  border-color: rgba(79, 70, 229, 0.45);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 24px 60px rgba(79, 70, 229, 0.18);
}

.tool-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(14, 165, 164, 0.96), rgba(37, 99, 235, 0.88));
  color: #fff;
  box-shadow: 0 14px 34px rgba(14, 165, 164, 0.24);
}

.tool-icon svg {
  width: 28px;
  height: 28px;
}

.tool-copy {
  display: grid;
  gap: 7px;
}

.tool-copy strong {
  font-size: 17px;
  line-height: 1.3;
}

.tool-copy small {
  color: var(--muted);
  line-height: 1.55;
}

.arrow {
  color: var(--accent);
  opacity: 0.74;
  transition: transform 180ms ease;
}

.tool-launch-card:hover .arrow,
.tool-launch-card.is-active .arrow {
  transform: translateX(4px);
}

.tool-stage {
  min-height: 240px;
}

.tool-empty-state {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 220px;
  border: 1px dashed rgba(79, 70, 229, 0.28);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.42);
  color: var(--muted);
  text-align: center;
}

.tool-empty-state svg {
  width: 42px;
  height: 42px;
  color: var(--accent);
  opacity: 0.72;
}

.tool-empty-state.is-hidden {
  display: none;
}

.tool-detail {
  display: none;
  animation: panelRise 240ms ease both;
}

.tool-detail.is-active {
  display: block;
}

.detail-heading {
  margin: 6px 0 16px;
}

@keyframes panelRise {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.tool-card {
  padding: 18px;
}

.tool-card.wide {
  grid-column: 1 / -1;
}

.tool-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}

form {
  display: grid;
  gap: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.span-2 {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  outline: none;
  padding: 10px 12px;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(79, 70, 229, 0.62);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

form button {
  justify-self: start;
  padding: 0 16px;
}

.result,
.command-box {
  overflow: auto;
  min-height: 64px;
  max-height: 320px;
  margin: 14px 0 0;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.82);
  color: #d1fae5;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  padding: 12px;
  white-space: pre-wrap;
}

.result-view {
  max-height: none;
  white-space: normal;
}

.result.has-error {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.42);
}

.result-output {
  white-space: pre-wrap;
}

.result-grid {
  display: grid;
  gap: 8px;
  white-space: normal;
}

.result-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.34fr) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
}

.result-row span,
.binary-line span,
.result-summary span {
  color: #93c5fd;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.result-row strong {
  color: #e0f2fe;
  font-weight: 700;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.result-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
  white-space: normal;
}

.result-summary div {
  display: grid;
  gap: 5px;
  min-width: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 10px;
}

.result-summary strong {
  color: #f8fafc;
  overflow-wrap: anywhere;
}

.bit-layout {
  display: flex;
  gap: 6px;
  width: 100%;
  margin: 10px 0;
  white-space: normal;
}

.bit-segment {
  flex: var(--bit-count) 1 0;
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 78px;
  border-radius: 12px;
  padding: 10px;
  color: #0f172a;
  overflow: hidden;
}

.bit-segment code,
.binary-line code {
  color: inherit;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.bit-label {
  font-size: 12px;
  font-weight: 900;
}

.bit-segment small {
  color: rgba(15, 23, 42, 0.76);
  line-height: 1.45;
}

.bit-segment.sign { background: #fda4af; }
.bit-segment.exponent { background: #fde68a; }
.bit-segment.mantissa { background: #86efac; }
.bit-segment.int-high { background: #93c5fd; }
.bit-segment.int-low { background: #a7f3d0; }
.bit-segment.byte-high { background: #c4b5fd; }
.bit-segment.byte-low { background: #f9a8d4; }

.binary-line {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  white-space: normal;
}

.command-box {
  display: grid;
  gap: 8px;
}

.site-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.site-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  padding: 14px;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.site-card:hover {
  transform: translateY(-2px);
  border-color: rgba(14, 165, 164, 0.42);
  background: rgba(255, 255, 255, 0.82);
}

.site-card span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.site-card strong {
  font-size: 16px;
  overflow-wrap: anywhere;
}

.site-card small {
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.site-empty {
  color: var(--muted);
  padding: 16px 0;
}

.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.knowledge-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.1);
  padding: 18px;
  backdrop-filter: blur(18px);
}

.knowledge-card.wide {
  grid-column: 1 / -1;
}

.cpp-book-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 14px;
}

.cpp-book-toolbar button {
  min-height: 42px;
  border: 1px solid rgba(79, 70, 229, 0.18);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.84);
  color: #d1fae5;
  cursor: pointer;
  font-weight: 900;
  padding: 0 16px;
}

.cpp-book-results {
  display: grid;
  gap: 8px;
  min-height: 44px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.cpp-book-result {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  cursor: pointer;
  padding: 11px 12px;
  text-align: left;
}

.cpp-book-result strong {
  color: var(--accent-2);
}

.cpp-book-result span {
  color: var(--muted);
  line-height: 1.55;
}

.cpp-book-viewer {
  height: min(68vh, 720px);
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  background: #fff;
}

.cpp-book-viewer iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.is-hidden {
  display: none !important;
}

.mini-diagram {
  display: grid;
  grid-template-columns: 1.1fr repeat(2, 0.8fr);
  gap: 8px;
  margin: 14px 0;
}

.mini-diagram span,
.mini-diagram i,
.command-list code,
.command-list span,
.embed-grid span,
.embed-grid strong {
  border-radius: 10px;
  padding: 9px 10px;
}

.mini-diagram span {
  background: rgba(14, 165, 164, 0.14);
  color: #0f766e;
  font-weight: 900;
}

.mini-diagram i {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  font-style: normal;
  font-weight: 800;
}

.guide-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding-left: 18px;
  color: #334155;
  line-height: 1.65;
}

.command-list,
.embed-grid {
  display: grid;
  grid-template-columns: minmax(130px, 0.58fr) minmax(0, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.command-list code,
.embed-grid span {
  background: rgba(15, 23, 42, 0.84);
  color: #d1fae5;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-weight: 800;
}

.command-list span,
.embed-grid strong {
  background: rgba(255, 255, 255, 0.62);
  color: #334155;
  font-weight: 800;
}

.site-footer {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto 30px;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}

.floating-toolbox {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--accent);
  cursor: pointer;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(18px);
  transition: transform 180ms ease, background 180ms ease;
}

.floating-toolbox:hover {
  transform: translateY(-2px) rotate(6deg);
  background: var(--accent);
  color: #fff;
}

.floating-toolbox svg {
  width: 26px;
  height: 26px;
}

body.theme-dark .site-header,
body.theme-dark .tabs,
body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea,
body.theme-dark .icon-link,
body.theme-dark .tool-launch-card,
body.theme-dark .tool-empty-state,
body.theme-dark .floating-toolbox,
body.theme-dark .chip-cloud span {
  background: rgba(15, 23, 42, 0.58);
  color: #e2e8f0;
}

body.theme-dark .knowledge-card {
  background: rgba(15, 23, 42, 0.58);
}

body.theme-dark .cpp-book-result {
  background: rgba(15, 23, 42, 0.68);
}

body.theme-dark .site-card {
  background: rgba(15, 23, 42, 0.58);
}

body.theme-dark .nav-links a,
body.theme-dark .nav-links button,
body.theme-dark .bio,
body.theme-dark .lead,
body.theme-dark label,
body.theme-dark .site-footer,
body.theme-dark .guide-list {
  color: #cbd5e1;
}

@media (max-width: 860px) {
  .site-header {
    height: auto;
    align-items: flex-start;
    flex-direction: column;
    padding: 14px;
  }

  .nav-links {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero-grid,
  .intro-grid,
  .tool-layout,
  .tool-picker,
  .knowledge-grid,
  .site-list {
    grid-template-columns: 1fr;
  }

  .profile-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .mini-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .result-summary,
  .command-list,
  .embed-grid,
  .cpp-book-toolbar {
    grid-template-columns: 1fr;
  }

  .bit-layout {
    flex-direction: column;
  }

  h1 {
    font-size: 42px;
  }
}
