:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --surface: #ffffff;
  --surface-soft: #f3f6f8;
  --line: #e5e8ec;
  --text: #161a22;
  --muted: #78838f;
  --blue: #1b83f6;
  --cyan: #21a8c7;
  --green: #17b769;
  --red: #d6173a;
  --yellow: #f6c200;
  --shadow: 0 10px 26px rgba(28, 37, 48, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

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

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  min-height: 86px;
  border-bottom: 1px solid #222;
  background: rgba(246, 247, 248, 0.96);
  backdrop-filter: blur(14px);
  padding: 18px 32px 12px;
}

.brand {
  display: grid;
  gap: 2px;
}

.brand-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  line-height: 28px;
}

.brand-subtitle {
  color: #3a414a;
  font-size: 13px;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  color: #10141a;
  font-size: 15px;
  font-weight: 800;
}

.top-nav a {
  position: relative;
  padding: 8px 0;
}

.top-nav a.active::after,
.top-nav a:hover::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: #10141a;
  content: "";
}

.library-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 22px;
  width: 100%;
  max-width: 1840px;
  margin: 0 auto;
  padding: 18px clamp(18px, 2.4vw, 44px) 40px;
}

.filter-sidebar {
  position: sticky;
  top: 104px;
  align-self: start;
  max-height: calc(100vh - 124px);
  overflow: auto;
  border-right: 4px solid #d6d9dd;
  padding: 8px 22px 18px 12px;
}

.stats-panel {
  display: grid;
  gap: 14px;
  margin: 4px 0 28px;
}

.stat-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
}

.stat-card.active {
  border-color: #cceaf6;
  background: #eefaff;
}

.stat-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-weight: 900;
}

.stat-icon.grid {
  background: #dff4ff;
  color: #188abc;
}

.stat-icon.learned {
  background: #e5faee;
  color: var(--green);
}

.stat-icon.pending {
  background: #f1f3f5;
  color: #64707d;
}

.stat-icon.favorite {
  background: #ffecef;
  color: var(--red);
}

.stat-card strong {
  display: block;
  font-size: 17px;
  line-height: 22px;
}

.stat-card small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.stat-card b {
  color: #1487b7;
  font-size: 24px;
}

.stat-card:nth-child(2) b {
  color: var(--green);
}

.stat-card:nth-child(4) b {
  color: var(--red);
}

.filter-panel {
  margin-top: 24px;
}

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

.filter-title h2 {
  margin: 0;
  font-size: 21px;
  line-height: 28px;
}

.filter-title button {
  border: 0;
  background: transparent;
  color: #697480;
  font-size: 13px;
}

.topic-grid {
  display: grid;
  gap: 8px;
}

.topic-grid button {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f0f2f4;
  color: #202630;
  font-weight: 760;
}

.topic-grid button.active {
  background: #08090b;
  color: #ffffff;
}

.filter-row {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.filter-row.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.filter-row label {
  display: grid;
  gap: 8px;
}

.filter-row span,
.topic-filter > span {
  color: #59616b;
  font-size: 14px;
  font-weight: 850;
}

select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #202630;
  padding: 0 10px;
}

.topic-filter {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.topic-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inline-calendar {
  border: 1px solid #d7dce2;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.month-button {
  border: 0;
  background: transparent;
  color: #10141a;
  padding: 0;
  font-size: 15px;
  font-weight: 900;
}

.month-button::after {
  margin-left: 4px;
  content: "▾";
  font-size: 11px;
}

.month-arrows {
  display: flex;
  gap: 18px;
  line-height: 1;
}

.month-arrows button {
  border: 0;
  background: transparent;
  color: #1f2933;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.month-arrows button:disabled,
.month-arrows button.is-disabled {
  color: #b8bfc8;
  cursor: default;
}

.calendar-weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  text-align: center;
}

.calendar-weekdays {
  margin-bottom: 6px;
  color: #111827;
  font-size: 14px;
  font-weight: 850;
}

.calendar-days {
  row-gap: 6px;
}

.calendar-days button {
  position: relative;
  display: inline-grid;
  place-items: center;
  justify-self: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #374151;
  font-size: 14px;
  font-weight: 700;
}

.calendar-days button:hover {
  background: #eef3f8;
  color: #111827;
}

.calendar-days button.is-available {
  color: #374151;
  opacity: 1;
}

.calendar-days button:disabled,
.calendar-days button.is-future {
  cursor: default;
  color: #c2c9d2;
  opacity: 1;
}

.calendar-days button:disabled:hover,
.calendar-days button.is-future:hover {
  background: transparent;
  color: #c2c9d2;
}

.calendar-days button.muted {
  color: #9aa4b2;
}

.calendar-days button.muted.is-future {
  color: #c2c9d2;
}

.calendar-days button.is-today {
  border: 1px solid rgba(13, 110, 253, 0.42);
  background: #edf5ff;
  color: #0d5bd7;
}

.calendar-days button.selected {
  background: #07080a;
  color: #ffffff;
}

.calendar-days button.checked,
.calendar-days button[data-checkin="done"].checked {
  border: 1px solid rgba(23, 183, 105, 0.34);
  background: #eaf9f1;
  color: #138a51;
}

.calendar-days button.selected {
  border-color: #0d6efd;
  background: #0d6efd;
  color: #ffffff;
}

.calendar-days button.selected.checked {
  border-color: rgba(23, 183, 105, 0.34);
  background: #eaf9f1;
  color: #138a51;
}

.calendar-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.calendar-actions button {
  border: 0;
  background: transparent;
  color: #0d6efd;
  padding: 0;
  font-size: 14px;
  font-weight: 760;
}

.checkin-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  border: 1px solid #dfe8ef;
  border-radius: 8px;
  background: #f8fbfd;
  padding: 10px;
}

