:root {
  color-scheme: dark;
  --page-gutter: clamp(14px, 3vw, 32px);
  --page-max: 1280px;
  --bg: #08090b;
  --panel: rgba(255, 248, 232, 0.08);
  --panel-strong: rgba(255, 248, 232, 0.13);
  --ink: #fff8e8;
  --muted: rgba(255, 248, 232, 0.68);
  --faint: rgba(255, 248, 232, 0.12);
  --line: rgba(255, 248, 232, 0.18);
  --lime: #d9ff65;
  --amber: #ffb44f;
  --blue: #8fb8ff;
  --dark-card: rgba(9, 11, 13, 0.78);
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
}

:root:has(body[data-theme="light"]) {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 82% 4%, rgba(217, 255, 101, 0.2), transparent 28rem),
    radial-gradient(circle at 4% 92%, rgba(255, 180, 79, 0.16), transparent 24rem),
    linear-gradient(135deg, #08090b 0%, #12161a 54%, #181710 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

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

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.study-noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 248, 232, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 248, 232, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 30%, black, transparent 78%);
}

.study-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(var(--page-max), calc(100% - (var(--page-gutter) * 2)));
  margin: 18px auto 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(8, 9, 11, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

.study-brand,
.study-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.study-brand {
  border: 0;
  background: transparent;
  padding: 8px 12px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.study-brand span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  background: var(--lime);
  color: #08090b;
  font-size: 0.82rem;
}

.study-nav {
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}

.study-nav a,
.study-nav button {
  padding: 10px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
}

.study-nav a:hover,
.study-nav button:hover,
.study-nav button.is-active {
  background: var(--panel);
  color: var(--ink);
}

.study-theme-toggle {
  flex: 0 0 auto;
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 248, 232, 0.08);
  color: var(--ink);
  cursor: pointer;
  overflow: hidden;
}

.study-nav-toggle,
.subject-tabs-toggle,
.db-case-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 248, 232, 0.08);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 900;
}

.study-nav-toggle {
  width: 42px;
  height: 42px;
  padding: 0;
}

.subject-tabs-toggle,
.db-case-toggle {
  padding: 9px 13px;
}

.study-nav-toggle span,
.subject-tabs-toggle span,
.db-case-toggle span {
  display: block;
  position: relative;
  flex: 0 0 auto;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: none;
  transition: background 160ms ease, transform 160ms ease;
}

.study-nav-toggle,
.subject-tabs-toggle,
.db-case-toggle {
  position: relative;
}

.study-nav-toggle span::before,
.study-nav-toggle span::after,
.subject-tabs-toggle span::before,
.subject-tabs-toggle span::after,
.db-case-toggle span::before,
.db-case-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: opacity 160ms ease, transform 160ms ease;
}

.study-nav-toggle span::before,
.subject-tabs-toggle span::before,
.db-case-toggle span::before {
  transform: translateY(-7px);
}

.study-nav-toggle span::after,
.subject-tabs-toggle span::after,
.db-case-toggle span::after {
  transform: translateY(7px);
}

.subject-tabs-wrap {
  position: relative;
}

.study-theme-toggle:hover {
  border-color: rgba(217, 255, 101, 0.38);
  background: rgba(255, 248, 232, 0.12);
  color: var(--ink);
  transform: translateY(-1px);
}

.study-theme-toggle .sun,
.study-theme-toggle .moon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition: transform 240ms ease, opacity 240ms ease;
}

.study-theme-toggle .sun::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffb13d;
  box-shadow:
    0 0 0 4px rgba(255, 177, 61, 0.18),
    0 0 16px rgba(255, 177, 61, 0.32);
}

.study-theme-toggle .moon::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow:
    inset -6px 0 0 rgba(31, 34, 26, 0.96),
    0 0 14px rgba(217, 255, 101, 0.3);
}

body[data-theme="dark"] .study-theme-toggle .sun {
  opacity: 0;
  transform: translateY(34px);
}

body[data-theme="light"] .study-theme-toggle .moon {
  opacity: 0;
  transform: translateY(-34px);
}

main {
  width: min(var(--page-max), calc(100% - (var(--page-gutter) * 2)));
  margin: 0 auto;
  padding: 60px 0 90px;
}

.study-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(var(--page-max), calc(100% - (var(--page-gutter) * 2)));
  margin: -36px auto 44px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}

.study-footer-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.study-footer-mark strong {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.study-footer-mark span {
  position: relative;
  padding-left: 12px;
}

.study-footer-mark span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 18px;
  background: var(--line);
  transform: translateY(-50%);
}

.study-footer button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.study-footer button:hover {
  color: var(--ink);
}

.study-hero {
  margin-bottom: 22px;
}

.hero-copy,
.db-workspace,
.course-placeholder,
.spring-workspace,
.lld-workspace,
.hld-workspace,
.credit-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-copy {
  position: relative;
  overflow: hidden;
  padding: clamp(34px, 6vw, 72px);
}

.hero-copy::after {
  content: "";
  position: absolute;
  right: -100px;
  bottom: -120px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 255, 101, 0.24), transparent 70%);
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--lime);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 22px;
  font-size: clamp(2.55rem, 5vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.hero-copy p:not(.eyebrow),
.section-head > p,
.credit-card p,
.course-placeholder p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.home-progress {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(8, 9, 11, 0.68);
}

.progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 18px;
  align-items: center;
  min-height: 78px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 248, 232, 0.06);
  color: var(--ink);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.progress-row:hover,
.progress-row:focus-visible {
  border-color: rgba(217, 255, 101, 0.48);
  background: rgba(255, 248, 232, 0.09);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.16);
  outline: none;
  transform: translateY(-1px);
}

.progress-row strong {
  display: block;
  margin-bottom: 4px;
  overflow: hidden;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.progress-row span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-align: right;
  text-transform: uppercase;
  white-space: nowrap;
}

.progress-row i {
  position: relative;
  grid-column: 1 / -1;
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 248, 232, 0.14);
}

.progress-row i::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--progress);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--lime), var(--amber));
  box-shadow: 0 0 24px rgba(217, 255, 101, 0.28);
}

.db-workspace,
.course-placeholder,
.spring-workspace,
.lld-workspace,
.hld-workspace,
.credit-card {
  position: relative;
  margin-top: 22px;
  --section-pad: clamp(20px, 4vw, 34px);
  padding: var(--section-pad);
}

.db-workspace {
  --section-pad: clamp(24px, 4vw, 42px);
}

.course-view:has(.study-back-row) {
  margin-top: 84px;
}

.course-view {
  animation: courseIn 220ms ease both;
}

@keyframes courseIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-head {
  display: grid;
  grid-template-columns: 0.8fr 1fr;
  gap: 32px;
  align-items: end;
  margin-bottom: 30px;
}

.subject-home-head {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 46px);
  align-items: end;
  margin-bottom: 28px;
}

.subject-home-head > div:first-child {
  min-width: 0;
}

.subject-home-head .eyebrow {
  margin-bottom: 12px;
}

.subject-home-copy {
  display: grid;
  justify-items: start;
  gap: 14px;
  min-width: 0;
}

.subject-home-copy p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.study-back-row {
  position: absolute;
  top: -66px;
  left: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-start;
  margin: 0;
  pointer-events: none;
}

.study-back-icon {
  position: relative;
  display: inline-grid;
  width: 44px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 248, 232, 0.08);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 900;
  pointer-events: auto;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.study-back-icon::after {
  content: attr(aria-label);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  width: max-content;
  max-width: 180px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 9, 11, 0.94);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transform: translate(-6px, -50%);
  transition: opacity 160ms ease, transform 160ms ease;
  white-space: nowrap;
  z-index: 3;
}

.study-back-icon:hover {
  border-color: transparent;
  background: var(--lime);
  color: #08090b;
  transform: translateY(-1px);
}

.study-back-icon:hover::after {
  opacity: 1;
  transform: translate(0, -50%);
}

.section-head h2,
.course-placeholder h2,
.credit-card h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.study-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.search-box {
  position: relative;
  display: block;
  width: min(520px, 100%);
  flex: 1 1 360px;
}

.search-box input {
  width: 100%;
  padding: 14px 16px 14px 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
  background: rgba(8, 9, 11, 0.62);
  color: var(--ink);
}

.search-box::before,
.lld-search-box::before,
.hld-search-box::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 50%;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-55%);
  z-index: 1;
}

.search-box::after,
.lld-search-box::after,
.hld-search-box::after {
  content: "";
  position: absolute;
  left: 29px;
  top: 50%;
  width: 7px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(5px) rotate(45deg);
  z-index: 1;
}

.search-box input:focus {
  border-color: rgba(217, 255, 101, 0.66);
}

.view-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.view-switch button,
.case-button,
.diagram-actions button,
.diagram-actions a,
.image-lightbox button {
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
}

.view-switch button {
  padding: 12px 14px;
  border-radius: 999px;
  background: rgba(8, 9, 11, 0.48);
  color: var(--muted);
  font-weight: 800;
}

.view-switch button.is-active {
  background: var(--lime);
  color: #08090b;
  border-color: transparent;
}

.db-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.db-workspace.is-menu-only .db-layout {
  grid-template-columns: minmax(0, 980px);
  justify-content: center;
}

.db-workspace.is-menu-only .case-list {
  position: static;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: none;
}

.case-list {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 118px);
  overflow: auto;
  padding: 2px 6px 2px 2px;
}

.case-button {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  width: 100%;
  padding: 16px 46px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(8, 9, 11, 0.42);
  cursor: pointer;
  text-align: left;
}

.case-button:hover,
.case-button.is-active {
  border-color: rgba(217, 255, 101, 0.56);
  background: rgba(217, 255, 101, 0.1);
}

.case-button strong {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 248, 232, 0.12);
  color: var(--lime);
}

.case-button span {
  display: block;
}

.case-button .case-title {
  color: var(--ink);
  font-weight: 850;
}

.case-button .case-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
}

.case-check {
  position: absolute;
  top: 14px;
  right: 14px;
}

.detail-check {
  position: absolute;
  top: 24px;
  right: 24px;
}

.db-case-actions {
  position: absolute;
  top: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.db-video-action {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 248, 232, 0.08);
  color: #ff6b63;
  font-size: 0.78rem;
  font-weight: 900;
}

