:root {
  --ink-900: #10212e;
  --ink-700: #2d4354;
  --ink-500: #5d7282;
  --mist-100: #f3f7f9;
  --paper: #fbfdff;
  --brand-600: #0f7ea8;
  --brand-500: #1397bf;
  --accent-500: #f18f01;
  --success-500: #1d9a62;
  --border: #d6e2e8;
  --shadow: 0 20px 45px rgba(16, 33, 46, 0.12);
  --definition-chip: #eaf8ff;
  --definition-reveal: #fff4df;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  color: var(--ink-900);
  background:
    radial-gradient(circle at 8% 12%, rgba(19, 151, 191, 0.16), transparent 38%),
    radial-gradient(circle at 92% 84%, rgba(241, 143, 1, 0.14), transparent 34%),
    linear-gradient(160deg, #edf4f7 0%, #f7fbfd 55%, #eef5f9 100%);
}

.slide-page {
  min-height: 100vh;
  padding: clamp(16px, 3vw, 34px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.slide-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: clamp(14px, 2vw, 24px);
  border-radius: 18px;
  border: 1px solid rgba(15, 126, 168, 0.2);
  background: rgba(251, 253, 255, 0.92);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow);
}

.slide-pill {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.68rem;
  color: var(--brand-600);
  font-weight: 800;
}

.slide-header h1 {
  margin: 4px 0 0;
  font-size: clamp(1.3rem, 2.4vw, 2.15rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-family: 'Poppins', sans-serif;
}

.slide-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.slide-header .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink-700);
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 700;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.slide-header .btn:hover {
  transform: translateY(-1px);
  border-color: var(--brand-500);
  box-shadow: 0 8px 20px rgba(19, 151, 191, 0.18);
}

.slide-header .btn-toggle {
  border-color: var(--brand-600);
  background: linear-gradient(120deg, var(--brand-600), var(--brand-500));
  color: #fff;
}

.slide-main {
  flex: 1;
}

.slide-panel {
  background: var(--paper);
  border-radius: 18px;
  padding: clamp(14px, 3vw, 34px);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.slide-panel section {
  column-count: 1;
  font-size: clamp(1rem, 1.7vw, 1.42rem);
  line-height: 1.36;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  overflow-x: auto;
}

h2 {
  column-span: all;
  margin: 10px 0 6px;
  font-size: 1.12em;
  color: var(--brand-600);
  border-bottom: 1px solid rgba(15, 126, 168, 0.22);
  padding-bottom: 7px;
  cursor: pointer;
  letter-spacing: 0.01em;
  font-family: 'Poppins', sans-serif;
}

h3 {
  column-span: all;
  margin: 10px 0 6px;
  color: var(--accent-500);
  font-size: 1.03em;
  font-family: 'Poppins', sans-serif;
}

ul,
ol {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
}

li {
  margin: 4px 0;
  line-height: 1.35;
  cursor: pointer;
}

.content ul,
.content ol {
  list-style: disc;
  list-style-position: outside;
  padding-left: 1.5rem;
  margin-left: 0;
}

.content li {
  margin: 1px 0;
  line-height: 1.28;
}

.content ul ul,
.content ol ul,
.content ul ol,
.content ol ol {
  list-style: circle;
  padding-left: 2rem;
  margin-left: 0.45rem;
  margin-top: 0.2rem;
  margin-bottom: 0.2rem;
}

.multi-column {
  column-count: 2;
  column-gap: 1.4rem;
}

.multi-column li {
  break-inside: avoid-column;
  -webkit-column-break-inside: avoid;
}

.topic-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.topic-heading__label {
  flex: 1;
}

.topic-heading-actions {
  display: flex;
  gap: 8px;
}

.topic-action {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid transparent;
  cursor: pointer;
  background: transparent;
}

.topic-action--match {
  border-color: rgba(15, 126, 168, 0.32);
  color: var(--brand-600);
}

.topic-action--multiple {
  border-color: transparent;
  background: linear-gradient(120deg, var(--brand-600), var(--brand-500));
  color: #fff;
}

.active-heading {
  display: flex;
  width: 100%;
  margin: 6px 0;
  padding: 6px 10px;
  border-radius: 10px;
  color: var(--ink-900);
  background: linear-gradient(120deg, rgba(19, 151, 191, 0.12), rgba(241, 143, 1, 0.12));
}

.active-word .term,
.active-row .term,
.active-word .hidden,
.active-row .hidden {
  display: inline-flex;
  align-items: center;
  margin: 0 6px 0 0;
  padding: 2px 7px;
  border-radius: 8px;
  color: var(--ink-900);
  background: var(--definition-chip);
}

.hidden {
  visibility: hidden;
  opacity: 0;
  margin-left: 6px;
  padding: 3px 8px;
  border-radius: 8px;
  color: var(--ink-700);
  background: #fff;
  font-weight: 500;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.revealed {
  visibility: visible;
  opacity: 1;
  margin-left: 7px;
  padding: 3px 8px;
  border-radius: 8px;
  color: #8f4a00;
  background: var(--definition-reveal);
  font-weight: 700;
}

.review-focus__notice {
  margin-bottom: 10px;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand-600);
}

.review-focus__empty {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-500);
}

.review-focus__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-focus__list li {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(29, 154, 98, 0.3);
  background: rgba(29, 154, 98, 0.08);
  font-weight: 700;
}

.markdown-library .slide-index {
  margin-top: 0;
  padding-left: 0;
}

.slide-index li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px dashed rgba(16, 33, 46, 0.1);
}

.slide-index a {
  font-size: 1.05em;
  font-weight: 700;
  color: var(--ink-900);
  text-decoration: none;
}

.slide-index a:hover {
  color: var(--brand-600);
}

.meta {
  font-size: 0.8em;
  color: var(--ink-500);
  font-weight: 600;
}

.back-link {
  margin-top: 20px;
}

.back-link a {
  color: var(--brand-600);
}

.page-footer {
  margin-top: 12px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-500);
}

.content table {
  width: 100%;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .slide-page {
    padding: 12px;
    gap: 12px;
  }

  .slide-header {
    flex-direction: column;
    align-items: flex-start;
    border-radius: 14px;
    padding: 12px;
  }

  .slide-header h1 {
    font-size: clamp(1.2rem, 5.4vw, 1.55rem);
  }

  .slide-header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .slide-header .btn,
  .slide-header .btn-toggle {
    width: 100%;
    min-height: 40px;
  }

  .slide-panel {
    border-radius: 14px;
    padding: 12px;
  }

  .slide-panel section {
    font-size: clamp(0.98rem, 4.6vw, 1.12rem);
    line-height: 1.4;
  }

  h2 {
    font-size: clamp(1rem, 4.8vw, 1.12rem);
    line-height: 1.32;
  }

  h3 {
    font-size: clamp(0.95rem, 4.2vw, 1.02rem);
    line-height: 1.3;
  }

  .topic-heading {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .topic-heading__label {
    width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

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

  .multi-column {
    column-count: 1;
    column-gap: 0;
  }

  .topic-action {
    width: 100%;
    min-width: 0;
    text-align: center;
    font-size: 0.64rem;
    letter-spacing: 0.08em;
  }

  .slide-index a {
    font-size: 1em;
  }
}

@media (max-width: 480px) {
  .slide-pill {
    letter-spacing: 0.14em;
    font-size: 0.62rem;
  }

  .slide-header-actions {
    grid-template-columns: 1fr;
  }

  .slide-header .btn,
  .slide-header .btn-toggle {
    font-size: 0.8rem;
    padding: 9px 12px;
  }

  .topic-action {
    min-width: 100%;
  }

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