.checkin-summary div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.checkin-summary strong {
  color: #111827;
  font-size: 14px;
  line-height: 19px;
}

.checkin-summary span {
  overflow: hidden;
  color: #6b7785;
  font-size: 12px;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkin-summary button {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #0d6efd;
  padding: 0;
  font-size: 12px;
  font-weight: 850;
}

.checkin-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.checkin-metrics span {
  border-radius: 8px;
  background: #f0f3f6;
  color: #677381;
  padding: 8px 6px;
  font-size: 11px;
  font-weight: 760;
  text-align: center;
}

.checkin-metrics b {
  display: block;
  color: #111827;
  font-size: 17px;
  line-height: 20px;
}

.library-main {
  min-width: 0;
}

.mobile-filter-actions {
  display: none;
}

.main-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 2px 0 18px;
}

.main-toolbar p,
.main-toolbar h1 {
  margin: 0;
}

.main-toolbar p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.main-toolbar h1 {
  margin-top: 2px;
  font-size: 28px;
  line-height: 36px;
}

.search-box {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  width: min(380px, 42vw);
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  padding: 0 14px;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.course-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.course-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.course-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(28, 37, 48, 0.14);
}

.course-card.is-hidden {
  display: none;
}

.course-card.is-favorite {
  border-color: #ffd4dc;
  box-shadow: 0 16px 34px rgba(214, 23, 58, 0.12);
}

.thumb {
  position: relative;
  display: grid;
  align-content: center;
  min-height: 174px;
  overflow: hidden;
  background: #d9e1e5;
  color: #ffffff;
}

.thumb img {
  width: 100%;
  height: 100%;
  min-height: 174px;
  object-fit: cover;
}

.thumb::after {
  position: absolute;
  inset: auto 0 0;
  height: 54%;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.42));
  content: "";
}

.course-favorite {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.34);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(10px);
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.course-favorite:hover {
  transform: translateY(-1px) scale(1.03);
  background: rgba(15, 23, 42, 0.48);
}

.course-favorite svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
}

.course-favorite.is-active {
  border-color: #ffd36b;
  background: #fff7db;
  color: #f2a900;
}

.course-favorite.is-active svg {
  fill: currentColor;
}

.thumb-title {
  position: relative;
  z-index: 1;
  justify-self: center;
  max-width: 74%;
  color: #ffffff;
  font-size: 26px;
  font-weight: 950;
  line-height: 32px;
  text-align: center;
}