.db-video-action:hover {
  border-color: transparent;
  background: var(--lime);
  color: #08090b;
  transform: translateY(-1px);
}

.case-detail {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(8, 9, 11, 0.48);
  overflow: hidden;
}

.case-header {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 32px 64px 32px 32px;
  border-bottom: 1px solid var(--line);
}

.case-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.case-header h3 {
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 4rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.badge {
  flex: 0 0 auto;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(217, 255, 101, 0.14);
  color: var(--lime);
  font-size: 0.8rem;
  font-weight: 900;
}

.focus-note {
  max-width: 820px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.case-body {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 0;
}

.question-panel,
.answer-panel {
  min-width: 0;
  padding: 32px;
}

.answer-panel {
  border-left: 1px solid var(--line);
  background: rgba(255, 248, 232, 0.04);
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-title h4 {
  margin: 0;
  font-size: 1.05rem;
}

.panel-title span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.question-card,
.requirements-card,
.solution-article,
.reference-block {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 248, 232, 0.06);
}

.question-card {
  margin-bottom: 22px;
  padding: 24px;
}

.question-card h4 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: clamp(1.65rem, 3vw, 2.45rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

.question-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.requirements-card {
  padding: 24px;
}

.requirement-list {
  display: grid;
  gap: 14px;
  max-height: 560px;
  margin: 0;
  overflow: auto;
  padding: 0;
  list-style: none;
  counter-reset: requirement;
}

.requirement-list li {
  position: relative;
  min-height: 54px;
  padding: 14px 14px 14px 58px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(8, 9, 11, 0.36);
  color: rgba(255, 248, 232, 0.84);
  font-size: 0.96rem;
  line-height: 1.62;
}

.requirement-list li::before {
  counter-increment: requirement;
  content: counter(requirement, decimal-leading-zero);
  position: absolute;
  top: 14px;
  left: 14px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 10px;
  background: rgba(217, 255, 101, 0.16);
  color: var(--lime);
  font-size: 0.72rem;
  font-weight: 900;
}

.reference-block {
  margin-top: 22px;
  overflow: hidden;
}

.reference-block summary {
  cursor: pointer;
  padding: 18px 20px;
  color: var(--ink);
  font-weight: 900;
}

.reference-block pre {
  max-height: 520px;
  margin: 0;
  overflow: auto;
  padding: 0 20px 20px;
  color: rgba(255, 248, 232, 0.78);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre;
}

.diagram-shell {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #f7f2e7;
  overflow: hidden;
}

.diagram-shell img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 680px;
  object-fit: contain;
}

.answer-popup-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(circle at 92% 12%, rgba(217, 255, 101, 0.16), transparent 36%),
    rgba(255, 248, 232, 0.06);
}

.answer-diagram-card {
  display: grid;
  grid-template-columns: minmax(180px, 0.48fr) minmax(0, 0.52fr);
  gap: 20px;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(circle at 92% 12%, rgba(217, 255, 101, 0.16), transparent 36%),
    rgba(255, 248, 232, 0.06);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.answer-diagram-card:hover {
  border-color: rgba(217, 255, 101, 0.5);
  transform: translateY(-1px);
}

.answer-diagram-card + .answer-diagram-card {
  margin-top: 16px;
}

.answer-diagram-card img {
  width: 100%;
  min-height: 210px;
  max-height: 320px;
  border-radius: 14px;
  object-fit: contain;
  background: #fff;
}

.answer-diagram-card h4 {
  margin: 0 0 10px;
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  line-height: 1;
  letter-spacing: -0.035em;
}

.answer-diagram-card p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.answer-popup-card + .answer-popup-card {
  margin-top: 16px;
}

.answer-popup-card h4 {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  line-height: 1;
  letter-spacing: -0.035em;
}

.answer-popup-card p:not(.eyebrow) {
  max-width: 470px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.answer-popup-card button {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 12px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--lime);
  color: #08090b;
  cursor: pointer;
  font-weight: 900;
}

.diagram-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.diagram-actions button,
.diagram-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(8, 9, 11, 0.5);
  color: var(--ink);
  font-weight: 800;
}

.diagram-actions button:first-child,
.diagram-actions button:hover,
.diagram-actions a:hover {
  background: var(--lime);
  border-color: transparent;
  color: #08090b;
}

.solution-article {
  margin-top: 0;
  margin-bottom: 22px;
  padding: 24px;
}

.solution-article p:not(.eyebrow) {
  margin-bottom: 14px;
  color: rgba(255, 248, 232, 0.78);
  line-height: 1.68;
}

.solution-article p:last-child {
  margin-bottom: 0;
}

.empty-state {
  padding: 40px;
  color: var(--muted);
}

.case-detail[data-mode="question"] .answer-panel,
.case-detail[data-mode="answer"] .question-panel {
  display: none;
}

.case-detail[data-mode="question"] .case-body,
.case-detail[data-mode="answer"] .case-body {
  grid-template-columns: 1fr;
}

.case-detail[data-mode="question"] .requirement-list,
.case-detail[data-mode="question"] .reference-block pre {
  max-height: none;
}

.case-detail[data-mode="answer"] .answer-panel {
  border-left: 0;
}

.lld-problem-tools {
  display: flex;
  justify-content: flex-end;
  margin: -8px 0 18px;
}

.lld-problem-detail[data-mode="problem"] .answer-panel,
.lld-problem-detail[data-mode="solution"] .question-panel {
  display: none;
}

.lld-problem-detail[data-mode="problem"] .case-body,
.lld-problem-detail[data-mode="solution"] .case-body {
  grid-template-columns: 1fr;
}

.lld-problem-detail[data-mode="problem"] .requirement-list {
  max-height: none;
}

.lld-problem-detail[data-mode="solution"] .answer-panel {
  display: grid;
  gap: 22px;
  border-left: 0;
}

.lld-problem-detail .lld-text-panel,
.lld-problem-detail .lld-gallery-panel,
.lld-problem-detail .lld-code-panel,
.lld-modal-solution .lld-text-panel,
.lld-modal-solution .lld-gallery-panel,
.lld-modal-solution .lld-code-panel {
  background: rgba(255, 248, 232, 0.045);
}

.lld-solution-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 20px;
  color: rgba(255, 248, 232, 0.8);
  line-height: 1.62;
}

.solution-article .lld-panel-head {
  margin-bottom: 18px;
}

.solution-article h3 {
  margin: 4px 0 0;
  color: var(--ink);
}

.lld-modal-solution {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.course-placeholder {
  display: block;
  max-width: 760px;
}

.spring-root {
  display: grid;
  gap: clamp(18px, 2.4vw, 24px);
  min-height: 520px;
}

.spring-topbar {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: clamp(16px, 2.5vw, 24px);
}

.db-topbar.subject-home-head,
.spring-topbar.subject-home-head,
.lld-topbar.subject-home-head,
.hld-topbar.subject-home-head {
  display: grid;
}

.db-topbar h2,
.spring-topbar h2 {
  max-width: 840px;
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.spring-topbar p:not(.eyebrow) {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.62;
}

.spring-section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(8, 9, 11, 0.34);
}

.spring-section-tabs button,
.spring-back {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 248, 232, 0.06);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 900;
}

.spring-section-tabs button {
  padding: 9px 12px;
}

.spring-section-tabs button:hover,
.spring-section-tabs button.is-active,
.spring-back:hover {
  border-color: rgba(217, 255, 101, 0.45);
  color: var(--ink);
  transform: translateY(-1px);
}

.spring-section-tabs button.is-active {
  background: rgba(217, 255, 101, 0.12);
  color: var(--lime);
}

.spring-back {
  flex: 0 0 auto;
  padding: 10px 14px;
}

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

.spring-track-card,
.spring-topic-card {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 168px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(217, 255, 101, 0.08), transparent 45%),
    rgba(8, 9, 11, 0.42);
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.spring-topic-card {
  padding-right: 56px;
}

.spring-track-card:hover,
.spring-topic-card:hover {
  border-color: rgba(217, 255, 101, 0.38);
  transform: translateY(-2px);
}

.spring-topic-card.is-done {
  border-color: rgba(217, 255, 101, 0.48);
  background: rgba(217, 255, 101, 0.1);
}

.spring-track-meta,
.spring-topic-meta,
.spring-panel-head span {
  color: var(--lime);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.spring-panel-head span {
  max-width: 48%;
  text-align: right;
  line-height: 1.35;
}

.spring-track-card strong,
.spring-topic-card strong {
  color: var(--ink);
  font-size: clamp(1.3rem, 2.3vw, 1.9rem);
  line-height: 1.05;
}

.spring-track-card p,
.spring-topic-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
}

.spring-topic-card .progress-radio {
  position: absolute;
  top: 18px;
  right: 18px;
}

.spring-top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.spring-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 16px;
}

.spring-note-panel,
.spring-article-panel,
.spring-visual-panel,
.spring-text-panel,
.spring-code-panel {
  padding: clamp(18px, 2.6vw, 24px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(8, 9, 11, 0.42);
}

.spring-note-panel {
  grid-row: span 2;
}

.spring-code-panel {
  grid-column: 1 / -1;
}

.spring-article-panel,
.spring-visual-panel {
  grid-column: 1 / -1;
}

.spring-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.spring-note-panel h3,
.spring-article-panel h3,
.spring-visual-panel h3,
.spring-text-panel h3,
.spring-code-panel h3 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: clamp(1.25rem, 2vw, 1.65rem);
}

.spring-panel-head h3 {
  margin: 0;
}

.spring-summary {
  display: grid;
  gap: 10px;
}

.spring-summary p,
.spring-text-panel li {
  margin: 0;
  color: var(--muted);
  line-height: 1.62;
}

.spring-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.spring-chip-row span {
  padding: 7px 10px;
  border: 1px solid rgba(217, 255, 101, 0.22);
  border-radius: 999px;
  background: rgba(217, 255, 101, 0.08);
  color: var(--lime);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.spring-visual-panel {
  display: grid;
  gap: 14px;
}

.spring-visual-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(143, 184, 255, 0.2);
  border-radius: 18px;
  background:
    radial-gradient(circle at 92% 10%, rgba(143, 184, 255, 0.16), transparent 28rem),
    rgba(255, 248, 232, 0.045);
}

