:root {
  --ldla-blue: #2563eb;
  --ldla-blue-dark: #1e40af;
  --hero-title-blue: #1f4f8f;
  --ldla-ink: #172033;
  --ldla-muted: #667085;
  --ldla-bg: #f5f7fb;
  --ldla-card: #fff;
  --ldla-border: #dbe3f0;
  --ldla-soft: #edf4ff;
  --ldla-warm: #fff7ed;
  --ldla-radius: 20px;
  --ldla-shadow: 0 16px 40px rgba(20, 38, 70, .08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  color: var(--ldla-ink);
  background: var(--ldla-bg);
  line-height: 1.75;
}

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

a:hover {
  color: var(--ldla-blue);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.ui-container {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.page-main {
  padding: 36px 0 56px;
}

.page-section {
  margin-top: 44px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  margin-bottom: 18px;
}

.page-title,
.section-heading h1,
.section-heading h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2vw, 2rem);
  line-height: 1.3;
}

.section-heading p {
  margin: .35rem 0 0;
  color: var(--ldla-muted);
}

.ui-card {
  background: var(--ldla-card);
  border: 1px solid var(--ldla-border);
  border-radius: var(--ldla-radius);
  box-shadow: var(--ldla-shadow);
}

.ui-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45em;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: .75rem 1.15rem;
  font-weight: 800;
  line-height: 1.1;
  cursor: pointer;
}

.ui-button--small {
  padding: .58rem .9rem;
  font-size: .92rem;
}

.ui-button--primary {
  background: var(--ldla-blue);
  color: #fff;
}

.ui-button--primary:hover {
  background: var(--ldla-blue-dark);
  color: #fff;
}

.ui-button--secondary {
  background: #fff;
  color: var(--ldla-blue);
  border-color: #bcd0ff;
}

.ui-button--ghost {
  background: transparent;
  color: var(--ldla-ink);
  border-color: var(--ldla-border);
}

.ui-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--ldla-soft);
  color: var(--ldla-blue-dark);
  font-size: .8rem;
  font-weight: 700;
  padding: .18rem .65rem;
}

.ui-form {
  display: grid;
  gap: 16px;
}

.ui-form label {
  font-weight: 700;
}

.ui-form input,
.ui-form select,
.ui-form textarea {
  width: 100%;
  border: 1px solid var(--ldla-border);
  border-radius: 12px;
  padding: .8rem 1rem;
  font: inherit;
  background: #fff;
}

.ui-alert,
.ui-success {
  padding: 1rem;
  border-radius: 14px;
}

.ui-alert {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #9f1239;
}

.ui-success {
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--ldla-border);
  backdrop-filter: blur(12px);
}

.site-header__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: center;
  min-height: 82px;
}

.site-logo img {
  width: clamp(168px, 13vw, 220px);
}

.site-nav {
  display: flex;
  gap: 24px;
  justify-content: center;
  align-items: center;
  font-weight: 800;
  white-space: nowrap;
}

.site-nav a {
  padding: .35rem 0;
}

.site-auth-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.site-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid #bcd0ff;
  border-radius: 999px;
  padding: .55rem 1rem;
  font: inherit;
  font-size: .92rem;
  font-weight: 800;
  line-height: 1.1;
  cursor: pointer;
}

.site-action--primary {
  background: var(--ldla-blue);
  color: #fff;
}

.site-action--primary:hover {
  background: var(--ldla-blue-dark);
  color: #fff;
}

.site-action--light {
  background: #fff;
  color: var(--ldla-ink);
}

.site-menu-button {
  display: none;
}

.site-header.is-open .site-menu-button {
  position: relative;
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  font-size: 0;
  color: transparent;
}

.site-header.is-open .site-menu-button::before,
.site-header.is-open .site-menu-button::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--ldla-ink);
  transform-origin: center;
}

.site-header.is-open .site-menu-button::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.site-header.is-open .site-menu-button::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.site-footer {
  margin-top: 64px;
  background: #10203b;
  color: #dfe8ff;
  padding: 36px 0;
}

.site-footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.site-footer__brand {
  margin: 0 0 .4rem;
  font-size: 1.2rem;
  font-weight: 800;
}

.site-footer p {
  margin: .2rem 0;
  color: #c4d1ef;
}

.site-footer__nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.site-footer__nav a {
  color: #fff;
}

.site-footer__copyright {
  width: 100%;
  font-size: .85rem;
  color: #9fb0d0;
}

.topic-card {
  padding: 22px;
}

.topic-card__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.topic-card__title {
  margin: .3rem 0;
  font-size: 1.2rem;
}

.topic-card__title a {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: .18em;
}

.topic-card__desc {
  margin: .4rem 0 1rem;
  color: var(--ldla-muted);
}

.topic-card__footer {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--ldla-muted);
  font-size: .9rem;
}

.topic-list-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.exam-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 14px;
  align-items: center;
  padding: 22px;
}

.exam-card__code {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: .03em;
  box-shadow: 0 10px 22px rgba(37, 99, 235, .18);
}

.exam-card strong {
  font-size: 1.1rem;
}

.exam-card span:last-child {
  grid-column: 1 / -1;
  color: var(--ldla-muted);
}

.ui-like-button {
  border: 1px solid #f9a8d4;
  background: #fff;
  color: #be185d;
  border-radius: 999px;
  padding: .65rem 1rem;
  font-weight: 800;
  cursor: pointer;
}

.ui-like-button.is-liked {
  background: #fdf2f8;
}

.ui-like-button:disabled {
  cursor: default;
  opacity: 1;
}

.ui-like-button.is-like-loading {
  cursor: wait;
  opacity: .72;
}

.auth-required-note {
  padding: 18px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 16px;
}

@media (max-width: 1023px) {
  .topic-list-grid {
    grid-template-columns: 1fr 1fr;
  }

  .site-header__inner {
    grid-template-columns: auto 1fr auto auto;
    grid-template-rows: 68px;
    gap: 8px;
    min-height: 68px;
  }

  .site-header.is-open .site-header__inner {
    grid-template-rows: 68px auto auto;
  }

  .site-logo,
  .site-menu-button,
  .site-auth-nav {
    align-self: center;
  }

  .site-logo {
    grid-column: 1;
  }

  .site-logo img {
    width: 168px;
  }

  .site-menu-button {
    display: inline-flex;
    grid-column: 4;
  }

  .site-nav,
  .site-auth-nav {
    display: none;
  }

  .site-auth-nav--logged-in {
    display: flex;
    grid-column: 3;
    grid-row: 1;
  }

  .site-header.is-open .site-nav {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 10px 0 12px;
  }

  .site-header.is-open .site-nav a {
    padding: .55rem .2rem;
    border-bottom: 1px solid var(--ldla-border);
  }

  .site-header.is-open .site-nav a:last-child {
    border-bottom: 0;
  }

  .site-header.is-open .site-auth-nav:not(.site-auth-nav--logged-in) {
    display: flex;
    grid-column: 1 / -1;
    gap: 8px;
    justify-content: flex-start;
    padding-bottom: 12px;
  }
}

@media (max-width: 767px) {
  .ui-container {
    width: min(100% - 24px, 1120px);
  }

  .page-main {
    padding: 24px 0 44px;
  }

  .section-heading {
    display: block;
  }

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

  .site-logo img {
    width: 136px;
  }

  .site-action {
    min-height: 36px;
    padding: .52rem .82rem;
    font-size: .88rem;
  }

  .site-footer__inner {
    display: block;
  }

  .site-footer__nav {
    margin-top: 20px;
  }

  .site-footer__copyright {
    width: auto;
    margin-top: 18px;
  }
}