.thumb-invest {
  background:
    linear-gradient(135deg, rgba(17, 24, 39, 0.1), rgba(17, 24, 39, 0.45)),
    radial-gradient(circle at 28% 46%, #f6d487 0 22%, transparent 23%),
    linear-gradient(135deg, #1a2638, #6281a0);
}

.thumb-garden {
  background:
    linear-gradient(135deg, rgba(16, 38, 24, 0.18), rgba(16, 38, 24, 0.5)),
    linear-gradient(120deg, #76a37a, #d9c487 52%, #8bb2c9);
}

.thumb-kitchen {
  background:
    linear-gradient(135deg, rgba(82, 45, 28, 0.1), rgba(82, 45, 28, 0.42)),
    linear-gradient(120deg, #f1d1ba, #b67d62 48%, #efe7dd);
}

.thumb-life {
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.42)),
    linear-gradient(120deg, #b0b778, #6f7f4d 50%, #2f3d37);
}

.thumb-room {
  background:
    linear-gradient(135deg, rgba(96, 54, 86, 0.1), rgba(96, 54, 86, 0.4)),
    linear-gradient(120deg, #ead4e6, #d8a7bc 50%, #8fb2ce);
}

.thumb-generated {
  background:
    linear-gradient(135deg, rgba(17, 24, 39, 0.18), rgba(17, 24, 39, 0.54)),
    radial-gradient(circle at 30% 42%, #8dd9c5 0 20%, transparent 21%),
    linear-gradient(120deg, #24374d, #758f75 54%, #c0a273);
}

.duration,
.source {
  position: absolute;
  z-index: 2;
  bottom: 10px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 850;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.45);
}

.duration {
  left: 12px;
}

.source {
  right: 12px;
}

.card-body {
  padding: 16px 16px 15px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 28px;
}

.stars {
  color: var(--yellow);
  cursor: default;
  font-size: 15px;
  letter-spacing: 0;
  white-space: nowrap;
}

.stars i {
  color: #d8dde3;
  font-style: normal;
}

.course-title {
  min-height: 42px;
  margin: 8px 0 12px;
  color: #3f4853;
  font-size: 14px;
  font-weight: 720;
  line-height: 21px;
}

.meta-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 30px;
  color: #697480;
  font-size: 13px;
}

.meta-row span:first-child {
  border-radius: 999px;
  background: #f3f5f7;
  color: #4a5562;
  padding: 5px 10px;
}

.card-foot {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  border-top: 1px solid #eef0f2;
  padding-top: 12px;
  color: #a0a8b1;
  font-size: 12px;
}

.course-status-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.course-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 28px;
  border-radius: 999px;
  background: #eef2f5;
  color: #5f6b78;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.course-status-pill.is-new {
  background: #eef2f5;
  color: #5f6b78;
}

.course-status-pill.is-pending {
  background: #eef7ff;
  color: #1574db;
}

.course-status-pill.is-learned {
  background: #eaf9ef;
  color: #18a15f;
}

.course-action {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  min-height: 28px;
  color: #243140;
  font-size: 13px;
  font-weight: 800;
  line-height: 18px;
  text-align: right;
  white-space: nowrap;
}

.course-date {
  display: block;
  overflow: hidden;
  color: #9aa4b2;
  font-size: 12px;
  line-height: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-progress {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.course-progress-label {
  color: #5e6a77;
  font-size: 13px;
  line-height: 19px;
}

.course-progress-track {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #ebeff3;
}

.course-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #30b9df, #45d584);
}

.empty-state {
  display: none;
  margin: 42px 0 0;
  border: 1px dashed #d5dce3;
  border-radius: 8px;
  background: #ffffff;
  color: #6d7783;
  padding: 34px;
  text-align: center;
}

.empty-state.is-visible {
  display: block;
}

.toast {
  position: fixed;
  right: 30px;
  bottom: 102px;
  z-index: 50;
  max-width: min(360px, calc(100vw - 32px));
  transform: translateY(12px);
  border: 1px solid #dce3ea;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  color: #1d2733;
  opacity: 0;
  pointer-events: none;
  padding: 12px 14px;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.account-panel {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.28);
  padding: 18px;
}

.account-card {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 20px 48px rgba(28, 37, 48, 0.18);
  padding: 20px;
}

.feedback-card {
  width: min(560px, 100%);
}

.account-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.account-head p,
.account-head h2 {
  margin: 0;
}

.account-head p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.account-head h2 {
  margin-top: 3px;
  font-size: 24px;
  line-height: 30px;
}

.account-head button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #ffffff;
  color: #111827;
  font-size: 22px;
  line-height: 1;
}

.account-status {
  margin-top: 14px;
  border: 1px solid #dce5ef;
  border-radius: 8px;
  background: #f8fbfd;
  color: #42505e;
  padding: 12px;
  font-size: 14px;
  line-height: 22px;
}

.account-status.is-active {
  border-color: #bcebd3;
  background: #edfbf4;
  color: #0f8f50;
}

.redeem-form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.redeem-form label {
  display: grid;
  gap: 8px;
}

.redeem-form span {
  color: #3f4854;
  font-size: 13px;
  font-weight: 850;
}

.redeem-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  outline: 0;
  padding: 11px 12px;
  text-transform: uppercase;
}

.feedback-form input,
.feedback-form select,
.feedback-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  outline: 0;
  padding: 11px 12px;
  font: inherit;
  text-transform: none;
}

.feedback-form textarea {
  min-height: 128px;
  line-height: 22px;
  resize: vertical;
}

.feedback-form select {
  appearance: auto;
}

.redeem-form button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: #0b0f14;
  color: #ffffff;
  font-weight: 950;
}