.spring-visual-card h4 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 1.15rem;
}

.spring-visual-card p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.56;
}

.spring-slide-card {
  display: block;
  width: 100%;
  padding: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 248, 232, 0.16);
  border-radius: 16px;
  background: #f7f2e7;
  cursor: zoom-in;
}

.spring-slide-card img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  object-fit: contain;
  background: #f7f2e7;
}

.spring-text-panel ul,
.spring-text-panel ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.spring-code-card pre {
  max-height: 520px;
}

.system-grid {
  display: block;
}

.topic-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
}

.topic-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(8, 9, 11, 0.42);
}

.topic-item.is-done,
.case-button.is-done,
.lld-topic-card.is-done {
  border-color: rgba(217, 255, 101, 0.48);
  background: rgba(217, 255, 101, 0.1);
}

.topic-item h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 1.25rem;
}

.topic-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.lld-root {
  min-height: 520px;
}

.lld-topbar {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}

.lld-topbar h2 {
  max-width: 760px;
  margin-bottom: 14px;
  font-size: clamp(2.1rem, 4vw, 4rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.lld-topbar p:not(.eyebrow) {
  max-width: 760px;
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.65;
}

.lld-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.lld-section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 28px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 9, 11, 0.5);
}

.lld-section-tabs button,
.lld-back {
  border: 1px solid var(--line);
  cursor: pointer;
  font-weight: 900;
}

.lld-section-tabs button {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
}

.lld-section-tabs button.is-active,
.lld-section-tabs button:hover,
.lld-back:hover {
  border-color: transparent;
  background: var(--lime);
  color: #08090b;
}

.lld-back {
  min-height: 40px;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(255, 248, 232, 0.08);
  color: var(--ink);
  white-space: nowrap;
}

.lld-search-box {
  position: relative;
  display: block;
  margin: 0 0 24px;
  width: min(520px, 100%);
}

.hld-search-box {
  position: relative;
  display: block;
  margin: 0 0 18px;
  width: min(520px, 100%);
}

.lld-search-box input,
.hld-search-box input {
  width: 100%;
  padding: 14px 16px 14px 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
  background: rgba(8, 9, 11, 0.62);
  color: var(--ink);
}

.lld-search-box input:focus,
.hld-search-box input:focus {
  border-color: rgba(217, 255, 101, 0.66);
}

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

.lld-track-card,
.lld-topic-card,
.lld-note-panel,
.lld-text-panel,
.lld-gallery-panel,
.lld-code-panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(8, 9, 11, 0.42);
}

.lld-track-card,
.lld-topic-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  text-align: left;
}

button.lld-track-card,
button.lld-topic-card {
  cursor: pointer;
}

.lld-track-card:hover,
.lld-topic-card:hover {
  border-color: rgba(217, 255, 101, 0.45);
  transform: translateY(-1px);
}

.lld-track-card strong,
.lld-topic-card strong {
  color: var(--ink);
  font-size: 1.2rem;
}

.lld-track-card p,
.lld-topic-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.lld-track-meta,
.lld-topic-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

.lld-topic-card {
  position: relative;
  min-height: 172px;
  padding: 24px;
  padding-right: 58px;
}

.lld-topic-card .progress-radio {
  position: absolute;
  top: 18px;
  right: 18px;
}

.lld-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  gap: 22px;
  align-items: start;
}

.lld-note-panel,
.lld-text-panel,
.lld-gallery-panel,
.lld-code-panel {
  padding: 24px;
}

.lld-code-panel {
  grid-column: 1 / -1;
}

.lld-note-panel h3,
.lld-text-panel h3,
.lld-gallery-panel h3,
.lld-code-panel h3 {
  margin-bottom: 16px;
  color: var(--ink);
}

.lld-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.lld-panel-head h3 {
  margin: 0;
}

.lld-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lld-video-action,
.lld-note-action {
  position: relative;
  display: inline-grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 248, 232, 0.08);
  color: var(--lime);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 900;
}

.lld-video-action {
  color: #ff6b63;
}

.lld-video-action[data-source-label]::after {
  content: attr(data-source-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  min-width: 28px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 9, 11, 0.94);
  color: var(--ink);
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translate(-50%, 4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.lld-video-action[data-source-label]:hover::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.lld-video-action:hover,
.lld-note-action:hover {
  border-color: transparent;
  background: var(--lime);
  color: #08090b;
  transform: translateY(-1px);
}

.lld-note-panel ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.58;
}

.lld-text-panel {
  display: grid;
  gap: 14px;
}

.lld-text-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.lld-text-panel ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lld-text-panel li {
  position: relative;
  padding: 12px 14px 12px 38px;
  border: 1px solid rgba(255, 248, 232, 0.08);
  border-radius: 14px;
  background: rgba(255, 248, 232, 0.04);
  color: var(--muted);
  line-height: 1.55;
}

.lld-text-panel li::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 18px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--lime);
  box-shadow: 0 0 16px rgba(217, 255, 101, 0.35);
}

.lld-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: 16px;
  align-items: start;
}

.lld-image-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 248, 232, 0.05);
  cursor: pointer;
  text-align: left;
}

.lld-image-card img {
  width: 100%;
  max-height: 620px;
  border-radius: 12px;
  aspect-ratio: 16 / 10;
  height: auto;
  object-fit: contain;
  background: #fff;
}

.lld-image-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.lld-code-stack {
  display: grid;
  gap: 18px;
}