@media (max-width: 1180px) {
  .library-shell {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .course-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .site-header {
    align-items: start;
    display: grid;
    padding: 16px;
  }

  .top-nav {
    overflow-x: auto;
    gap: 20px;
    white-space: nowrap;
  }

  .library-shell {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .filter-sidebar {
    position: static;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 16px;
  }

  .stats-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main-toolbar {
    display: grid;
  }

  .search-box {
    width: 100%;
  }
}

@media (max-width: 900px) {
  body {
    background: #f7f8fa;
  }

  .site-header {
    align-items: start;
    display: grid;
    gap: 14px;
    padding: 16px 14px 10px;
  }

  .top-nav {
    border-top: 0;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    white-space: nowrap;
  }

  .top-nav::-webkit-scrollbar {
    display: none;
  }

  .library-shell {
    gap: 18px;
    grid-template-columns: 1fr;
    padding: 12px 14px 34px;
  }

  .filter-sidebar {
    position: static;
    max-height: none;
    border-bottom: 0;
    border-right: 0;
    padding-bottom: 0;
  }

  .stats-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 16px;
    overflow: visible;
    padding-bottom: 0;
  }

  .stat-card {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 66px;
    padding: 9px 10px;
  }

  .stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }

  .stat-card strong {
    font-size: 15px;
  }

  .stat-card small {
    font-size: 12px;
  }

  .stat-card b {
    font-size: 22px;
  }

  .filter-panel {
    margin-top: 16px;
  }

  .filter-title h2 {
    font-size: 19px;
  }

  .inline-calendar {
    border: 1px solid #d7dce2;
    background: #ffffff;
    padding: 10px;
  }

  .calendar-head {
    min-height: 0;
    border: 0;
    padding: 0;
  }

  .calendar-weekdays {
    font-size: 12px;
  }

  .calendar-days {
    row-gap: 3px;
  }

  .calendar-days button {
    width: 26px;
    height: 26px;
    font-size: 12px;
  }

  .month-arrows {
    font-size: 18px;
  }

  .calendar-actions {
    margin-top: 8px;
  }

  .topic-filter {
    margin-top: 14px;
  }

  .topic-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    padding-bottom: 0;
  }

  .topic-grid button {
    min-width: 0;
    min-height: 34px;
  }

  .library-main {
    border-top: 1px solid var(--line);
    padding-top: 18px;
  }

  .mobile-filter-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
  }

  .mobile-filter-actions button {
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: #111827;
    font-size: 14px;
    font-weight: 900;
  }

  .mobile-filter-actions button.active {
    border-color: #111827;
    background: #111827;
    color: #ffffff;
  }

  .collapsible-panel {
    display: none;
  }

  .collapsible-panel.is-open {
    display: block;
  }

  .main-toolbar {
    gap: 12px;
    margin-bottom: 14px;
  }

  .main-toolbar h1 {
    font-size: 24px;
    line-height: 30px;
  }

  .search-box {
    min-height: 40px;
  }
}

@media (max-width: 767px) {
  .stats-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-row.two-col {
    grid-template-columns: 1fr;
  }

  .topic-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .site-header {
    min-height: auto;
  }

  .brand-title {
    font-size: 21px;
  }

  .thumb {
    min-height: 126px;
  }

  .course-favorite {
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
  }

  .course-favorite svg {
    width: 16px;
    height: 16px;
  }

  .thumb-title {
    max-width: 86%;
    font-size: 20px;
    line-height: 24px;
  }

  .card-body {
    padding: 9px 9px 10px;
  }

  .card-head h2 {
    font-size: 16px;
    line-height: 22px;
  }

  .stars {
    font-size: 12px;
  }

  .course-title {
    display: -webkit-box;
    min-height: 34px;
    overflow: hidden;
    margin: 5px 0 8px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 12px;
    line-height: 18px;
  }

  .meta-row {
    align-items: start;
    display: grid;
    min-height: 48px;
    gap: 4px;
    font-size: 11px;
  }

  .card-foot {
    display: grid;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    font-size: 11px;
  }

  .course-status-group {
    gap: 6px;
  }

  .course-status-pill {
    min-width: 54px;
    min-height: 26px;
    padding: 0 9px;
    font-size: 11px;
  }

  .course-action {
    min-height: 26px;
    font-size: 12px;
  }

  .course-date,
  .course-progress-label {
    font-size: 11px;
    line-height: 16px;
  }

  .source {
    display: none;
  }
}

@media (max-width: 420px) {
  .site-header {
    padding: 14px 10px 8px;
  }

  .top-nav {
    gap: 16px;
  }

  .library-shell {
    padding: 10px 10px 30px;
  }

  .stat-card {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px;
  }

  .stat-card b {
    grid-column: 2;
    justify-self: start;
    font-size: 20px;
  }

  .thumb {
    min-height: 112px;
  }

  .thumb-title {
    font-size: 18px;
    line-height: 22px;
  }
}