.lld-code-card {
  --code-bg: #0b0f14;
  --code-head-bg: linear-gradient(180deg, #111820, #0d1219);
  --code-border: rgba(143, 184, 255, 0.2);
  --code-divider: rgba(143, 184, 255, 0.16);
  --code-gutter: rgba(255, 248, 232, 0.035);
  --code-row: rgba(255, 255, 255, 0.018);
  --code-text: #dce8ff;
  --code-title: #fff8e8;
  --code-muted: rgba(255, 248, 232, 0.72);
  overflow: hidden;
  border: 1px solid var(--code-border);
  border-radius: 18px;
  background:
    linear-gradient(90deg, var(--code-gutter) 44px, transparent 44px),
    var(--code-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.lld-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 12px 16px;
  border-bottom: 1px solid var(--code-divider);
  background: var(--code-head-bg);
  color: var(--code-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.lld-code-head::before {
  content: "";
  flex: 0 0 auto;
  width: 38px;
  height: 10px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 5px 5px, #ff6b63 4px, transparent 4.5px),
    radial-gradient(circle at 19px 5px, #ffbf4d 4px, transparent 4.5px),
    radial-gradient(circle at 33px 5px, #55d86a 4px, transparent 4.5px);
}

.lld-code-head span {
  min-width: 0;
}

.lld-code-head span:first-child {
  overflow: hidden;
  color: var(--code-title);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-theme-toggle {
  flex: 0 0 auto;
  position: relative;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--code-divider);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--code-muted);
  cursor: pointer;
  overflow: hidden;
}

.code-theme-toggle:hover {
  background: var(--lime);
  color: #08090b;
}

.code-theme-toggle .sun,
.code-theme-toggle .moon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition: transform 220ms ease, opacity 220ms ease;
}

.code-theme-toggle .sun::before {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ffb13d;
  box-shadow:
    0 0 0 3px rgba(255, 177, 61, 0.16),
    0 0 12px rgba(255, 177, 61, 0.28);
}

.code-theme-toggle .moon::before {
  content: "";
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow:
    inset -5px 0 0 var(--code-bg),
    0 0 12px rgba(217, 255, 101, 0.28);
}

.code-theme-toggle[data-code-theme-current="dark"] .sun {
  opacity: 0;
  transform: translateY(24px);
}

.code-theme-toggle[data-code-theme-current="light"] .moon {
  opacity: 0;
  transform: translateY(-24px);
}

.lld-code-card pre {
  max-height: 460px;
  margin: 0;
  overflow: auto;
  padding: 20px 20px 20px 60px;
  background:
    repeating-linear-gradient(
      to bottom,
      var(--code-row) 0,
      var(--code-row) 1px,
      transparent 1px,
      transparent 26px
    );
}

.lld-code-card code {
  color: var(--code-text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.7;
  white-space: pre;
}

.lld-empty {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.lld-note-modal {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 248, 232, 0.06);
}

.lld-note-modal ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 20px;
  color: rgba(255, 248, 232, 0.82);
  line-height: 1.68;
}

.lld-note-modal-head {
  max-width: 980px;
}

.hld-root {
  display: grid;
  gap: 24px;
}

.hld-topbar {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.hld-topbar h2 {
  max-width: 780px;
  margin-bottom: 14px;
  font-size: clamp(2.35rem, 5vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.hld-topbar p:not(.eyebrow) {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.hld-progress-pill {
  flex: 0 0 auto;
  padding: 12px 16px;
  border: 1px solid rgba(217, 255, 101, 0.3);
  border-radius: 999px;
  background: rgba(217, 255, 101, 0.12);
  color: var(--lime);
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.hld-section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 9, 11, 0.5);
}

.hld-section-tabs button {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.hld-back {
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 248, 232, 0.08);
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  white-space: nowrap;
}

.hld-section-tabs button:hover,
.hld-section-tabs button.is-active,
.hld-back:hover {
  border-color: transparent;
  background: var(--lime);
  color: #08090b;
}

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

.hld-track-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(8, 9, 11, 0.42);
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.hld-track-card:hover {
  border-color: rgba(217, 255, 101, 0.45);
  transform: translateY(-1px);
}

.hld-track-card strong {
  color: var(--ink);
  font-size: 1.2rem;
}

.hld-track-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.hld-track-meta {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hld-subtopic-head,
.hld-coming-soon {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(8, 9, 11, 0.34);
}

.hld-coming-soon {
  position: relative;
  align-items: flex-start;
  justify-content: flex-start;
  max-width: 760px;
  min-height: auto;
  padding: 24px 24px 24px 82px;
  overflow: hidden;
}

.hld-coming-soon::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(217, 255, 101, 0.09), transparent 52%);
  pointer-events: none;
}

.hld-coming-soon > div {
  position: relative;
  z-index: 1;
}

.hld-coming-icon {
  position: absolute;
  left: 24px;
  top: 24px;
  z-index: 1;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(217, 255, 101, 0.28);
  border-radius: 999px;
  background: rgba(217, 255, 101, 0.1);
  color: var(--lime);
  font-weight: 900;
}

.hld-subtopic-head h3,
.hld-coming-soon h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: clamp(1.6rem, 3vw, 2.7rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

.hld-coming-soon h3 {
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  letter-spacing: -0.03em;
}

.hld-subtopic-head p:not(.eyebrow),
.hld-coming-soon p:not(.eyebrow) {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.hld-page-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(8, 9, 11, 0.34);
}

.hld-page-menu a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 248, 232, 0.06);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.hld-page-menu a:hover {
  border-color: rgba(217, 255, 101, 0.45);
  color: var(--ink);
  transform: translateY(-1px);
}

.hld-page-menu span {
  color: var(--lime);
  font-weight: 900;
}

.hld-page-stack {
  display: grid;
  gap: 14px;
}

.hld-empty {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 248, 232, 0.04);
  color: var(--muted);
  line-height: 1.55;
}

.hld-sheet-page {
  scroll-margin-top: 100px;
  padding: 0;
  border: 1px solid rgba(255, 248, 232, 0.12);
  border-radius: 18px;
  background: rgba(8, 9, 11, 0.34);
  overflow: hidden;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.hld-sheet-page.is-done {
  border-color: rgba(217, 255, 101, 0.34);
  background: rgba(217, 255, 101, 0.06);
}

.hld-sheet-page[open] {
  border-color: rgba(255, 248, 232, 0.18);
  background: rgba(8, 9, 11, 0.56);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.2);
}

.hld-sheet-page summary {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-height: 74px;
  padding: 14px 16px 14px 20px;
  cursor: pointer;
  list-style: none;
}

.hld-sheet-page summary::-webkit-details-marker {
  display: none;
}

.hld-sheet-page summary > div {
  min-width: 0;
}

.hld-sheet-page summary .eyebrow {
  margin-bottom: 6px;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
}

.hld-sheet-page h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.08rem, 2vw, 1.45rem);
  line-height: 1.15;
  letter-spacing: 0;
}

.hld-collapse-cue {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(255, 248, 232, 0.16);
  border-radius: 999px;
  color: var(--lime);
  transition: background 180ms ease, color 180ms ease;
}

.hld-collapse-cue::before {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 180ms ease;
}

.hld-sheet-page[open] .hld-collapse-cue {
  background: var(--lime);
  color: #08090b;
}

.hld-sheet-page[open] .hld-collapse-cue::before {
  transform: translateY(2px) rotate(225deg);
}

.hld-check {
  width: 20px;
  height: 20px;
  border-color: rgba(255, 248, 232, 0.2);
}

.hld-check::before {
  width: 7px;
  height: 7px;
}

.hld-check::after {
  right: calc(100% + 8px);
  left: auto;
  padding: 7px 9px;
  transform: translate(6px, -50%);
}

.hld-check:hover::after {
  transform: translate(0, -50%);
}

.hld-card-body {
  display: grid;
  gap: 20px;
  margin: 0 16px 16px;
  padding: 18px;
  border: 1px solid rgba(255, 248, 232, 0.1);
  border-radius: 16px;
  background: rgba(255, 248, 232, 0.035);
}

.hld-card-body.has-diagram {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 34%);
  align-items: start;
}

.hld-text-content {
  display: grid;
  gap: 14px;
}

.hld-intro {
  margin: 0;
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.65;
}

.hld-content-section {
  padding: 14px 16px;
  border: 1px solid rgba(255, 248, 232, 0.1);
  border-radius: 14px;
  background: rgba(8, 9, 11, 0.18);
}

.hld-content-section h4 {
  margin: 0 0 10px;
  color: var(--lime);
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hld-content-section ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.58;
}

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

.hld-callouts div {
  padding: 14px;
  border: 1px solid rgba(217, 255, 101, 0.2);
  border-radius: 14px;
  background: rgba(217, 255, 101, 0.08);
}

.hld-callouts span {
  display: block;
  margin-bottom: 8px;
  color: var(--lime);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hld-callouts p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.hld-diagram-card {
  display: block;
  width: 100%;
  padding: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 248, 232, 0.14);
  border-radius: 18px;
  background: #fff;
  cursor: zoom-in;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.hld-diagram-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.progress-radio {
  position: relative;
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 248, 232, 0.08);
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.progress-radio::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: transparent;
  transition: background 180ms ease;
}

.progress-radio::after {
  content: attr(aria-label);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  width: max-content;
  max-width: 150px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 9, 11, 0.94);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transform: translate(-6px, -50%);
  transition: opacity 160ms ease, transform 160ms ease;
  white-space: nowrap;
  z-index: 3;
}

.progress-radio:hover {
  transform: scale(1.08);
  border-color: rgba(217, 255, 101, 0.7);
}

.progress-radio:hover::after {
  opacity: 1;
  transform: translate(0, -50%);
}

.progress-radio[aria-pressed="true"] {
  border-color: var(--lime);
  background: var(--lime);
}

.progress-radio[aria-pressed="true"]::before {
  background: #08090b;
}

.db-workspace .progress-radio,
.lld-workspace .progress-radio {
  width: 22px;
  height: 22px;
  border-width: 1px;
}

.db-workspace .progress-radio::before,
.lld-workspace .progress-radio::before {
  width: 8px;
  height: 8px;
}

.db-workspace .progress-radio::after,
.lld-workspace .progress-radio::after {
  right: calc(100% + 8px);
  left: auto;
  padding: 7px 9px;
  transform: translate(6px, -50%);
}

.db-workspace .progress-radio:hover::after,
.lld-workspace .progress-radio:hover::after {
  transform: translate(0, -50%);
}

.db-workspace .case-check {
  position: absolute;
  top: 14px;
  right: 14px;
}

.db-workspace .detail-check {
  position: absolute;
  top: 18px;
  right: 18px;
}

.db-case-actions .detail-check {
  position: static;
}

.lld-workspace .lld-topic-card .progress-radio {
  position: absolute;
  top: 18px;
  right: 18px;
}


.credit-card {
  background: rgba(255, 248, 232, 0.1);
}

.credit-card a {
  color: var(--lime);
  font-weight: 900;
}

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

.credit-links a,
.credit-links span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 248, 232, 0.08);
  text-decoration: none;
}

.credit-links a:hover {
  border-color: transparent;
  background: var(--lime);
  color: #08090b;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(0, 0, 0, 0.86);
}

.study-scroll-top {
  position: fixed;
  right: clamp(16px, 3vw, 34px);
  bottom: clamp(18px, 3vw, 34px);
  z-index: 42;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(217, 255, 101, 0.34);
  border-radius: 999px;
  background: rgba(8, 9, 11, 0.78);
  color: var(--lime);
  cursor: pointer;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.26);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease, background 180ms ease, color 180ms ease;
  backdrop-filter: blur(14px);
}

.study-scroll-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.study-scroll-top:hover {
  background: var(--lime);
  color: #08090b;
  transform: translateY(-2px);
}

.image-lightbox[hidden] {
  display: none;
}

.image-lightbox button {
  position: fixed;
  top: 24px;
  right: 24px;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--lime);
  color: #08090b;
  font-weight: 900;
}

.image-lightbox img {
  max-width: min(96vw, 1500px);
  max-height: 88vh;
  border-radius: 18px;
  background: #f7f2e7;
}

.study-modal {
  position: fixed;
  inset: 0;
  z-index: 48;
  padding: 26px;
}

.study-modal[hidden] {
  display: none;
}

.study-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
}

.study-modal-panel {
  position: relative;
  width: min(1480px, 100%);
  max-height: calc(100vh - 52px);
  margin: 0 auto;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 86% 8%, rgba(217, 255, 101, 0.14), transparent 28rem),
    linear-gradient(135deg, #08090b 0%, #12161a 58%, #181710 100%);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.56);
}

.study-modal-close {
  position: sticky;
  top: 18px;
  left: 100%;
  z-index: 2;
  width: 42px;
  height: 42px;
  min-height: 42px;
  margin: 18px 18px 0 auto;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: var(--lime);
  color: #08090b;
  cursor: pointer;
  font-weight: 900;
}

.study-modal-content {
  padding: 0 clamp(20px, 4vw, 38px) clamp(24px, 5vw, 44px);
}

.study-modal-head {
  max-width: 920px;
  margin: 0 0 24px;
}

.study-modal-head h2 {
  margin-bottom: 14px;
  font-size: clamp(2.3rem, 5vw, 4.8rem);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.study-modal-head p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.65;
}

.study-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  gap: 20px;
}

.study-modal-grid > section {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 248, 232, 0.06);
}

.modal-requirements {
  max-height: 620px;
}

.modal-diagram img {
  max-height: 720px;
}

.modal-reference pre {
  max-height: 430px;
}

.approach-block + .approach-block {
  margin-top: 18px;
}

.approach-block > p {
  margin: -6px 0 14px;
  color: var(--muted);
  line-height: 1.6;
}

body[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f2e8;
  --panel: rgba(20, 24, 22, 0.07);
  --panel-strong: rgba(20, 24, 22, 0.12);
  --ink: #151713;
  --muted: rgba(21, 23, 19, 0.68);
  --faint: rgba(20, 24, 22, 0.1);
  --line: rgba(20, 24, 22, 0.16);
  --lime: #5e7f00;
  --amber: #aa6200;
  --blue: #2c65b8;
  --dark-card: rgba(255, 255, 255, 0.76);
  --shadow: 0 24px 70px rgba(60, 50, 32, 0.16);
  background:
    radial-gradient(circle at 82% 4%, rgba(94, 127, 0, 0.18), transparent 28rem),
    radial-gradient(circle at 5% 92%, rgba(170, 98, 0, 0.13), transparent 24rem),
    linear-gradient(135deg, #faf7ee 0%, #f0eadb 54%, #e8eedf 100%);
  color: var(--ink);
}

body[data-theme="light"] .study-noise {
  background-image:
    linear-gradient(rgba(21, 23, 19, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 23, 19, 0.045) 1px, transparent 1px);
}

body[data-theme="light"] .study-header,
body[data-theme="light"] .home-progress,
body[data-theme="light"] .study-tools,
body[data-theme="light"] .case-detail,
body[data-theme="light"] .case-button,
body[data-theme="light"] .question-card,
body[data-theme="light"] .requirements-card,
body[data-theme="light"] .solution-article,
body[data-theme="light"] .reference-block,
body[data-theme="light"] .course-placeholder,
body[data-theme="light"] .spring-track-card,
body[data-theme="light"] .spring-topic-card,
body[data-theme="light"] .spring-note-panel,
body[data-theme="light"] .spring-article-panel,
body[data-theme="light"] .spring-visual-panel,
body[data-theme="light"] .spring-text-panel,
body[data-theme="light"] .spring-code-panel,
body[data-theme="light"] .lld-track-card,
body[data-theme="light"] .lld-topic-card,
body[data-theme="light"] .lld-note-panel,
body[data-theme="light"] .lld-text-panel,
body[data-theme="light"] .lld-gallery-panel,
body[data-theme="light"] .lld-code-panel,
body[data-theme="light"] .hld-track-card,
body[data-theme="light"] .hld-sheet-page,
body[data-theme="light"] .credit-card {
  background: rgba(255, 255, 255, 0.58);
}

body[data-theme="light"] .hld-sheet-page[open] {
  border-color: rgba(35, 92, 135, 0.18);
  background:
    linear-gradient(180deg, rgba(248, 251, 253, 0.96), rgba(242, 247, 250, 0.9));
  box-shadow: 0 18px 44px rgba(36, 58, 79, 0.1);
}

body[data-theme="light"] .hld-card-body,
body[data-theme="light"] .hld-content-section {
  border-color: rgba(35, 92, 135, 0.12);
  background: rgba(255, 255, 255, 0.58);
}

body[data-theme="light"] .hld-sheet-page summary .eyebrow,
body[data-theme="light"] .hld-content-section h4,
body[data-theme="light"] .hld-callouts span {
  color: #1f6f8b;
}

body[data-theme="light"] .hld-collapse-cue {
  border-color: rgba(35, 92, 135, 0.2);
  background: rgba(238, 244, 248, 0.78);
  color: #1f6f8b;
}

body[data-theme="light"] .hld-sheet-page[open] .hld-collapse-cue {
  background: linear-gradient(135deg, #1f6f8b, #38a3a5);
  color: #f8fbff;
}

body[data-theme="light"] .hld-check {
  border-color: rgba(35, 92, 135, 0.28);
  background: rgba(248, 251, 253, 0.9);
}

body[data-theme="light"] .hld-check[aria-pressed="true"] {
  border-color: #1f6f8b;
  background: linear-gradient(135deg, #1f6f8b, #38a3a5);
}

body[data-theme="light"] .hld-check[aria-pressed="true"]::before {
  background: #f8fbff;
}

body[data-theme="light"] .spring-track-card:hover,
body[data-theme="light"] .spring-topic-card:hover,
body[data-theme="light"] .lld-track-card:hover,
body[data-theme="light"] .lld-topic-card:hover,
body[data-theme="light"] .hld-track-card:hover {
  border-color: rgba(31, 111, 139, 0.5);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(238, 248, 250, 0.92));
  box-shadow: 0 16px 34px rgba(31, 111, 139, 0.14), 0 0 0 1px rgba(31, 111, 139, 0.08);
}

body[data-theme="light"] .progress-row {
  background: rgba(255, 255, 255, 0.72);
}

body[data-theme="light"] .progress-row:hover,
body[data-theme="light"] .progress-row:focus-visible {
  border-color: rgba(31, 111, 139, 0.48);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(238, 248, 250, 0.94));
  box-shadow: 0 16px 36px rgba(31, 111, 139, 0.15), 0 0 0 1px rgba(31, 111, 139, 0.08);
}

body[data-theme="light"] .progress-row i {
  background: rgba(94, 127, 0, 0.16);
  box-shadow: inset 0 0 0 1px rgba(94, 127, 0, 0.08);
}

body[data-theme="light"] .progress-row i::before {
  background: linear-gradient(90deg, #5e7f00, #d2931f);
  box-shadow: 0 0 18px rgba(94, 127, 0, 0.22);
}

body[data-theme="light"] .hero-copy,
body[data-theme="light"] .db-workspace,
body[data-theme="light"] .spring-workspace,
body[data-theme="light"] .lld-workspace,
body[data-theme="light"] .hld-workspace {
  background:
    radial-gradient(circle at 92% 18%, rgba(94, 127, 0, 0.15), transparent 34rem),
    rgba(255, 255, 255, 0.54);
}

body[data-theme="light"] .study-header {
  background: rgba(250, 247, 238, 0.78);
}

body[data-theme="light"] .study-back-icon {
  border-color: rgba(35, 92, 135, 0.18);
  background: rgba(248, 251, 253, 0.78);
  color: #1f6f8b;
  box-shadow: 0 8px 18px rgba(36, 58, 79, 0.08);
}

body[data-theme="light"] .study-back-icon::after {
  border-color: rgba(35, 92, 135, 0.14);
  background: rgba(248, 251, 253, 0.96);
  color: #17212b;
  box-shadow: 0 10px 24px rgba(36, 58, 79, 0.12);
}

body[data-theme="light"] .study-back-icon:hover {
  border-color: transparent;
  background: linear-gradient(135deg, #1f6f8b, #38a3a5);
  color: #f8fbff;
}

body[data-theme="light"] .study-nav a:hover,
body[data-theme="light"] .study-nav button:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.76);
  color: #17212b;
  box-shadow: inset 0 0 0 1px rgba(31, 111, 139, 0.22), 0 8px 18px rgba(31, 111, 139, 0.1);
}

body[data-theme="light"] .study-brand span,
body[data-theme="light"] .study-theme-toggle:hover,
body[data-theme="light"] .answer-popup-card button,
body[data-theme="light"] .diagram-actions button:first-child,
body[data-theme="light"] .diagram-actions button:hover,
body[data-theme="light"] .diagram-actions a:hover,
body[data-theme="light"] .image-lightbox button,
body[data-theme="light"] .study-modal-close,
body[data-theme="light"] .study-back:hover,
body[data-theme="light"] .spring-back:hover,
body[data-theme="light"] .lld-back:hover,
body[data-theme="light"] .hld-back:hover,
body[data-theme="light"] .lld-section-tabs button.is-active,
body[data-theme="light"] .lld-section-tabs button:hover {
  color: #f8f4ea;
}

body[data-theme="light"] .study-nav button.is-active,
body[data-theme="light"] .view-switch button.is-active,
body[data-theme="light"] .case-button.is-active,
body[data-theme="light"] .spring-section-tabs button.is-active,
body[data-theme="light"] .lld-section-tabs button.is-active,
body[data-theme="light"] .hld-section-tabs button.is-active {
  border-color: rgba(35, 92, 135, 0.5);
  background: linear-gradient(135deg, #1f6f8b, #38a3a5);
  color: #f8fbff;
  box-shadow: 0 10px 24px rgba(31, 111, 139, 0.2);
}

body[data-theme="light"] .spring-section-tabs button:hover,
body[data-theme="light"] .lld-section-tabs button:not(.is-active):hover,
body[data-theme="light"] .hld-section-tabs button:hover,
body[data-theme="light"] .hld-back:hover,
body[data-theme="light"] .case-button:hover {
  border-color: rgba(31, 111, 139, 0.44);
  background: rgba(238, 248, 250, 0.92);
  color: #1f4454;
  box-shadow: 0 10px 22px rgba(31, 111, 139, 0.1);
}

body[data-theme="light"] .spring-section-tabs button.is-active:hover,
body[data-theme="light"] .lld-section-tabs button.is-active:hover,
body[data-theme="light"] .hld-section-tabs button.is-active:hover,
body[data-theme="light"] .case-button.is-active:hover {
  color: #fffaf0;
}

body[data-theme="light"] .case-button.is-active {
  border-color: rgba(31, 111, 139, 0.58);
  background: linear-gradient(135deg, #1f6f8b, #38a3a5);
  color: #f8fbff;
  box-shadow: 0 14px 30px rgba(31, 111, 139, 0.2);
}

body[data-theme="light"] .case-button.is-active strong {
  background: rgba(255, 255, 255, 0.88);
  color: #1f6f8b;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.62), 0 8px 18px rgba(23, 33, 43, 0.12);
}

body[data-theme="light"] .case-button.is-active .case-title {
  color: #ffffff;
}

body[data-theme="light"] .case-button.is-active .case-meta {
  color: rgba(248, 251, 255, 0.8);
}

body[data-theme="light"] .case-button.is-active .progress-radio {
  border-color: rgba(255, 255, 255, 0.66);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 6px 14px rgba(23, 33, 43, 0.14);
}

body[data-theme="light"] .case-button.is-active .progress-radio[aria-pressed="true"] {
  background: #ffffff;
}

body[data-theme="light"] .case-button.is-active .progress-radio[aria-pressed="true"]::before {
  background: #1f6f8b;
}

body[data-theme="light"] .search-box input,
body[data-theme="light"] .lld-search-box input,
body[data-theme="light"] .hld-search-box input,
body[data-theme="light"] .view-switch button,
body[data-theme="light"] .spring-section-tabs,
body[data-theme="light"] .lld-section-tabs,
body[data-theme="light"] .hld-section-tabs,
body[data-theme="light"] .hld-subtopic-head,
body[data-theme="light"] .hld-coming-soon,
body[data-theme="light"] .hld-page-menu,
body[data-theme="light"] .hld-page-menu a,
body[data-theme="light"] .credit-links a,
body[data-theme="light"] .credit-links span,
body[data-theme="light"] .progress-radio,
body[data-theme="light"] .study-theme-toggle,
body[data-theme="light"] .study-scroll-top {
  background: rgba(255, 255, 255, 0.62);
}

body[data-theme="light"] .study-tools {
  border-color: rgba(35, 92, 135, 0.14);
  background: rgba(246, 248, 251, 0.56);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body[data-theme="light"] .search-box input,
body[data-theme="light"] .lld-search-box input,
body[data-theme="light"] .hld-search-box input {
  border-color: rgba(35, 92, 135, 0.18);
  background: linear-gradient(180deg, rgba(245, 249, 252, 0.94), rgba(238, 244, 248, 0.9));
  color: #17212b;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 8px 18px rgba(36, 58, 79, 0.06);
}

body[data-theme="light"] .search-box input::placeholder,
body[data-theme="light"] .lld-search-box input::placeholder,
body[data-theme="light"] .hld-search-box input::placeholder {
  color: rgba(23, 33, 43, 0.48);
}

body[data-theme="light"] .search-box input:focus,
body[data-theme="light"] .lld-search-box input:focus,
body[data-theme="light"] .hld-search-box input:focus {
  border-color: rgba(31, 111, 139, 0.58);
  background: #f8fbfd;
  box-shadow: 0 0 0 4px rgba(31, 111, 139, 0.12), 0 10px 22px rgba(36, 58, 79, 0.08);
}

body[data-theme="light"] .search-box::before,
body[data-theme="light"] .search-box::after,
body[data-theme="light"] .lld-search-box::before,
body[data-theme="light"] .lld-search-box::after,
body[data-theme="light"] .hld-search-box::before,
body[data-theme="light"] .hld-search-box::after {
  color: rgba(23, 33, 43, 0.56);
}

body[data-theme="light"] .view-switch {
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(35, 92, 135, 0.14);
  border-radius: 999px;
  background: rgba(238, 244, 248, 0.72);
}

body[data-theme="light"] .view-switch button {
  border-color: transparent;
  background: transparent;
  color: rgba(23, 33, 43, 0.72);
  box-shadow: none;
}

body[data-theme="light"] .view-switch button:not(.is-active):hover {
  background: rgba(255, 255, 255, 0.72);
  color: #17212b;
}

body[data-theme="light"] .requirement-list li,
body[data-theme="light"] .lld-text-panel li,
body[data-theme="light"] .hld-callouts div,
body[data-theme="light"] .spring-visual-card,
body[data-theme="light"] .answer-popup-card,
body[data-theme="light"] .answer-diagram-card {
  background: rgba(255, 255, 255, 0.5);
}

body[data-theme="light"] .hld-callouts div {
  border-color: rgba(35, 92, 135, 0.14);
  background: linear-gradient(180deg, rgba(248, 251, 253, 0.86), rgba(239, 246, 249, 0.72));
}

body[data-theme="light"] .requirement-list li,
body[data-theme="light"] .reference-block pre,
body[data-theme="light"] .solution-article p:not(.eyebrow),
body[data-theme="light"] .lld-note-modal ul,
body[data-theme="light"] .hld-intro {
  color: rgba(23, 33, 43, 0.78);
}

body[data-theme="light"] .answer-panel {
  background: rgba(255, 255, 255, 0.34);
}

body[data-theme="light"] .lld-video-action[data-source-label]::after {
  border-color: rgba(35, 92, 135, 0.14);
  background: rgba(248, 251, 253, 0.96);
  color: #17212b;
  box-shadow: 0 10px 24px rgba(36, 58, 79, 0.12);
}

body[data-theme="light"] .answer-popup-card button,
body[data-theme="light"] .diagram-actions button:first-child,
body[data-theme="light"] .image-lightbox button,
body[data-theme="light"] .study-modal-close {
  border: 1px solid rgba(31, 111, 139, 0.38);
  background: linear-gradient(135deg, #1f6f8b, #38a3a5);
  color: #f8fbff;
  box-shadow: 0 12px 26px rgba(31, 111, 139, 0.18);
}

body[data-theme="light"] .answer-popup-card button:hover,
body[data-theme="light"] .diagram-actions button:first-child:hover,
body[data-theme="light"] .image-lightbox button:hover,
body[data-theme="light"] .study-modal-close:hover {
  border-color: rgba(31, 111, 139, 0.54);
  background: linear-gradient(135deg, #185b74, #2f9092);
  box-shadow: 0 16px 32px rgba(31, 111, 139, 0.24);
  transform: translateY(-1px);
}

body[data-theme="light"] .diagram-actions button:not(:first-child),
body[data-theme="light"] .diagram-actions a {
  border-color: rgba(35, 92, 135, 0.18);
  background: rgba(248, 251, 253, 0.82);
  color: #1f4454;
}

body[data-theme="light"] .diagram-actions button:not(:first-child):hover,
body[data-theme="light"] .diagram-actions a:hover {
  border-color: rgba(31, 111, 139, 0.44);
  background: rgba(238, 248, 250, 0.94);
  color: #1f4454;
  box-shadow: 0 10px 22px rgba(31, 111, 139, 0.1);
}

body[data-theme="light"] .lld-problem-detail .lld-text-panel,
body[data-theme="light"] .lld-problem-detail .lld-gallery-panel,
body[data-theme="light"] .lld-problem-detail .lld-code-panel,
body[data-theme="light"] .lld-modal-solution .lld-text-panel,
body[data-theme="light"] .lld-modal-solution .lld-gallery-panel,
body[data-theme="light"] .lld-modal-solution .lld-code-panel {
  background: rgba(255, 255, 255, 0.5);
}

body[data-theme="light"] .lld-solution-list {
  color: rgba(21, 23, 19, 0.78);
}

body[data-theme="light"] .diagram-shell,
body[data-theme="light"] .spring-slide-card,
body[data-theme="light"] .image-lightbox img {
  background: #fff;
}

body[data-theme="light"] .study-modal-panel {
  background:
    radial-gradient(circle at 86% 8%, rgba(94, 127, 0, 0.12), transparent 28rem),
    linear-gradient(135deg, #fbf8ef 0%, #f0eadb 58%, #e8eedf 100%);
}

body[data-theme="light"] .lld-code-card:not([data-code-theme="dark"]),
.lld-code-card[data-code-theme="light"] {
  --code-bg: #fbfaf7;
  --code-head-bg: linear-gradient(180deg, #f4efe3, #e9e1d1);
  --code-border: rgba(20, 24, 22, 0.16);
  --code-divider: rgba(20, 24, 22, 0.14);
  --code-gutter: rgba(20, 24, 22, 0.055);
  --code-row: rgba(20, 24, 22, 0.035);
  --code-text: #1d2930;
  --code-title: #151713;
  --code-muted: rgba(21, 23, 19, 0.64);
}

.lld-code-card[data-code-theme="dark"] {
  --code-bg: #0b0f14;
  --code-head-bg: linear-gradient(180deg, #111820, #0d1219);
  --code-border: rgba(143, 184, 255, 0.2);
  --code-divider: rgba(143, 184, 255, 0.16);
  --code-gutter: rgba(255, 248, 232, 0.035);
  --code-row: rgba(255, 255, 255, 0.018);
  --code-text: #dce8ff;
  --code-title: #fff8e8;
  --code-muted: rgba(255, 248, 232, 0.72);
}

@media (min-width: 1440px) {
  :root {
    --page-max: 1360px;
  }

  main {
    padding-bottom: 110px;
  }

  .db-layout {
    grid-template-columns: 330px minmax(0, 1fr);
  }

  .spring-detail-grid,
  .lld-detail-grid {
    gap: 24px;
  }

  .hld-card-body.has-diagram {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 34%);
  }
}

@media (max-width: 1120px) {
  .study-header {
    position: sticky;
    align-items: center;
    flex-direction: row;
    flex-wrap: nowrap;
    width: min(var(--page-max), calc(100% - 24px));
    gap: 10px;
    padding: 10px;
  }

  .study-brand {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    justify-content: flex-start;
  }

  .study-nav-toggle {
    display: grid;
    order: 2;
  }

  .study-theme-toggle {
    order: 3;
  }

  .study-nav {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 8;
    display: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 12px;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(8, 9, 11, 0.96);
    box-shadow: 0 24px 62px rgba(0, 0, 0, 0.36);
    backdrop-filter: blur(18px);
  }

  .study-header.is-nav-open .study-nav {
    display: grid;
  }

  .study-nav a,
  .study-nav button {
    display: flex;
    justify-content: center;
    min-height: 42px;
    padding: 10px;
    border: 1px solid var(--line);
    background: rgba(255, 248, 232, 0.045);
    font-size: 0.78rem;
    white-space: normal;
    text-align: center;
  }

  .db-layout {
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 18px;
  }

  .case-header h3 {
    font-size: 3rem;
  }
}

@media (max-width: 980px) {
  .study-header,
  main,
  .study-footer {
    width: min(100% - 24px, 860px);
  }

  .study-hero,
  .section-head,
  .subject-home-head,
  .db-layout,
  .case-body,
  .course-placeholder,
  .spring-section-grid,
  .spring-topic-grid,
  .spring-detail-grid,
  .lld-section-grid,
  .lld-topic-grid,
  .lld-detail-grid,
  .hld-section-grid,
  .hld-topbar,
  .hld-card-body.has-diagram,
  .study-modal-grid {
    grid-template-columns: 1fr;
  }

  .case-list {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }

  .case-detail {
    border-radius: 22px;
  }

  .spring-note-panel,
  .lld-note-panel {
    grid-row: auto;
  }

  .topic-list {
    grid-template-columns: 1fr;
  }

  .answer-panel {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .study-modal {
    padding: 12px;
  }

  .study-modal-panel {
    max-height: calc(100vh - 24px);
    border-radius: 22px;
  }

  .study-modal-close {
    top: 12px;
    margin: 12px 12px 0 auto;
  }
}

@media (max-width: 820px) {
  .study-header {
    position: sticky;
    gap: 10px;
    margin-top: 10px;
    padding: 10px;
    border-radius: 20px;
  }

  .study-brand {
    width: 100%;
    justify-content: flex-start;
    padding: 6px 8px;
  }

  .study-nav,
  .spring-section-tabs,
  .lld-section-tabs,
  .hld-section-tabs,
  .hld-page-menu {
    flex-wrap: nowrap;
    justify-content: flex-start;
    margin-inline: -4px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 10px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .study-nav a,
  .study-nav button,
  .spring-section-tabs button,
  .lld-section-tabs button,
  .hld-section-tabs button,
  .hld-page-menu a {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .home-progress {
    padding: 10px;
  }

  .case-list {
    grid-template-columns: 1fr;
  }

  .db-workspace.is-menu-only .case-list {
    grid-template-columns: 1fr;
  }

  .case-body,
  .answer-diagram-card,
  .spring-visual-card,
  .hld-section-grid,
  .hld-callouts {
    grid-template-columns: 1fr;
  }

  .answer-panel {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .spring-slide-card img {
    max-height: 360px;
  }

  .hld-sheet-page summary {
    padding-block: 16px;
  }
}

@media (max-width: 680px) {
  :root {
    --page-gutter: 12px;
  }

  .study-header {
    top: 8px;
  }

  .study-nav {
    justify-content: flex-start;
  }

  main {
    padding-top: 28px;
    padding-bottom: 72px;
  }

  .study-hero {
    min-height: auto;
  }

  .progress-row,
  .case-list,
  .system-grid,
  .topic-list,
  .spring-visual-card,
  .lld-section-grid,
  .lld-topic-grid,
  .lld-detail-grid,
  .hld-callouts {
    grid-template-columns: 1fr;
  }

  .progress-row span {
    text-align: left;
  }

  .study-tools,
  .case-header-row,
  .answer-popup-card,
  .hld-subtopic-head {
    align-items: stretch;
    flex-direction: column;
  }

  .hld-coming-soon {
    max-width: none;
    padding: 22px 20px 22px 72px;
  }

  .answer-diagram-card {
    grid-template-columns: 1fr;
  }

  .view-switch {
    justify-content: flex-start;
  }

  .lld-problem-tools {
    justify-content: flex-start;
    margin-top: 0;
  }

  .hero-copy,
  .db-workspace,
  .course-placeholder,
  .spring-workspace,
  .lld-workspace,
  .hld-workspace,
  .credit-card,
  .case-header,
  .question-panel,
  .answer-panel,
  .study-modal-grid > section {
    padding: 18px;
  }

  .db-workspace,
  .course-placeholder,
  .spring-workspace,
  .lld-workspace,
  .hld-workspace {
    --section-pad: 18px;
  }

  .hero-copy,
  .db-workspace,
  .course-placeholder,
  .spring-workspace,
  .lld-workspace,
  .hld-workspace,
  .credit-card {
    border-radius: 22px;
  }

  .study-tools {
    gap: 14px;
  }

  .study-footer {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 72px;
  }

  .search-box {
    width: 100%;
  }

  .case-header {
    padding: 22px 54px 22px 18px;
  }

  .question-panel,
  .answer-panel {
    padding: 18px;
  }

  .case-button {
    padding: 14px 42px 14px 14px;
  }

  h1 {
    font-size: 2.75rem;
    line-height: 1;
  }

  .section-head h2,
  .course-placeholder h2,
  .db-topbar h2,
  .spring-topbar h2,
  .lld-topbar h2,
  .hld-topbar h2,
  .credit-card h2 {
    font-size: 2.15rem;
    line-height: 1.03;
  }

  .db-topbar,
  .spring-topbar,
  .lld-topbar,
  .hld-topbar {
    flex-direction: column;
    gap: 16px;
    margin-bottom: 18px;
  }

  .subject-home-head {
    align-items: start;
    gap: 14px;
  }

  .spring-root {
    gap: 18px;
  }

  .spring-topbar h2 {
    font-size: 2.15rem;
  }

  .spring-top-actions {
    width: 100%;
    justify-content: space-between;
  }

  .spring-section-tabs {
    border-radius: 20px;
    padding: 8px;
  }

  .spring-section-tabs button,
  .spring-back {
    flex: 0 0 auto;
  }

  .spring-track-card,
  .spring-topic-card,
  .spring-note-panel,
  .spring-article-panel,
  .spring-visual-panel,
  .spring-text-panel,
  .spring-code-panel {
    padding: 18px;
  }

  .spring-topic-card {
    padding-right: 52px;
  }

  .spring-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .spring-panel-head span {
    max-width: 100%;
    text-align: left;
  }

  .lld-top-actions {
    width: 100%;
    justify-content: space-between;
  }

  .lld-section-tabs {
    border-radius: 20px;
    margin-bottom: 22px;
  }

  .hld-section-tabs {
    border-radius: 20px;
  }

  .lld-section-tabs button,
  .lld-back {
    flex: 0 0 auto;
  }

  .lld-track-card,
  .lld-topic-card,
  .hld-track-card,
  .lld-note-panel,
  .lld-text-panel,
  .lld-gallery-panel,
  .lld-code-panel {
    padding: 20px;
  }

  .lld-topic-card {
    padding-right: 54px;
  }

  .lld-code-card pre {
    padding: 16px 16px 16px 52px;
    max-height: 360px;
  }

  .requirement-list,
  .reference-block pre {
    max-height: 420px;
  }

  .image-lightbox {
    padding: 12px;
  }

  .image-lightbox button {
    top: 12px;
    right: 12px;
  }

  .image-lightbox img {
    max-width: 100%;
    max-height: 82vh;
    border-radius: 12px;
  }

  .study-scroll-top {
    right: 14px;
    bottom: 14px;
    width: 42px;
    height: 42px;
    font-size: 1.15rem;
  }

  .study-modal {
    padding: 8px;
  }

  .study-modal-content {
    padding: 0 14px 20px;
  }

  .study-modal-head h2 {
    font-size: 2.2rem;
  }
}

@media (max-width: 480px) {
  .study-header {
    width: calc(100% - 16px);
  }

  .study-brand {
    font-size: 0.92rem;
  }

  .study-nav a,
  .study-nav button {
    padding: 9px 10px;
    font-size: 0.82rem;
  }

  main,
  .study-footer {
    width: calc(100% - 18px);
  }

  .hero-copy {
    padding: 22px 18px;
  }

  .progress-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 14px;
  }

  .progress-row span {
    white-space: normal;
  }

  .section-head,
  .subject-home-head {
    gap: 12px;
    margin-bottom: 20px;
  }

  .subject-home-copy p,
  .section-head > p,
  .hero-copy p:not(.eyebrow),
  .credit-card p,
  .course-placeholder p {
    font-size: 0.98rem;
    line-height: 1.62;
  }

  .study-tools {
    gap: 12px;
  }

  .view-switch button,
  .spring-section-tabs button,
  .lld-section-tabs button,
  .hld-section-tabs button,
  .hld-page-menu a {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 0.78rem;
  }

  .case-button {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px 46px 14px 14px;
  }

  .case-button strong {
    width: fit-content;
    min-width: 34px;
  }

  .case-header h3,
  .question-card h4 {
    font-size: 2.1rem;
  }

  .requirement-list li {
    padding: 12px 12px 12px 48px;
    font-size: 0.92rem;
  }

  .requirement-list li::before {
    left: 10px;
  }

  .answer-popup-card,
  .answer-diagram-card,
  .question-card,
  .requirements-card,
  .solution-article {
    padding: 16px;
    border-radius: 16px;
  }

  .spring-track-card,
  .spring-topic-card,
  .lld-track-card,
  .lld-topic-card {
    min-height: auto;
  }

  .spring-slide-card,
  .hld-diagram-card,
  .lld-image-card {
    padding: 6px;
    border-radius: 14px;
  }

  .hld-sheet-page {
    border-radius: 18px;
  }

  .hld-sheet-page summary {
    grid-template-columns: minmax(0, 1fr) 28px 20px;
    gap: 10px;
    min-height: 66px;
    padding: 12px 12px 12px 14px;
  }

  .hld-check::after {
    display: none;
  }

  .hld-card-body {
    margin: 0 10px 10px;
    padding: 12px;
  }

  .hld-content-section,
  .hld-callouts div {
    padding: 12px;
    border-radius: 14px;
  }
}

@media (max-width: 1120px) {
  .study-header {
    position: sticky;
    align-items: center;
    flex-direction: row;
    flex-wrap: nowrap;
  }
}

@media (max-width: 820px) {
  .study-header {
    gap: 8px;
    width: calc(100% - 18px);
    margin-top: 8px;
  }

  .study-brand {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }

  .study-brand span {
    width: 30px;
    height: 30px;
    border-radius: 10px;
  }

  .study-nav-toggle {
    display: grid;
    order: 2;
  }

  .study-theme-toggle {
    order: 3;
    width: 42px;
    height: 38px;
  }

  .study-nav {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 8;
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 12px;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(8, 9, 11, 0.96);
    box-shadow: 0 24px 62px rgba(0, 0, 0, 0.36);
    backdrop-filter: blur(18px);
  }

  .study-header.is-nav-open .study-nav {
    display: grid;
  }

  .study-nav a,
  .study-nav button {
    display: flex;
    justify-content: center;
    min-height: 42px;
    padding: 10px;
    border: 1px solid var(--line);
    background: rgba(255, 248, 232, 0.045);
    font-size: 0.78rem;
    white-space: normal;
    text-align: center;
  }

  .subject-tabs-toggle {
    display: inline-flex;
    width: 100%;
    justify-content: flex-start;
    margin-bottom: 10px;
  }

  .spring-section-tabs,
  .lld-section-tabs,
  .hld-section-tabs {
    display: none;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 0 0 18px;
    padding: 10px;
    overflow: visible;
    border-radius: 18px;
  }

  .subject-tabs-wrap.is-open .spring-section-tabs,
  .subject-tabs-wrap.is-open .lld-section-tabs,
  .subject-tabs-wrap.is-open .hld-section-tabs {
    display: grid;
  }

  .spring-section-tabs button,
  .lld-section-tabs button,
  .hld-section-tabs button {
    justify-content: flex-start;
    width: 100%;
    min-height: 40px;
    white-space: normal;
    text-align: left;
  }

  .db-workspace.has-selection .db-case-toggle {
    display: inline-flex;
    order: 2;
  }

  .db-workspace:not(.has-selection) .db-case-toggle {
    display: none;
  }

  .db-workspace.has-selection .case-list {
    display: none;
  }

  .db-workspace.has-selection.is-case-menu-open .case-list {
    display: grid;
  }

  .study-tools {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: stretch;
  }

  .study-tools .search-box {
    grid-column: 1 / -1;
  }

  .study-tools .view-switch {
    grid-column: 1 / -1;
    order: 3;
  }

  .search-box input,
  .lld-search-box input,
  .hld-search-box input {
    min-height: 42px;
    padding: 12px 14px 12px 42px;
    font-size: 0.9rem;
  }

  .search-box::before,
  .lld-search-box::before,
  .hld-search-box::before {
    left: 15px;
    width: 13px;
    height: 13px;
  }

  .search-box::after,
  .lld-search-box::after,
  .hld-search-box::after {
    left: 26px;
    width: 6px;
  }

  .view-switch {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
  }

  .view-switch button {
    min-width: 0;
    padding: 10px 8px;
    font-size: 0.74rem;
    text-align: center;
  }

  .lld-code-card {
    border-radius: 14px;
    background: var(--code-bg);
  }

  .lld-code-head {
    gap: 8px;
    padding: 10px;
    font-size: 0.72rem;
  }

  .lld-code-head::before {
    width: 32px;
    transform: scale(0.86);
    transform-origin: left center;
  }

  .lld-code-card pre {
    max-height: 340px;
    padding: 14px 12px;
    background:
      repeating-linear-gradient(
        to bottom,
        var(--code-row) 0,
        var(--code-row) 1px,
        transparent 1px,
        transparent 24px
      );
  }

  .lld-code-card code {
    font-size: 0.72rem;
    line-height: 1.58;
  }

  .study-modal-close,
  .image-lightbox button {
    display: grid;
    width: 40px;
    height: 40px;
    min-height: 40px;
    place-items: center;
    padding: 0;
    border-radius: 999px;
    font-size: 0;
  }

  .study-modal-close::before,
  .image-lightbox button::before {
    content: "X";
    font-size: 0.84rem;
    line-height: 1;
  }
}

@media (max-width: 680px) {
  h1 {
    font-size: 2.2rem;
  }

  .section-head h2,
  .course-placeholder h2,
  .db-topbar h2,
  .spring-topbar h2,
  .lld-topbar h2,
  .hld-topbar h2,
  .credit-card h2 {
    font-size: 1.74rem;
    line-height: 1.08;
  }

  .case-header h3,
  .question-card h4 {
    font-size: 1.58rem;
    line-height: 1.12;
  }

  .hero-copy,
  .db-workspace,
  .course-placeholder,
  .spring-workspace,
  .lld-workspace,
  .hld-workspace,
  .credit-card,
  .case-header,
  .question-panel,
  .answer-panel,
  .study-modal-grid > section {
    padding: 16px;
  }

  .spring-track-card,
  .spring-topic-card,
  .lld-track-card,
  .lld-topic-card,
  .hld-track-card,
  .lld-note-panel,
  .lld-text-panel,
  .lld-gallery-panel,
  .lld-code-panel,
  .spring-note-panel,
  .spring-article-panel,
  .spring-visual-panel,
  .spring-text-panel,
  .spring-code-panel {
    padding: 16px;
  }

  .spring-track-card strong,
  .spring-topic-card strong,
  .lld-track-card strong,
  .lld-topic-card strong {
    font-size: 1.18rem;
  }

  .subject-home-copy p,
  .section-head > p,
  .hero-copy p:not(.eyebrow),
  .credit-card p,
  .course-placeholder p,
  .spring-summary p,
  .spring-text-panel li,
  .lld-text-panel p,
  .lld-text-panel li,
  .requirement-list li {
    font-size: 0.92rem;
    line-height: 1.56;
  }

  .study-modal-head h2 {
    font-size: 1.72rem;
  }
}

@media (max-width: 430px) {
  .study-nav {
    grid-template-columns: 1fr;
  }

  .view-switch {
    grid-template-columns: 1fr;
  }

  .db-layout,
  .case-body,
  .spring-detail-grid,
  .lld-detail-grid {
    gap: 12px;
  }

  .case-button {
    padding: 12px 42px 12px 12px;
  }

  .progress-row strong,
  .case-title {
    font-size: 0.96rem;
  }

  .study-footer {
    font-size: 0.82rem;
  }
}

body[data-theme="light"] .study-nav,
body[data-theme="light"] .study-nav-toggle,
body[data-theme="light"] .subject-tabs-toggle,
body[data-theme="light"] .db-case-toggle {
  border-color: rgba(35, 92, 135, 0.16);
  background: rgba(248, 251, 253, 0.92);
  color: #17212b;
}

body[data-theme="light"] .study-nav-toggle:hover,
body[data-theme="light"] .subject-tabs-toggle:hover,
body[data-theme="light"] .db-case-toggle:hover {
  border-color: rgba(31, 111, 139, 0.44);
  background: rgba(238, 248, 250, 0.96);
  color: #1f4454;
}

/* Final responsive polish: keep controls aligned and content breathable. */
.study-modal-close,
.image-lightbox button {
  display: grid;
  place-items: center;
  font-size: 0;
  line-height: 1;
  text-align: center;
}

.study-modal-close::before,
.image-lightbox button::before {
  content: "X";
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1;
  transform: translate(-50%, -50%);
}

.spring-top-actions,
.lld-top-actions {
  position: absolute;
  top: 0;
  right: 0;
}

.spring-topbar:not(.subject-home-head),
.lld-topbar:not(.subject-home-head) {
  padding-right: 48px;
}

.spring-topbar.subject-home-head,
.lld-topbar.subject-home-head {
  padding-right: 0;
}

.study-theme-toggle,
.code-theme-toggle {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body[data-theme="light"] .study-theme-toggle,
body[data-theme="light"] .code-theme-toggle {
  border-color: rgba(35, 92, 135, 0.16);
  background: rgba(248, 251, 253, 0.88);
  color: #17212b;
}

.lld-problem-detail {
  background:
    radial-gradient(circle at 100% 0%, rgba(217, 255, 101, 0.08), transparent 24rem),
    rgba(8, 9, 11, 0.48);
}

.lld-problem-detail .case-body {
  gap: 16px;
  padding: 16px;
}

.lld-problem-detail .question-panel,
.lld-problem-detail .answer-panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 248, 232, 0.045);
}

.lld-problem-detail .answer-panel {
  border-left: 1px solid var(--line);
}

body[data-theme="light"] .lld-problem-detail {
  background: rgba(246, 248, 251, 0.56);
}

body[data-theme="light"] .lld-problem-detail .question-panel,
body[data-theme="light"] .lld-problem-detail .answer-panel {
  border-color: rgba(35, 92, 135, 0.13);
  background: rgba(255, 255, 255, 0.62);
}

.db-case-actions {
  top: 22px;
  right: 22px;
}

.db-case-actions .db-video-action,
.db-case-actions .detail-check {
  width: 34px;
  height: 34px;
}

.db-case-actions .detail-check::before {
  width: 10px;
  height: 10px;
}

.study-tools .view-switch,
.lld-problem-tools .view-switch {
  width: fit-content;
  max-width: 100%;
}

.study-tools .view-switch button,
.lld-problem-tools .view-switch button {
  min-height: 40px;
}

.study-back-row {
  position: static;
  margin: -18px 0 18px;
}

.study-back-icon {
  width: 40px;
  height: 34px;
  border-radius: 12px;
  background: rgba(255, 248, 232, 0.05);
}

.spring-top-actions,
.lld-top-actions {
  width: auto;
  justify-content: flex-end;
}

@media (max-width: 820px) {
  :root {
    --page-gutter: 14px;
  }

  main,
  .study-footer,
  .study-header {
    width: calc(100% - 24px);
  }

  main {
    padding-top: 20px;
  }

  .study-header {
    padding: 9px;
  }

  .course-view:has(.study-back-row) {
    margin-top: 24px;
  }

  .study-back-row {
    margin: -6px 0 16px;
  }

  .study-nav,
  .spring-section-tabs,
  .lld-section-tabs,
  .hld-section-tabs {
    border-radius: 16px;
  }

  .study-nav-toggle,
  .study-theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 13px;
  }

  .subject-tabs-toggle,
  .db-case-toggle {
    min-height: 40px;
    border-radius: 13px;
  }

  .spring-top-actions,
  .lld-top-actions {
    top: 2px;
    right: 2px;
    width: auto;
  }

  .db-workspace .detail-check {
    top: 16px;
    right: 16px;
  }

  .case-header {
    padding: 22px 74px 20px 18px;
  }

  .lld-problem-tools {
    margin-bottom: 12px;
  }

  .lld-problem-tools .view-switch {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    width: fit-content;
    padding: 4px;
    overflow-x: auto;
    border-radius: 999px;
  }

  .lld-problem-tools .view-switch button {
    flex: 1 0 max-content;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    white-space: nowrap;
  }

  .study-tools .view-switch {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    width: fit-content;
    max-width: 100%;
    padding: 4px;
    overflow-x: auto;
    border-radius: 999px;
  }

  .study-tools .view-switch button {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    white-space: nowrap;
  }

  .lld-problem-detail .case-body {
    gap: 12px;
    padding: 12px;
  }

  .lld-problem-detail .question-panel,
  .lld-problem-detail .answer-panel {
    padding: 16px;
    border-radius: 18px;
  }
}

@media (max-width: 560px) {
  main,
  .study-footer,
  .study-header {
    width: calc(100% - 22px);
  }

  .hero-copy,
  .db-workspace,
  .course-placeholder,
  .spring-workspace,
  .lld-workspace,
  .hld-workspace,
  .credit-card {
    border-radius: 18px;
  }

  .db-workspace,
  .course-placeholder,
  .spring-workspace,
  .lld-workspace,
  .hld-workspace,
  .credit-card,
  .hero-copy {
    padding: 14px;
  }

  .course-view:has(.study-back-row) {
    margin-top: 18px;
  }

  .study-back-row {
    margin: -4px 0 14px;
  }

  .study-back-icon {
    width: 40px;
    height: 34px;
  }

  .case-header {
    padding: 20px 66px 18px 16px;
  }

  .db-case-actions {
    top: 18px;
    right: 16px;
    gap: 6px;
  }

  .db-case-actions .db-video-action,
  .db-case-actions .detail-check {
    width: 30px;
    height: 30px;
  }

  .spring-topbar:not(.subject-home-head),
  .lld-topbar:not(.subject-home-head) {
    padding-right: 42px;
  }

  .study-modal-close,
  .image-lightbox button {
    width: 36px;
    height: 36px;
    min-height: 36px;
    border-radius: 12px;
  }
}
